]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 months agoMerge branch 'ps/reftable-multi-level-indices-fix'
Junio C Hamano [Mon, 12 Feb 2024 21:16:09 +0000 (13:16 -0800)] 
Merge branch 'ps/reftable-multi-level-indices-fix'

Write multi-level indices for reftable has been corrected.

* ps/reftable-multi-level-indices-fix:
  reftable: document reading and writing indices
  reftable/writer: fix writing multi-level indices
  reftable/writer: simplify writing index records
  reftable/writer: use correct type to iterate through index entries
  reftable/reader: be more careful about errors in indexed seeks

3 months agoGit 2.44-rc0 v2.44.0-rc0
Junio C Hamano [Fri, 9 Feb 2024 00:35:07 +0000 (16:35 -0800)] 
Git 2.44-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 months agoSync with Git 2.43.1
Junio C Hamano [Fri, 9 Feb 2024 00:30:22 +0000 (16:30 -0800)] 
Sync with Git 2.43.1

3 months agoGit 2.43.1 v2.43.1
Junio C Hamano [Thu, 8 Feb 2024 23:56:45 +0000 (15:56 -0800)] 
Git 2.43.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 months agoMerge branch 'ib/rebase-reschedule-doc' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:12 +0000 (16:22 -0800)] 
Merge branch 'ib/rebase-reschedule-doc' into maint-2.43

Doc update.

* ib/rebase-reschedule-doc:
  rebase: clarify --reschedule-failed-exec default

3 months agoMerge branch 'jk/index-pack-lsan-false-positive-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:12 +0000 (16:22 -0800)] 
Merge branch 'jk/index-pack-lsan-false-positive-fix' into maint-2.43

Fix false positive reported by leak sanitizer.

* jk/index-pack-lsan-false-positive-fix:
  index-pack: spawn threads atomically

3 months agoMerge branch 'cp/sideband-array-index-comment-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:12 +0000 (16:22 -0800)] 
Merge branch 'cp/sideband-array-index-comment-fix' into maint-2.43

In-code comment fix.

* cp/sideband-array-index-comment-fix:
  sideband.c: remove redundant 'NEEDSWORK' tag

3 months agoMerge branch 'ms/rebase-insnformat-doc-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:11 +0000 (16:22 -0800)] 
Merge branch 'ms/rebase-insnformat-doc-fix' into maint-2.43

Docfix.

* ms/rebase-insnformat-doc-fix:
  Documentation: fix statement about rebase.instructionFormat

3 months agoMerge branch 'jx/sideband-chomp-newline-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:11 +0000 (16:22 -0800)] 
Merge branch 'jx/sideband-chomp-newline-fix' into maint-2.43

Sideband demultiplexer fixes.

* jx/sideband-chomp-newline-fix:
  pkt-line: do not chomp newlines for sideband messages
  pkt-line: memorize sideband fragment in reader
  test-pkt-line: add option parser for unpack-sideband

3 months agoMerge branch 'jk/t1006-cat-file-objectsize-disk' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:11 +0000 (16:22 -0800)] 
Merge branch 'jk/t1006-cat-file-objectsize-disk' into maint-2.43

Test update.

* jk/t1006-cat-file-objectsize-disk:
  t1006: prefer shell loop to awk for packed object sizes
  t1006: add tests for %(objectsize:disk)

3 months agoMerge branch 'js/contributor-docs-updates' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:11 +0000 (16:22 -0800)] 
Merge branch 'js/contributor-docs-updates' into maint-2.43

Doc update.

* js/contributor-docs-updates:
  SubmittingPatches: hyphenate non-ASCII
  SubmittingPatches: clarify GitHub artifact format
  SubmittingPatches: clarify GitHub visual
  SubmittingPatches: provide tag naming advice
  SubmittingPatches: update extra tags list
  SubmittingPatches: discourage new trailers
  SubmittingPatches: drop ref to "What's in git.git"
  CodingGuidelines: write punctuation marks
  CodingGuidelines: move period inside parentheses

3 months agoMerge branch 'rs/fast-import-simplify-mempool-allocation' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:10 +0000 (16:22 -0800)] 
Merge branch 'rs/fast-import-simplify-mempool-allocation' into maint-2.43

Code simplification.

* rs/fast-import-simplify-mempool-allocation:
  fast-import: use mem_pool_calloc()

3 months agoMerge branch 'en/header-cleanup' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:10 +0000 (16:22 -0800)] 
Merge branch 'en/header-cleanup' into maint-2.43

Remove unused header "#include".

* en/header-cleanup:
  treewide: remove unnecessary includes in source files
  treewide: add direct includes currently only pulled in transitively
  trace2/tr2_tls.h: remove unnecessary include
  submodule-config.h: remove unnecessary include
  pkt-line.h: remove unnecessary include
  line-log.h: remove unnecessary include
  http.h: remove unnecessary include
  fsmonitor--daemon.h: remove unnecessary includes
  blame.h: remove unnecessary includes
  archive.h: remove unnecessary include
  treewide: remove unnecessary includes in source files
  treewide: remove unnecessary includes from header files

3 months agoMerge branch 'ml/doc-merge-updates' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:10 +0000 (16:22 -0800)] 
Merge branch 'ml/doc-merge-updates' into maint-2.43

Doc update.

* ml/doc-merge-updates:
  Documentation/git-merge.txt: use backticks for command wrapping
  Documentation/git-merge.txt: fix reference to synopsis

3 months agoMerge branch 'jc/orphan-unborn' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:09 +0000 (16:22 -0800)] 
Merge branch 'jc/orphan-unborn' into maint-2.43

Doc updates to clarify what an "unborn branch" means.

* jc/orphan-unborn:
  orphan/unborn: fix use of 'orphan' in end-user facing messages
  orphan/unborn: add to the glossary and use them consistently

3 months agoMerge branch 'la/trailer-cleanups' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:09 +0000 (16:22 -0800)] 
Merge branch 'la/trailer-cleanups' into maint-2.43

Code clean-up.

* la/trailer-cleanups:
  trailer: use offsets for trailer_start/trailer_end
  trailer: find the end of the log message
  commit: ignore_non_trailer computes number of bytes to ignore

3 months agoMerge branch 'jc/retire-cas-opt-name-constant' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:09 +0000 (16:22 -0800)] 
Merge branch 'jc/retire-cas-opt-name-constant' into maint-2.43

Code clean-up.

* jc/retire-cas-opt-name-constant:
  remote.h: retire CAS_OPT_NAME

3 months agoMerge branch 'rs/rebase-use-strvec-pushf' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:09 +0000 (16:22 -0800)] 
Merge branch 'rs/rebase-use-strvec-pushf' into maint-2.43

Code clean-up.

* rs/rebase-use-strvec-pushf:
  rebase: use strvec_pushf() for format-patch revisions

3 months agoMerge branch 'rs/t6300-compressed-size-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:08 +0000 (16:22 -0800)] 
Merge branch 'rs/t6300-compressed-size-fix' into maint-2.43

Test fix.

* rs/t6300-compressed-size-fix:
  t6300: avoid hard-coding object sizes

3 months agoMerge branch 'sp/test-i18ngrep' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:08 +0000 (16:22 -0800)] 
Merge branch 'sp/test-i18ngrep' into maint-2.43

Error message fix in the test framework.

* sp/test-i18ngrep:
  test-lib-functions.sh: fix test_grep fail message wording

3 months agoMerge branch 'jc/doc-misspelt-refs-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:08 +0000 (16:22 -0800)] 
Merge branch 'jc/doc-misspelt-refs-fix' into maint-2.43

Doc update.

* jc/doc-misspelt-refs-fix:
  doc: format.notes specify a ref under refs/notes/ hierarchy

3 months agoMerge branch 'jc/doc-most-refs-are-not-that-special' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:08 +0000 (16:22 -0800)] 
Merge branch 'jc/doc-most-refs-are-not-that-special' into maint-2.43

Doc updates.

* jc/doc-most-refs-are-not-that-special:
  docs: MERGE_AUTOSTASH is not that special
  docs: AUTO_MERGE is not that special
  refs.h: HEAD is not that special
  git-bisect.txt: BISECT_HEAD is not that special
  git.txt: HEAD is not that special

3 months agoMerge branch 'es/add-doc-list-short-form-of-all-in-synopsis' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:07 +0000 (16:22 -0800)] 
Merge branch 'es/add-doc-list-short-form-of-all-in-synopsis' into maint-2.43

Doc update.

* es/add-doc-list-short-form-of-all-in-synopsis:
  git-add.txt: add missing short option -A to synopsis

3 months agoMerge branch 'ps/chainlint-self-check-update' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:07 +0000 (16:22 -0800)] 
Merge branch 'ps/chainlint-self-check-update' into maint-2.43

Test framework update.

* ps/chainlint-self-check-update:
  tests: adjust whitespace in chainlint expectations

3 months agoMerge branch 'ps/reftable-fixes' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:07 +0000 (16:22 -0800)] 
Merge branch 'ps/reftable-fixes' into maint-2.43

Bunch of small fix-ups to the reftable code.

* ps/reftable-fixes:
  reftable/block: reuse buffer to compute record keys
  reftable/block: introduce macro to initialize `struct block_iter`
  reftable/merged: reuse buffer to compute record keys
  reftable/stack: fix use of unseeded randomness
  reftable/stack: fix stale lock when dying
  reftable/stack: reuse buffers when reloading stack
  reftable/stack: perform auto-compaction with transactional interface
  reftable/stack: verify that `reftable_stack_add()` uses auto-compaction
  reftable: handle interrupted writes
  reftable: handle interrupted reads
  reftable: wrap EXPECT macros in do/while

3 months agoMerge branch 'jk/config-cleanup' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:07 +0000 (16:22 -0800)] 
Merge branch 'jk/config-cleanup' into maint-2.43

Code clean-up around use of configuration variables.

* jk/config-cleanup:
  sequencer: simplify away extra git_config_string() call
  gpg-interface: drop pointless config_error_nonbool() checks
  push: drop confusing configset/callback redundancy
  config: use git_config_string() for core.checkRoundTripEncoding
  diff: give more detailed messages for bogus diff.* config
  config: use config_error_nonbool() instead of custom messages
  imap-send: don't use git_die_config() inside callback
  git_xmerge_config(): prefer error() to die()
  config: reject bogus values for core.checkstat

3 months agoMerge branch 'rs/incompatible-options-messages' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:06 +0000 (16:22 -0800)] 
Merge branch 'rs/incompatible-options-messages' into maint-2.43

Clean-up code that handles combinations of incompatible options.

* rs/incompatible-options-messages:
  worktree: simplify incompatibility message for --orphan and commit-ish
  worktree: standardize incompatibility messages
  clean: factorize incompatibility message
  revision, rev-parse: factorize incompatibility messages about - -exclude-hidden
  revision: use die_for_incompatible_opt3() for - -graph/--reverse/--walk-reflogs
  repack: use die_for_incompatible_opt3() for -A/-k/--cruft
  push: use die_for_incompatible_opt4() for - -delete/--tags/--all/--mirror

3 months agoMerge branch 'mk/doc-gitfile-more' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:06 +0000 (16:22 -0800)] 
Merge branch 'mk/doc-gitfile-more' into maint-2.43

Doc update.

* mk/doc-gitfile-more:
  doc: make the gitfile syntax easier to discover

3 months agoMerge branch 'ps/ref-tests-update-more' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:06 +0000 (16:22 -0800)] 
Merge branch 'ps/ref-tests-update-more' into maint-2.43

Tests update.

* ps/ref-tests-update-more:
  t6301: write invalid object ID via `test-tool ref-store`
  t5551: stop writing packed-refs directly
  t5401: speed up creation of many branches
  t4013: simplify magic parsing and drop "failure"
  t3310: stop checking for reference existence via `test -f`
  t1417: make `reflog --updateref` tests backend agnostic
  t1410: use test-tool to create empty reflog
  t1401: stop treating FETCH_HEAD as real reference
  t1400: split up generic reflog tests from the reffile-specific ones
  t0410: mark tests to require the reffiles backend

3 months agoMerge branch 'rs/column-leakfix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:06 +0000 (16:22 -0800)] 
Merge branch 'rs/column-leakfix' into maint-2.43

Leakfix.

* rs/column-leakfix:
  column: release strbuf and string_list after use

3 months agoMerge branch 'rs/i18n-cannot-be-used-together' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:05 +0000 (16:22 -0800)] 
Merge branch 'rs/i18n-cannot-be-used-together' into maint-2.43

Clean-up code that handles combinations of incompatible options.

* rs/i18n-cannot-be-used-together:
  i18n: factorize even more 'incompatible options' messages

3 months agoMerge branch 'jb/reflog-expire-delete-dry-run-options' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:05 +0000 (16:22 -0800)] 
Merge branch 'jb/reflog-expire-delete-dry-run-options' into maint-2.43

Command line parsing fix for "git reflog".

* jb/reflog-expire-delete-dry-run-options:
  builtin/reflog.c: fix dry-run option short name

3 months agoMerge branch 'js/packfile-h-typofix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:05 +0000 (16:22 -0800)] 
Merge branch 'js/packfile-h-typofix' into maint-2.43

Typofix.

* js/packfile-h-typofix:
  packfile.c: fix a typo in `each_file_in_pack_dir_fn()`'s declaration

3 months agoMerge branch 'jk/commit-graph-slab-clear-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:05 +0000 (16:22 -0800)] 
Merge branch 'jk/commit-graph-slab-clear-fix' into maint-2.43

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.

* jk/commit-graph-slab-clear-fix:
  commit-graph: retain commit slab when closing NULL commit_graph

3 months agoMerge branch 'cp/git-flush-is-an-env-bool' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:04 +0000 (16:22 -0800)] 
Merge branch 'cp/git-flush-is-an-env-bool' into maint-2.43

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.

* cp/git-flush-is-an-env-bool:
  write-or-die: make GIT_FLUSH a Boolean environment variable

3 months agoMerge branch 'jc/sparse-checkout-set-default-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:04 +0000 (16:22 -0800)] 
Merge branch 'jc/sparse-checkout-set-default-fix' into maint-2.43

"git sparse-checkout set" added default patterns even when the
patterns are being fed from the standard input, which has been
corrected.

* jc/sparse-checkout-set-default-fix:
  sparse-checkout: use default patterns for 'set' only !stdin

3 months agoMerge branch 'jc/archive-list-with-extra-args' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:04 +0000 (16:22 -0800)] 
Merge branch 'jc/archive-list-with-extra-args' into maint-2.43

"git archive --list extra garbage" silently ignored excess command
line parameters, which has been corrected.

* jc/archive-list-with-extra-args:
  archive: "--list" does not take further options

3 months agoMerge branch 'rj/status-bisect-while-rebase' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:04 +0000 (16:22 -0800)] 
Merge branch 'rj/status-bisect-while-rebase' into maint-2.43

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

* rj/status-bisect-while-rebase:
  status: fix branch shown when not only bisecting

3 months agoMerge branch 'sh/completion-with-reftable' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:04 +0000 (16:22 -0800)] 
Merge branch 'sh/completion-with-reftable' into maint-2.43

Command line completion script (in contrib/) learned to work better
with the reftable backend.

* sh/completion-with-reftable:
  completion: support pseudoref existence checks for reftables
  completion: refactor existence checks for pseudorefs

3 months agoMerge branch 'jx/fetch-atomic-error-message-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:03 +0000 (16:22 -0800)] 
Merge branch 'jx/fetch-atomic-error-message-fix' into maint-2.43

"git fetch --atomic" issued an unnecessary empty error message,
which has been corrected.
cf. <ZX__e7VjyLXIl-uV@tanuki>

* jx/fetch-atomic-error-message-fix:
  fetch: no redundant error message for atomic fetch
  t5574: test porcelain output of atomic fetch

3 months agoMerge branch 'jk/mailinfo-iterative-unquote-comment' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:03 +0000 (16:22 -0800)] 
Merge branch 'jk/mailinfo-iterative-unquote-comment' into maint-2.43

The code to parse the From e-mail header has been updated to avoid
recursion.

* jk/mailinfo-iterative-unquote-comment:
  mailinfo: avoid recursion when unquoting From headers
  t5100: make rfc822 comment test more careful
  mailinfo: fix out-of-bounds memory reads in unquote_quoted_pair()

3 months agoMerge branch 'rs/show-ref-incompatible-options' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:03 +0000 (16:22 -0800)] 
Merge branch 'rs/show-ref-incompatible-options' into maint-2.43

Code clean-up for sanity checking of command line options for "git
show-ref".

* rs/show-ref-incompatible-options:
  show-ref: use die_for_incompatible_opt3()

3 months agoMerge branch 'jk/implicit-true' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:03 +0000 (16:22 -0800)] 
Merge branch 'jk/implicit-true' into maint-2.43

Some codepaths did not correctly parse configuration variables
specified with valueless "true", which has been corrected.

* jk/implicit-true:
  fsck: handle NULL value when parsing message config
  trailer: handle NULL value when parsing trailer-specific config
  submodule: handle NULL value when parsing submodule.*.branch
  help: handle NULL value for alias.* config
  trace2: handle NULL values in tr2_sysenv config callback
  setup: handle NULL value when parsing extensions
  config: handle NULL value when parsing non-bools

3 months agoMerge branch 'jk/bisect-reset-fix' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:02 +0000 (16:22 -0800)] 
Merge branch 'jk/bisect-reset-fix' into maint-2.43

"git bisect reset" has been taught to clean up state files and refs
even when BISECT_START file is gone.

* jk/bisect-reset-fix:
  bisect: always clean on reset

3 months agoMerge branch 'jk/end-of-options' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:02 +0000 (16:22 -0800)] 
Merge branch 'jk/end-of-options' into maint-2.43

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

* jk/end-of-options:
  parse-options: decouple "--end-of-options" and "--"

3 months agoMerge branch 'jc/revision-parse-int' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:02 +0000 (16:22 -0800)] 
Merge branch 'jc/revision-parse-int' into maint-2.43

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.

* jc/revision-parse-int:
  revision: parse integer arguments to --max-count, --skip, etc., more carefully

3 months agoMerge branch 'jp/use-diff-index-in-pre-commit-sample' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:02 +0000 (16:22 -0800)] 
Merge branch 'jp/use-diff-index-in-pre-commit-sample' into maint-2.43

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.

* jp/use-diff-index-in-pre-commit-sample:
  hooks--pre-commit: detect non-ASCII when renaming

3 months agoMerge branch 'jh/trace2-redact-auth' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:01 +0000 (16:22 -0800)] 
Merge branch 'jh/trace2-redact-auth' into maint-2.43

trace2 streams used to record the URLs that potentially embed
authentication material, which has been corrected.

* jh/trace2-redact-auth:
  t0212: test URL redacting in EVENT format
  t0211: test URL redacting in PERF format
  trace2: redact passwords from https:// URLs by default
  trace2: fix signature of trace2_def_param() macro

3 months agoMerge branch 'js/update-urls-in-doc-and-comment' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:01 +0000 (16:22 -0800)] 
Merge branch 'js/update-urls-in-doc-and-comment' into maint-2.43

Stale URLs have been updated to their current counterparts (or
archive.org) and HTTP links are replaced with working HTTPS links.

* js/update-urls-in-doc-and-comment:
  doc: refer to internet archive
  doc: update links for andre-simon.de
  doc: switch links to https
  doc: update links to current pages

3 months agoMerge branch 'ps/commit-graph-less-paranoid' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:01 +0000 (16:22 -0800)] 
Merge branch 'ps/commit-graph-less-paranoid' into maint-2.43

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.

* ps/commit-graph-less-paranoid:
  commit-graph: disable GIT_COMMIT_GRAPH_PARANOIA by default

3 months agoMerge branch 'tz/send-email-negatable-options' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:00 +0000 (16:22 -0800)] 
Merge branch 'tz/send-email-negatable-options' into maint-2.43

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.

* tz/send-email-negatable-options:
  send-email: avoid duplicate specification warnings
  perl: bump the required Perl version to 5.8.1 from 5.8.0

3 months agoMerge branch 'js/ci-discard-prove-state' into maint-2.43
Junio C Hamano [Fri, 9 Feb 2024 00:22:00 +0000 (16:22 -0800)] 
Merge branch 'js/ci-discard-prove-state' into maint-2.43

The way CI testing used "prove" could lead to running the test
suite twice needlessly, which has been corrected.

* js/ci-discard-prove-state:
  ci: avoid running the test suite _twice_
  ci: add support for GitLab CI
  ci: install test dependencies for linux-musl
  ci: squelch warnings when testing with unusable Git repo
  ci: unify setup of some environment variables
  ci: split out logic to set up failed test artifacts
  ci: group installation of Docker dependencies
  ci: make grouping setup more generic
  ci: reorder definitions for grouping functions

3 months agoThe fifteenth batch
Junio C Hamano [Thu, 8 Feb 2024 21:20:41 +0000 (13:20 -0800)] 
The fifteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 months agoMerge branch 'jh/sparse-index-expand-to-path-fix'
Junio C Hamano [Thu, 8 Feb 2024 21:20:34 +0000 (13:20 -0800)] 
Merge branch 'jh/sparse-index-expand-to-path-fix'

A caller called index_file_exists() that takes a string expressed
as <ptr, length> with a wrong length, which has been corrected.

* jh/sparse-index-expand-to-path-fix:
  sparse-index: pass string length to index_file_exists()

3 months agoMerge branch 'pb/imap-send-wo-curl-build-fix'
Junio C Hamano [Thu, 8 Feb 2024 21:20:34 +0000 (13:20 -0800)] 
Merge branch 'pb/imap-send-wo-curl-build-fix'

Build fix.

* pb/imap-send-wo-curl-build-fix:
  imap-send: add missing "strbuf.h" include under NO_CURL

3 months agoMerge branch 'ja/doc-placeholders-fix'
Junio C Hamano [Thu, 8 Feb 2024 21:20:34 +0000 (13:20 -0800)] 
Merge branch 'ja/doc-placeholders-fix'

Docfix.

* ja/doc-placeholders-fix:
  doc: enforce placeholders in documentation
  doc: enforce dashes in placeholders

3 months agoMerge branch 'mh/credential-oauth-refresh-token-with-wincred'
Junio C Hamano [Thu, 8 Feb 2024 21:20:34 +0000 (13:20 -0800)] 
Merge branch 'mh/credential-oauth-refresh-token-with-wincred'

The wincred credential backend has been taught to support oauth refresh
token the same way as credential-cache and credential-libsecret backends.

* mh/credential-oauth-refresh-token-with-wincred:
  credential/wincred: store oauth_refresh_token

3 months agoMerge branch 'jk/unit-tests-buildfix'
Junio C Hamano [Thu, 8 Feb 2024 21:20:33 +0000 (13:20 -0800)] 
Merge branch 'jk/unit-tests-buildfix'

Build dependency around unit tests has been fixed.

* jk/unit-tests-buildfix:
  t/Makefile: say the default target upfront
  t/Makefile: get UNIT_TESTS list from C sources
  Makefile: remove UNIT_TEST_BIN directory with "make clean"
  Makefile: use mkdir_p_parent_template for UNIT_TEST_BIN

3 months agoMerge branch 'jc/index-pack-fsck-levels'
Junio C Hamano [Thu, 8 Feb 2024 21:20:33 +0000 (13:20 -0800)] 
Merge branch 'jc/index-pack-fsck-levels'

The "--fsck-objects" option of "git index-pack" now can take the
optional parameter to tweak severity of different fsck errors.

* jc/index-pack-fsck-levels:
  index-pack: --fsck-objects to take an optional argument for fsck msgs
  index-pack: test and document --strict=<msg-id>=<severity>...

3 months agoMerge branch 'cp/unit-test-prio-queue'
Junio C Hamano [Thu, 8 Feb 2024 21:20:33 +0000 (13:20 -0800)] 
Merge branch 'cp/unit-test-prio-queue'

The priority queue test has been migrated to the unit testing
framework.

* cp/unit-test-prio-queue:
  tests: move t0009-prio-queue.sh to the new unit testing framework

3 months agoThe fourteenth batch
Junio C Hamano [Tue, 6 Feb 2024 22:31:50 +0000 (14:31 -0800)] 
The fourteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 months agoMerge branch 'cb/use-freebsd-13-2-at-cirrus-ci'
Junio C Hamano [Tue, 6 Feb 2024 22:31:22 +0000 (14:31 -0800)] 
Merge branch 'cb/use-freebsd-13-2-at-cirrus-ci'

Cirrus CI jobs started breaking because we specified version of
FreeBSD that is no longer available, which has been corrected.

* cb/use-freebsd-13-2-at-cirrus-ci:
  ci: update FreeBSD cirrus job

3 months agoMerge branch 'jc/make-libpath-template'
Junio C Hamano [Tue, 6 Feb 2024 22:31:22 +0000 (14:31 -0800)] 
Merge branch 'jc/make-libpath-template'

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.

* jc/make-libpath-template:
  Makefile: simplify output of the libpath_template
  Makefile: reduce repetitive library paths

3 months agoMerge branch 'rj/test-with-leak-check'
Junio C Hamano [Tue, 6 Feb 2024 22:31:21 +0000 (14:31 -0800)] 
Merge branch 'rj/test-with-leak-check'

More tests that are supposed to pass leak sanitizer are marked as such.

* rj/test-with-leak-check:
  t0080: mark as leak-free
  test-lib: check for TEST_PASSES_SANITIZE_LEAK
  t6113: mark as leak-free
  t5332: mark as leak-free

3 months agoMerge branch 'jc/t0091-with-unknown-git'
Junio C Hamano [Tue, 6 Feb 2024 22:31:21 +0000 (14:31 -0800)] 
Merge branch 'jc/t0091-with-unknown-git'

The test did not work when Git was built from a repository without
tags.

* jc/t0091-with-unknown-git:
  t0091: allow test in a repository without tags

3 months agoMerge branch 'js/win32-retry-pipe-write-on-enospc'
Junio C Hamano [Tue, 6 Feb 2024 22:31:21 +0000 (14:31 -0800)] 
Merge branch 'js/win32-retry-pipe-write-on-enospc'

Update to the code that writes to pipes on Windows.

* js/win32-retry-pipe-write-on-enospc:
  win32: special-case `ENOSPC` when writing to a pipe

3 months agoMerge branch 'ps/tests-with-ref-files-backend'
Junio C Hamano [Tue, 6 Feb 2024 22:31:21 +0000 (14:31 -0800)] 
Merge branch 'ps/tests-with-ref-files-backend'

Prepare existing tests on refs to work better with non-default
backends.

* ps/tests-with-ref-files-backend:
  t: mark tests regarding git-pack-refs(1) to be backend specific
  t5526: break test submodule differently
  t1419: mark test suite as files-backend specific
  t1302: make tests more robust with new extensions
  t1301: mark test for `core.sharedRepository` as reffiles specific
  t1300: make tests more robust with non-default ref backends

3 months agoMerge branch 'jc/comment-style-fixes'
Junio C Hamano [Tue, 6 Feb 2024 22:31:21 +0000 (14:31 -0800)] 
Merge branch 'jc/comment-style-fixes'

Rewrite //-comments to /* comments */ in files whose comments
prevalently use the latter.

* jc/comment-style-fixes:
  reftable/pq_test: comment style fix
  merge-ort.c: comment style fix
  builtin/worktree: comment style fixes

3 months agoMerge branch 'jk/diff-external-with-no-index'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'jk/diff-external-with-no-index'

"git diff --no-index file1 file2" segfaulted while invoking the
external diff driver, which has been corrected.

* jk/diff-external-with-no-index:
  diff: handle NULL meta-info when spawning external diff

3 months agoMerge branch 'kh/maintenance-use-xdg-when-it-should'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'kh/maintenance-use-xdg-when-it-should'

Comment fix.

* kh/maintenance-use-xdg-when-it-should:
  config: add back code comment

3 months agoMerge branch 'tb/pack-bitmap-drop-unused-struct-member'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'tb/pack-bitmap-drop-unused-struct-member'

Code clean-up.

* tb/pack-bitmap-drop-unused-struct-member:
  pack-bitmap: drop unused `reuse_objects`

3 months agoMerge branch 'jt/p4-spell-re-with-raw-string'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'jt/p4-spell-re-with-raw-string'

"git p4" update to squelch warnings from Python.

* jt/p4-spell-re-with-raw-string:
  git-p4: use raw string literals for regular expressions

3 months agoMerge branch 'ps/reftable-compacted-tables-permission-fix'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'ps/reftable-compacted-tables-permission-fix'

Reftable bugfix.

* ps/reftable-compacted-tables-permission-fix:
  reftable/stack: adjust permissions of compacted tables

3 months agoMerge branch 'jc/reftable-core-fsync'
Junio C Hamano [Tue, 6 Feb 2024 22:31:20 +0000 (14:31 -0800)] 
Merge branch 'jc/reftable-core-fsync'

The write codepath for the reftable data learned to honor
core.fsync configuration.

* jc/reftable-core-fsync:
  reftable/stack: fsync "tables.list" during compaction
  reftable: honor core.fsync

4 months agot/Makefile: say the default target upfront
Junio C Hamano [Sat, 3 Feb 2024 01:32:42 +0000 (17:32 -0800)] 
t/Makefile: say the default target upfront

Similar to how 2731d048 (Makefile: say the default target upfront.,
2005-12-01) added the default target to the very beginning of the
main Makefile to prevent a random rule that happens to be defined
first in an included makefile fragments from becoming the default
target, protect this Makefile the same way.

This started to matter as we started to include config.mak.uname
and that included makefile fragment does more than defining Make
macros, unfortunately.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoThe thirteenth batch
Junio C Hamano [Fri, 2 Feb 2024 18:33:01 +0000 (10:33 -0800)] 
The thirteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMerge branch 'zf/subtree-split-fix'
Junio C Hamano [Fri, 2 Feb 2024 19:31:51 +0000 (11:31 -0800)] 
Merge branch 'zf/subtree-split-fix'

"git subtree" (in contrib/) update.

* zf/subtree-split-fix:
  subtree: fix split processing with multiple subtrees present

4 months agoMerge branch 'jc/ls-files-doc-update'
Junio C Hamano [Fri, 2 Feb 2024 19:31:51 +0000 (11:31 -0800)] 
Merge branch 'jc/ls-files-doc-update'

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.

* jc/ls-files-doc-update:
  ls-files: avoid the verb "deprecate" for individual options

4 months agoMerge branch 'jk/fetch-auto-tag-following-fix'
Junio C Hamano [Fri, 2 Feb 2024 19:31:51 +0000 (11:31 -0800)] 
Merge branch 'jk/fetch-auto-tag-following-fix'

Fetching via protocol v0 over Smart HTTP transport sometimes failed
to correctly auto-follow tags.

* jk/fetch-auto-tag-following-fix:
  transport-helper: re-examine object dir after fetching

4 months agoMerge branch 'jc/coc-whitespace-fix'
Junio C Hamano [Fri, 2 Feb 2024 19:31:51 +0000 (11:31 -0800)] 
Merge branch 'jc/coc-whitespace-fix'

Docfix.

* jc/coc-whitespace-fix:
  CoC: whitespace fix

4 months agoMerge branch 'ad/custom-merge-placeholder-for-symbolic-pathnames'
Junio C Hamano [Fri, 2 Feb 2024 19:31:50 +0000 (11:31 -0800)] 
Merge branch 'ad/custom-merge-placeholder-for-symbolic-pathnames'

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.

* ad/custom-merge-placeholder-for-symbolic-pathnames:
  merge-ll: expose revision names to custom drivers

4 months agoMerge branch 'jc/reffiles-tests'
Junio C Hamano [Fri, 2 Feb 2024 19:31:50 +0000 (11:31 -0800)] 
Merge branch 'jc/reffiles-tests'

Tests on ref API are moved around to prepare for reftable.

* jc/reffiles-tests:
  t5312: move reffiles specific tests to t0601
  t4202: move reffiles specific tests to t0600
  t3903: make drop stash test ref backend agnostic
  t1503: move reffiles specific tests to t0600
  t1415: move reffiles specific tests to t0601
  t1410: move reffiles specific tests to t0600
  t1406: move reffiles specific tests to t0600
  t1405: move reffiles specific tests to t0601
  t1404: move reffiles specific tests to t0600
  t1414: convert test to use Git commands instead of writing refs manually
  remove REFFILES prerequisite for some tests in t1405 and t2017
  t3210: move to t0601

4 months agoMerge branch 'pb/complete-log-more'
Junio C Hamano [Fri, 2 Feb 2024 19:31:50 +0000 (11:31 -0800)] 
Merge branch 'pb/complete-log-more'

The completion script (in contrib/) learned more options that can
be used with "git log".

* pb/complete-log-more:
  completion: complete missing 'git log' options
  completion: complete --encoding
  completion: complete --patch-with-raw
  completion: complete missing rev-list options

4 months agosparse-index: pass string length to index_file_exists()
Jeff Hostetler [Fri, 2 Feb 2024 18:04:54 +0000 (18:04 +0000)] 
sparse-index: pass string length to index_file_exists()

The call to index_file_exists() in the loop in expand_to_path() passes
the wrong string length.  Let's fix that.

The loop in expand_to_path() searches the name-hash for each
sub-directory prefix in the provided pathname. That is, by searching
for "dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until
it finds a cache-entry representing a sparse directory.

The code creates "strbuf path_mutable" to contain the working pathname
and modifies the buffer in-place by temporarily replacing the character
following each successive "/" with NUL for the duration of the call to
index_file_exists().

It does not update the strbuf.len during this substitution.

Pass the patched length of the prefix path instead.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoimap-send: add missing "strbuf.h" include under NO_CURL
Philippe Blain [Fri, 2 Feb 2024 00:18:33 +0000 (00:18 +0000)] 
imap-send: add missing "strbuf.h" include under NO_CURL

Building with NO_CURL is currently broken since imap-send.c uses things
defined in "strbuf.h" wihtout including it.

The inclusion of that header was removed in eea0e59ffb (treewide: remove
unnecessary includes in source files, 2023-12-23), which failed to
notice that "strbuf.h" was transitively included in imap-send.c via
"http.h", but only if USE_CURL_FOR_IMAP_SEND is defined. Add back the
missing include. Note that it was explicitely added in 3307f7dde2
(imap-send: include strbuf.h, 2023-05-17) after a similar breakage in
ba3d1c73da (treewide: remove unnecessary cache.h includes, 2023-02-24) -
see the thread starting at [1].

It can be verified by inspection that this is the only case where a
header we include is dependent on a Makefile knob in the files modified
in eea0e59ffb.

[1] https://lore.kernel.org/git/20230517070632.71884-1-list@eworm.de/

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoreftable: document reading and writing indices
Patrick Steinhardt [Thu, 1 Feb 2024 07:52:12 +0000 (08:52 +0100)] 
reftable: document reading and writing indices

The way the index gets written and read is not trivial at all and
requires the reader to piece together a bunch of parts to figure out how
it works. Add some documentation to hopefully make this easier to
understand for the next reader.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoreftable/writer: fix writing multi-level indices
Patrick Steinhardt [Thu, 1 Feb 2024 07:52:08 +0000 (08:52 +0100)] 
reftable/writer: fix writing multi-level indices

When finishing a section we will potentially write an index that makes
it more efficient to look up relevant blocks. The index records written
will encode, for each block of the indexed section, what the offset of
that block is as well as the last key of that block. Thus, the reader
would iterate through the index records to find the first key larger or
equal to the wanted key and then use the encoded offset to look up the
desired block.

When there are a lot of blocks to index though we may end up writing
multiple index blocks, too. To not require a linear search across all
index blocks we instead end up writing a multi-level index. Instead of
referring to the block we are after, an index record may point to
another index block. The reader will then access the highest-level index
and follow down the chain of index blocks until it hits the sought-after
block.

It has been observed though that it is impossible to seek ref records of
the last ref block when using a multi-level index. While the multi-level
index exists and looks fine for most of the part, the highest-level
index was missing an index record pointing to the last block of the next
index. Thus, every additional level made more refs become unseekable at
the end of the ref section.

The root cause is that we are not flushing the last block of the current
level once done writing the level. Consequently, it wasn't recorded in
the blocks that need to be indexed by the next-higher level and thus we
forgot about it.

Fix this bug by flushing blocks after we have written all index records.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoreftable/writer: simplify writing index records
Patrick Steinhardt [Thu, 1 Feb 2024 07:52:04 +0000 (08:52 +0100)] 
reftable/writer: simplify writing index records

When finishing the current section some index records might be written
for the section to the table. The logic that adds these records to the
writer duplicates what we already have in `writer_add_record()`, making
this more complicated than it really has to be.

Simplify the code by using `writer_add_record()` instead. While at it,
drop the unneeded braces around a loop to make the code conform to our
code style better.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoreftable/writer: use correct type to iterate through index entries
Patrick Steinhardt [Thu, 1 Feb 2024 07:52:00 +0000 (08:52 +0100)] 
reftable/writer: use correct type to iterate through index entries

The reftable writer is tracking the number of blocks it has to index via
the `index_len` variable. But while this variable is of type `size_t`,
some sites use an `int` to loop through the index entries.

Convert the code to consistently use `size_t`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoreftable/reader: be more careful about errors in indexed seeks
Patrick Steinhardt [Thu, 1 Feb 2024 07:51:56 +0000 (08:51 +0100)] 
reftable/reader: be more careful about errors in indexed seeks

When doing an indexed seek we first need to do a linear seek in order to
find the index block for our wanted key. We do not check the returned
error of the linear seek though. This is likely not an issue because the
next call to `table_iter_next()` would return error, too. But it very
much is a code smell when an error variable is being assigned to without
actually checking it.

Safeguard the code by checking for errors.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoindex-pack: --fsck-objects to take an optional argument for fsck msgs
John Cai [Thu, 1 Feb 2024 01:38:02 +0000 (01:38 +0000)] 
index-pack: --fsck-objects to take an optional argument for fsck msgs

git-index-pack has a --strict option that can take an optional argument
to provide a list of fsck issues to change their severity.
--fsck-objects does not have such a utility, which would be useful if
one would like to be more lenient or strict on data integrity in a
repository.

Like --strict, allow --fsck-objects to also take a list of fsck msgs to
change the severity.

Remove the "For internal use only" note for --fsck-objects, and document
the option. This won't often be used by the normal end user, but it
turns out it is useful for Git forges like GitLab.

Reviewed-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoindex-pack: test and document --strict=<msg-id>=<severity>...
John Cai [Thu, 1 Feb 2024 01:38:01 +0000 (01:38 +0000)] 
index-pack: test and document --strict=<msg-id>=<severity>...

5d477a334a (fsck (receive-pack): allow demoting errors to warnings,
2015-06-22) allowed a list of fsck msg to downgrade to be passed to
--strict. However this is a hidden argument that was not documented nor
tested. Though it is true that most users would not call this option
directly, (nor use index-pack for that matter) it is still useful to
document and test this feature.

Reviewed-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMakefile: simplify output of the libpath_template
Junio C Hamano [Wed, 31 Jan 2024 17:42:20 +0000 (09:42 -0800)] 
Makefile: simplify output of the libpath_template

If a platform lacks the support to specify the dynamic library path,
there is no suitable value to give to the CC_LD_DYNPATH variable.
Allow them to be set to an empty string to signal that they do not
need to add the usual -Wl,-rpath, or -R or whatever option followed
by a directory name.  This way,

    $(call libpath_template,$(SOMELIBDIR))

would expand to just a single mention of that directory, i.e.

    -L$(SOMELIBDIR)

when CC_LD_DYNPATH is set to an empty string (or a "-L", which
would have repeated the same "-L$(SOMELIBDIR)" twice without any
ill effect).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoci: update FreeBSD cirrus job
Carlo Marcelo Arenas Belón [Wed, 31 Jan 2024 19:13:25 +0000 (11:13 -0800)] 
ci: update FreeBSD cirrus job

FreeBSD 12 is EOL and no longer available, causing errors in this job.

Upgrade to 13.2, which is the next oldest release with support and that
should keep it for at least another 4 months.

This will be upgraded again once 13.3 is released to avoid further
surprises.

The original report [*] of this problem mentions an error message
"Not enough compute credits to prioritize tasks!".  It seems to be
just a reminder that the credit allocate for the Free Tier by Cirrus
is all used up and which might result in additional delays getting a
result.

[*] https://lore.kernel.org/git/d2d7da84-e2a3-a7b2-3f95-c8d53ad4dd5f@gmx.de/

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agot/Makefile: get UNIT_TESTS list from C sources
Jeff King [Tue, 30 Jan 2024 05:40:37 +0000 (00:40 -0500)] 
t/Makefile: get UNIT_TESTS list from C sources

We decide on the set of unit tests to run by asking make to expand the
wildcard "t/unit-tests/bin/*". One unfortunate outcome of this is that
we'll run anything in that directory, even if it is leftover cruft from
a previous build. This isn't _quite_ as bad as it sounds, since in
theory the unit tests executables are self-contained (so if they passed
before, they'll pass even though they now have nothing to do with the
checked out version of Git). But at the very least it's wasteful, and if
they _do_ fail it can be quite confusing to understand why they are
being run at all.

This wildcarding presumably came from our handling of the regular
shell-script tests, which use $(wildcard t[0-9][0-9][0-9][0-9]-*.sh).
But the difference there is that those are actual tracked files. So if
you checkout a different commit, they'll go away. Whereas the contents
of unit-tests/bin are ignored (so not only do they stick around, but you
are not even warned of the stale files via "git status").

This patch fixes the situation by looking for the actual unit-test
source files and then massaging those names into the final executable
names. This has two additional benefits:

  1. It will notice if we failed to build one or more unit-tests for
     some reason (whereas the current code just runs whatever made it to
     the bin/ directory).

  2. The wildcard should avoid other build cruft, like the pdb files we
     worked around in 0df903d402 (unit-tests: do not mistake `.pdb`
     files for being executable, 2023-09-25).

Our new wildcard does make an assumption that unit tests are built from
C sources. It would be a bit cleaner if we consulted UNIT_TEST_PROGRAMS
from the top-level Makefile. But doing so is tricky unless we reorganize
that Makefile to split the source file lists into include-able subfiles.
That might be worth doing in general, but in the meantime, the
assumptions made by the wildcard here seems reasonable.

Note that we do need to include config.mak.uname either way, though, as
we need the value of $(X) to compute the correct executable names (which
would be true even if we had access to the top-level's UNIT_TEST_PROGRAMS
variable).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMakefile: reduce repetitive library paths
Junio C Hamano [Wed, 31 Jan 2024 17:42:19 +0000 (09:42 -0800)] 
Makefile: reduce repetitive library paths

When we take a library package we depend on (e.g., LIBPCRE) from a
directory other than the default location of the system, we add the
same directory twice on the linker command like, like so:

  EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)

Introduce a template "libpath_template" that takes the path to the
directory, which can be used like so:

  EXTLIBS += $(call libpath_template,$(LIBPCREDIR)/$(lib))

and expand it into the "-L$(DIR) $(CC_LD_DYNPATH)$(DIR)" form.
Hopefully we can reduce the chance of typoes this way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMerge branch 'jc/reftable-core-fsync' into ps/reftable-multi-level-indices-fix
Junio C Hamano [Tue, 30 Jan 2024 22:11:44 +0000 (14:11 -0800)] 
Merge branch 'jc/reftable-core-fsync' into ps/reftable-multi-level-indices-fix

* jc/reftable-core-fsync:
  reftable/stack: fsync "tables.list" during compaction
  reftable: honor core.fsync

4 months agowin32: special-case `ENOSPC` when writing to a pipe
Johannes Schindelin [Tue, 30 Jan 2024 21:36:59 +0000 (21:36 +0000)] 
win32: special-case `ENOSPC` when writing to a pipe

Since c6d3cce6f3c4 (pipe_command(): handle ENOSPC when writing to a
pipe, 2022-08-17), one `write()` call that results in an `errno` value
`ENOSPC` (which typically indicates out of disk space, which makes
little sense in the context of a pipe) is treated the same as `EAGAIN`.

However, contrary to expectations, as diagnosed in
https://github.com/python/cpython/issues/101881#issuecomment-1428667015,
when writing to a non-blocking pipe on Windows, an `errno` value of
`ENOSPC` means something else: the write _fails_. Completely. Because
more data was provided than the internal pipe buffer can handle.
Somewhat surprising, considering that `write()` is allowed to write less
than the specified amount, e.g. by writing only as much as fits in that
buffer. But it doesn't, it writes no byte at all in that instance.

Let's handle this by manually detecting when an `ENOSPC` indicates that
a pipe's buffer is smaller than what needs to be written, and re-try
using the pipe's buffer size as `size` parameter.

It would be plausible to try writing the entire buffer in a loop,
feeding pipe buffer-sized chunks, but experiments show that trying to
write more than one buffer-sized chunk right after that will immediately
fail because the buffer is unlikely to be drained as fast as `write()`
could write again. And the whole point of a non-blocking pipe is to be
non-blocking.

Which means that the logic that determines the pipe's buffer size
unfortunately has to be run potentially many times when writing large
amounts of data to a non-blocking pipe, as there is no elegant way to
cache that information between `write()` calls. It's the best we can do,
though, so it has to be good enough.

This fix is required to let t3701.60 (handle very large filtered diff)
pass with the MSYS2 runtime provided by the MSYS2 project: Without this
patch, the failed write would result in an infinite loop. This patch is
not required with Git for Windows' variant of the MSYS2 runtime only
because Git for Windows added an ugly work-around specifically to avoid
a hang in that test case.

The diff is slightly chatty because it extends an already-existing
conditional that special-cases a _different_ `errno` value for pipes,
and because this patch needs to account for the fact that
`_get_osfhandle()` potentially overwrites `errno`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoThe twelfth batch
Junio C Hamano [Tue, 30 Jan 2024 20:33:02 +0000 (12:33 -0800)] 
The twelfth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 months agoMerge branch 'sd/negotiate-trace-fix'
Junio C Hamano [Tue, 30 Jan 2024 21:34:12 +0000 (13:34 -0800)] 
Merge branch 'sd/negotiate-trace-fix'

Tracing fix.

* sd/negotiate-trace-fix:
  push: region_leave trace for negotiate_using_fetch