]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
22 months agoscalar-diagnose: move 'get_disk_info()' to 'compat/'
Victoria Dye [Fri, 12 Aug 2022 20:10:12 +0000 (20:10 +0000)] 
scalar-diagnose: move 'get_disk_info()' to 'compat/'

Move 'get_disk_info()' function into 'compat/'. Although Scalar-specific
code is generally not part of the main Git tree, 'get_disk_info()' will be
used in subsequent patches by additional callers beyond 'scalar diagnose'.
This patch prepares for that change, at which point this platform-specific
code should be part of 'compat/' as a matter of convention.

The function is copied *mostly* verbatim, with two exceptions:

* '#ifdef WIN32' is replaced with '#ifdef GIT_WINDOWS_NATIVE' to allow
  'statvfs' to be used with Cygwin.
* the 'struct strbuf buf' and 'int res' (as well as their corresponding
  cleanup & return) are moved outside of the '#ifdef' block.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoscalar-diagnose: add directory to archiver more gently
Victoria Dye [Fri, 12 Aug 2022 20:10:11 +0000 (20:10 +0000)] 
scalar-diagnose: add directory to archiver more gently

If a directory added to the 'scalar diagnose' archiver does not exist, warn
and return 0 from 'add_directory_to_archiver()' rather than failing with a
fatal error. This handles a failure edge case where the '.git/logs' has not
yet been created when running 'scalar diagnose', but extends to any
situation where a directory may be missing in the '.git' dir.

Now, when a directory is missing a warning is captured in the diagnostic
logs. This provides a user with more complete information than if 'scalar
diagnose' simply failed with an error.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoscalar-diagnose: avoid 32-bit overflow of size_t
Victoria Dye [Fri, 12 Aug 2022 20:10:10 +0000 (20:10 +0000)] 
scalar-diagnose: avoid 32-bit overflow of size_t

Avoid 32-bit size_t overflow when reporting the available disk space in
'get_disk_info' by casting the block size and available block count to
'off_t' before multiplying them. Without this change, 'st_mult' would
(correctly) report a size_t overflow on 32-bit systems at or exceeding 2^32
bytes of available space.

Note that 'off_t' is a 64-bit integer even on 32-bit systems due to the
inclusion of '#define _FILE_OFFSET_BITS 64' in 'git-compat-util.h' (see
b97e911643 (Support for large files on 32bit systems., 2007-02-17)).

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoscalar-diagnose: use "$GIT_UNZIP" in test
Victoria Dye [Fri, 12 Aug 2022 20:10:09 +0000 (20:10 +0000)] 
scalar-diagnose: use "$GIT_UNZIP" in test

Use the "$GIT_UNZIP" test variable rather than verbatim 'unzip' to unzip the
'scalar diagnose' archive. Using "$GIT_UNZIP" is needed to run the Scalar
tests on systems where 'unzip' is not in the system path.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoThe eighth batch
Junio C Hamano [Mon, 1 Aug 2022 02:34:14 +0000 (19:34 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'mt/pkt-line-comment-tweak'
Junio C Hamano [Mon, 1 Aug 2022 16:58:39 +0000 (09:58 -0700)] 
Merge branch 'mt/pkt-line-comment-tweak'

In-code comment clarification.
source: <6a14443c101fa132498297af6d7a483520688d75.1658488203.git.matheus.bernardino@usp.br>

* mt/pkt-line-comment-tweak:
  pkt-line.h: move comment closer to the associated code

22 months agoMerge branch 'mt/checkout-count-fix'
Junio C Hamano [Mon, 1 Aug 2022 16:58:38 +0000 (09:58 -0700)] 
Merge branch 'mt/checkout-count-fix'

"git checkout" miscounted the paths it updated, which has been
corrected.
source: <cover.1657799213.git.matheus.bernardino@usp.br>

* mt/checkout-count-fix:
  checkout: fix two bugs on the final count of updated entries
  checkout: show bug about failed entries being included in final report
  checkout: document bug where delayed checkout counts entries twice

22 months agoMerge branch 'cl/rerere-train-with-no-sign'
Junio C Hamano [Mon, 1 Aug 2022 16:58:38 +0000 (09:58 -0700)] 
Merge branch 'cl/rerere-train-with-no-sign'

"rerere-train" script (in contrib/) used to honor commit.gpgSign
while recreating the throw-away merges.
source: <PH7PR14MB5594A27B9295E95ACA4D6A69CE8F9@PH7PR14MB5594.namprd14.prod.outlook.com>

* cl/rerere-train-with-no-sign:
  contrib/rerere-train: avoid useless gpg sign in training

22 months agoMerge branch 'ds/rebase-update-ref'
Junio C Hamano [Mon, 1 Aug 2022 16:58:38 +0000 (09:58 -0700)] 
Merge branch 'ds/rebase-update-ref'

"git rebase -i" learns to update branches whose tip appear in the
rebased range with "--update-refs" option.
source: <pull.1247.v5.git.1658255624.gitgitgadget@gmail.com>

* ds/rebase-update-ref:
  sequencer: notify user of --update-refs activity
  sequencer: ignore HEAD ref under --update-refs
  rebase: add rebase.updateRefs config option
  sequencer: rewrite update-refs as user edits todo list
  rebase: update refs from 'update-ref' commands
  rebase: add --update-refs option
  sequencer: add update-ref command
  sequencer: define array with enum values
  rebase-interactive: update 'merge' description
  branch: consider refs under 'update-refs'
  t2407: test branches currently using apply backend
  t2407: test bisect and rebase as black-boxes

22 months agoMerge branch 'kk/p4-client-name-encoding-fix'
Junio C Hamano [Mon, 1 Aug 2022 16:58:37 +0000 (09:58 -0700)] 
Merge branch 'kk/p4-client-name-encoding-fix'

"git p4" did not handle non-ASCII client name well, which has been
corrected.
source: <pull.1285.v3.git.git.1658394440.gitgitgadget@gmail.com>

* kk/p4-client-name-encoding-fix:
  git-p4: refactoring of p4CmdList()
  git-p4: fix bug with encoding of p4 client name

22 months agoSync with 'maint'
Junio C Hamano [Wed, 27 Jul 2022 20:40:32 +0000 (13:40 -0700)] 
Sync with 'maint'

22 months agoDownmerge a handful of fixes for 2.37.x maintenance track
Junio C Hamano [Wed, 27 Jul 2022 20:22:06 +0000 (13:22 -0700)] 
Downmerge a handful of fixes for 2.37.x maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'tk/rev-parse-doc-clarify-at-u' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:52 +0000 (13:19 -0700)] 
Merge branch 'tk/rev-parse-doc-clarify-at-u' into maint

Doc update.
source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com>

* tk/rev-parse-doc-clarify-at-u:
  rev-parse: documentation adjustment - mention remote tracking with @{u}

22 months agoMerge branch 'll/ls-files-tests-update' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:52 +0000 (13:19 -0700)] 
Merge branch 'll/ls-files-tests-update' into maint

Test update.
source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com>

* ll/ls-files-tests-update:
  ls-files: update test style

22 months agoMerge branch 'ds/t5510-brokequote' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:51 +0000 (13:19 -0700)] 
Merge branch 'ds/t5510-brokequote' into maint

Test fix.
source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com>

* ds/t5510-brokequote:
  t5510: replace 'origin' with URL more carefully

22 months agoMerge branch 'tb/pack-objects-remove-pahole-comment' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:51 +0000 (13:19 -0700)] 
Merge branch 'tb/pack-objects-remove-pahole-comment' into maint

Comment fix.
source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com>

* tb/pack-objects-remove-pahole-comment:
  pack-objects.h: remove outdated pahole results

22 months agoMerge branch 'en/t6429-test-must-be-empty-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:50 +0000 (13:19 -0700)] 
Merge branch 'en/t6429-test-must-be-empty-fix' into maint

A test fix.
source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com>

* en/t6429-test-must-be-empty-fix:
  t6429: fix use of non-existent function

22 months agoMerge branch 'ds/vscode-settings' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:50 +0000 (13:19 -0700)] 
Merge branch 'ds/vscode-settings' into maint

* ds/vscode-settings:
  vscode: improve tab size and wrapping

22 months agoMerge branch 'cr/setup-bug-typo' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:49 +0000 (13:19 -0700)] 
Merge branch 'cr/setup-bug-typo' into maint

Typofix in a BUG() message.
source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com>

* cr/setup-bug-typo:
  setup: fix function name in a BUG() message

22 months agoMerge branch 'pb/diff-doc-raw-format' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:49 +0000 (13:19 -0700)] 
Merge branch 'pb/diff-doc-raw-format' into maint

Update "git diff/log --raw" format documentation.
source: <pull.1259.git.1655123383.gitgitgadget@gmail.com>

* pb/diff-doc-raw-format:
  diff-index.txt: update raw output format in examples
  diff-format.txt: correct misleading wording
  diff-format.txt: dst can be 0* SHA-1 when path is deleted, too

22 months agoMerge branch 'jk/revisions-doc-markup-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:48 +0000 (13:19 -0700)] 
Merge branch 'jk/revisions-doc-markup-fix' into maint

Documentation mark-up fix.
source: <YrOmsA04FZae89be@coredump.intra.peff.net>

* jk/revisions-doc-markup-fix:
  revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis

22 months agoMerge branch 'rs/combine-diff-with-incompatible-options' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:32 +0000 (13:00 -0700)] 
Merge branch 'rs/combine-diff-with-incompatible-options' into maint

Certain diff options are currently ignored when combined-diff is
shown; mark them as incompatible with the feature.
source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com>

* rs/combine-diff-with-incompatible-options:
  combine-diff: abort if --output is given
  combine-diff: abort if --ignore-matching-lines is given

22 months agoMerge branch 'ac/bitmap-format-doc' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:31 +0000 (13:00 -0700)] 
Merge branch 'ac/bitmap-format-doc' into maint

Adjust technical/bitmap-format to be formatted by AsciiDoc, and
add some missing information to the documentation.
source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com>

* ac/bitmap-format-doc:
  bitmap-format.txt: add information for trailing checksum
  bitmap-format.txt: fix some formatting issues
  bitmap-format.txt: feed the file to asciidoc to generate html

22 months agoMerge branch 'ab/test-quoting-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:31 +0000 (13:00 -0700)] 
Merge branch 'ab/test-quoting-fix' into maint

Fixes for tests when the source directory has unusual characters in
its path, e.g. whitespaces, double-quotes, etc.
source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com>

* ab/test-quoting-fix:
  config tests: fix harmless but broken "rm -r" cleanup
  test-lib.sh: fix prepend_var() quoting issue
  tests: add missing double quotes to included library paths

22 months agoMerge branch 'ro/mktree-allow-missing-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:30 +0000 (13:00 -0700)] 
Merge branch 'ro/mktree-allow-missing-fix' into maint

"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.
source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com>

* ro/mktree-allow-missing-fix:
  mktree: do not check type of remote objects

22 months agoMerge branch 'dr/i18n-die-warn-error-usage' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:30 +0000 (13:00 -0700)] 
Merge branch 'dr/i18n-die-warn-error-usage' into maint

Give _() markings to fatal/warning/usage: labels that are shown in
front of these messages.
source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com>

* dr/i18n-die-warn-error-usage:
  i18n: mark message helpers prefix for translation

22 months agoMerge branch 'ds/git-rebase-doc-markup' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:29 +0000 (13:00 -0700)] 
Merge branch 'ds/git-rebase-doc-markup' into maint

References to commands-to-be-typed-literally in "git rebase"
documentation mark-up have been corrected.
source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com>

* ds/git-rebase-doc-markup:
  git-rebase.txt: use back-ticks consistently

22 months agoMerge branch 'gg/worktree-from-the-above' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:29 +0000 (13:00 -0700)] 
Merge branch 'gg/worktree-from-the-above' into maint

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.
source: <20220616234433.225-1-gg.oss@outlook.com>
source: <20220616231956.154-1-gg.oss@outlook.com>

* gg/worktree-from-the-above:
  dir: minor refactoring / clean-up
  dir: traverse into repository

22 months agoMerge branch 'fr/vimdiff-layout-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:28 +0000 (13:00 -0700)] 
Merge branch 'fr/vimdiff-layout-fix' into maint

Recent update to vimdiff layout code has been made more robust
against different end-user vim settings.
source: <20220708181024.45839-1-greenfoo@u92.eu>

* fr/vimdiff-layout-fix:
  vimdiff: make layout engine more robust against user vim settings

22 months agoMerge branch 'en/merge-dual-dir-renames-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:28 +0000 (13:00 -0700)] 
Merge branch 'en/merge-dual-dir-renames-fix' into maint

Fixes a long-standing corner case bug around directory renames in
the merge-ort strategy.
source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com>

* en/merge-dual-dir-renames-fix:
  merge-ort: fix issue with dual rename and add/add conflict
  merge-ort: shuffle the computation and cleanup of potential collisions
  merge-ort: make a separate function for freeing struct collisions
  merge-ort: small cleanups of check_for_directory_rename
  t6423: add tests of dual directory rename plus add/add conflict

22 months agoMerge branch 'jk/diff-files-cleanup-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:27 +0000 (13:00 -0700)] 
Merge branch 'jk/diff-files-cleanup-fix' into maint

An earlier attempt to plug leaks placed a clean-up label to jump to
at a bogus place, which as been corrected.
source: <Ys0c0ePxPOqZ/5ck@coredump.intra.peff.net>

* jk/diff-files-cleanup-fix:
  diff-files: move misplaced cleanup label

22 months agoMerge branch 'js/vimdiff-quotepath-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)] 
Merge branch 'js/vimdiff-quotepath-fix' into maint

Variable quoting fix in the vimdiff driver of "git mergetool"
source: <pull.1287.v2.git.1657809063728.gitgitgadget@gmail.com>

* js/vimdiff-quotepath-fix:
  mergetool(vimdiff): allow paths to contain spaces again

22 months agoMerge branch 'js/shortlog-sort-stably' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)] 
Merge branch 'js/shortlog-sort-stably' into maint

"git shortlog -n" relied on the underlying qsort() to be stable,
which shouldn't have.  Fixed.
source: <pull.1290.git.1657813429221.gitgitgadget@gmail.com>

* js/shortlog-sort-stably:
  shortlog: use a stable sort

22 months agoMerge branch 'js/ci-github-workflow-markup' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:25 +0000 (13:00 -0700)] 
Merge branch 'js/ci-github-workflow-markup' into maint

A fix for a regression in test framework.
source: <pull.1288.git.1657789234416.gitgitgadget@gmail.com>

* js/ci-github-workflow-markup:
  tests: fix incorrect --write-junit-xml code

22 months agoThe seventh batch
Junio C Hamano [Wed, 27 Jul 2022 16:06:42 +0000 (09:06 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'mb/p4-utf16-crlf'
Junio C Hamano [Wed, 27 Jul 2022 16:16:55 +0000 (09:16 -0700)] 
Merge branch 'mb/p4-utf16-crlf'

"git p4" working on UTF-16 files on Windows did not implement
CRLF-to-LF conversion correctly, which has been corrected.

* mb/p4-utf16-crlf:
  git-p4: fix CR LF handling for utf16 files

22 months agoMerge branch 'mb/p4-fixes'
Junio C Hamano [Wed, 27 Jul 2022 16:16:54 +0000 (09:16 -0700)] 
Merge branch 'mb/p4-fixes'

Fix a few issues in "git p4".

* mb/p4-fixes:
  git-p4: fix error handling in P4Unshelve.renameBranch()
  git-p4: fix typo in P4Submit.applyCommit()

22 months agoMerge branch 'ds/win-syslog-compiler-fix'
Junio C Hamano [Wed, 27 Jul 2022 16:16:54 +0000 (09:16 -0700)] 
Merge branch 'ds/win-syslog-compiler-fix'

Workaround for a false positive compiler warning.

* ds/win-syslog-compiler-fix:
  compat/win32: correct for incorrect compiler warning

22 months agoMerge branch 'ld/osx-keychain-usage-fix'
Junio C Hamano [Wed, 27 Jul 2022 16:16:54 +0000 (09:16 -0700)] 
Merge branch 'ld/osx-keychain-usage-fix'

Workaround for a compiler warning against use of die() in
osx-keychain (in contrib/).

* ld/osx-keychain-usage-fix:
  osx-keychain: fix compiler warning

22 months agoMerge branch 'vd/scalar-doc'
Junio C Hamano [Wed, 27 Jul 2022 16:16:54 +0000 (09:16 -0700)] 
Merge branch 'vd/scalar-doc'

Doc update.

* vd/scalar-doc:
  scalar: convert README.md into a technical design doc
  scalar: reword command documentation to clarify purpose

22 months agoMerge branch 'ds/doc-wo-whitelist'
Junio C Hamano [Wed, 27 Jul 2022 16:16:54 +0000 (09:16 -0700)] 
Merge branch 'ds/doc-wo-whitelist'

Avoid "white/black-list" in documentation and code comments.

* ds/doc-wo-whitelist:
  transport.c: avoid "whitelist"
  t: avoid "whitelist"
  git.txt: remove redundant language
  git-cvsserver: clarify directory list
  daemon: clarify directory arguments

22 months agoMerge branch 'mb/config-document-include'
Junio C Hamano [Wed, 27 Jul 2022 16:16:53 +0000 (09:16 -0700)] 
Merge branch 'mb/config-document-include'

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.

* mb/config-document-include:
  config.txt: document include, includeIf

22 months agoMerge branch 'sg/index-format-doc-update'
Junio C Hamano [Wed, 27 Jul 2022 16:16:53 +0000 (09:16 -0700)] 
Merge branch 'sg/index-format-doc-update'

Docfix.

* sg/index-format-doc-update:
  index-format.txt: remove outdated list of supported extensions

22 months agoMerge branch 'ma/sparse-checkout-cone-doc-fix'
Junio C Hamano [Wed, 27 Jul 2022 16:16:53 +0000 (09:16 -0700)] 
Merge branch 'ma/sparse-checkout-cone-doc-fix'

Docfix.

* ma/sparse-checkout-cone-doc-fix:
  config/core.txt: fix minor issues for `core.sparseCheckoutCone`

22 months agoMerge branch 'ma/t4200-update'
Junio C Hamano [Wed, 27 Jul 2022 16:16:52 +0000 (09:16 -0700)] 
Merge branch 'ma/t4200-update'

Test fix.

* ma/t4200-update:
  t4200: drop irrelevant code

22 months agoMerge branch 'tl/pack-bitmap-error-messages'
Junio C Hamano [Wed, 27 Jul 2022 16:16:52 +0000 (09:16 -0700)] 
Merge branch 'tl/pack-bitmap-error-messages'

Tweak various messages that come from the pack-bitmap codepaths.

* tl/pack-bitmap-error-messages:
  pack-bitmap.c: continue looping when first MIDX bitmap is found
  pack-bitmap.c: using error() instead of silently returning -1
  pack-bitmap.c: do not ignore error when opening a bitmap file
  pack-bitmap.c: rename "idx_name" to "bitmap_name"
  pack-bitmap.c: mark more strings for translations
  pack-bitmap.c: fix formatting of error messages

22 months agoMerge branch 'ab/squelch-empty-fsync-traces'
Junio C Hamano [Wed, 27 Jul 2022 16:16:52 +0000 (09:16 -0700)] 
Merge branch 'ab/squelch-empty-fsync-traces'

Omit fsync-related trace2 entries when their values are all zero.

* ab/squelch-empty-fsync-traces:
  trace2: only include "fsync" events if we git_fsync()

22 months agoMerge branch 'js/commit-graph-parsing-without-repo-settings'
Junio C Hamano [Wed, 27 Jul 2022 16:16:52 +0000 (09:16 -0700)] 
Merge branch 'js/commit-graph-parsing-without-repo-settings'

API tweak to make it easier to run fuzz testing on commit-graph parser.

* js/commit-graph-parsing-without-repo-settings:
  commit-graph: pass repo_settings instead of repository

22 months agoThe sixth batch
Junio C Hamano [Fri, 22 Jul 2022 22:03:45 +0000 (15:03 -0700)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'rs/mingw-tighten-mkstemp'
Junio C Hamano [Fri, 22 Jul 2022 22:04:03 +0000 (15:04 -0700)] 
Merge branch 'rs/mingw-tighten-mkstemp'

mkstemp() emulation on Windows has been improved.

* rs/mingw-tighten-mkstemp:
  mingw: avoid mktemp() in mkstemp() implementation

22 months agoMerge branch 'js/ci-github-workflow-markup'
Junio C Hamano [Fri, 22 Jul 2022 22:04:03 +0000 (15:04 -0700)] 
Merge branch 'js/ci-github-workflow-markup'

A fix for a regression in test framework.

* js/ci-github-workflow-markup:
  tests: fix incorrect --write-junit-xml code

22 months agoMerge branch 'js/shortlog-sort-stably'
Junio C Hamano [Fri, 22 Jul 2022 22:04:02 +0000 (15:04 -0700)] 
Merge branch 'js/shortlog-sort-stably'

"git shortlog -n" relied on the underlying qsort() to be stable,
which shouldn't have.  Fixed.

* js/shortlog-sort-stably:
  shortlog: use a stable sort

22 months agoMerge branch 'js/vimdiff-quotepath-fix'
Junio C Hamano [Fri, 22 Jul 2022 22:04:02 +0000 (15:04 -0700)] 
Merge branch 'js/vimdiff-quotepath-fix'

Variable quoting fix in the vimdiff driver of "git mergetool"

* js/vimdiff-quotepath-fix:
  mergetool(vimdiff): allow paths to contain spaces again

22 months agoMerge branch 'gc/bare-repo-discovery'
Junio C Hamano [Fri, 22 Jul 2022 22:04:01 +0000 (15:04 -0700)] 
Merge branch 'gc/bare-repo-discovery'

Introduce a discovery.barerepository configuration variable that
allows users to forbid discovery of bare repositories.

* gc/bare-repo-discovery:
  setup.c: create `safe.bareRepository`
  safe.directory: use git_protected_config()
  config: learn `git_protected_config()`
  Documentation: define protected configuration
  Documentation/git-config.txt: add SCOPES section

22 months agopkt-line.h: move comment closer to the associated code
Matheus Tavares [Fri, 22 Jul 2022 11:10:05 +0000 (08:10 -0300)] 
pkt-line.h: move comment closer to the associated code

ec9a37d ("pkt-line.[ch]: remove unused packet_read_line_buf()",
2021-10-14) removed the "src_buffer" and "src_len" parameters from
packet_read(), only leaving them at packet_read_with_status(). Let's
also update the function documentation by moving the comment about these
parameters from the former to the latter.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agogit-p4: refactoring of p4CmdList()
Kilian Kilger [Thu, 21 Jul 2022 09:07:20 +0000 (09:07 +0000)] 
git-p4: refactoring of p4CmdList()

The function p4CmdList executes a Perforce command and
decodes the marshalled python dictionary. Special care has to be
taken for certain dictionary values which contain non-unicode characters.
The old handling contained separate hacks for each of the corresponding
dictionary keys. This commit tries to refactor the coding to handle the
special cases uniformely.

Signed-off-by: Kilian Kilger <kkilger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agogit-p4: fix error handling in P4Unshelve.renameBranch()
Moritz Baumann [Wed, 20 Jul 2022 18:55:30 +0000 (18:55 +0000)] 
git-p4: fix error handling in P4Unshelve.renameBranch()

The error handling code path is meant to be triggered when the loop does
not exit early via "break". This fails, as the boolean variable "found",
which is used to track whether the loop was exited early, is initialized
incorrectly.

It would be possible to fix this issue by correcting the initialization,
but Python supports a for:-else: control flow construct for this exact
use case (executing code if a loop does not exit early), so it is more
idiomatic to remove the tracking variable entirely.

In addition, the error message no longer refers to a variable that does
not exist.

Signed-off-by: Moritz Baumann <moritz.baumann@sap.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agogit-p4: fix typo in P4Submit.applyCommit()
Moritz Baumann [Wed, 20 Jul 2022 18:55:29 +0000 (18:55 +0000)] 
git-p4: fix typo in P4Submit.applyCommit()

Signed-off-by: Moritz Baumann <moritz.baumann@sap.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agogit-p4: fix CR LF handling for utf16 files
Moritz Baumann [Wed, 20 Jul 2022 18:17:45 +0000 (18:17 +0000)] 
git-p4: fix CR LF handling for utf16 files

Perforce silently replaces LF with CR LF for "utf16" files if the client
is a native Windows client. Since git's autocrlf logic does not undo
this transformation for UTF-16 encoded files, git-p4 replaces CR LF with
LF during the sync if the file type "utf16" is detected and the Perforce
client platform indicates that this conversion is performed.

Windows only runs on little-endian architectures, therefore the encoding
of the byte stream received from the Perforce client is UTF-16-LE and
the relevant byte sequence is 0D 00 0A 00.

Signed-off-by: Moritz Baumann <moritz.baumann@sap.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agoThe fifth batch
Junio C Hamano [Tue, 19 Jul 2022 23:39:56 +0000 (16:39 -0700)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agoMerge branch 'll/curl-accept-language'
Junio C Hamano [Tue, 19 Jul 2022 23:40:19 +0000 (16:40 -0700)] 
Merge branch 'll/curl-accept-language'

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.

* ll/curl-accept-language:
  remote-curl: send Accept-Language header to server

23 months agoMerge branch 'jk/diff-files-cleanup-fix'
Junio C Hamano [Tue, 19 Jul 2022 23:40:18 +0000 (16:40 -0700)] 
Merge branch 'jk/diff-files-cleanup-fix'

An earlier attempt to plug leaks placed a clean-up label to jump to
at a bogus place, which as been corrected.

* jk/diff-files-cleanup-fix:
  diff-files: move misplaced cleanup label

23 months agoMerge branch 'rs/cocci-array-copy'
Junio C Hamano [Tue, 19 Jul 2022 23:40:18 +0000 (16:40 -0700)] 
Merge branch 'rs/cocci-array-copy'

A coccinelle rule (in contrib/) to encourage use of COPY_ARRAY
macro has been improved.

* rs/cocci-array-copy:
  cocci: avoid normalization rules for memcpy

23 months agoMerge branch 'jk/ref-filter-discard-commit-buffer'
Junio C Hamano [Tue, 19 Jul 2022 23:40:17 +0000 (16:40 -0700)] 
Merge branch 'jk/ref-filter-discard-commit-buffer'

* jk/ref-filter-discard-commit-buffer:
  ref-filter: disable save_commit_buffer while traversing

23 months agoMerge branch 'jk/clone-unborn-confusion'
Junio C Hamano [Tue, 19 Jul 2022 23:40:17 +0000 (16:40 -0700)] 
Merge branch 'jk/clone-unborn-confusion'

"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.

* jk/clone-unborn-confusion:
  clone: move unborn head creation to update_head()
  clone: use remote branch if it matches default HEAD
  clone: propagate empty remote HEAD even with other branches
  clone: drop extra newline from warning message

23 months agoMerge branch 'hx/lookup-commit-in-graph-fix'
Junio C Hamano [Tue, 19 Jul 2022 23:40:16 +0000 (16:40 -0700)] 
Merge branch 'hx/lookup-commit-in-graph-fix'

A corner case bug where lazily fetching objects from a promisor
remote resulted in infinite recursion has been corrected.

* hx/lookup-commit-in-graph-fix:
  t5330: remove run_with_limited_processses()
  commit-graph.c: no lazy fetch in lookup_commit_in_graph()

23 months agoMerge branch 'jc/resolve-undo'
Junio C Hamano [Tue, 19 Jul 2022 23:40:16 +0000 (16:40 -0700)] 
Merge branch 'jc/resolve-undo'

The resolve-undo information in the index was not protected against
GC, which has been corrected.

* jc/resolve-undo:
  fsck: do not dereference NULL while checking resolve-undo data
  revision: mark blobs needed for resolve-undo as reachable

23 months agocompat/win32: correct for incorrect compiler warning
Derrick Stolee [Tue, 19 Jul 2022 18:45:54 +0000 (18:45 +0000)] 
compat/win32: correct for incorrect compiler warning

The 'win build' job of our CI build is failing with the following error:

compat/win32/syslog.c: In function 'syslog':
compat/win32/syslog.c:53:17: error: pointer 'pos' may be used after \
    'realloc' [-Werror=use-after-free]
   53 |                 memmove(pos + 2, pos + 1, strlen(pos));
    CC compat/poll/poll.o
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compat/win32/syslog.c:47:23: note: call to 'realloc' here
   47 |                 str = realloc(str, st_add(++str_len, 1));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However, between this realloc() and the use we have a line that resets
the value of 'pos'. Thus, this error is incorrect. It is likely due to a
new version of the compiler on the CI machines.

Instead of waiting for a new compiler, create a new variable to avoid
this error.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agosequencer: notify user of --update-refs activity
Derrick Stolee [Tue, 19 Jul 2022 18:33:44 +0000 (18:33 +0000)] 
sequencer: notify user of --update-refs activity

When the user runs 'git rebase -i --update-refs', the end message still
says only

  Successfully rebased and updated <HEAD-ref>.

Update the sequencer to collect the successful (and unsuccessful) ref
updates due to the --update-refs option, so the end message now says

  Successfully rebased and updated <HEAD-ref>.
  Updated the following refs with --update-refs:
refs/heads/first
refs/heads/third
  Failed to update the following refs with --update-refs:
refs/heads/second

To test this output, we need to be very careful to format the expected
error to drop the leading tab characters. Also, we need to be aware that
the verbose output from 'git rebase' is writing progress lines which
don't use traditional newlines but clear the line after every progress
item is complete. When opening the error file in an editor, these lines
are visible, but when looking at the diff in a terminal those lines
disappear because of the characters that delete the previous characters.
Use 'sed' to clear those progress lines and clear the tabs so we can get
an exact match on our expected output.

Reported-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agosequencer: ignore HEAD ref under --update-refs
Derrick Stolee [Tue, 19 Jul 2022 18:33:43 +0000 (18:33 +0000)] 
sequencer: ignore HEAD ref under --update-refs

When using the 'git rebase -i --update-refs' option, the todo list is
populated with 'update-ref' commands for all tip refs in the history
that is being rebased. Refs that are checked out by some worktree are
instead added as a comment to warn the user that they will not be
updated.

Until now, this included the HEAD ref, which is being updated by the
rebase process itself, regardless of the --update-refs option. Remove
the comment in this case by ignoring any decorations that match the HEAD
ref.

Reported-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agorebase: add rebase.updateRefs config option
Derrick Stolee [Tue, 19 Jul 2022 18:33:42 +0000 (18:33 +0000)] 
rebase: add rebase.updateRefs config option

The previous change added the --update-refs command-line option.  For
users who always want this mode, create the rebase.updateRefs config
option which behaves the same way as rebase.autoSquash does with the
--autosquash option.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agosequencer: rewrite update-refs as user edits todo list
Derrick Stolee [Tue, 19 Jul 2022 18:33:41 +0000 (18:33 +0000)] 
sequencer: rewrite update-refs as user edits todo list

An interactive rebase provides opportunities for the user to edit the
todo list. The --update-refs option initializes the list with some
'update-ref <ref>' steps, but the user could add these manually.
Further, the user could add or remove these steps during pauses in the
interactive rebase.

Add a new method, todo_list_filter_update_refs(), that scans a todo_list
and compares it to the stored update-refs file. There are two actions
that can happen at this point:

1. If a '<ref>/<before>/<after>' triple in the update-refs file does not
   have a matching 'update-ref <ref>' command in the todo-list _and_ the
   <after> value is the null OID, then remove that triple. Here, the
   user removed the 'update-ref <ref>' command before it was executed,
   since if it was executed then the <after> value would store the
   commit at that position.

2. If a 'update-ref <ref>' command in the todo-list does not have a
   matching '<ref>/<before>/<after>' triple in the update-refs file,
   then insert a new one. Store the <before> value to be the current
   OID pointed at by <ref>. This is handled inside of the
   init_update_ref_record() helper method.

We can test that this works by rewriting the todo-list several times in
the course of a rebase. Check that each ref is locked or unlocked for
updates after each todo-list update. We can also verify that the ref
update fails if a concurrent process updates one of the refs after the
rebase process records the "locked" ref location.

To help these tests, add a new 'set_replace_editor' helper that will
replace the todo-list with an exact file.

Reported-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agorebase: update refs from 'update-ref' commands
Derrick Stolee [Tue, 19 Jul 2022 18:33:40 +0000 (18:33 +0000)] 
rebase: update refs from 'update-ref' commands

The previous change introduced the 'git rebase --update-refs' option
which added 'update-ref <ref>' commands to the todo list of an
interactive rebase.

Teach Git to record the HEAD position when reaching these 'update-ref'
commands. The ref/before/after triple is stored in the
$GIT_DIR/rebase-merge/update-refs file. A previous change parsed this
file to avoid having other processes updating the refs in that file
while the rebase is in progress.

Not only do we update the file when the sequencer reaches these
'update-ref' commands, we then update the refs themselves at the end of
the rebase sequence. If the rebase is aborted before this final step,
then the refs are not updated. The 'before' value is used to ensure that
we do not accidentally obliterate a ref that was updated concurrently
(say, by an older version of Git or a third-party tool).

Now that the 'git rebase --update-refs' command is implemented to write
to the update-refs file, we can remove the fake construction of the
update-refs file from a test in t2407-worktree-heads.sh.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agorebase: add --update-refs option
Derrick Stolee [Tue, 19 Jul 2022 18:33:39 +0000 (18:33 +0000)] 
rebase: add --update-refs option

When working on a large feature, it can be helpful to break that feature
into multiple smaller parts that become reviewed in sequence. During
development or during review, a change to one part of the feature could
affect multiple of these parts. An interactive rebase can help adjust
the multi-part "story" of the branch.

However, if there are branches tracking the different parts of the
feature, then rebasing the entire list of commits can create commits not
reachable from those "sub branches". It can take a manual step to update
those branches.

Add a new --update-refs option to 'git rebase -i' that adds 'update-ref
<ref>' steps to the todo file whenever a commit that is being rebased is
decorated with that <ref>. At the very end, the rebase process updates
all of the listed refs to the values stored during the rebase operation.

Be sure to iterate after any squashing or fixups are placed. Update the
branch only after those squashes and fixups are complete. This allows a
--fixup commit at the tip of the feature to apply correctly to the sub
branch, even if it is fixing up the most-recent commit in that part.

This change update the documentation and builtin to accept the
--update-refs option as well as updating the todo file with the
'update-ref' commands. Tests are added to ensure that these todo
commands are added in the correct locations.

This change does _not_ include the actual behavior of tracking the
updated refs and writing the new ref values at the end of the rebase
process. That is deferred to a later change.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agosequencer: add update-ref command
Derrick Stolee [Tue, 19 Jul 2022 18:33:38 +0000 (18:33 +0000)] 
sequencer: add update-ref command

Add the boilerplate for an "update-ref" command in the sequencer. This
connects to the current no-op do_update_ref() which will be filled in
after more connections are created.

The syntax in the todo list will be "update-ref <ref-name>" to signal
that we should store the current commit as the value for updating
<ref-name> at the end of the rebase.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agosequencer: define array with enum values
Derrick Stolee [Tue, 19 Jul 2022 18:33:37 +0000 (18:33 +0000)] 
sequencer: define array with enum values

The todo_command_info array defines which strings match with which
todo_command enum values. The array is defined in the same order as the
enum values, but if one changed without the other, then we would have
unexpected results.

Make it easier to see changes to the enum and this array by using the
enum values as the indices of the array.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agorebase-interactive: update 'merge' description
Derrick Stolee [Tue, 19 Jul 2022 18:33:36 +0000 (18:33 +0000)] 
rebase-interactive: update 'merge' description

The 'merge' command description for the todo list documentation in an
interactive rebase has multiple lines. The lines other than the first
one start with dots ('.') while the similar multi-line documentation for
'fixup' does not. This description only appears in the comment text of
the todo file during an interactive rebase.

The 'merge' command was documented when interactive rebase was first
ported to C in 145e05ac44b (rebase -i: rewrite append_todo_help() in C,
2018-08-10). These dots might have been carried over from the previous
shell implementation.

The 'fixup' command was documented more recently in 9e3cebd97cb (rebase
-i: add fixup [-C | -c] command, 2021-01-29).

Looking at the output in an editor, my personal opinion is that the dots
are unnecessary and noisy. Remove them now before adding more commands
with multi-line documentation.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agobranch: consider refs under 'update-refs'
Derrick Stolee [Tue, 19 Jul 2022 18:33:35 +0000 (18:33 +0000)] 
branch: consider refs under 'update-refs'

The branch_checked_out() helper helps commands like 'git branch' and
'git fetch' from overwriting refs that are currently checked out in
other worktrees.

A future update to 'git rebase' will introduce a new '--update-refs'
option which will update the local refs that point to commits that are
being rebased. To avoid collisions as the rebase completes, we want to
make the future data store for these refs to be considered by
branch_checked_out().

The data store is a plaintext file inside the 'rebase-merge' directory
for that worktree. The file lists refnames followed by two OIDs, each on
separate lines. The OIDs will be used to store the original values of
the refs and the to-be-written values as the rebase progresses, but can
be ignored at the moment.

Create a new sequencer_get_update_refs_state() method that parses this
file and populates a struct string_list with the ref-OID pairs. We can
then use this list to add to the current_checked_out_branches strmap
used by branch_checked_out().

To properly navigate to the rebase directory for a given worktree,
extract the static strbuf_worktree_gitdir() method to a public API
method.

We can test that this works without having Git write this file by
artificially creating one in our test script, at least until 'git rebase
--update-refs' is implemented and we can use it directly.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agot2407: test branches currently using apply backend
Derrick Stolee [Tue, 19 Jul 2022 18:33:34 +0000 (18:33 +0000)] 
t2407: test branches currently using apply backend

The tests in t2407 that verify the branch_checked_out() helper in the
case of bisects and rebases were added by 9347303db89 (branch: check for
bisects and rebases, 2022-06-08). However, that commit failed to check
for rebases that are using the 'apply' backend.

Add a test that checks the apply backend. The implementation was already
correct here, but it is good to have regression tests before modifying
the implementation further.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agot2407: test bisect and rebase as black-boxes
Derrick Stolee [Tue, 19 Jul 2022 18:33:33 +0000 (18:33 +0000)] 
t2407: test bisect and rebase as black-boxes

The tests added by d2ba271aad0 (branch: check for bisects and rebases,
2022-06-14) modified hidden state to verify the branch_checked_out()
helper. While this indeed checks that the method implementation is _as
designed_, it doesn't show that it is _correct_. Specifically, if 'git
bisect' or 'git rebase' change their back-end for preserving refs, then
these tests do not demonstrate that drift as a bug in
branch_checked_out().

Modify the tests in t2407 to actually rely on a paused bisect or rebase.
This requires adding the !SANITIZE_LEAK prereq for tests using those
builtins. The logic is still tested for leaks in the final test which
does set up that back-end directly for an error state that should not be
possible using Git commands.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agotransport.c: avoid "whitelist"
Derrick Stolee [Tue, 19 Jul 2022 18:32:17 +0000 (18:32 +0000)] 
transport.c: avoid "whitelist"

The word "whitelist" has cultural implications that are not inclusive.
Thankfully, it is not difficult to reword and avoid its use.

The GIT_ALLOW_PROTOCOL environment variable was referred to as a
"whitelist", but the word "allow" is already part of the variable.
Replace "whitelist" with "allow_list" in these cases to demonstrate that
we are processing a list of allowed protocols.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agot: avoid "whitelist"
Derrick Stolee [Tue, 19 Jul 2022 18:32:16 +0000 (18:32 +0000)] 
t: avoid "whitelist"

The word "whitelist" has cultural implications that are not inclusive.
Thankfully, it is not difficult to reword and avoid its use.

Focus on changes in the test scripts, since most of the changes are in
comments and test names. The renamed test_allow_var helper is only used
once inside the widely-used test_proto helper.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agogit.txt: remove redundant language
Derrick Stolee [Tue, 19 Jul 2022 18:32:15 +0000 (18:32 +0000)] 
git.txt: remove redundant language

The documentation for GIT_ALLOW_PROTOCOL has a sentence that adds no
value, since it repeats the meaning from the previous sentence (twice!).

The word "whitelist" has cultural implications that are not inclusive,
which brought attention to this sentence.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agogit-cvsserver: clarify directory list
Derrick Stolee [Tue, 19 Jul 2022 18:32:14 +0000 (18:32 +0000)] 
git-cvsserver: clarify directory list

The documentation and error messages for git-cvsserver include some
references to a "whitelist" that is not otherwise included in the
documentation. When different parts of the documentation do not use
common language, this can lead to confusion as to how things are meant
to operate.

Further, the word "whitelist" has cultural implications that make its
use non-inclusive. Thankfully, we can remove it while increasing
clarity.

Update Documentation/git-cvsserver.txt in a similar way to the previous
change to Documentation/git-daemon.txt. The optional '<directory>...'
list can specify a list of allowed directories. We refer to that list
directly inside of the documentation for the GIT_CVSSERVER_ROOT
environment variable.

While modifying this documentation, update the environment variables to
use a list format. We use the modern way of tabbing the description of
each variable in this section. We do _not_ update the description of
'<directory>...' to use tabs this way since the rest of the items in the
OPTIONS list do not use this modern formatting.

A single error message in the actual git-cvsserver.perl code refers to
the whitelist during argument parsing. Instead, refer to the directory
list that has been clarified in the documentation.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agodaemon: clarify directory arguments
Derrick Stolee [Tue, 19 Jul 2022 18:32:13 +0000 (18:32 +0000)] 
daemon: clarify directory arguments

The undecorated arguments to the 'git-daemon' command provide a list of
directories. When at least one directory is specified, then 'git-daemon'
only serves requests that are within that directory list. The boolean
'--strict-paths' option makes the list more explicit in that
subdirectories are no longer included.

The existing documentation and error messages around this directory list
refer to it and its behavior as a "whitelist". The word "whitelist" has
cultural implications that are not inclusive.  Thankfully, it is not
difficult to reword and avoid its use. In the process, we can define the
purpose of this directory list directly.

In Documentation/git-daemon.txt, rewrite the OPTIONS section around the
'<directory>' option. Add additional clarity to the other options that
refer to these directories.

Some error messages can also be improved in daemon.c. The
'--strict-paths' option requires '<directory>' arguments, so refer to
that section of the documentation directly. A logerror() call points out
that a requested directory is not in the specified directory list. We
can use "list" here without any loss of information.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agoosx-keychain: fix compiler warning
Lessley Dennington [Tue, 19 Jul 2022 17:25:03 +0000 (17:25 +0000)] 
osx-keychain: fix compiler warning

Update git-credential-osxkeychain.c to remove 'format string is not a string
literal (potentially insecure)' compiler warning by treating the string as
an argument.

Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agocontrib/rerere-train: avoid useless gpg sign in training
Celeste Liu [Tue, 19 Jul 2022 17:21:44 +0000 (01:21 +0800)] 
contrib/rerere-train: avoid useless gpg sign in training

Users may have configured "git merge" to always require GPG
signing the resulting commits. We are not running "git merge" to
re-create merge commits, but merely to replay merge conflicts,
and we will immediately discard the resulting commits; there
is no point in signing them.

Override such configuration that forces useless signing from the
command line with the "--no-gpg-sign" option.

Signed-off-by: Celeste Liu <coelacanthus@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agoThe fourth batch
Junio C Hamano [Mon, 18 Jul 2022 20:13:48 +0000 (13:13 -0700)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 months agoMerge branch 'sg/multi-pack-index-parse-options-fix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:58 +0000 (13:31 -0700)] 
Merge branch 'sg/multi-pack-index-parse-options-fix'

The way "git multi-pack" uses parse-options API has been improved.

* sg/multi-pack-index-parse-options-fix:
  multi-pack-index: simplify handling of unknown --options

23 months agoMerge branch 'bc/nettle-sha256'
Junio C Hamano [Mon, 18 Jul 2022 20:31:57 +0000 (13:31 -0700)] 
Merge branch 'bc/nettle-sha256'

Support for libnettle as SHA256 implementation has been added.

* bc/nettle-sha256:
  sha256: add support for Nettle

23 months agoMerge branch 'jd/gpg-interface-trust-level-string'
Junio C Hamano [Mon, 18 Jul 2022 20:31:57 +0000 (13:31 -0700)] 
Merge branch 'jd/gpg-interface-trust-level-string'

The code to convert between GPG trust level strings and internal
constants we use to represent them have been cleaned up.

* jd/gpg-interface-trust-level-string:
  gpg-interface: add function for converting trust level to string

23 months agoMerge branch 'ab/cocci-unused'
Junio C Hamano [Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)] 
Merge branch 'ab/cocci-unused'

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.

* ab/cocci-unused:
  cocci: generalize "unused" rule to cover more than "strbuf"
  cocci: add and apply a rule to find "unused" strbufs
  cocci: have "coccicheck{,-pending}" depend on "coccicheck-test"
  cocci: add a "coccicheck-test" target and test *.cocci rules
  Makefile & .gitignore: ignore & clean "git.res", not "*.res"
  Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS

23 months agoMerge branch 'gc/submodule-use-super-prefix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)] 
Merge branch 'gc/submodule-use-super-prefix'

Another step to rewrite more parts of "git submodule" in C.

* gc/submodule-use-super-prefix:
  submodule--helper: remove display path helper
  submodule--helper update: use --super-prefix
  submodule--helper: remove unused SUPPORT_SUPER_PREFIX flags
  submodule--helper: use correct display path helper
  submodule--helper: don't recreate recursive prefix
  submodule--helper update: use display path helper
  submodule--helper tests: add missing "display path" coverage

23 months agoMerge branch 'en/merge-dual-dir-renames-fix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:56 +0000 (13:31 -0700)] 
Merge branch 'en/merge-dual-dir-renames-fix'

Fixes a long-standing corner case bug around directory renames in
the merge-ort strategy.

* en/merge-dual-dir-renames-fix:
  merge-ort: fix issue with dual rename and add/add conflict
  merge-ort: shuffle the computation and cleanup of potential collisions
  merge-ort: make a separate function for freeing struct collisions
  merge-ort: small cleanups of check_for_directory_rename
  t6423: add tests of dual directory rename plus add/add conflict

23 months agoMerge branch 'ab/test-without-templates'
Junio C Hamano [Mon, 18 Jul 2022 20:31:55 +0000 (13:31 -0700)] 
Merge branch 'ab/test-without-templates'

Tweak tests so that they still work when the "git init" template
did not create .git/info directory.

* ab/test-without-templates:
  tests: don't assume a .git/info for .git/info/sparse-checkout
  tests: don't assume a .git/info for .git/info/exclude
  tests: don't assume a .git/info for .git/info/refs
  tests: don't assume a .git/info for .git/info/attributes
  tests: don't assume a .git/info for .git/info/grafts
  tests: don't depend on template-created .git/branches
  t0008: don't rely on default ".git/info/exclude"

23 months agoMerge branch 'ab/build-gitweb'
Junio C Hamano [Mon, 18 Jul 2022 20:31:55 +0000 (13:31 -0700)] 
Merge branch 'ab/build-gitweb'

Teach "make all" to build gitweb as well.

* ab/build-gitweb:
  gitweb/Makefile: add a "NO_GITWEB" parameter
  Makefile: build 'gitweb' in the default target
  gitweb/Makefile: include in top-level Makefile
  gitweb: remove "test" and "test-installed" targets
  gitweb/Makefile: prepare to merge into top-level Makefile
  gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars
  gitweb/Makefile: add a $(GITWEB_ALL) variable
  gitweb/Makefile: define all .PHONY prerequisites inline

23 months agoMerge branch 'ab/test-tool-leakfix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:54 +0000 (13:31 -0700)] 
Merge branch 'ab/test-tool-leakfix'

Plug various memory leaks in test-tool commands.

* ab/test-tool-leakfix:
  test-tool delta: fix a memory leak
  test-tool ref-store: fix a memory leak
  test-tool bloom: fix memory leaks
  test-tool json-writer: fix memory leaks
  test-tool regex: call regfree(), fix memory leaks
  test-tool urlmatch-normalization: fix a memory leak
  test-tool {dump,scrap}-cache-tree: fix memory leaks
  test-tool path-utils: fix a memory leak
  test-tool test-hash: fix a memory leak

23 months agoMerge branch 'ab/leakfix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:54 +0000 (13:31 -0700)] 
Merge branch 'ab/leakfix'

Plug various memory leaks.

* ab/leakfix:
  pull: fix a "struct oid_array" memory leak
  cat-file: fix a common "struct object_context" memory leak
  gc: fix a memory leak
  checkout: avoid "struct unpack_trees_options" leak
  merge-file: fix memory leaks on error path
  merge-file: refactor for subsequent memory leak fix
  cat-file: fix a memory leak in --batch-command mode
  revert: free "struct replay_opts" members
  submodule.c: free() memory from xgetcwd()
  clone: fix memory leak in wanted_peer_refs()
  check-ref-format: fix trivial memory leak

23 months agoMerge branch 'jc/builtin-mv-move-array'
Junio C Hamano [Mon, 18 Jul 2022 20:31:53 +0000 (13:31 -0700)] 
Merge branch 'jc/builtin-mv-move-array'

Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp
macro, which would improve maintainability and readability.

* jc/builtin-mv-move-array:
  builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove()

23 months agoMerge branch 'fr/vimdiff-layout-fix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:53 +0000 (13:31 -0700)] 
Merge branch 'fr/vimdiff-layout-fix'

Recent update to vimdiff layout code has been made more robust
against different end-user vim settings.

* fr/vimdiff-layout-fix:
  vimdiff: make layout engine more robust against user vim settings