]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agogrep: extract grep_binexp() from grep_or_expr()
Taylor Blau [Thu, 6 Jan 2022 19:50:12 +0000 (14:50 -0500)] 
grep: extract grep_binexp() from grep_or_expr()

When constructing an OR node, the grep.c code uses `grep_or_expr()` to
make a node, assign its kind, and set its left and right children. The
same is not done for AND nodes.

Prepare to introduce a new `grep_and_expr()` function which will share
code with the existing implementation of `grep_or_expr()` by introducing
a new function which compiles either kind of binary expression, and
reimplement `grep_or_expr()` in terms of it.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogrep: use grep_not_expr() in compile_pattern_not()
René Scharfe [Thu, 6 Jan 2022 09:54:19 +0000 (10:54 +0100)] 
grep: use grep_not_expr() in compile_pattern_not()

Move the definition of grep_not_expr() up and use this function in
compile_pattern_not() to simplify the code and reduce duplication.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogrep: use grep_or_expr() in compile_pattern_or()
René Scharfe [Thu, 6 Jan 2022 09:51:00 +0000 (10:51 +0100)] 
grep: use grep_or_expr() in compile_pattern_or()

Move the definition of grep_or_expr() up and use this function in
compile_pattern_or() to reduce code duplication.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoThe seventh batch
Junio C Hamano [Wed, 5 Jan 2022 21:56:49 +0000 (13:56 -0800)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'rs/daemon-plug-leak'
Junio C Hamano [Wed, 5 Jan 2022 22:01:31 +0000 (14:01 -0800)] 
Merge branch 'rs/daemon-plug-leak'

Plug a memory leak.

* rs/daemon-plug-leak:
  daemon: plug memory leak on overlong path

3 years agoMerge branch 'rs/pcre2-utf'
Junio C Hamano [Wed, 5 Jan 2022 22:01:31 +0000 (14:01 -0800)] 
Merge branch 'rs/pcre2-utf'

"git grep --perl-regexp" failed to match UTF-8 characters with
wildcard when the pattern consists only of ASCII letters, which has
been corrected.

* rs/pcre2-utf:
  grep/pcre2: factor out literal variable
  grep/pcre2: use PCRE2_UTF even with ASCII patterns

3 years agoMerge branch 'jc/t4204-do-not-write-git-on-upstream-of-pipe'
Junio C Hamano [Wed, 5 Jan 2022 22:01:31 +0000 (14:01 -0800)] 
Merge branch 'jc/t4204-do-not-write-git-on-upstream-of-pipe'

Test fixes.

* jc/t4204-do-not-write-git-on-upstream-of-pipe:
  t4204 is not sanitizer clean at all

3 years agoMerge branch 'rs/log-invert-grep-with-headers'
Junio C Hamano [Wed, 5 Jan 2022 22:01:30 +0000 (14:01 -0800)] 
Merge branch 'rs/log-invert-grep-with-headers'

"git log --invert-grep --author=<name>" used to exclude commits
written by the given author, but now "--invert-grep" only affects
the matches made by the "--grep=<pattern>" option.

* rs/log-invert-grep-with-headers:
  log: let --invert-grep only invert --grep

3 years agoMerge branch 'gh/gpg-doc-markup-fix'
Junio C Hamano [Wed, 5 Jan 2022 22:01:30 +0000 (14:01 -0800)] 
Merge branch 'gh/gpg-doc-markup-fix'

Doc markup fix.

* gh/gpg-doc-markup-fix:
  docs: add missing colon to Documentation/config/gpg.txt

3 years agoMerge branch 'rs/t4202-invert-grep-test-fix'
Junio C Hamano [Wed, 5 Jan 2022 22:01:30 +0000 (14:01 -0800)] 
Merge branch 'rs/t4202-invert-grep-test-fix'

Test fix.

* rs/t4202-invert-grep-test-fix:
  t4202: fix patternType setting in --invert-grep test

3 years agoMerge branch 'ds/repack-fixlets'
Junio C Hamano [Wed, 5 Jan 2022 22:01:30 +0000 (14:01 -0800)] 
Merge branch 'ds/repack-fixlets'

Two fixes around "git repack".

* ds/repack-fixlets:
  repack: make '--quiet' disable progress
  repack: respect kept objects with '--write-midx -b'

3 years agoMerge branch 'jc/merge-detached-head-name'
Junio C Hamano [Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)] 
Merge branch 'jc/merge-detached-head-name'

The default merge message prepared by "git merge" records the name
of the current branch; the name can be overridden with a new option
to allow users to pretend a merge is made on a different branch.

* jc/merge-detached-head-name:
  merge: allow to pretend a merge is made into a different branch

3 years agoMerge branch 'km/help-prompt-fix'
Junio C Hamano [Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)] 
Merge branch 'km/help-prompt-fix'

Among some code paths that ask an yes/no question, only one place
gave a prompt that looked different from the others, which has been
updated to match what the others create.

* km/help-prompt-fix:
  help: make auto-correction prompt more consistent

3 years agoMerge branch 'jv/use-larger-buffer-in-upload-pack'
Junio C Hamano [Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)] 
Merge branch 'jv/use-larger-buffer-in-upload-pack'

"git upload-pack" (the other side of "git fetch") used a 8kB buffer
but most of its payload came on 64kB "packets".  The buffer size
has been enlarged so that such a packet fits.

* jv/use-larger-buffer-in-upload-pack:
  upload-pack.c: increase output buffer size

3 years agoMerge branch 'jk/ssh-signing-doc-markup-fix'
Junio C Hamano [Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)] 
Merge branch 'jk/ssh-signing-doc-markup-fix'

Docfix.

* jk/ssh-signing-doc-markup-fix:
  doc/config: mark ssh allowedSigners example as literal

3 years agoMerge branch 'pw/diff-color-moved-fix'
Junio C Hamano [Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)] 
Merge branch 'pw/diff-color-moved-fix'

Correctness and performance update to "diff --color-moved" feature.

* pw/diff-color-moved-fix:
  diff --color-moved: intern strings
  diff: use designated initializers for emitted_diff_symbol
  diff --color-moved-ws=allow-indentation-change: improve hash lookups
  diff --color-moved: stop clearing potential moved blocks
  diff --color-moved: shrink potential moved blocks as we go
  diff --color-moved: unify moved block growth functions
  diff --color-moved: call comparison function directly
  diff --color-moved-ws=allow-indentation-change: simplify and optimize
  diff: simplify allow-indentation-change delta calculation
  diff --color-moved: avoid false short line matches and bad zebra coloring
  diff --color-moved=zebra: fix alternate coloring
  diff --color-moved: rewind when discarding pmb
  diff --color-moved: factor out function
  diff --color-moved: clear all flags on blocks that are too short
  diff --color-moved: add perf tests

3 years agoMerge branch 'xw/am-empty'
Junio C Hamano [Wed, 5 Jan 2022 22:01:28 +0000 (14:01 -0800)] 
Merge branch 'xw/am-empty'

"git am" learns "--empty=(stop|drop|keep)" option to tweak what is
done to a piece of e-mail without a patch in it.

* xw/am-empty:
  am: support --allow-empty to record specific empty patches
  am: support --empty=<option> to handle empty patches
  doc: git-format-patch: describe the option --always

3 years agoMerge branch 'en/keep-cwd'
Junio C Hamano [Wed, 5 Jan 2022 22:01:28 +0000 (14:01 -0800)] 
Merge branch 'en/keep-cwd'

Many git commands that deal with working tree files try to remove a
directory that becomes empty (i.e. "git switch" from a branch that
has the directory to another branch that does not would attempt
remove all files in the directory and the directory itself).  This
drops users into an unfamiliar situation if the command was run in
a subdirectory that becomes subject to removal due to the command.
The commands have been taught to keep an empty directory if it is
the directory they were started in to avoid surprising users.

* en/keep-cwd:
  t2501: simplify the tests since we can now assume desired behavior
  dir: new flag to remove_dir_recurse() to spare the original_cwd
  dir: avoid incidentally removing the original_cwd in remove_path()
  stash: do not attempt to remove startup_info->original_cwd
  rebase: do not attempt to remove startup_info->original_cwd
  clean: do not attempt to remove startup_info->original_cwd
  symlinks: do not include startup_info->original_cwd in dir removal
  unpack-trees: add special cwd handling
  unpack-trees: refuse to remove startup_info->original_cwd
  setup: introduce startup_info->original_cwd
  t2501: add various tests for removing the current working directory

3 years agoMerge branch 'jc/flex-array-definition'
Junio C Hamano [Wed, 5 Jan 2022 22:01:27 +0000 (14:01 -0800)] 
Merge branch 'jc/flex-array-definition'

The conditions to choose different definitions of the FLEX_ARRAY
macro for vendor compilers has been simplified to make it easier to
maintain.

* jc/flex-array-definition:
  flex-array: simplify compiler-specific workaround

3 years agoMerge branch 'jh/p4-rcs-expansion-in-bytestring'
Junio C Hamano [Wed, 5 Jan 2022 22:01:27 +0000 (14:01 -0800)] 
Merge branch 'jh/p4-rcs-expansion-in-bytestring'

The RCS keyword substitution in "git p4" used to be done assuming
that the contents are UTF-8 text, which can trigger decoding
errors.  We now treat the contents as a bytestring for robustness
and correctness.

* jh/p4-rcs-expansion-in-bytestring:
  git-p4: resolve RCS keywords in bytes not utf-8
  git-p4: open temporary patch file for write only
  git-p4: add raw option to read_pipelines
  git-p4: pre-compile RCS keyword regexes
  git-p4: use with statements to close files after use in patchRCSKeywords

3 years agoThe sixth batch
Junio C Hamano [Tue, 4 Jan 2022 00:23:32 +0000 (16:23 -0800)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'en/sparse-checkout-set'
Junio C Hamano [Tue, 4 Jan 2022 00:24:15 +0000 (16:24 -0800)] 
Merge branch 'en/sparse-checkout-set'

The "init" and "set" subcommands in "git sparse-checkout" have been
unified for a better user experience and performance.

* en/sparse-checkout-set:
  sparse-checkout: remove stray trailing space
  clone: avoid using deprecated `sparse-checkout init`
  Documentation: clarify/correct a few sparsity related statements
  git-sparse-checkout.txt: update to document init/set/reapply changes
  sparse-checkout: enable reapply to take --[no-]{cone,sparse-index}
  sparse-checkout: enable `set` to initialize sparse-checkout mode
  sparse-checkout: split out code for tweaking settings config
  sparse-checkout: disallow --no-stdin as an argument to set
  sparse-checkout: add sanity-checks on initial sparsity state
  sparse-checkout: break apart functions for sparse_checkout_(set|add)
  sparse-checkout: pass use_stdin as a parameter instead of as a global

3 years agoMerge branch 'es/test-chain-lint'
Junio C Hamano [Tue, 4 Jan 2022 00:24:15 +0000 (16:24 -0800)] 
Merge branch 'es/test-chain-lint'

Broken &&-chains in the test scripts have been corrected.

* es/test-chain-lint:
  t6000-t9999: detect and signal failure within loop
  t5000-t5999: detect and signal failure within loop
  t4000-t4999: detect and signal failure within loop
  t0000-t3999: detect and signal failure within loop
  tests: simplify by dropping unnecessary `for` loops
  tests: apply modern idiom for exiting loop upon failure
  tests: apply modern idiom for signaling test failure
  tests: fix broken &&-chains in `{...}` groups
  tests: fix broken &&-chains in `$(...)` command substitutions
  tests: fix broken &&-chains in compound statements
  tests: use test_write_lines() to generate line-oriented output
  tests: simplify construction of large blocks of text
  t9107: use shell parameter expansion to avoid breaking &&-chain
  t6300: make `%(raw:size) --shell` test more robust
  t5516: drop unnecessary subshell and command invocation
  t4202: clarify intent by creating expected content less cleverly
  t1020: avoid aborting entire test script when one test fails
  t1010: fix unnoticed failure on Windows
  t/lib-pager: use sane_unset() to avoid breaking &&-chain

3 years agoMerge branch 'ns/tmp-objdir'
Junio C Hamano [Tue, 4 Jan 2022 00:24:14 +0000 (16:24 -0800)] 
Merge branch 'ns/tmp-objdir'

New interface into the tmp-objdir API to help in-core use of the
quarantine feature.

* ns/tmp-objdir:
  tmp-objdir: disable ref updates when replacing the primary odb
  tmp-objdir: new API for creating temporary writable databases

3 years agoMerge branch 'jc/unleak-log'
Junio C Hamano [Tue, 4 Jan 2022 00:24:14 +0000 (16:24 -0800)] 
Merge branch 'jc/unleak-log'

"git format-patch" uses a single rev_info instance and then exits.
Mark the structure with UNLEAK() macro to squelch leak sanitizer.

* jc/unleak-log:
  format-patch: mark rev_info with UNLEAK

3 years agosparse-checkout: remove stray trailing space
Elijah Newren [Thu, 23 Dec 2021 17:07:03 +0000 (17:07 +0000)] 
sparse-checkout: remove stray trailing space

Reported-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoThe fifth batch
Junio C Hamano [Thu, 23 Dec 2021 02:00:04 +0000 (18:00 -0800)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'es/chainlint'
Junio C Hamano [Thu, 23 Dec 2021 06:48:11 +0000 (22:48 -0800)] 
Merge branch 'es/chainlint'

The chainlint test script linter in the test suite has been updated.

* es/chainlint:
  chainlint.sed: stop splitting "(..." into separate lines "(" and "..."
  chainlint.sed: swallow comments consistently
  chainlint.sed: stop throwing away here-doc tags
  chainlint.sed: don't mistake `<< word` in string as here-doc operator
  chainlint.sed: make here-doc "<<-" operator recognition more POSIX-like
  chainlint.sed: drop subshell-closing ">" annotation
  chainlint.sed: drop unnecessary distinction between ?!AMP?! and ?!SEMI?!
  chainlint.sed: tolerate harmless ";" at end of last line in block
  chainlint.sed: improve ?!SEMI?! placement accuracy
  chainlint.sed: improve ?!AMP?! placement accuracy
  t/Makefile: optimize chainlint self-test
  t/chainlint/one-liner: avoid overly intimate chainlint.sed knowledge
  t/chainlint/*.test: generalize self-test commentary
  t/chainlint/*.test: fix invalid test cases due to mixing quote types
  t/chainlint/*.test: don't use invalid shell syntax

3 years agoMerge branch 'jz/apply-quiet-and-allow-empty'
Junio C Hamano [Thu, 23 Dec 2021 06:48:11 +0000 (22:48 -0800)] 
Merge branch 'jz/apply-quiet-and-allow-empty'

"git apply" has been taught to ignore a message without a patch
with the "--allow-empty" option.  It also learned to honor the
"--quiet" option given from the command line.

* jz/apply-quiet-and-allow-empty:
  git-apply: add --allow-empty flag
  git-apply: add --quiet flag

3 years agoMerge branch 'jk/limit-developers-to-gnu99'
Junio C Hamano [Thu, 23 Dec 2021 06:48:11 +0000 (22:48 -0800)] 
Merge branch 'jk/limit-developers-to-gnu99'

Enable -std=gnu99 option in DEVELOPER builds.

* jk/limit-developers-to-gnu99:
  config.mak.dev: specify -std=gnu99 for gcc/clang

3 years agoMerge branch 'ab/common-main-cleanup'
Junio C Hamano [Thu, 23 Dec 2021 06:48:11 +0000 (22:48 -0800)] 
Merge branch 'ab/common-main-cleanup'

Code clean-up.

* ab/common-main-cleanup:
  common-main.c: call exit(), don't return

3 years agoMerge branch 'ab/fetch-set-upstream-while-detached'
Junio C Hamano [Thu, 23 Dec 2021 06:48:10 +0000 (22:48 -0800)] 
Merge branch 'ab/fetch-set-upstream-while-detached'

"git fetch --set-upstream" did not check if there is a current
branch, leading to a segfault when it is run on a detached HEAD,
which has been corrected.

* ab/fetch-set-upstream-while-detached:
  pull, fetch: fix segfault in --set-upstream option

3 years agoThe fourth batch
Junio C Hamano [Tue, 21 Dec 2021 23:03:23 +0000 (15:03 -0800)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'js/scalar'
Junio C Hamano [Tue, 21 Dec 2021 23:03:17 +0000 (15:03 -0800)] 
Merge branch 'js/scalar'

Add pieces from "scalar" to contrib/.

* js/scalar:
  scalar: implement the `version` command
  scalar: implement the `delete` command
  scalar: teach 'reconfigure' to optionally handle all registered enlistments
  scalar: allow reconfiguring an existing enlistment
  scalar: implement the `run` command
  scalar: teach 'clone' to support the --single-branch option
  scalar: implement the `clone` subcommand
  scalar: implement 'scalar list'
  scalar: let 'unregister' handle a deleted enlistment directory gracefully
  scalar: 'unregister' stops background maintenance
  scalar: 'register' sets recommended config and starts maintenance
  scalar: create test infrastructure
  scalar: start documenting the command
  scalar: create a rudimentary executable
  scalar: add a README with a roadmap

3 years agoMerge branch 'ld/sparse-diff-blame'
Junio C Hamano [Tue, 21 Dec 2021 23:03:17 +0000 (15:03 -0800)] 
Merge branch 'ld/sparse-diff-blame'

Teach diff and blame to work well with sparse index.

* ld/sparse-diff-blame:
  blame: enable and test the sparse index
  diff: enable and test the sparse index
  diff: replace --staged with --cached in t1092 tests
  repo-settings: prepare_repo_settings only in git repos
  test-read-cache: set up repo after git directory
  commit-graph: return if there is no git directory
  git: ensure correct git directory setup with -h

3 years agoMerge branch 'en/name-rev-shorter-output'
Junio C Hamano [Tue, 21 Dec 2021 23:03:16 +0000 (15:03 -0800)] 
Merge branch 'en/name-rev-shorter-output'

"git name-rev" has been tweaked to give output that is shorter and
easier to understand.

* en/name-rev-shorter-output:
  name-rev: prefer shorter names over following merges

3 years agoMerge branch 'ak/protect-any-current-branch'
Junio C Hamano [Tue, 21 Dec 2021 23:03:16 +0000 (15:03 -0800)] 
Merge branch 'ak/protect-any-current-branch'

"git fetch" without the "--update-head-ok" option ought to protect
a checked out branch from getting updated, to prevent the working
tree that checks it out to go out of sync.  The code was written
before the use of "git worktree" got widespread, and only checked
the branch that was checked out in the current worktree, which has
been updated.
(originally called ak/fetch-not-overwrite-any-current-branch)

* ak/protect-any-current-branch:
  branch: protect branches checked out in all worktrees
  receive-pack: protect current branch for bare repository worktree
  receive-pack: clean dead code from update_worktree()
  fetch: protect branches checked out in all worktrees
  worktree: simplify find_shared_symref() memory ownership model
  branch: lowercase error messages
  receive-pack: lowercase error messages
  fetch: lowercase error messages

3 years agoMerge branch 'fs/ssh-signing-other-keytypes'
Junio C Hamano [Tue, 21 Dec 2021 23:03:16 +0000 (15:03 -0800)] 
Merge branch 'fs/ssh-signing-other-keytypes'

The cryptographic signing using ssh keys can specify literal keys
for keytypes whose name do not begin with the "ssh-" prefix by
using the "key::" prefix mechanism (e.g. "key::ecdsa-sha2-nistp256").

* fs/ssh-signing-other-keytypes:
  ssh signing: make sign/amend test more resilient
  ssh signing: support non ssh-* keytypes

3 years agoMerge branch 'fs/ssh-signing-key-lifetime'
Junio C Hamano [Tue, 21 Dec 2021 23:03:15 +0000 (15:03 -0800)] 
Merge branch 'fs/ssh-signing-key-lifetime'

Extend the signing of objects with SSH keys and learn to pay
attention to the key validity time range when verifying.

* fs/ssh-signing-key-lifetime:
  ssh signing: verify ssh-keygen in test prereq
  ssh signing: make fmt-merge-msg consider key lifetime
  ssh signing: make verify-tag consider key lifetime
  ssh signing: make git log verify key lifetime
  ssh signing: make verify-commit consider key lifetime
  ssh signing: add key lifetime test prereqs
  ssh signing: use sigc struct to pass payload
  t/fmt-merge-msg: make gpgssh tests more specific
  t/fmt-merge-msg: do not redirect stderr

3 years agoMerge branch 'jc/grep-patterntype-default-doc'
Junio C Hamano [Tue, 21 Dec 2021 23:03:15 +0000 (15:03 -0800)] 
Merge branch 'jc/grep-patterntype-default-doc'

Doc update.

* jc/grep-patterntype-default-doc:
  grep: clarify what `grep.patternType=default` means

3 years agoMerge branch 'jk/log-decorate-opts-with-implicit-decorate'
Junio C Hamano [Tue, 21 Dec 2021 23:03:15 +0000 (15:03 -0800)] 
Merge branch 'jk/log-decorate-opts-with-implicit-decorate'

When "git log" implicitly enabled the "decoration" processing
without being explicitly asked with "--decorate" option, it failed
to read and honor the settings given by the "--decorate-refs"
option.

* jk/log-decorate-opts-with-implicit-decorate:
  log: load decorations with --simplify-by-decoration
  log: handle --decorate-refs with userformat "%d"

3 years agoMerge branch 'en/rebase-x-wo-git-dir-env'
Junio C Hamano [Tue, 21 Dec 2021 23:03:15 +0000 (15:03 -0800)] 
Merge branch 'en/rebase-x-wo-git-dir-env'

"git rebase -x" by mistake started exporting the GIT_DIR and
GIT_WORK_TREE environment variables when the command was rewritten
in C, which has been corrected.

* en/rebase-x-wo-git-dir-env:
  sequencer: do not export GIT_DIR and GIT_WORK_TREE for 'exec'

3 years agoMerge branch 'jc/c99-var-decl-in-for-loop'
Junio C Hamano [Tue, 21 Dec 2021 23:03:15 +0000 (15:03 -0800)] 
Merge branch 'jc/c99-var-decl-in-for-loop'

Weather balloon to find compilers that do not grok variable
declaration in the for() loop.

* jc/c99-var-decl-in-for-loop:
  revision: use C99 declaration of variable in for() loop

3 years agoMerge branch 'pw/xdiff-classify-record-in-histogram'
Junio C Hamano [Tue, 21 Dec 2021 23:03:14 +0000 (15:03 -0800)] 
Merge branch 'pw/xdiff-classify-record-in-histogram'

"diff --histogram" optimization.

* pw/xdiff-classify-record-in-histogram:
  xdiff: drop unused flags parameter from recs_match
  xdiff: drop xpparam_t parameter from histogram cmp_recs()
  xdiff: drop CMP_ENV macro from xhistogram
  xdiff: simplify comparison
  xdiff: avoid unnecessary memory allocations
  diff histogram: intern strings

3 years agomerge: allow to pretend a merge is made into a different branch
Junio C Hamano [Mon, 20 Dec 2021 22:53:43 +0000 (14:53 -0800)] 
merge: allow to pretend a merge is made into a different branch

When a series of patches for a topic-B depends on having topic-A,
the workflow to prepare the topic-B branch would look like this:

    $ git checkout -b topic-B main
    $ git merge --no-ff --no-edit topic-A
    $ git am <mbox-for-topic-B

When topic-A gets updated, recreating the first merge and rebasing
the rest of the topic-B, all on detached HEAD, is a useful
technique.  After updating topic-A with its new round of patches:

    $ git checkout topic-B
    $ prev=$(git rev-parse 'HEAD^{/^Merge branch .topic-A. into}')
    $ git checkout --detach $prev^1
    $ git merge --no-ff --no-edit topic-A
    $ git rebase --onto HEAD $prev @{-1}^0
    $ git checkout -B @{-1}

This will

 (0) check out the current topic-B.
 (1) find the previous merge of topic-A into topic-B.
 (2) detach the HEAD to the parent of the previous merge.
 (3) merge the updated topic-A to it.
 (4) reapply the patches to rebuild the rest of topic-B.
 (5) update topic-B with the result.

without contaminating the reflog of topic-B too much.  topic-B@{1}
is the "logically previous" state before topic-A got updated, for
example.  At (4), comparison (e.g. range-diff) between HEAD and
@{-1} is a meaningful way to sanity check the result, and the same
can be done at (5) by comparing topic-B and topic-B@{1}.

But there is one glitch.  The merge into the detached HEAD done in
the step (3) above gives us "Merge branch 'topic-A' into HEAD", and
does not say "into topic-B".

Teach the "--into-name=<branch>" option to "git merge" and its
underlying "git fmt-merge-message", to pretend as if we were merging
into <branch>, no matter what branch we are actually merging into,
when they prepare the merge message.  The pretend name honors the
usual "into <target>" suppression mechanism, which can be seen in
the tests added here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogrep/pcre2: factor out literal variable
René Scharfe [Sat, 18 Dec 2021 19:53:15 +0000 (20:53 +0100)] 
grep/pcre2: factor out literal variable

Patterns that contain no wildcards and don't have to be case-folded are
literal.  Give this condition a name to increase the readability of the
boolean expression for enabling the option PCRE2_UTF.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogrep/pcre2: use PCRE2_UTF even with ASCII patterns
René Scharfe [Sat, 18 Dec 2021 19:50:02 +0000 (20:50 +0100)] 
grep/pcre2: use PCRE2_UTF even with ASCII patterns

compile_pcre2_pattern() currently uses the option PCRE2_UTF only for
patterns with non-ASCII characters.  Patterns with ASCII wildcards can
match non-ASCII strings, though.  Without that option PCRE2 mishandles
UTF-8 input, though -- it matches parts of multi-byte characters.  Fix
that by using PCRE2_UTF even for ASCII-only patterns.

This is a remake of the reverted ae39ba431a (grep/pcre2: fix an edge
case concerning ascii patterns and UTF-8 data, 2021-10-15).  The change
to the condition and the test are simplified and more targeted.

Original-patch-by: Hamza Mahfooz <someguy@effective-light.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodaemon: plug memory leak on overlong path
René Scharfe [Sat, 18 Dec 2021 09:47:03 +0000 (10:47 +0100)] 
daemon: plug memory leak on overlong path

Release the strbuf containing the interpolated path after copying it to
a stack buffer and before erroring out if it's too long.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agorepack: make '--quiet' disable progress
Derrick Stolee [Mon, 20 Dec 2021 14:48:11 +0000 (14:48 +0000)] 
repack: make '--quiet' disable progress

While testing some ideas in 'git repack', I ran it with '--quiet' and
discovered that some progress output was still shown. Specifically, the
output for writing the multi-pack-index showed the progress.

The 'show_progress' variable in cmd_repack() is initialized with
isatty(2) and is not modified at all by the '--quiet' flag. The
'--quiet' flag modifies the po_args.quiet option which is translated
into a '--quiet' flag for the 'git pack-objects' child process. However,
'show_progress' is used to directly send progress information to the
multi-pack-index writing logic which does not use a child process.

The fix here is to modify 'show_progress' to be false if po_opts.quiet
is true, and isatty(2) otherwise. This new expectation simplifies a
later condition that checks both.

Update the documentation to make it clear that '-q' will disable all
progress in addition to ensuring the 'git pack-objects' child process
will receive the flag.

Use 'test_terminal' to check that this works to get around the isatty(2)
check.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agorepack: respect kept objects with '--write-midx -b'
Derrick Stolee [Mon, 20 Dec 2021 14:48:10 +0000 (14:48 +0000)] 
repack: respect kept objects with '--write-midx -b'

Historically, we needed a single packfile in order to have reachability
bitmaps. This introduced logic that when 'git repack' had a '-b' option
that we should stop sending the '--honor-pack-keep' option to the 'git
pack-objects' child process, ensuring that we create a packfile
containing all reachable objects.

In the world of multi-pack-index bitmaps, we no longer need to repack
all objects into a single pack to have valid bitmaps. Thus, we should
continue sending the '--honor-pack-keep' flag to 'git pack-objects'.

The fix is very simple: only disable the flag when writing bitmaps but
also _not_ writing the multi-pack-index.

This opens the door to new repacking strategies that might want to keep
some historical set of objects in a stable pack-file while only
repacking more recent objects.

To test, create a new 'test_subcommand_inexact' helper that is more
flexible than 'test_subcommand'. This allows us to look for the
--honor-pack-keep flag without over-indexing on the exact set of
arguments.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot4202: fix patternType setting in --invert-grep test
René Scharfe [Fri, 17 Dec 2021 16:48:52 +0000 (17:48 +0100)] 
t4202: fix patternType setting in --invert-grep test

Actually use extended regexes as indicated in the comment.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodocs: add missing colon to Documentation/config/gpg.txt
Greg Hurrell [Fri, 17 Dec 2021 16:17:18 +0000 (17:17 +0100)] 
docs: add missing colon to Documentation/config/gpg.txt

Add missing colon to ensure correct rendering of definition list
item. Without the proper number of colons, it renders as just another
top-level paragraph rather than a list item.

Signed-off-by: Greg Hurrell <greg@hurrell.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agolog: let --invert-grep only invert --grep
René Scharfe [Fri, 17 Dec 2021 16:48:49 +0000 (17:48 +0100)] 
log: let --invert-grep only invert --grep

The option --invert-grep is documented to filter out commits whose
messages match the --grep filters.  However, it also affects the
header matches (--author, --committer), which is not intended.

Move the handling of that option to grep.c, as only the code there can
distinguish between matches in the header from those in the message
body.  If --invert-grep is given then enable extended expressions (not
the regex type, we just need git grep's --not to work), negate the body
patterns and check if any of them match by piggy-backing on the
collect_hits mechanism of grep_source_1().

Collecting the matches in struct grep_opt is a bit iffy, but with
"last_shown" we have a precedent for writing state information to that
struct.

Reported-by: Dotan Cohen <dotancohen@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoformat-patch: mark rev_info with UNLEAK
Junio C Hamano [Thu, 16 Dec 2021 23:37:10 +0000 (15:37 -0800)] 
format-patch: mark rev_info with UNLEAK

The comand uses a single instance of rev_info on stack, makes a
single revision traversal and exit.  Mark the resources held by the
rev_info structure with UNLEAK().

We do not do this at lower level in revision.c or cmd_log_walk(), as
a new caller of the revision traversal API can make unbounded number
of rev_info during a single run, and UNLEAK() would not a be
suitable mechanism to deal with such a caller.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot4204 is not sanitizer clean at all
Junio C Hamano [Thu, 16 Dec 2021 23:11:12 +0000 (15:11 -0800)] 
t4204 is not sanitizer clean at all

Earlier we marked that this patch-id test is leak-sanitizer clean,
but if we read the test script carefully, it is merely because we
have too many invocations of commands in the "git log" family on the
upstream side of the pipe, hiding breakages from them.

Split the pipeline so that breakages from these commands can be
caught (not limited to aborts due to leak-sanitizer) and unmark
the script as not passing the test with leak-sanitizer in effect.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-p4: resolve RCS keywords in bytes not utf-8
Joel Holdsworth [Thu, 16 Dec 2021 13:46:19 +0000 (13:46 +0000)] 
git-p4: resolve RCS keywords in bytes not utf-8

RCS keywords are strings that are replaced with information from
Perforce. Examples include $Date$, $Author$, $File$, $Change$ etc.

Perforce resolves these by expanding them with their expanded values
when files are synced, but Git's data model requires these expanded
values to be converted back into their unexpanded form.

Previously, git-p4.py would implement this behaviour through the use of
regular expressions. However, the regular expression substitution was
applied using decoded strings i.e. the content of incoming commit diffs
was first decoded from bytes into UTF-8, processed with regular
expressions, then converted back to bytes.

Not only is this behaviour inefficient, but it is also a cause of a
common issue caused by text files containing invalid UTF-8 data. For
files created in Windows, CP1252 Smart Quote Characters (0x93 and 0x94)
are seen fairly frequently. These codes are invalid in UTF-8, so if the
script encountered any file containing them, on Python 2 the symbols
will be corrupted, and on Python 3 the script will fail with an
exception.

This patch replaces this decoding/encoding with bytes object regular
expressions, so that the substitution is performed directly upon the
source data with no conversions.

A test for smart quote handling has been added to the
t9810-git-p4-rcs.sh test suite.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-p4: open temporary patch file for write only
Joel Holdsworth [Thu, 16 Dec 2021 13:46:18 +0000 (13:46 +0000)] 
git-p4: open temporary patch file for write only

The patchRCSKeywords method creates a temporary file in which to store
the patched output data. Previously this file was opened in "w+" mode
(write and read), but the code never reads the contents of the file
while open, so it only needs to be opened in "w" mode (write-only).

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-p4: add raw option to read_pipelines
Joel Holdsworth [Thu, 16 Dec 2021 13:46:17 +0000 (13:46 +0000)] 
git-p4: add raw option to read_pipelines

Previously the read_lines function always decoded the result lines. In
order to improve support for non-decoded binary processing of data in
git-p4.py, this patch adds a raw option to the function that allows
decoding to be disabled.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-p4: pre-compile RCS keyword regexes
Joel Holdsworth [Thu, 16 Dec 2021 13:46:16 +0000 (13:46 +0000)] 
git-p4: pre-compile RCS keyword regexes

Previously git-p4.py would compile one of two regular expressions for
ever RCS keyword-enabled file. This patch improves simplifies the code
by pre-compiling the two regular expressions when the script first
loads.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-p4: use with statements to close files after use in patchRCSKeywords
Joel Holdsworth [Thu, 16 Dec 2021 13:46:15 +0000 (13:46 +0000)] 
git-p4: use with statements to close files after use in patchRCSKeywords

Python with statements are used to wrap the execution of a block of code
so that an object can be safely released when execution leaves the
scope.

They are desirable for improving code tidyness, and to ensure that
objects are properly destroyed even when exceptions are thrown.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agohelp: make auto-correction prompt more consistent
Kashav Madan [Wed, 15 Dec 2021 22:58:58 +0000 (22:58 +0000)] 
help: make auto-correction prompt more consistent

There are three callsites of git_prompt() helper function that ask a
"yes/no" question to the end user, but one of them in help.c that
asks if the suggested auto-correction is OK, which is given when the
user makes a possible typo in a Git subcommand name, is formatted
differently from the others.

Update the format string to make the prompt string look more
consistent.

Signed-off-by: Kashav Madan <kshvmdn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoam: support --allow-empty to record specific empty patches
徐沛文 (Aleen) [Thu, 9 Dec 2021 07:25:55 +0000 (07:25 +0000)] 
am: support --allow-empty to record specific empty patches

This option helps to record specific empty patches in the middle
of an am session, which does create empty commits only when:

    1. the index has not changed
    2. lacking a branch

When the index has changed, "--allow-empty" will create a non-empty
commit like passing "--continue" or "--resolved".

Signed-off-by: 徐沛文 (Aleen) <aleen42@vip.qq.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoam: support --empty=<option> to handle empty patches
徐沛文 (Aleen) [Thu, 9 Dec 2021 07:25:54 +0000 (07:25 +0000)] 
am: support --empty=<option> to handle empty patches

Since that the command 'git-format-patch' can include patches of
commits that emit no changes, the 'git-am' command should also
support an option, named as '--empty', to specify how to handle
those empty patches. In this commit, we have implemented three
valid options ('stop', 'drop' and 'keep').

Signed-off-by: 徐沛文 (Aleen) <aleen42@vip.qq.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodoc: git-format-patch: describe the option --always
徐沛文 (Aleen) [Thu, 9 Dec 2021 07:25:53 +0000 (07:25 +0000)] 
doc: git-format-patch: describe the option --always

This commit has described how to use '--always' option in the command
'git-format-patch' to include patches for commits that emit no changes.

Signed-off-by: 徐沛文 (Aleen) <aleen42@vip.qq.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodoc/config: mark ssh allowedSigners example as literal
Jeff King [Wed, 15 Dec 2021 16:23:48 +0000 (11:23 -0500)] 
doc/config: mark ssh allowedSigners example as literal

The discussion for gpg.ssh.allowedSignersFile shows an example string
that contains "user1@example.com,user2@example.com". Asciidoc thinks
these are real email addresses and generates "mailto" footnotes for
them. This makes the rendered content more confusing, as it has extra
"[1]" markers:

  The file consists of one or more lines of principals followed by an
  ssh public key. e.g.: user1@example.com[1],user2@example.com[2]
  ssh-rsa AAAAX1... See ssh-keygen(1) "ALLOWED SIGNERS" for details.

and also generates pointless notes at the end of the page:

  NOTES
        1. user1@example.com
           mailto:user1@example.com

        2. user2@example.com
           mailto:user2@example.com

We can fix this by putting the example into a backtick literal block.
That inhibits the mailto generation, and as a bonus typesets the example
text in a way that sets it off from the regular prose (a tt font for
html, or bold in the roff manpage).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoupload-pack.c: increase output buffer size
Jacob Vosmaer [Tue, 14 Dec 2021 19:46:26 +0000 (20:46 +0100)] 
upload-pack.c: increase output buffer size

When serving a fetch, git upload-pack copies data from a git
pack-objects stdout pipe to its stdout. This commit increases the size
of the buffer used for that copying from 8192 to 65515, the maximum
sideband-64k packet size.

Previously, this buffer was allocated on the stack. Because the new
buffer size is nearly 64KB, we switch this to a heap allocation.

On GitLab.com we use GitLab's pack-objects cache which does writes of
65515 bytes. Because of the default 8KB buffer size, propagating these
cache writes requires 8 pipe reads and 8 pipe writes from
git-upload-pack, and 8 pipe reads from Gitaly (our Git RPC service).
If we increase the size of the buffer to the maximum Git packet size,
we need only 1 pipe read and 1 pipe write in git-upload-pack, and 1
pipe read in Gitaly to transfer the same amount of data. In benchmarks
with a pure fetch and 100% cache hit rate workload we are seeing CPU
utilization reductions of over 30%.

Signed-off-by: Jacob Vosmaer <jacob@gitlab.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoclone: avoid using deprecated `sparse-checkout init`
Elijah Newren [Tue, 14 Dec 2021 04:09:12 +0000 (04:09 +0000)] 
clone: avoid using deprecated `sparse-checkout init`

The previous commits marked `sparse-checkout init` as deprecated; we
can just use `set` instead here and pass it no paths.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoDocumentation: clarify/correct a few sparsity related statements
Elijah Newren [Tue, 14 Dec 2021 04:09:11 +0000 (04:09 +0000)] 
Documentation: clarify/correct a few sparsity related statements

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogit-sparse-checkout.txt: update to document init/set/reapply changes
Elijah Newren [Tue, 14 Dec 2021 04:09:10 +0000 (04:09 +0000)] 
git-sparse-checkout.txt: update to document init/set/reapply changes

As noted in the previous commit, using separate `init` and `set` steps
with sparse-checkout result in a number of issues.  The previous commits
made `set` able to handle the work of both commands, and enabled reapply
to tweak the {cone,sparse-index} settings.  Update the documentation to
reflect this, and mark `init` as deprecated.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: enable reapply to take --[no-]{cone,sparse-index}
Elijah Newren [Tue, 14 Dec 2021 04:09:09 +0000 (04:09 +0000)] 
sparse-checkout: enable reapply to take --[no-]{cone,sparse-index}

Folks may want to switch to or from cone mode, or to or from a
sparse-index without changing their sparsity paths.  Allow them to do so
using the reapply command.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: enable `set` to initialize sparse-checkout mode
Elijah Newren [Tue, 14 Dec 2021 04:09:08 +0000 (04:09 +0000)] 
sparse-checkout: enable `set` to initialize sparse-checkout mode

The previously suggested workflow:
  git sparse-checkout init ...
  git sparse-checkout set ...

Suffered from three problems:
  1) It would delete nearly all files in the first step, then
     restore them in the second.  That was poor performance and
     forced unnecessary rebuilds.
  2) The two-step process resulted in two progress bars, which
     was suboptimal from a UI point of view for wrappers that
     invoked both of these commands but only exposed a single
     command to their end users.
  3) With cone mode, the first step would delete nearly all
     ignored files everywhere, because everything was considered
     to be outside of the specified sparsity paths.  (The user was
     not allowed to specify any sparsity paths in the `init` step.)

Avoid these problems by teaching `set` to understand the extra
parameters that `init` takes and performing any necessary initialization
if not already in a sparse checkout.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: split out code for tweaking settings config
Elijah Newren [Tue, 14 Dec 2021 04:09:07 +0000 (04:09 +0000)] 
sparse-checkout: split out code for tweaking settings config

`init` has some code for handling updates to either cone mode or
the sparse-index setting.  We would like to be able to reuse this
elsewhere, namely in `set` and `reapply`.  Split this function out,
and make it slightly more general so it can handle being called from
the new callers.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: disallow --no-stdin as an argument to set
Elijah Newren [Tue, 14 Dec 2021 04:09:06 +0000 (04:09 +0000)] 
sparse-checkout: disallow --no-stdin as an argument to set

We intentionally added --stdin as an option to `sparse-checkout set`,
but didn't intend for --no-stdin to be permitted as well.

Reported-by: Victoria Dye <vdye@github.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: add sanity-checks on initial sparsity state
Elijah Newren [Tue, 14 Dec 2021 04:09:05 +0000 (04:09 +0000)] 
sparse-checkout: add sanity-checks on initial sparsity state

Most sparse-checkout subcommands (list, add, reapply) only make sense
when already in a sparse state.  Add a quick check that will error out
early if this is not the case.

Also document with a comment why we do not exit early in `disable` even
when core.sparseCheckout starts as false.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: break apart functions for sparse_checkout_(set|add)
Elijah Newren [Tue, 14 Dec 2021 04:09:04 +0000 (04:09 +0000)] 
sparse-checkout: break apart functions for sparse_checkout_(set|add)

sparse_checkout_set() was reused by sparse_checkout_add() with the only
difference being a single parameter being passed to that function.
However, we would like sparse_checkout_set() to do the same work that
sparse_checkout_init() does if sparse checkouts are not already enabled.
To facilitate this transition, give each mode their own copy of the
function.  This does not introduce any behavioral changes; that will
come in a subsequent patch.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosparse-checkout: pass use_stdin as a parameter instead of as a global
Elijah Newren [Tue, 14 Dec 2021 04:09:03 +0000 (04:09 +0000)] 
sparse-checkout: pass use_stdin as a parameter instead of as a global

add_patterns_from_input() has relied on a global variable,
set_opts.use_stdin, which has been used by both the `set` and `add`
subcommands of sparse-checkout.  Once we introduce an
add_opts.use_stdin, the hardcoding of set_opts.use_stdin will be
incorrect.  Pass the value as function parameter instead to allow us to
make subsequent changes.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Victoria Dye <vdye@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoThe third batch
Junio C Hamano [Wed, 15 Dec 2021 17:40:11 +0000 (09:40 -0800)] 
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ab/die-with-bug'
Junio C Hamano [Wed, 15 Dec 2021 17:39:55 +0000 (09:39 -0800)] 
Merge branch 'ab/die-with-bug'

Code clean-up.

* ab/die-with-bug:
  object.c: use BUG(...) no die("BUG: ...") in lookup_object_by_type()
  pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>)
  strbuf.h: use BUG(...) not die("BUG: ...")
  pack-objects: use BUG(...) not die("BUG: ...")

3 years agoMerge branch 'hn/allow-bogus-oid-in-ref-tests'
Junio C Hamano [Wed, 15 Dec 2021 17:39:54 +0000 (09:39 -0800)] 
Merge branch 'hn/allow-bogus-oid-in-ref-tests'

The test helper for refs subsystem learned to write bogus and/or
nonexistent object name to refs to simulate error situations we
want to test Git in.

* hn/allow-bogus-oid-in-ref-tests:
  t1430: create valid symrefs using test-helper
  t1430: remove refs using test-tool
  refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
  refs: introduce REF_SKIP_OID_VERIFICATION flag
  refs: update comment.
  test-ref-store: plug memory leak in cmd_delete_refs
  test-ref-store: parse symbolic flag constants
  test-ref-store: remove force-create argument for create-reflog

3 years agoMerge branch 'ab/parse-options-cleanup'
Junio C Hamano [Wed, 15 Dec 2021 17:39:54 +0000 (09:39 -0800)] 
Merge branch 'ab/parse-options-cleanup'

Change the type of an internal function to return an enum (instead
of int) and replace -2 that was used to signal an error with -1.

* ab/parse-options-cleanup:
  parse-options.c: use "enum parse_opt_result" for parse_nodash_opt()

3 years agoMerge branch 're/color-default-reset'
Junio C Hamano [Wed, 15 Dec 2021 17:39:53 +0000 (09:39 -0800)] 
Merge branch 're/color-default-reset'

"default" and "reset" colors have been added to our palette.

* re/color-default-reset:
  color: allow colors to be prefixed with "reset"
  color: support "default" to restore fg/bg color
  color: add missing GIT_COLOR_* white/black constants

3 years agoMerge branch 'jc/reflog-iterator-callback-doc'
Junio C Hamano [Wed, 15 Dec 2021 17:39:52 +0000 (09:39 -0800)] 
Merge branch 'jc/reflog-iterator-callback-doc'

Document the parameters given to the reflog entry iterator callback
functions.

* jc/reflog-iterator-callback-doc:
  refs: document callback for reflog-ent iterators

3 years agoMerge branch 'ew/test-wo-fsync'
Junio C Hamano [Wed, 15 Dec 2021 17:39:51 +0000 (09:39 -0800)] 
Merge branch 'ew/test-wo-fsync'

Allow running our tests while disabling fsync.

* ew/test-wo-fsync:
  tests: disable fsync everywhere

3 years agoMerge branch 'ew/cbtree-remove-unused-and-broken-cb-unlink'
Junio C Hamano [Wed, 15 Dec 2021 17:39:51 +0000 (09:39 -0800)] 
Merge branch 'ew/cbtree-remove-unused-and-broken-cb-unlink'

Code clean-up.

* ew/cbtree-remove-unused-and-broken-cb-unlink:
  cbtree: remove broken and unused cb_unlink

3 years agoMerge branch 'ds/sparse-deep-pattern-checkout-fix'
Junio C Hamano [Wed, 15 Dec 2021 17:39:50 +0000 (09:39 -0800)] 
Merge branch 'ds/sparse-deep-pattern-checkout-fix'

The sparse-index/sparse-checkout feature had a bug in its use of
the matching code to determine which path is in or outside the
sparse checkout patterns.

* ds/sparse-deep-pattern-checkout-fix:
  unpack-trees: use traverse_path instead of name
  t1092: add deeper changes during a checkout

3 years agoMerge branch 'tb/pack-revindex-on-disk-cleanup'
Junio C Hamano [Wed, 15 Dec 2021 17:39:50 +0000 (09:39 -0800)] 
Merge branch 'tb/pack-revindex-on-disk-cleanup'

Code clean-up.

* tb/pack-revindex-on-disk-cleanup:
  packfile: make `close_pack_revindex()` static

3 years agoMerge branch 'es/doc-stdout-vs-stderr'
Junio C Hamano [Wed, 15 Dec 2021 17:39:49 +0000 (09:39 -0800)] 
Merge branch 'es/doc-stdout-vs-stderr'

Coding guideline document has been updated to clarify what goes to
standard error in our system.

* es/doc-stdout-vs-stderr:
  CodingGuidelines: document which output goes to stdout vs. stderr

3 years agoMerge branch 'js/test-initial-branch-override-cleanup'
Junio C Hamano [Wed, 15 Dec 2021 17:39:49 +0000 (09:39 -0800)] 
Merge branch 'js/test-initial-branch-override-cleanup'

Many tests that used to need GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
mechanism to force "git" to use 'master' as the default name for
the initial branch no longer need it; the use of the mechanism from
them have been removed.

* js/test-initial-branch-override-cleanup:
  tests: set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME only when needed

3 years agoMerge branch 'es/worktree-chatty-to-stderr'
Junio C Hamano [Wed, 15 Dec 2021 17:39:49 +0000 (09:39 -0800)] 
Merge branch 'es/worktree-chatty-to-stderr'

"git worktree add" showed "Preparing worktree" message to the
standard output stream, but when it failed, the message from die()
went to the standard error stream.  Depending on the order the
stdio streams are flushed at the program end, this resulted in
confusing output.  It has been corrected by sending all the chatty
messages to the standard error stream.

* es/worktree-chatty-to-stderr:
  git-worktree.txt: add missing `-v` to synopsis for `worktree list`
  worktree: send "chatty" messages to stderr

3 years agoMerge branch 'ab/ci-updates'
Junio C Hamano [Wed, 15 Dec 2021 17:39:49 +0000 (09:39 -0800)] 
Merge branch 'ab/ci-updates'

Drop support for TravisCI and update test workflows at GitHub.

* ab/ci-updates:
  CI: don't run "make test" twice in one job
  CI: use "$runs_on_pool", not "$jobname" to select packages & config
  CI: rename the "Linux32" job to lower-case "linux32"
  CI: use shorter names that fit in UX tooltips
  CI: remove Travis CI support

3 years agoMerge branch 'hn/reflog-tests'
Junio C Hamano [Wed, 15 Dec 2021 17:39:48 +0000 (09:39 -0800)] 
Merge branch 'hn/reflog-tests'

Prepare tests on ref API to help testing reftable backends.

* hn/reflog-tests:
  refs/debug: trim trailing LF from reflog message
  test-ref-store: tweaks to for-each-reflog-ent format
  t1405: check for_each_reflog_ent_reverse() more thoroughly
  test-ref-store: don't add newline to reflog message
  show-branch: show reflog message

3 years agoMerge branch 'rj/receive-pack-avoid-sigpipe-during-status-reporting'
Junio C Hamano [Wed, 15 Dec 2021 17:39:48 +0000 (09:39 -0800)] 
Merge branch 'rj/receive-pack-avoid-sigpipe-during-status-reporting'

When the "git push" command is killed while the receiving end is
trying to report what happened to the ref update proposals, the
latter used to die, due to SIGPIPE.  The code now ignores SIGPIPE
to increase our chances to run the post-receive hook after it
happens.

* rj/receive-pack-avoid-sigpipe-during-status-reporting:
  receive-pack: ignore SIGPIPE while reporting status to client

3 years agoMerge branch 'es/pretty-describe-more'
Junio C Hamano [Wed, 15 Dec 2021 17:39:48 +0000 (09:39 -0800)] 
Merge branch 'es/pretty-describe-more'

Extend "git log --format=%(describe)" placeholder to allow passing
selected command-line options to the underlying "git describe"
command.

* es/pretty-describe-more:
  pretty: add abbrev option to %(describe)
  pretty: add tag option to %(describe)
  pretty.c: rework describe options parsing for better extensibility

3 years agoMerge branch 'ab/run-command'
Junio C Hamano [Wed, 15 Dec 2021 17:39:47 +0000 (09:39 -0800)] 
Merge branch 'ab/run-command'

API clean-up.

* ab/run-command:
  run-command API: remove "env" member, always use "env_array"
  difftool: use "env_array" to simplify memory management
  run-command API: remove "argv" member, always use "args"
  run-command API users: use strvec_push(), not argv construction
  run-command API users: use strvec_pushl(), not argv construction
  run-command tests: use strvec_pushv(), not argv assignment
  run-command API users: use strvec_pushv(), not argv assignment
  upload-archive: use regular "struct child_process" pattern
  worktree: stop being overly intimate with run_command() internals

3 years agoMerge branch 'hn/t1404-df-limitation-is-ref-files-only'
Junio C Hamano [Wed, 15 Dec 2021 17:39:47 +0000 (09:39 -0800)] 
Merge branch 'hn/t1404-df-limitation-is-ref-files-only'

Test update.

* hn/t1404-df-limitation-is-ref-files-only:
  t1404: mark directory/file conflict tests with REFFILES

3 years agoMerge branch 'en/zdiff3'
Junio C Hamano [Wed, 15 Dec 2021 17:39:47 +0000 (09:39 -0800)] 
Merge branch 'en/zdiff3'

"Zealous diff3" style of merge conflict presentation has been added.

* en/zdiff3:
  update documentation for new zdiff3 conflictStyle
  xdiff: implement a zealous diff3, or "zdiff3"

3 years agoMerge branch 'ds/trace2-regions-in-tests'
Junio C Hamano [Wed, 15 Dec 2021 17:39:46 +0000 (09:39 -0800)] 
Merge branch 'ds/trace2-regions-in-tests'

The default setting for trace2 event nesting was too low to cause
test failures, which is worked around by bumping it up in the test
framework.

* ds/trace2-regions-in-tests:
  t/t*: remove custom GIT_TRACE2_EVENT_NESTING
  test-lib.sh: set GIT_TRACE2_EVENT_NESTING

3 years agoMerge branch 'fs/test-prereq'
Junio C Hamano [Wed, 15 Dec 2021 17:39:46 +0000 (09:39 -0800)] 
Merge branch 'fs/test-prereq'

The test framework learns to list unsatisfied test prerequisites,
and optionally error out when prerequisites that are expected to be
satisfied are not.

* fs/test-prereq:
  test-lib: make BAIL_OUT() work in tests and prereq
  test-lib: introduce required prereq for test runs
  test-lib: show missing prereq summary

3 years agoMerge branch 'ab/mark-leak-free-tests-even-more'
Junio C Hamano [Wed, 15 Dec 2021 17:39:46 +0000 (09:39 -0800)] 
Merge branch 'ab/mark-leak-free-tests-even-more'

More tests are marked as leak-free.

* ab/mark-leak-free-tests-even-more:
  leak tests: mark some fast-import tests as passing with SANITIZE=leak
  leak tests: mark some config tests as passing with SANITIZE=leak
  leak tests: mark some status tests as passing with SANITIZE=leak
  leak tests: mark some clone tests as passing with SANITIZE=leak
  leak tests: mark some add tests as passing with SANITIZE=leak
  leak tests: mark some diff tests as passing with SANITIZE=leak
  leak tests: mark some apply tests as passing with SANITIZE=leak
  leak tests: mark some notes tests as passing with SANITIZE=leak
  leak tests: mark some update-index tests as passing with SANITIZE=leak
  leak tests: mark some rev-parse tests as passing with SANITIZE=leak
  leak tests: mark some rev-list tests as passing with SANITIZE=leak
  leak tests: mark some misc tests as passing with SANITIZE=leak
  leak tests: mark most gettext tests as passing with SANITIZE=leak
  leak tests: mark "sort" test as passing SANITIZE=leak
  leak tests: mark a read-tree test as passing SANITIZE=leak

3 years agoMerge branch 'hn/reftable'
Junio C Hamano [Wed, 15 Dec 2021 17:39:45 +0000 (09:39 -0800)] 
Merge branch 'hn/reftable'

The "reftable" backend for the refs API, without integrating into
the refs subsystem, has been added.

* hn/reftable:
  Add "test-tool dump-reftable" command.
  reftable: add dump utility
  reftable: implement stack, a mutable database of reftable files.
  reftable: implement refname validation
  reftable: add merged table view
  reftable: add a heap-based priority queue for reftable records
  reftable: reftable file level tests
  reftable: read reftable files
  reftable: generic interface to tables
  reftable: write reftable files
  reftable: a generic binary tree implementation
  reftable: reading/writing blocks
  Provide zlib's uncompress2 from compat/zlib-compat.c
  reftable: (de)serialization for the polymorphic record type.
  reftable: add blocksource, an abstraction for random access reads
  reftable: utility functions
  reftable: add error related functionality
  reftable: add LICENSE
  hash.h: provide constants for the hash IDs