]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'rs/pcre-invalid-utf8-fix-fix'
Junio C Hamano [Fri, 25 Feb 2022 23:47:38 +0000 (15:47 -0800)] 
Merge branch 'rs/pcre-invalid-utf8-fix-fix'

Workaround we have for versions of PCRE2 before their version 10.36
were in effect only for their versions newer than 10.36 by mistake,
which has been corrected.

* rs/pcre-invalid-utf8-fix-fix:
  grep: fix triggering PCRE2_NO_START_OPTIMIZE workaround

2 years agoMerge branch 'ds/core-untracked-cache-config'
Junio C Hamano [Fri, 25 Feb 2022 23:47:36 +0000 (15:47 -0800)] 
Merge branch 'ds/core-untracked-cache-config'

Setting core.untrackedCache to true failed to add the untracked
cache extension to the index.

* ds/core-untracked-cache-config:
  dir: force untracked cache with core.untrackedCache

2 years agoMerge branch 'ab/diff-free-more'
Junio C Hamano [Fri, 25 Feb 2022 23:47:36 +0000 (15:47 -0800)] 
Merge branch 'ab/diff-free-more'

Leakfixes.

* ab/diff-free-more:
  diff.[ch]: have diff_free() free options->parseopts
  diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)

2 years agoMerge branch 'ab/date-mode-release'
Junio C Hamano [Fri, 25 Feb 2022 23:47:36 +0000 (15:47 -0800)] 
Merge branch 'ab/date-mode-release'

Plug (some) memory leaks around parse_date_format().

* ab/date-mode-release:
  date API: add and use a date_mode_release()
  date API: add basic API docs
  date API: provide and use a DATE_MODE_INIT
  date API: create a date.h, split from cache.h
  cache.h: remove always unused show_date_human() declaration

2 years agoMerge branch 'jc/name-rev-stdin'
Junio C Hamano [Fri, 25 Feb 2022 23:47:36 +0000 (15:47 -0800)] 
Merge branch 'jc/name-rev-stdin'

Finishing touches to an earlier "name-rev --annotate-stdin" series.

* jc/name-rev-stdin:
  name-rev: replace --stdin with --annotate-stdin in synopsis

2 years agoMerge branch 'ab/grep-patterntype'
Junio C Hamano [Fri, 25 Feb 2022 23:47:35 +0000 (15:47 -0800)] 
Merge branch 'ab/grep-patterntype'

Some code clean-up in the "git grep" machinery.

* ab/grep-patterntype:
  grep: simplify config parsing and option parsing
  grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"
  grep.h: make "grep_opt.pattern_type_option" use its enum
  grep API: call grep_config() after grep_init()
  grep.c: don't pass along NULL callback value
  built-ins: trust the "prefix" from run_builtin()
  grep tests: add missing "grep.patternType" config tests
  grep tests: create a helper function for "BRE" or "ERE"
  log tests: check if grep_config() is called by "log"-like cmds
  grep.h: remove unused "regex_t regexp" from grep_opt

2 years agoMerge branch 'js/apply-partial-clone-filters-recursively'
Junio C Hamano [Fri, 25 Feb 2022 23:47:35 +0000 (15:47 -0800)] 
Merge branch 'js/apply-partial-clone-filters-recursively'

"git clone --filter=... --recurse-submodules" only makes the
top-level a partial clone, while submodules are fully cloned.  This
behaviour is changed to pass the same filter down to the submodules.

* js/apply-partial-clone-filters-recursively:
  clone, submodule: pass partial clone filters to submodules

2 years agoMerge branch 'ja/i18n-common-messages'
Junio C Hamano [Fri, 25 Feb 2022 23:47:35 +0000 (15:47 -0800)] 
Merge branch 'ja/i18n-common-messages'

Unify more messages to help l10n.

* ja/i18n-common-messages:
  i18n: fix some misformated placeholders in command synopsis
  i18n: remove from i18n strings that do not hold translatable parts
  i18n: factorize "invalid value" messages
  i18n: factorize more 'incompatible options' messages

2 years agoMerge branch 'ab/only-single-progress-at-once'
Junio C Hamano [Fri, 25 Feb 2022 23:47:35 +0000 (15:47 -0800)] 
Merge branch 'ab/only-single-progress-at-once'

Further tweaks on progress API.

* ab/only-single-progress-at-once:
  pack-bitmap-write.c: don't return without stop_progress()
  progress API: unify stop_progress{,_msg}(), fix trace2 bug
  progress.c: refactor stop_progress{,_msg}() to use helpers
  progress.c: use dereferenced "progress" variable, not "(*p_progress)"
  progress.h: format and be consistent with progress.c naming
  progress.c tests: test some invalid usage
  progress.c tests: make start/stop commands on stdin
  progress.c test helper: add missing braces
  leak tests: fix a memory leak in "test-progress" helper

2 years agoMerge branch 'ds/sparse-checkout-requires-per-worktree-config'
Junio C Hamano [Fri, 25 Feb 2022 23:47:33 +0000 (15:47 -0800)] 
Merge branch 'ds/sparse-checkout-requires-per-worktree-config'

"git sparse-checkout" wants to work with per-worktree configuration,
but did not work well in a worktree attached to a bare repository.

* ds/sparse-checkout-requires-per-worktree-config:
  config: make git_configset_get_string_tmp() private
  worktree: copy sparse-checkout patterns and config on add
  sparse-checkout: set worktree-config correctly
  config: add repo_config_set_worktree_gently()
  worktree: create init_worktree_config()
  Documentation: add extensions.worktreeConfig details

2 years agoMerge branch 'ab/ambiguous-object-name'
Junio C Hamano [Fri, 25 Feb 2022 23:47:33 +0000 (15:47 -0800)] 
Merge branch 'ab/ambiguous-object-name'

Error output given in response to an ambiguous object name has been
improved.

* ab/ambiguous-object-name:
  object-name: re-use "struct strbuf" in show_ambiguous_object()
  object-name: iterate ambiguous objects before showing header
  object-name: show date for ambiguous tag objects
  object-name: make ambiguous object output translatable
  object-name: explicitly handle bad tags in show_ambiguous_object()
  object-name: explicitly handle OBJ_BAD in show_ambiguous_object()
  object-name tests: add tests for ambiguous object blind spots

2 years agoThe seventh batch
Junio C Hamano [Thu, 24 Feb 2022 00:58:13 +0000 (16:58 -0800)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'bc/clarify-eol-attr'
Junio C Hamano [Thu, 24 Feb 2022 00:58:04 +0000 (16:58 -0800)] 
Merge branch 'bc/clarify-eol-attr'

Documentation update

* bc/clarify-eol-attr:
  doc: clarify interaction between 'eol' and text=auto

2 years agoMerge branch 'ds/mailmap'
Junio C Hamano [Thu, 24 Feb 2022 00:58:04 +0000 (16:58 -0800)] 
Merge branch 'ds/mailmap'

Update mailmap entries.

* ds/mailmap:
  mailmap: change primary address for Derrick Stolee

2 years agoMerge branch 'ah/log-no-graph'
Junio C Hamano [Thu, 24 Feb 2022 00:58:03 +0000 (16:58 -0800)] 
Merge branch 'ah/log-no-graph'

"git log --graph --graph" used to leak a graph structure, and there
was no way to countermand "--graph" that appear earlier on the
command line.  A "--no-graph" option has been added and resource
leakage has been plugged.

* ah/log-no-graph:
  log: add a --no-graph option
  log: fix memory leak if --graph is passed multiple times

2 years agoMerge branch 'hw/t1410-adjust-test-for-reftable'
Junio C Hamano [Thu, 24 Feb 2022 00:58:03 +0000 (16:58 -0800)] 
Merge branch 'hw/t1410-adjust-test-for-reftable'

Fix tests that are unnecessarily specific to ref-files backend.

* hw/t1410-adjust-test-for-reftable:
  t1410: mark bufsize boundary test as REFFILES
  t1410: use test-tool ref-store to inspect reflogs

2 years agoMerge branch 'ps/fetch-optim-with-commit-graph'
Junio C Hamano [Thu, 24 Feb 2022 00:58:03 +0000 (16:58 -0800)] 
Merge branch 'ps/fetch-optim-with-commit-graph'

A couple of optimization to "git fetch".

* ps/fetch-optim-with-commit-graph:
  fetch: skip computing output width when not printing anything
  fetch-pack: use commit-graph when computing cutoff

2 years agoMerge branch 'sy/t0001-use-path-is-helper'
Junio C Hamano [Thu, 24 Feb 2022 00:58:03 +0000 (16:58 -0800)] 
Merge branch 'sy/t0001-use-path-is-helper'

Test modernization.

* sy/t0001-use-path-is-helper:
  t0001: replace "test [-d|-f]" with test_path_is_* functions

2 years agoMerge branch 'bs/forbid-i18n-of-protocol-token-in-fetch-pack'
Junio C Hamano [Thu, 24 Feb 2022 00:58:03 +0000 (16:58 -0800)] 
Merge branch 'bs/forbid-i18n-of-protocol-token-in-fetch-pack'

L10n support for a few error messages.

* bs/forbid-i18n-of-protocol-token-in-fetch-pack:
  fetch-pack: parameterize message containing 'ready' keyword

2 years agoThe sixth batch
Junio C Hamano [Fri, 18 Feb 2022 17:53:31 +0000 (09:53 -0800)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jc/glossary-worktree'
Junio C Hamano [Fri, 18 Feb 2022 21:53:30 +0000 (13:53 -0800)] 
Merge branch 'jc/glossary-worktree'

"working tree" and "per-worktree ref" were in glossary, but
"worktree" itself wasn't, which has been corrected.

* jc/glossary-worktree:
  glossary: describe "worktree"

2 years agoMerge branch 'jd/t0015-modernize'
Junio C Hamano [Fri, 18 Feb 2022 21:53:30 +0000 (13:53 -0800)] 
Merge branch 'jd/t0015-modernize'

Test modernization.

* jd/t0015-modernize:
  t/t0015-hash.sh: remove unnecessary '\' at line end

2 years agoMerge branch 'js/short-help-outside-repo-fix'
Junio C Hamano [Fri, 18 Feb 2022 21:53:30 +0000 (13:53 -0800)] 
Merge branch 'js/short-help-outside-repo-fix'

"git cmd -h" outside a repository should error out cleanly for many
commands, but instead it hit a BUG(), which has been corrected.

* js/short-help-outside-repo-fix:
  t0012: verify that built-ins handle `-h` even without gitdir
  checkout/fetch/pull/pack-objects: allow `-h` outside a repository

2 years agoMerge branch 'tb/midx-no-bitmap-for-no-objects'
Junio C Hamano [Fri, 18 Feb 2022 21:53:30 +0000 (13:53 -0800)] 
Merge branch 'tb/midx-no-bitmap-for-no-objects'

When there is no object to write .bitmap file for, "git
multi-pack-index" triggered an error, instead of just skipping,
which has been corrected.

* tb/midx-no-bitmap-for-no-objects:
  midx: prevent writing a .bitmap without any objects

2 years agoMerge branch 'ab/release-transport-ls-refs-options'
Junio C Hamano [Fri, 18 Feb 2022 21:53:29 +0000 (13:53 -0800)] 
Merge branch 'ab/release-transport-ls-refs-options'

* ab/release-transport-ls-refs-options:
  ls-remote & transport API: release "struct transport_ls_refs_options"

2 years agoMerge branch 'ab/hash-object-leakfix'
Junio C Hamano [Fri, 18 Feb 2022 21:53:29 +0000 (13:53 -0800)] 
Merge branch 'ab/hash-object-leakfix'

Trivial leakfix.

* ab/hash-object-leakfix:
  hash-object: fix a trivial leak in --path

2 years agoMerge branch 'gc/branch-recurse-submodules'
Junio C Hamano [Fri, 18 Feb 2022 21:53:29 +0000 (13:53 -0800)] 
Merge branch 'gc/branch-recurse-submodules'

"git branch" learned the "--recurse-submodules" option.

* gc/branch-recurse-submodules:
  branch.c: use 'goto cleanup' in setup_tracking() to fix memory leaks
  branch: add --recurse-submodules option for branch creation
  builtin/branch: consolidate action-picking logic in cmd_branch()
  branch: add a dry_run parameter to create_branch()
  branch: make create_branch() always create a branch
  branch: move --set-upstream-to behavior to dwim_and_setup_tracking()

2 years agoMerge branch 'ab/t0051-skip-on-non-windows'
Junio C Hamano [Fri, 18 Feb 2022 21:53:28 +0000 (13:53 -0800)] 
Merge branch 'ab/t0051-skip-on-non-windows'

Conditional test update.

* ab/t0051-skip-on-non-windows:
  t0051: use "skip_all" under !MINGW in single-test file

2 years agoMerge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'
Junio C Hamano [Fri, 18 Feb 2022 21:53:27 +0000 (13:53 -0800)] 
Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'

Because a deletion of ref would need to remove it from both the
loose ref store and the packed ref store, a delete-ref operation
that logically removes one ref may end up invoking ref-transaction
hook twice, which has been corrected.

* ps/avoid-unnecessary-hook-invocation-with-packed-refs:
  refs: skip hooks when deleting uncovered packed refs
  refs: do not execute reference-transaction hook on packing refs
  refs: demonstrate excessive execution of the reference-transaction hook
  refs: allow skipping the reference-transaction hook
  refs: allow passing flags when beginning transactions
  refs: extract packed_refs_delete_refs() to allow control of transaction

2 years agoMerge branch 'pw/use-in-process-checkout-in-rebase'
Junio C Hamano [Fri, 18 Feb 2022 21:53:27 +0000 (13:53 -0800)] 
Merge branch 'pw/use-in-process-checkout-in-rebase'

Use an internal call to reset_head() helper function instead of
spawning "git checkout" in "rebase", and update code paths that are
involved in the change.

* pw/use-in-process-checkout-in-rebase:
  rebase -m: don't fork git checkout
  rebase --apply: set ORIG_HEAD correctly
  rebase --apply: fix reflog
  reset_head(): take struct rebase_head_opts
  rebase: cleanup reset_head() calls
  create_autostash(): remove unneeded parameter
  reset_head(): make default_reflog_action optional
  reset_head(): factor out ref updates
  reset_head(): remove action parameter
  rebase --apply: don't run post-checkout hook if there is an error
  rebase: do not remove untracked files on checkout
  rebase: pass correct arguments to post-checkout hook
  t5403: refactor rebase post-checkout hook tests
  rebase: factor out checkout for up to date branch

2 years agoMerge branch 'cb/clear-quarantine-early-on-all-ref-update-errors'
Junio C Hamano [Fri, 18 Feb 2022 21:53:27 +0000 (13:53 -0800)] 
Merge branch 'cb/clear-quarantine-early-on-all-ref-update-errors'

"receive-pack" checks if it will do any ref updates (various
conditions could reject a push) before received objects are taken
out of the temporary directory used for quarantine purposes, so
that a push that is known-to-fail will not leave crufts that a
future "gc" needs to clean up.

* cb/clear-quarantine-early-on-all-ref-update-errors:
  receive-pack: purge temporary data if no command is ready to run

2 years agoThe fifth batch
Junio C Hamano [Fri, 18 Feb 2022 00:24:23 +0000 (16:24 -0800)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/complete-show-all-commands'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'ab/complete-show-all-commands'

The command line completion script (in contrib/) learned to
complete all Git subcommands, including the ones that are normally
hidden, when GIT_COMPLETION_SHOW_ALL_COMMANDS is used.

* ab/complete-show-all-commands:
  completion: add a GIT_COMPLETION_SHOW_ALL_COMMANDS
  completion tests: re-source git-completion.bash in a subshell

2 years agoMerge branch 'sy/modernize-t-lib-read-tree-m-3way'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'sy/modernize-t-lib-read-tree-m-3way'

Style updates on a test script helper.

* sy/modernize-t-lib-read-tree-m-3way:
  t/lib-read-tree-m-3way: indent with tabs
  t/lib-read-tree-m-3way: modernize style

2 years agoMerge branch 'po/doc-check-ignore-markup-fix'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'po/doc-check-ignore-markup-fix'

Typofix.

* po/doc-check-ignore-markup-fix:
  doc: check-ignore: code-quote an exclamation mark

2 years agoMerge branch 'js/scalar-global-options'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'js/scalar-global-options'

Scalar update.

* js/scalar-global-options:
  scalar: accept -C and -c options before the subcommand

2 years agoMerge branch 'vd/sparse-clean-etc'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'vd/sparse-clean-etc'

"git update-index", "git checkout-index", and "git clean" are
taught to work better with the sparse checkout feature.

* vd/sparse-clean-etc:
  update-index: reduce scope of index expansion in do_reupdate
  update-index: integrate with sparse index
  update-index: add tests for sparse-checkout compatibility
  checkout-index: integrate with sparse index
  checkout-index: add --ignore-skip-worktree-bits option
  checkout-index: expand sparse checkout compatibility tests
  clean: integrate with sparse index
  reset: reorder wildcard pathspec conditions
  reset: fix validation in sparse index test

2 years agoMerge branch 'jz/rev-list-exclude-first-parent-only'
Junio C Hamano [Fri, 18 Feb 2022 00:25:05 +0000 (16:25 -0800)] 
Merge branch 'jz/rev-list-exclude-first-parent-only'

"git log" and friends learned an option --exclude-first-parent-only
to propagate UNINTERESTING bit down only along the first-parent
chain, just like --first-parent option shows commits that lack the
UNINTERESTING bit only along the first-parent chain.

* jz/rev-list-exclude-first-parent-only:
  git-rev-list: add --exclude-first-parent-only flag

2 years agoMerge branch 'jz/patch-id-hunk-header-parsing-fix'
Junio C Hamano [Fri, 18 Feb 2022 00:25:04 +0000 (16:25 -0800)] 
Merge branch 'jz/patch-id-hunk-header-parsing-fix'

Unlike "git apply", "git patch-id" did not handle patches with
hunks that has only 1 line in either preimage or postimage, which
has been corrected.

* jz/patch-id-hunk-header-parsing-fix:
  patch-id: fix scan_hunk_header on diffs with 1 line of before/after
  patch-id: fix antipatterns in tests

2 years agoMerge branch 'hn/reftable-tests'
Junio C Hamano [Fri, 18 Feb 2022 00:25:04 +0000 (16:25 -0800)] 
Merge branch 'hn/reftable-tests'

Prepare more test scripts for the introduction of reftable.

* hn/reftable-tests:
  t5312: prepare for reftable
  t1405: mark test that checks existence as REFFILES
  t1405: explictly delete reflogs for reftable

2 years agoMerge branch 'tk/subtree-merge-not-ff-only'
Junio C Hamano [Fri, 18 Feb 2022 00:25:04 +0000 (16:25 -0800)] 
Merge branch 'tk/subtree-merge-not-ff-only'

When "git subtree" wants to create a merge, it used "git merge" and
let it be affected by end-user's "merge.ff" configuration, which
has been corrected.

* tk/subtree-merge-not-ff-only:
  subtree: force merge commit

2 years agogrep: fix triggering PCRE2_NO_START_OPTIMIZE workaround
René Scharfe [Thu, 17 Feb 2022 21:14:29 +0000 (22:14 +0100)] 
grep: fix triggering PCRE2_NO_START_OPTIMIZE workaround

PCRE2 bug 2642 was fixed in version 10.36.  Our 95ca1f987e (grep/pcre2:
better support invalid UTF-8 haystacks, 2021-01-24) worked around it on
older versions by setting the flag PCRE2_NO_START_OPTIMIZE.  797c359978
(grep/pcre2: use compile-time PCREv2 version test, 2021-02-18) switched
it around to set the flag on 10.36 and higher instead, while it claimed
to use "the same test done at compile-time".

Switch the condition back to apply the workaround on PCRE2 versions
_before_ 10.36.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodir: force untracked cache with core.untrackedCache
Derrick Stolee [Thu, 17 Feb 2022 21:00:29 +0000 (21:00 +0000)] 
dir: force untracked cache with core.untrackedCache

The GIT_FORCE_UNTRACKED_CACHE environment variable writes the untracked
cache more frequently than the core.untrackedCache config variable. This
is due to how read_directory() handles the creation of an untracked
cache.

Before this change, Git would not create the untracked cache extension
for an index that did not already have one. Users would need to run a
command such as 'git update-index --untracked-cache' before the index
would actually contain an untracked cache.

In particular, users noticed that the untracked cache would not appear
even with core.untrackedCache=true. Some users reported setting
GIT_FORCE_UNTRACKED_CACHE=1 in their engineering system environment to
ensure the untracked cache would be created.

The decision to not write the untracked cache without an environment
variable tracks back to fc9ecbeb9 (dir.c: don't flag the index as dirty
for changes to the untracked cache, 2018-02-05). The motivation of that
change is that writing the index is expensive, and if the untracked
cache is the only thing that needs to be written, then it is more
expensive than the benefit of the cache. However, this also means that
the untracked cache never gets populated, so the user who enabled it via
config does not actually get the extension until running 'git
update-index --untracked-cache' manually or using the environment
variable.

We have had a version of this change in the microsoft/git fork for a few
major releases now. It has been working well to get users into a good
state. Yes, that first index write is slow, but the remaining index
writes are much faster than they would be without this change.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoThe fourth batch
Junio C Hamano [Wed, 16 Feb 2022 23:12:19 +0000 (15:12 -0800)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/do-not-hide-failures-in-git-dot-pm'
Junio C Hamano [Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)] 
Merge branch 'ab/do-not-hide-failures-in-git-dot-pm'

Git.pm update.

* ab/do-not-hide-failures-in-git-dot-pm:
  perl Git.pm: don't ignore signalled failure in _cmd_close()

2 years agoMerge branch 'js/no-more-legacy-stash'
Junio C Hamano [Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)] 
Merge branch 'js/no-more-legacy-stash'

Removal of unused code and doc.

* js/no-more-legacy-stash:
  stash: stop warning about the obsolete `stash.useBuiltin` config setting
  stash: remove documentation for `stash.useBuiltin`
  add: remove support for `git-legacy-stash`
  git-sh-setup: remove remnant bits referring to `git-legacy-stash`

2 years agoMerge branch 'js/diff-filter-negation-fix'
Junio C Hamano [Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)] 
Merge branch 'js/diff-filter-negation-fix'

"git diff --diff-filter=aR" is now parsed correctly.

* js/diff-filter-negation-fix:
  diff-filter: be more careful when looking for negative bits
  diff.c: move the diff filter bits definitions up a bit
  docs(diff): lose incorrect claim about `diff-files --diff-filter=A`

2 years agoMerge branch 'en/fetch-negotiation-default-fix'
Junio C Hamano [Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)] 
Merge branch 'en/fetch-negotiation-default-fix'

Interaction between fetch.negotiationAlgorithm and
feature.experimental configuration variables has been corrected.

* en/fetch-negotiation-default-fix:
  repo-settings: rename the traditional default fetch.negotiationAlgorithm
  repo-settings: fix error handling for unknown values
  repo-settings: fix checking for fetch.negotiationAlgorithm=default

2 years agoMerge branch 'ab/auto-detect-zlib-compress2'
Junio C Hamano [Wed, 16 Feb 2022 23:14:29 +0000 (15:14 -0800)] 
Merge branch 'ab/auto-detect-zlib-compress2'

The build procedure has been taught to notice older version of zlib
and enable our replacement uncompress2() automatically.

* ab/auto-detect-zlib-compress2:
  compat: auto-detect if zlib has uncompress2()

2 years agoMerge branch 'tb/midx-bitmap-corruption-fix'
Junio C Hamano [Wed, 16 Feb 2022 23:14:29 +0000 (15:14 -0800)] 
Merge branch 'tb/midx-bitmap-corruption-fix'

A bug that made multi-pack bitmap and the object order out-of-sync,
making the .midx data corrupt, has been fixed.

* tb/midx-bitmap-corruption-fix:
  pack-bitmap.c: gracefully fallback after opening pack/MIDX
  midx: read `RIDX` chunk when present
  t/lib-bitmap.sh: parameterize tests over reverse index source
  t5326: move tests to t/lib-bitmap.sh
  t5326: extract `test_rev_exists`
  t5326: drop unnecessary setup
  pack-revindex.c: instrument loading on-disk reverse index
  midx.c: make changing the preferred pack safe
  t5326: demonstrate bitmap corruption after permutation

2 years agoMerge branch 'en/remerge-diff'
Junio C Hamano [Wed, 16 Feb 2022 23:14:29 +0000 (15:14 -0800)] 
Merge branch 'en/remerge-diff'

"git log --remerge-diff" shows the difference from mechanical merge
result and the result that is actually recorded in a merge commit.

* en/remerge-diff:
  diff-merges: avoid history simplifications when diffing merges
  merge-ort: mark conflict/warning messages from inner merges as omittable
  show, log: include conflict/warning messages in --remerge-diff headers
  diff: add ability to insert additional headers for paths
  merge-ort: format messages slightly different for use in headers
  merge-ort: mark a few more conflict messages as omittable
  merge-ort: capture and print ll-merge warnings in our preferred fashion
  ll-merge: make callers responsible for showing warnings
  log: clean unneeded objects during `log --remerge-diff`
  show, log: provide a --remerge-diff capability

2 years agoMerge branch 'hn/reftable-coverity-fixes'
Junio C Hamano [Wed, 16 Feb 2022 23:14:27 +0000 (15:14 -0800)] 
Merge branch 'hn/reftable-coverity-fixes'

Problems identified by Coverity in the reftable code have been
corrected.

* hn/reftable-coverity-fixes:
  reftable: add print functions to the record types
  reftable: make reftable_record a tagged union
  reftable: remove outdated file reftable.c
  reftable: implement record equality generically
  reftable: make reftable-record.h function signatures const correct
  reftable: handle null refnames in reftable_ref_record_equal
  reftable: drop stray printf in readwrite_test
  reftable: order unittests by complexity
  reftable: all xxx_free() functions accept NULL arguments
  reftable: fix resource warning
  reftable: ignore remove() return value in stack_test.c
  reftable: check reftable_stack_auto_compact() return value
  reftable: fix resource leak blocksource.c
  reftable: fix resource leak in block.c error path
  reftable: fix OOB stack write in print functions

2 years agoMerge branch 'll/doc-mktree-typofix'
Junio C Hamano [Wed, 16 Feb 2022 23:14:26 +0000 (15:14 -0800)] 
Merge branch 'll/doc-mktree-typofix'

Typofix.

* ll/doc-mktree-typofix:
  fix typo in git-mktree.txt

2 years agoMerge branch 'ld/sparse-index-bash-completion'
Junio C Hamano [Wed, 16 Feb 2022 23:14:26 +0000 (15:14 -0800)] 
Merge branch 'ld/sparse-index-bash-completion'

The command line completion (in contrib/) learns to complete
arguments to give to "git sparse-checkout" command.

* ld/sparse-index-bash-completion:
  completion: handle unusual characters for sparse-checkout
  completion: improve sparse-checkout cone mode directory completion
  completion: address sparse-checkout issues

2 years agodiff.[ch]: have diff_free() free options->parseopts
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 10:56:29 +0000 (11:56 +0100)] 
diff.[ch]: have diff_free() free options->parseopts

The "struct option" added in 4a288478394 (diff.c: prepare to use
parse_options() for parsing, 2019-01-27) would be free'd in the case
of diff_setup_done() being called.

But not all codepaths that allocate it reach that,
e.g. "t6427-diff3-conflict-markers.sh" will now free memory that it
didn't free before. By using FREE_AND_NULL() here (which
diff_setup_done() also does) we ensure that we free the memory, and
that we won't have double-free's.

Before this running:

    ./t6427-diff3-conflict-markers.sh -vixd --run=7

Would report:

    SUMMARY: LeakSanitizer: 7823 byte(s) leaked in 6 allocation(s).

But now we'll report:

    SUMMARY: LeakSanitizer: 703 byte(s) leaked in 5 allocation(s).

I.e. the largest leak in that particular test has now been addressed.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodiff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 10:56:28 +0000 (11:56 +0100)] 
diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec)

Have the diff_free() function call clear_pathspec(). Since the
diff_flush() function calls this all its callers can be simplified to
rely on it instead.

When I added the diff_free() function in e900d494dcf (diff: add an API
for deferred freeing, 2021-02-11) I simply missed this, or wasn't
interested in it. Let's consolidate this now. This means that any
future callers (and I've got revision.c in mind) that embed a "struct
diff_options" can simply call diff_free() instead of needing know that
it has an embedded pathspec.

This does fix a bunch of leaks, but I can't mark any test here as
passing under the SANITIZE=leak testing mode because in
886e1084d78 (builtin/: add UNLEAKs, 2017-10-01) an UNLEAK(rev) was
added, which plasters over the memory
leak. E.g. "t4011-diff-symlink.sh" would report fewer leaks with this
fix, but because of the UNLEAK() reports none.

I'll eventually loop around to removing that UNLEAK(rev) annotation as
I'll fix deeper issues with the revisions API leaking. This is one
small step on the way there, a new freeing function in revisions.c
will want to call this diff_free().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodate API: add and use a date_mode_release()
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 08:14:05 +0000 (09:14 +0100)] 
date API: add and use a date_mode_release()

Fix a memory leak in the parse_date_format() function by providing a
new date_mode_release() companion function.

By using this in "t/helper/test-date.c" we can mark the
"t0006-date.sh" test as passing when git is compiled with
SANITIZE=leak, and whitelist it to run under
"GIT_TEST_PASSING_SANITIZE_LEAK=true" by adding
"TEST_PASSES_SANITIZE_LEAK=true" to the test itself.

The other tests that expose this memory leak (i.e. take the
"mode->type == DATE_STRFTIME" branch in parse_date_format()) are
"t6300-for-each-ref.sh" and "t7004-tag.sh". The former is due to an
easily fixed leak in "ref-filter.c", and brings the failures in
"t6300-for-each-ref.sh" down from 51 to 48.

Fixing the remaining leaks will have to wait until there's a
release_revisions() in "revision.c", as they have to do with leaks via
"struct rev_info".

There is also a leak in "builtin/blame.c" due to its call to
parse_date_format() to parse the "blame.date" configuration. However
as it declares a file-level "static struct date_mode blame_date_mode"
to track the data, LSAN will not report it as a leak. It's possible to
get valgrind(1) to complain about it with e.g.:

    valgrind --leak-check=full --show-leak-kinds=all ./git -P -c blame.date=format:%Y blame README.md

But let's focus on things LSAN complains about, and are thus
observable with "TEST_PASSES_SANITIZE_LEAK=true". We should get to
fixing memory leaks in "builtin/blame.c", but as doing so would
require some re-arrangement of cmd_blame() let's leave it for some
other time.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodate API: add basic API docs
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 08:14:04 +0000 (09:14 +0100)] 
date API: add basic API docs

Add basic API doc comments to date.h, and while doing so move the the
parse_date_format() function adjacent to show_date(). This way all the
"struct date_mode" functions are grouped together. Documenting the
rest is one of our #leftoverbits.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodate API: provide and use a DATE_MODE_INIT
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 08:14:03 +0000 (09:14 +0100)] 
date API: provide and use a DATE_MODE_INIT

Provide and use a DATE_MODE_INIT macro. Most of the users of struct
date_mode" use it via pretty.h's "struct pretty_print_context" which
doesn't have an initialization macro, so we're still bound to being
initialized to "{ 0 }" by default.

But we can change the couple of callers that directly declared a
variable on the stack to instead use the initializer, and thus do away
with the "mode.local = 0" added in add00ba2de9 (date: make "local"
orthogonal to date format, 2015-09-03).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodate API: create a date.h, split from cache.h
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 08:14:02 +0000 (09:14 +0100)] 
date API: create a date.h, split from cache.h

Move the declaration of the date.c functions from cache.h, and adjust
the relevant users to include the new date.h header.

The show_ident_date() function belonged in pretty.h (it's defined in
pretty.c), its two users outside of pretty.c didn't strictly need to
include pretty.h, as they get it indirectly, but let's add it to them
anyway.

Similarly, the change to "builtin/{fast-import,show-branch,tag}.c"
isn't needed as far as the compiler is concerned, but since they all
use the "DATE_MODE()" macro we now define in date.h, let's have them
include it.

We could simply include this new header in "cache.h", but as this
change shows these functions weren't common enough to warrant
including in it in the first place. By moving them out of cache.h
changes to this API will no longer cause a (mostly) full re-build of
the project when "make" is run.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocache.h: remove always unused show_date_human() declaration
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 08:14:01 +0000 (09:14 +0100)] 
cache.h: remove always unused show_date_human() declaration

There has never been a show_date_human() function on the "master"
branch in git.git. This declaration was added in b841d4ff438 (Add
`human` format to test-tool, 2019-01-28).

A look at the ML history reveals that it was leftover cruft from an
earlier version of that commit[1].

1. https://lore.kernel.org/git/20190118061805.19086-5-ischis2@cox.net/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep: simplify config parsing and option parsing
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:39 +0000 (01:00 +0100)] 
grep: simplify config parsing and option parsing

Simplify the parsing of "grep.patternType" and
"grep.extendedRegexp". This changes no behavior, but gets rid of
complex parsing logic that isn't needed anymore.

When "grep.patternType" was introduced in 84befcd0a4a (grep: add a
grep.patternType configuration setting, 2012-08-03) we promised that:

 1. You can set "grep.patternType", and "[setting it to] 'default'
    will return to the default matching behavior".

    In that context "the default" meant whatever the configuration
    system specified before that change, i.e. via grep.extendedRegexp.

 2. We'd support the existing "grep.extendedRegexp" option, but ignore
    it when the new "grep.patternType" option is set. We said we'd
    only ignore the older "grep.extendedRegexp" option "when the
    `grep.patternType` option is set to a value other than
    'default'".

In a preceding commit we changed grep_config() to be called after
grep_init(), which means that much of the complexity here can go
away.

As before both "grep.patternType" and "grep.extendedRegexp" are
last-one-wins variable, with "grep.extendedRegexp" yielding to
"grep.patternType", except when "grep.patternType=default".

Note that as the previously added tests indicate this cannot be done
on-the-fly as we see the config variables, without introducing more
state keeping. I.e. if we see:

    -c grep.extendedRegexp=false
    -c grep.patternType=default
    -c extendedRegexp=true

We need to select ERE, since grep.patternType=default unselects that
variable, which normally has higher precedence, but we also need to
select BRE in cases of:

    -c grep.extendedRegexp=true \
    -c grep.extendedRegexp=false

Which would not be the case for this, which select ERE:

    -c grep.patternType=extended \
    -c grep.extendedRegexp=false

Therefore we cannot do this on-the-fly in grep_config without also
introducing tracking variables for not only the pattern type, but what
the source of that pattern type was.

So we need to decide on the pattern after our config was fully
parsed. Let's do that by deferring the decision on the pattern type
until it's time to compile it in compile_regexp().

By that time we've not only parsed the config, but also handled the
command-line options. Those will set "opt.pattern_type_option" (*not*
"opt.extended_regexp_option"!).

At that point all we need to do is see if "grep.patternType" was
UNSPECIFIED in the end (including an explicit "=default"), if so we'll
use the "grep.extendedRegexp" configuration, if any.

See my 07a3d411739 (grep: remove regflags from the public grep_opt
API, 2017-06-29) for addition of the two comments being removed here,
i.e. the complexity noted in that commit is now going away.

1. https://lore.kernel.org/git/patch-v8-09.10-c211bb0c69d-20220118T155211Z-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep.c: do "if (bool && memchr())" not "if (memchr() && bool)"
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:38 +0000 (01:00 +0100)] 
grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"

Change code in compile_regexp() to check the cheaper boolean
"!opt->pcre2" condition before the "memchr()" search.

This doesn't noticeably optimize anything, but makes the code more
obvious and conventional. The line wrapping being added here also
makes a subsequent commit smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep.h: make "grep_opt.pattern_type_option" use its enum
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:37 +0000 (01:00 +0100)] 
grep.h: make "grep_opt.pattern_type_option" use its enum

Change the "pattern_type_option" member of "struct grep_opt" to use
the enum type we use for it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep API: call grep_config() after grep_init()
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:36 +0000 (01:00 +0100)] 
grep API: call grep_config() after grep_init()

The grep_init() function used the odd pattern of initializing the
passed-in "struct grep_opt" with a statically defined "grep_defaults"
struct, which would be modified in-place when we invoked
grep_config().

So we effectively (b) initialized config, (a) then defaults, (c)
followed by user options. Usually those are ordered as "a", "b" and
"c" instead.

As the comments being removed here show the previous behavior needed
to be carefully explained as we'd potentially share the populated
configuration among different instances of grep_init(). In practice we
didn't do that, but now that it can't be a concern anymore let's
remove those comments.

This does not change the behavior of any of the configuration
variables or options. That would have been the case if we didn't move
around the grep_config() call in "builtin/log.c". But now that we call
"grep_config" after "git_log_config" and "git_format_config" we'll
need to pass in the already initialized "struct grep_opt *".

See 6ba9bb76e02 (grep: copy struct in one fell swoop, 2020-11-29) and
7687a0541e0 (grep: move the configuration parsing logic to grep.[ch],
2012-10-09) for the commits that added the comments.

The memcpy() pattern here will be optimized away and follows the
convention of other *_init() functions. See 5726a6b4012 (*.c *_init():
define in terms of corresponding *_INIT macro, 2021-07-01).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep.c: don't pass along NULL callback value
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:35 +0000 (01:00 +0100)] 
grep.c: don't pass along NULL callback value

Change grep_cmd_config() to stop passing around the always-NULL "cb"
value. When this code was added in 7e8f59d577e (grep: color patterns
in output, 2009-03-07) it was non-NULL, but when that changed in
15fabd1bbd4 (builtin/grep.c: make configuration callback more
reusable, 2012-10-09) this code was left behind.

In a subsequent change I'll start using the "cb" value, this will make
it clear which functions we call need it, and which don't.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agobuilt-ins: trust the "prefix" from run_builtin()
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:34 +0000 (01:00 +0100)] 
built-ins: trust the "prefix" from run_builtin()

Change code in "builtin/grep.c" and "builtin/ls-tree.c" to trust the
"prefix" passed from "run_builtin()". The "prefix" we get from setup.c
is either going to be NULL or a string of length >0, never "".

So we can drop the "prefix && *prefix" checks added for
"builtin/grep.c" in 0d042fecf2f (git-grep: show pathnames relative to
the current directory, 2006-08-11), and for "builtin/ls-tree.c" in
a69dd585fca (ls-tree: chomp leading directories when run from a
subdirectory, 2005-12-23).

As seen in code in revision.c that was added in cd676a51367 (diff
--relative: output paths as relative to the current subdirectory,
2008-02-12) we already have existing code that does away with this
assertion.

This makes it easier to reason about a subsequent change to the
"prefix_length" code in grep.c in a subsequent commit, and since we're
going to the trouble of doing that let's leave behind an assert() to
promise this to any future callers.

For "builtin/grep.c" it would be painful to pass the "prefix" down the
callchain of:

    cmd_grep -> grep_tree -> grep_submodule -> grep_cache -> grep_oid ->
    grep_source_name

So for the code that needs it in grep_source_name() let's add a
"grep_prefix" variable similar to the existing "ls_tree_prefix".

While at it let's move the code in cmd_ls_tree() around so that we
assign to the "ls_tree_prefix" right after declaring the variables,
and stop assigning to "prefix". We only subsequently used that
variable later in the function after clobbering it. Let's just use our
own "grep_prefix" instead.

Let's also add an assert() in git.c, so that we'll make this promise
about the "prefix" to any current and future callers, as well as to
any readers of the code.

Code history:

 * The strlen() in "grep.c" hasn't been used since 493b7a08d80 (grep:
   accept relative paths outside current working directory, 2009-09-05).

   When that code was added in 0d042fecf2f (git-grep: show pathnames
   relative to the current directory, 2006-08-11) we used the length.

   But since 493b7a08d80 we haven't used it for anything except a
   boolean check that we could have done on the "prefix" member
   itself.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep tests: add missing "grep.patternType" config tests
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:33 +0000 (01:00 +0100)] 
grep tests: add missing "grep.patternType" config tests

Extend the grep tests to assert that setting
"grep.patternType=extended" followed by "grep.patternType=default"
will behave as if "--basic-regexp" was provided, and not as
"--extended-regexp". In a subsequent commit we'll need to treat
"grep.patternType=default" as a special-case, but let's make sure we
ignore it if it's being set to "default" following an earlier
non-"default" "grep.patternType" setting.

Let's also test what happens when we have a sequence of "extended"
followed by "default" and "fixed". In that case the "fixed" should
prevail, as well as tests to check that a "grep.extendedRegexp=true"
followed by a "grep.extendedRegexp=false" behaves as though
"grep.extendedRegexp" wasn't provided.

See [1] for the source of some of these tests, and their
initial (pseudocode) implementation, and [2] for a later discussion
about a breakage due to missing testing (which had been noted in [1]
all along).

1. https://lore.kernel.org/git/xmqqv8zf6j86.fsf@gitster.g/
2. https://lore.kernel.org/git/xmqqpmoczwtu.fsf@gitster.g/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep tests: create a helper function for "BRE" or "ERE"
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:32 +0000 (01:00 +0100)] 
grep tests: create a helper function for "BRE" or "ERE"

Refactor the repeated test code for finding out whether a given set of
configuration will pick basic, extended or fixed into a new
"test_pattern_type" helper function.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agolog tests: check if grep_config() is called by "log"-like cmds
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:31 +0000 (01:00 +0100)] 
log tests: check if grep_config() is called by "log"-like cmds

Extend the tests added in my 9df46763ef1 (log: add exhaustive tests
for pattern style options & config, 2017-05-20) to check not only
whether "git log" handles "grep.patternType", but also "git show"
etc.

It's sufficient to check whether we match a "fixed" or a "basic" regex
here to see if these codepaths correctly invoked grep_config(). We
don't need to check the details of their regular expression matching
as the "log" test does.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogrep.h: remove unused "regex_t regexp" from grep_opt
Ævar Arnfjörð Bjarmason [Wed, 16 Feb 2022 00:00:30 +0000 (01:00 +0100)] 
grep.h: remove unused "regex_t regexp" from grep_opt

This "regex_t" in grep_opt has not been used since
f9b9faf6f8a (builtin-grep: allow more than one patterns., 2006-05-02),
we still use a "regex_t" for compiling regexes, but that's in the
"grep_pat" struct".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoname-rev: replace --stdin with --annotate-stdin in synopsis
John Cai [Tue, 15 Feb 2022 20:52:07 +0000 (20:52 +0000)] 
name-rev: replace --stdin with --annotate-stdin in synopsis

34ae3b70 (name-rev: deprecate --stdin in favor of --annotate-stdin,
2022-01-05) added --annotate-stdin to replace --stdin as a clearer
flag name. Since --stdin is to be deprecated, we should replace
--stdin in the output from "git name-rev -h".

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomailmap: change primary address for Derrick Stolee
Derrick Stolee [Mon, 14 Feb 2022 16:45:53 +0000 (16:45 +0000)] 
mailmap: change primary address for Derrick Stolee

Stolee transitioned from Microsoft to GitHub in July 2020, but continued
to use <dstolee@microsoft.com> because it was a valid address. He also
used <stolee@gmail.com> to communicate with the mailing list since
writing plaintext emails is difficult in Outlook. However, recent issues
with GMail delaying mailing list messages created a need to change his
primary email address.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: clarify interaction between 'eol' and text=auto
brian m. carlson [Mon, 14 Feb 2022 18:15:43 +0000 (10:15 -0800)] 
doc: clarify interaction between 'eol' and text=auto

The `eol` takes effect on text files only when the index has the
contents in LF line endings.  Paths with contents in CRLF line
endings in the index may become dirty unless text=auto.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoThe third batch
Junio C Hamano [Sat, 12 Feb 2022 00:49:31 +0000 (16:49 -0800)] 
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'sy/diff-usage-typofix'
Junio C Hamano [Sat, 12 Feb 2022 00:56:01 +0000 (16:56 -0800)] 
Merge branch 'sy/diff-usage-typofix'

Typofix.

* sy/diff-usage-typofix:
  builtin/diff.c: fix "git-diff" usage string typo

2 years agoMerge branch 'tg/fetch-prune-exit-code-fix'
Junio C Hamano [Sat, 12 Feb 2022 00:56:01 +0000 (16:56 -0800)] 
Merge branch 'tg/fetch-prune-exit-code-fix'

When "git fetch --prune" failed to prune the refs it wanted to
prune, the command issued error messages but exited with exit
status 0, which has been corrected.

* tg/fetch-prune-exit-code-fix:
  fetch --prune: exit with error if pruning fails

2 years agoMerge branch 'en/sparse-checkout-leakfix'
Junio C Hamano [Sat, 12 Feb 2022 00:56:01 +0000 (16:56 -0800)] 
Merge branch 'en/sparse-checkout-leakfix'

Leakfix.

* en/sparse-checkout-leakfix:
  sparse-checkout: fix a couple minor memory leaks

2 years agoMerge branch 'rc/negotiate-only-typofix'
Junio C Hamano [Sat, 12 Feb 2022 00:55:59 +0000 (16:55 -0800)] 
Merge branch 'rc/negotiate-only-typofix'

Typofix.

* rc/negotiate-only-typofix:
  fetch: fix negotiate-only error message

2 years agoMerge branch 'jc/doc-log-messages'
Junio C Hamano [Sat, 12 Feb 2022 00:55:58 +0000 (16:55 -0800)] 
Merge branch 'jc/doc-log-messages'

Update the contributor-facing documents on proposed log messages.

* jc/doc-log-messages:
  SubmittingPatches: explain why we care about log messages
  CodingGuidelines: hint why we value clearly written log messages
  SubmittingPatches: write problem statement in the log in the present tense

2 years agoMerge branch 'ab/no-errno-from-resolve-ref-unsafe'
Junio C Hamano [Sat, 12 Feb 2022 00:55:58 +0000 (16:55 -0800)] 
Merge branch 'ab/no-errno-from-resolve-ref-unsafe'

Remaining code-clean-up.

* ab/no-errno-from-resolve-ref-unsafe:
  refs API: remove "failure_errno" from refs_resolve_ref_unsafe()
  sequencer: don't use die_errno() on refs_resolve_ref_unsafe() failure

2 years agoMerge branch 'gh/doc-typos'
Junio C Hamano [Sat, 12 Feb 2022 00:55:58 +0000 (16:55 -0800)] 
Merge branch 'gh/doc-typos'

Typofix.

* gh/doc-typos:
  Documentation/config/pgp.txt: add missing apostrophe
  Documentation/config/pgp.txt: replace stray <TAB> character with <SPC>

2 years agoMerge branch 'rs/parse-options-lithelp-help'
Junio C Hamano [Sat, 12 Feb 2022 00:55:58 +0000 (16:55 -0800)] 
Merge branch 'rs/parse-options-lithelp-help'

Comment update.

* rs/parse-options-lithelp-help:
  parse-options: document bracketing of argh

2 years agoMerge branch 'bc/csprng-mktemps'
Junio C Hamano [Sat, 12 Feb 2022 00:55:57 +0000 (16:55 -0800)] 
Merge branch 'bc/csprng-mktemps'

Pick a better random number generator and use it when we prepare
temporary filenames.

* bc/csprng-mktemps:
  wrapper: use a CSPRNG to generate random file names
  wrapper: add a helper to generate numbers from a CSPRNG

2 years agoMerge branch 'bc/clarify-eol-attr'
Junio C Hamano [Sat, 12 Feb 2022 00:55:57 +0000 (16:55 -0800)] 
Merge branch 'bc/clarify-eol-attr'

Doc and test update around the eol attribute.

* bc/clarify-eol-attr:
  docs: correct documentation about eol attribute
  t0027: add tests for eol without text in .gitattributes

2 years agot0001: replace "test [-d|-f]" with test_path_is_* functions
Shaoxuan Yuan [Fri, 21 Jan 2022 10:21:09 +0000 (18:21 +0800)] 
t0001: replace "test [-d|-f]" with test_path_is_* functions

Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agofetch-pack: parameterize message containing 'ready' keyword
Bagas Sanjaya [Wed, 22 Dec 2021 07:58:06 +0000 (14:58 +0700)] 
fetch-pack: parameterize message containing 'ready' keyword

The protocol keyword 'ready' isn't meant for translation. Pass it as
parameter instead of spell it in die() message (and potentially confuse
translators).

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agolog: add a --no-graph option
Alex Henrie [Fri, 11 Feb 2022 16:36:25 +0000 (09:36 -0700)] 
log: add a --no-graph option

It's useful to be able to countermand a previous --graph option, for
example if `git log --graph` is run via an alias.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agolog: fix memory leak if --graph is passed multiple times
Alex Henrie [Fri, 11 Feb 2022 16:36:24 +0000 (09:36 -0700)] 
log: fix memory leak if --graph is passed multiple times

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agofetch: skip computing output width when not printing anything
Patrick Steinhardt [Thu, 10 Feb 2022 12:28:16 +0000 (13:28 +0100)] 
fetch: skip computing output width when not printing anything

When updating references via git-fetch(1), then by default we report to
the user which references have been changed. This output is formatted in
a nice table such that the different columns are aligned. Because the
first column contains abbreviated object IDs we thus need to iterate
over all refs which have changed and compute the minimum length for
their respective abbreviated hashes. While this effort makes sense in
most cases, it is wasteful when the user passes the `--quiet` flag: we
don't print the summary, but still compute the length.

Skip computing the summary width when the user asked for us to be quiet.
This gives us a speedup of nearly 10% when doing a mirror-fetch in a
repository with thousands of references being updated:

    Benchmark 1: git fetch --quiet +refs/*:refs/* (HEAD~)
      Time (mean ± σ):     96.078 s ±  0.508 s    [User: 91.378 s, System: 10.870 s]
      Range (min … max):   95.449 s … 96.760 s    5 runs

    Benchmark 2: git fetch --quiet +refs/*:refs/* (HEAD)
      Time (mean ± σ):     88.214 s ±  0.192 s    [User: 83.274 s, System: 10.978 s]
      Range (min … max):   87.998 s … 88.446 s    5 runs

    Summary
      'git fetch --quiet +refs/*:refs/* (HEAD)' ran
        1.09 ± 0.01 times faster than 'git fetch --quiet +refs/*:refs/* (HEAD~)'

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agofetch-pack: use commit-graph when computing cutoff
Patrick Steinhardt [Thu, 10 Feb 2022 12:28:09 +0000 (13:28 +0100)] 
fetch-pack: use commit-graph when computing cutoff

During packfile negotiation we iterate over all refs announced by the
remote side to check whether their IDs refer to commits already known to
us. If a commit is known to us already, then its date is a potential
cutoff point for commits we have in common with the remote side.

There is potentially a lot of commits announced by the remote depending
on how many refs there are in the remote repository, and for every one
of them we need to search for it in our object database and, if found,
parse the corresponding object to find out whether it is a candidate for
the cutoff date. This can be sped up by trying to look up commits via
the commit-graph first, which is a lot more efficient.

Benchmarks in a repository with about 2,1 million refs and an up-to-date
commit-graph show an almost 20% speedup when mirror-fetching:

    Benchmark 1: git fetch +refs/*:refs/* (v2.35.0)
      Time (mean ± σ):     115.587 s ±  2.009 s    [User: 109.874 s, System: 11.305 s]
      Range (min … max):   113.584 s … 118.820 s    5 runs

    Benchmark 2: git fetch +refs/*:refs/* (HEAD)
      Time (mean ± σ):     96.859 s ±  0.624 s    [User: 91.948 s, System: 10.980 s]
      Range (min … max):   96.180 s … 97.875 s    5 runs

    Summary
      'git fetch +refs/*:refs/* (HEAD)' ran
        1.19 ± 0.02 times faster than 'git fetch +refs/*:refs/* (v2.35.0)'

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot1410: mark bufsize boundary test as REFFILES
Han-Wen Nienhuys [Wed, 9 Feb 2022 11:29:40 +0000 (11:29 +0000)] 
t1410: mark bufsize boundary test as REFFILES

This test fiddles with files under .git/logs to recreate a condition
that is unlikely to warrant special attention under reftable, as
reflog blocks are zlib compressed.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot1410: use test-tool ref-store to inspect reflogs
Han-Wen Nienhuys [Wed, 9 Feb 2022 11:29:39 +0000 (11:29 +0000)] 
t1410: use test-tool ref-store to inspect reflogs

This makes the test compatible with reftable (it doesn't pass yet for
other reasons, unfortunately)

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoglossary: describe "worktree"
Junio C Hamano [Thu, 10 Feb 2022 02:19:07 +0000 (18:19 -0800)] 
glossary: describe "worktree"

We have description on "per worktree ref", but "worktree" is not
described in the glossary.  We do have "working tree", though.

Casually put, a "working tree" is what your editor and compiler
interacts with.  "worktree" is a mechanism to allow one or more
"working tree"s to be attached to a repository and used to check out
different commits and branches independently, which includes not
just a "working tree" but also repository metadata like HEAD, the
index to support simultaneous use of them.  Historically, we used
these terms interchangeably but we have been trying to use "working
tree" when we mean it, instead of "worktree".

Most of the existing references to "working tree" in the glossary do
refer primarily to the working tree portion, except for one that
said refs like HEAD and refs/bisect/* are per "working tree", but it
is more precise to say they are per "worktree".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot/t0015-hash.sh: remove unnecessary '\' at line end
Jaydeep Das [Tue, 8 Feb 2022 09:23:39 +0000 (14:53 +0530)] 
t/t0015-hash.sh: remove unnecessary '\' at line end

The `|` at line end already imples that the statement is not over.
So a `\` after that is redundant.

Signed-off-by: Jaydeep P Das <jaydeepjd.8914@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoclone, submodule: pass partial clone filters to submodules
Josh Steadmon [Sat, 5 Feb 2022 05:00:49 +0000 (21:00 -0800)] 
clone, submodule: pass partial clone filters to submodules

When cloning a repo with a --filter and with --recurse-submodules
enabled, the partial clone filter only applies to the top-level repo.
This can lead to unexpected bandwidth and disk usage for projects which
include large submodules. For example, a user might wish to make a
partial clone of Gerrit and would run:
`git clone --recurse-submodules --filter=blob:5k https://gerrit.googlesource.com/gerrit`.
However, only the superproject would be a partial clone; all the
submodules would have all blobs downloaded regardless of their size.
With this change, the same filter can also be applied to submodules,
meaning the expected bandwidth and disk savings apply consistently.

To avoid changing default behavior, add a new clone flag,
`--also-filter-submodules`. When this is set along with `--filter` and
`--recurse-submodules`, the filter spec is passed along to git-submodule
and git-submodule--helper, such that submodule clones also have the
filter applied.

This applies the same filter to the superproject and all submodules.
Users who need to customize the filter per-submodule would need to clone
with `--no-recurse-submodules` and then manually initialize each
submodule with the proper filter.

Applying filters to submodules should be safe thanks to Jonathan Tan's
recent work [1, 2, 3] eliminating the use of alternates as a method of
accessing submodule objects, so any submodule object access now triggers
a lazy fetch from the submodule's promisor remote if the accessed object
is missing. This patch is a reworked version of [4], which was created
prior to Jonathan Tan's work.

[1]: 8721e2e (Merge branch 'jt/partial-clone-submodule-1', 2021-07-16)
[2]: 11e5d0a (Merge branch 'jt/grep-wo-submodule-odb-as-alternate',
2021-09-20)
[3]: 162a13b (Merge branch 'jt/no-abuse-alternate-odb-for-submodules',
2021-10-25)
[4]: https://lore.kernel.org/git/52bf9d45b8e2b72ff32aa773f2415bf7b2b86da2.1563322192.git.steadmon@google.com/

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoThe second batch for 2.36
Junio C Hamano [Wed, 9 Feb 2022 22:21:18 +0000 (14:21 -0800)] 
The second batch for 2.36

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jc/mem-pool-alignment'
Junio C Hamano [Wed, 9 Feb 2022 22:21:01 +0000 (14:21 -0800)] 
Merge branch 'jc/mem-pool-alignment'

Update the logic to compute alignment requirement for our mem-pool.

* jc/mem-pool-alignment:
  mem-pool: don't assume uintmax_t is aligned enough for all types

2 years agoMerge branch 'js/sparse-vs-split-index'
Junio C Hamano [Wed, 9 Feb 2022 22:21:01 +0000 (14:21 -0800)] 
Merge branch 'js/sparse-vs-split-index'

Mark in various places in the code that the sparse index and the
split index features are mutually incompatible.

* js/sparse-vs-split-index:
  split-index: it really is incompatible with the sparse index
  t1091: disable split index
  sparse-index: sparse index is disallowed when split index is active

2 years agoMerge branch 'jt/clone-not-quite-empty'
Junio C Hamano [Wed, 9 Feb 2022 22:21:01 +0000 (14:21 -0800)] 
Merge branch 'jt/clone-not-quite-empty'

Cloning from a repository that does not yet have any branches or
tags but has other refs resulted in a "remote transport reported
error", which has been corrected.

* jt/clone-not-quite-empty:
  clone: support unusual remote ref configurations