]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'gc/parse-tree-indirect-errors'
Junio C Hamano [Sun, 13 Mar 2022 22:56:17 +0000 (22:56 +0000)] 
Merge branch 'gc/parse-tree-indirect-errors'

Check the return value from parse_tree_indirect() to turn segfaults
into calls to die().

* gc/parse-tree-indirect-errors:
  checkout, clone: die if tree cannot be parsed

2 years agoMerge branch 'en/merge-ort-align-verbosity-with-recursive'
Junio C Hamano [Sun, 13 Mar 2022 22:56:17 +0000 (22:56 +0000)] 
Merge branch 'en/merge-ort-align-verbosity-with-recursive'

Align the level of verbose output from the ort backend during inner
merge to that of the recursive backend.

* en/merge-ort-align-verbosity-with-recursive:
  merge-ort: exclude messages from inner merges by default

2 years agoMerge branch 'ab/make-optim-noop'
Junio C Hamano [Sun, 13 Mar 2022 22:56:17 +0000 (22:56 +0000)] 
Merge branch 'ab/make-optim-noop'

Makefile refactoring with a bit of suffixes rule stripping to
optimize the runtime overhead.

* ab/make-optim-noop:
  Makefiles: add and use wildcard "mkdir -p" template
  Makefile: add "$(QUIET)" boilerplate to shared.mak
  Makefile: move $(comma), $(empty) and $(space) to shared.mak
  Makefile: move ".SUFFIXES" rule to shared.mak
  Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
  Makefile: disable GNU make built-in wildcard rules
  Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
  scalar Makefile: use "The default target of..." pattern

2 years agoMerge branch 'ps/fetch-atomic'
Junio C Hamano [Sun, 13 Mar 2022 22:56:16 +0000 (22:56 +0000)] 
Merge branch 'ps/fetch-atomic'

"git fetch" can make two separate fetches, but ref updates coming
from them were in two separate ref transactions under "--atomic",
which has been corrected.

* ps/fetch-atomic:
  fetch: make `--atomic` flag cover pruning of refs
  fetch: make `--atomic` flag cover backfilling of tags
  refs: add interface to iterate over queued transactional updates
  fetch: report errors when backfilling tags fails
  fetch: control lifecycle of FETCH_HEAD in a single place
  fetch: backfill tags before setting upstream
  fetch: increase test coverage of fetches

2 years agoThe tenth batch
Junio C Hamano [Wed, 9 Mar 2022 21:38:46 +0000 (13:38 -0800)] 
The tenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/help-fixes'
Junio C Hamano [Wed, 9 Mar 2022 21:38:24 +0000 (13:38 -0800)] 
Merge branch 'ab/help-fixes'

Updates to how command line options to "git help" are handled.

* ab/help-fixes:
  help: don't print "\n" before single-section output
  help: add --no-[external-commands|aliases] for use with --all
  help: error if [-a|-g|-c] and [-i|-m|-w] are combined
  help: correct usage & behavior of "git help --all"
  help: note the option name on option incompatibility
  help.c: split up list_all_cmds_help() function
  help tests: test "git" and "git help [-a|-g] spacing
  help.c: use puts() instead of printf{,_ln}() for consistency
  help doc: add missing "]" to "[-a|--all]"

2 years agoMerge branch 'ab/c99-variadic-macros'
Junio C Hamano [Wed, 9 Mar 2022 21:38:24 +0000 (13:38 -0800)] 
Merge branch 'ab/c99-variadic-macros'

Remove the escape hatch we added when we introduced the weather
balloon to use variadic macros unconditionally, to make it official
that we now have a hard dependency on the feature.

* ab/c99-variadic-macros:
  C99: remove hardcoded-out !HAVE_VARIADIC_MACROS code
  git-compat-util.h: clarify GCC v.s. C99-specific in comment

2 years agoMerge branch 'hn/reftable-no-empty-keys'
Junio C Hamano [Wed, 9 Mar 2022 21:38:24 +0000 (13:38 -0800)] 
Merge branch 'hn/reftable-no-empty-keys'

General clean-up in reftable implementation, including
clarification of the API documentation, tightening the code to
honor documented length limit, etc.

* hn/reftable-no-empty-keys:
  reftable: rename writer_stats to reftable_writer_stats
  reftable: add test for length of disambiguating prefix
  reftable: ensure that obj_id_len is >= 2 on writing
  reftable: avoid writing empty keys at the block layer
  reftable: add a test that verifies that writing empty keys fails
  reftable: reject 0 object_id_len
  Documentation: object_id_len goes up to 31

2 years agoMerge branch 'jc/cat-file-batch-commands'
Junio C Hamano [Wed, 9 Mar 2022 21:38:24 +0000 (13:38 -0800)] 
Merge branch 'jc/cat-file-batch-commands'

"git cat-file" learns "--batch-command" mode, which is a more
flexible interface than the existing "--batch" or "--batch-check"
modes, to allow different kinds of inquiries made.

* jc/cat-file-batch-commands:
  cat-file: add --batch-command mode
  cat-file: add remove_timestamp helper
  cat-file: introduce batch_mode enum to replace print_contents
  cat-file: rename cmdmode to transform_mode

2 years agoMerge branch 'pw/xdiff-alloc-fail'
Junio C Hamano [Wed, 9 Mar 2022 21:38:23 +0000 (13:38 -0800)] 
Merge branch 'pw/xdiff-alloc-fail'

Improve failure case behaviour of xdiff library when memory
allocation fails.

* pw/xdiff-alloc-fail:
  xdiff: handle allocation failure when merging
  xdiff: refactor a function
  xdiff: handle allocation failure in patience diff
  xdiff: fix a memory leak

2 years agoMerge branch 'en/present-despite-skipped'
Junio C Hamano [Wed, 9 Mar 2022 21:38:23 +0000 (13:38 -0800)] 
Merge branch 'en/present-despite-skipped'

In sparse-checkouts, files mis-marked as missing from the working tree
could lead to later problems.  Such files were hard to discover, and
harder to correct.  Automatically detecting and correcting the marking
of such files has been added to avoid these problems.

* en/present-despite-skipped:
  repo_read_index: add config to expect files outside sparse patterns
  Accelerate clear_skip_worktree_from_present_files() by caching
  Update documentation related to sparsity and the skip-worktree bit
  repo_read_index: clear SKIP_WORKTREE bit from files present in worktree
  unpack-trees: fix accidental loss of user changes
  t1011: add testcase demonstrating accidental loss of user modifications

2 years agoThe ninth batch
Junio C Hamano [Mon, 7 Mar 2022 04:44:10 +0000 (20:44 -0800)] 
The ninth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jt/ls-files-stage-recurse'
Junio C Hamano [Mon, 7 Mar 2022 05:25:33 +0000 (21:25 -0800)] 
Merge branch 'jt/ls-files-stage-recurse'

Many output modes of "ls-files" do not work with its
"--recurse-submodules" option, but the "-s" mode has been taught to
work with it.

* jt/ls-files-stage-recurse:
  ls-files: support --recurse-submodules --stage

2 years agoMerge branch 'gc/stash-on-branch-with-multi-level-name'
Junio C Hamano [Mon, 7 Mar 2022 05:25:32 +0000 (21:25 -0800)] 
Merge branch 'gc/stash-on-branch-with-multi-level-name'

"git checkout -b branch/with/multi/level/name && git stash" only
recorded the last level component of the branch name, which has
been corrected.

* gc/stash-on-branch-with-multi-level-name:
  stash: strip "refs/heads/" with skip_prefix

2 years agoMerge branch 'ah/advice-switch-requires-detach-to-detach'
Junio C Hamano [Mon, 7 Mar 2022 05:25:32 +0000 (21:25 -0800)] 
Merge branch 'ah/advice-switch-requires-detach-to-detach'

The error message given by "git switch HEAD~4" has been clarified
to suggest the "--detach" option that is required.

* ah/advice-switch-requires-detach-to-detach:
  switch: mention the --detach option when dying due to lack of a branch

2 years agoMerge branch 'ab/c99-designated-initializers'
Junio C Hamano [Mon, 7 Mar 2022 05:25:32 +0000 (21:25 -0800)] 
Merge branch 'ab/c99-designated-initializers'

Use designated initializers we started using in mid 2017 in more
parts of the codebase that are relatively quiescent.

* ab/c99-designated-initializers:
  fast-import.c: use designated initializers for "partial" struct assignments
  refspec.c: use designated initializers for "struct refspec_item"
  convert.c: use designated initializers for "struct stream_filter*"
  userdiff.c: use designated initializers for "struct userdiff_driver"
  archive-*.c: use designated initializers for "struct archiver"
  object-file: use designated initializers for "struct git_hash_algo"
  trace2: use designated initializers for "struct tr2_dst"
  trace2: use designated initializers for "struct tr2_tgt"
  imap-send.c: use designated initializers for "struct imap_server_conf"

2 years agoMerge branch 'mc/index-pack-report-max-size'
Junio C Hamano [Mon, 7 Mar 2022 05:25:32 +0000 (21:25 -0800)] 
Merge branch 'mc/index-pack-report-max-size'

When "index-pack" dies due to incoming data exceeding the maximum
allowed input size, include the value of the limit in the error
message.

* mc/index-pack-report-max-size:
  index-pack: clarify the breached limit

2 years agoMerge branch 'ac/usage-string-fixups'
Junio C Hamano [Mon, 7 Mar 2022 05:25:32 +0000 (21:25 -0800)] 
Merge branch 'ac/usage-string-fixups'

Usage-string normalization.

* ac/usage-string-fixups:
  amend remaining usage strings according to style guide

2 years agoMerge branch 'ab/test-leak-diag'
Junio C Hamano [Mon, 7 Mar 2022 05:25:31 +0000 (21:25 -0800)] 
Merge branch 'ab/test-leak-diag'

Random test-framework clean-up.

* ab/test-leak-diag:
  test-lib: add "fast_unwind_on_malloc=0" to LSAN_OPTIONS
  test-lib: make $GIT_BUILD_DIR an absolute path
  test-lib: correct and assert TEST_DIRECTORY overriding
  test-lib: add GIT_SAN_OPTIONS, inherit [AL]SAN_OPTIONS

2 years agoMerge branch 'ab/hook-tests'
Junio C Hamano [Mon, 7 Mar 2022 05:25:31 +0000 (21:25 -0800)] 
Merge branch 'ab/hook-tests'

Test modernization.

* ab/hook-tests:
  hook tests: use a modern style for "pre-push" tests
  hook tests: test for exact "pre-push" hook input

2 years agoMerge branch 'en/merge-ort-plug-leaks'
Junio C Hamano [Mon, 7 Mar 2022 05:25:31 +0000 (21:25 -0800)] 
Merge branch 'en/merge-ort-plug-leaks'

Leakfix.

* en/merge-ort-plug-leaks:
  merge-ort: fix small memory leak in unique_path()
  merge-ort: fix small memory leak in detect_and_process_renames()

2 years agoMerge branch 'ds/worktree-docs'
Junio C Hamano [Mon, 7 Mar 2022 05:25:31 +0000 (21:25 -0800)] 
Merge branch 'ds/worktree-docs'

Tighten the language around "working tree" and "worktree" in the
docs.

* ds/worktree-docs:
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: use 'worktree' over 'working tree'
  worktree: extract checkout_worktree()
  worktree: extract copy_sparse_checkout()
  worktree: extract copy_filtered_worktree_config()
  worktree: combine two translatable messages

2 years agoMerge branch 'jc/rerere-train-modernise'
Junio C Hamano [Mon, 7 Mar 2022 05:25:30 +0000 (21:25 -0800)] 
Merge branch 'jc/rerere-train-modernise'

Small modernization of the rerere-train script (in contrib/).

* jc/rerere-train-modernise:
  rerere-train: two fixes to the use of "git show -s"

2 years agoMerge branch 'rs/bisect-executable-not-found'
Junio C Hamano [Mon, 7 Mar 2022 05:25:30 +0000 (21:25 -0800)] 
Merge branch 'rs/bisect-executable-not-found'

A not-so-common mistake is to write a script to feed "git bisect
run" without making it executable, in which case all tests will
exit with 126 or 127 error codes, even on revisions that are marked
as good.  Try to recognize this situation and stop iteration early.

* rs/bisect-executable-not-found:
  bisect--helper: double-check run command on exit code 126 and 127
  bisect: document run behavior with exit codes 126 and 127
  bisect--helper: release strbuf and strvec on run error
  bisect--helper: report actual bisect_state() argument on error

2 years agoMerge branch 'en/sparse-checkout-fixes'
Junio C Hamano [Mon, 7 Mar 2022 05:25:30 +0000 (21:25 -0800)] 
Merge branch 'en/sparse-checkout-fixes'

Further polishing of "git sparse-checkout".

* en/sparse-checkout-fixes:
  sparse-checkout: reject arguments in cone-mode that look like patterns
  sparse-checkout: error or warn when given individual files
  sparse-checkout: pay attention to prefix for {set, add}
  sparse-checkout: correctly set non-cone mode when expected
  sparse-checkout: correct reapply's handling of options

2 years agoMerge branch 'cg/t3903-modernize'
Junio C Hamano [Mon, 7 Mar 2022 05:25:30 +0000 (21:25 -0800)] 
Merge branch 'cg/t3903-modernize'

Test modernization.

* cg/t3903-modernize:
  tests: make the code more readable
  tests: allow testing if a path is truly a file or a directory
  t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*

2 years agoMakefiles: add and use wildcard "mkdir -p" template
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:19 +0000 (17:04 +0100)] 
Makefiles: add and use wildcard "mkdir -p" template

Add a template to do the "mkdir -p" of $(@D) (the parent dir of $@)
for us, and use it for the "make lint-docs" targets I added in
8650c6298c1 (doc lint: make "lint-docs" non-.PHONY, 2021-10-15).

As seen in 4c64fb5aad9 (Documentation/Makefile: fix lint-docs mkdir
dependency, 2021-10-26) maintaining these manual lists of parent
directory dependencies is fragile, in addition to being obviously
verbose.

I used this pattern at the time because I couldn't find another method
than "order-only" prerequisites to avoid doing a "mkdir -p $(@D)" for
every file being created, which as noted in [1] would be significantly
slower.

But as it turns out we can use this neat trick of only doing a "mkdir
-p" if the $(wildcard) macro tells us the path doesn't exist. A re-run
of a performance test similar to that noted downthread of [1] in [2]
shows that this is faster, in addition to being less verbose and more
reliable (this uses my "git-hyperfine" thin wrapper for "hyperfine"[3]):

    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation lint-docs' -p 'rm -rf Documentation/.build' 'make -C Documentation -j1 lint-docs'
    Benchmark 1: make -C Documentation -j1 lint-docs' in 'HEAD~1
      Time (mean ± σ):      2.914 s ±  0.062 s    [User: 2.449 s, System: 0.489 s]
      Range (min … max):    2.834 s …  3.020 s    10 runs

    Benchmark 2: make -C Documentation -j1 lint-docs' in 'HEAD~0
      Time (mean ± σ):      2.315 s ±  0.062 s    [User: 1.950 s, System: 0.386 s]
      Range (min … max):    2.229 s …  2.397 s    10 runs

    Summary
      'make -C Documentation -j1 lint-docs' in 'HEAD~0' ran
        1.26 ± 0.04 times faster than 'make -C Documentation -j1 lint-docs' in 'HEAD~1'

So let's use that pattern both for the "lint-docs" target, and a few
miscellaneous other targets.

This method of creating parent directories is explicitly racy in that
we don't know if we're going to say always create a "foo" followed by
a "foo/bar" under parallelism, or skip the "foo" because we created
"foo/bar" first. In this case it doesn't matter for anything except
that we aren't guaranteed to get the same number of rules firing when
running make in parallel.

1. https://lore.kernel.org/git/211028.861r45y3pt.gmgdl@evledraar.gmail.com/
2. https://lore.kernel.org/git/211028.86o879vvtp.gmgdl@evledraar.gmail.com/
3. https://gitlab.com/avar/git-hyperfine/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: add "$(QUIET)" boilerplate to shared.mak
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:18 +0000 (17:04 +0100)] 
Makefile: add "$(QUIET)" boilerplate to shared.mak

The $(QUIET) variables we define are largely duplicated between our
various Makefiles, let's define them in the new "shared.mak" instead.

Since we're not using the environment to pass these around we don't
need to export the "QUIET_GEN" and "QUIET_BUILT_IN" variables
anymore. The "QUIET_GEN" variable is used in "git-gui/Makefile" and
"gitweb/Makefile", but they've got their own definition for those. The
"QUIET_BUILT_IN" variable is only used in the top-level "Makefile". We
still need to export the "V" variable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: move $(comma), $(empty) and $(space) to shared.mak
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:17 +0000 (17:04 +0100)] 
Makefile: move $(comma), $(empty) and $(space) to shared.mak

Move these variables over to the shared.mak, we'll make use of them in
a subsequent commit.

Note that there's reason for these to be "simply expanded variables",
i.e. to use ":=" assignments instead of lazily expanded "="
assignments. We could use "=", but let's leave this as-is for now for
ease of review.

See 425ca6710b2 (Makefile: allow combining UBSan with other
sanitizers, 2017-07-15) for the commit that introduced these.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: move ".SUFFIXES" rule to shared.mak
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:16 +0000 (17:04 +0100)] 
Makefile: move ".SUFFIXES" rule to shared.mak

This was added in 30248886ce8 (Makefile: disable default implicit
rules, 2010-01-26), let's move it to the top of "shared.mak" so it'll
apply to all our Makefiles.

This doesn't benefit the main Makefile at all, since it already had
the rule, but since we're including shared.mak in other Makefiles
starts to benefit them. E.g. running the 'man" target is now faster:

    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make -C Documentation man' 'make -C Documentation -j1 man'
    Benchmark 1: make -C Documentation -j1 man' in 'HEAD~1
      Time (mean ± σ):     121.7 ms ±   8.8 ms    [User: 105.8 ms, System: 18.6 ms]
      Range (min … max):   112.8 ms … 148.4 ms    26 runs

    Benchmark 2: make -C Documentation -j1 man' in 'HEAD~0
      Time (mean ± σ):      97.5 ms ±   8.0 ms    [User: 80.1 ms, System: 20.1 ms]
      Range (min … max):    89.8 ms … 111.8 ms    32 runs

    Summary
      'make -C Documentation -j1 man' in 'HEAD~0' ran
        1.25 ± 0.14 times faster than 'make -C Documentation -j1 man' in 'HEAD~1'

The reason for that can be seen when comparing that run with
"--debug=a". Without this change making a target like "git-status.1"
will cause "make" to consider not only "git-status.txt", but
"git-status.txt.o", as well as numerous other implicit suffixes such
as ".c", ".cc", ".cpp" etc. See [1] for a more detailed before/after
example.

So this is causing us to omit a bunch of work we didn't need to
do. For making "git-status.1" the "--debug=a" output is reduced from
~140k lines to ~6k.

1. https://lore.kernel.org/git/220222.86bkyz875k.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:15 +0000 (17:04 +0100)] 
Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)

Combine the definitions of $(FIND_SOURCE_FILES) and $(LIB_H) to speed
up the Makefile, as these are the two main expensive $(shell) commands
that we execute unconditionally.

When see what was in $(FOUND_SOURCE_FILES) that wasn't in $(LIB_H) via
the ad-hoc test of:

    $(error $(filter-out $(LIB_H),$(filter %.h,$(ALL_SOURCE_FILES))))
    $(error $(filter-out $(ALL_SOURCE_FILES),$(filter %.h,$(LIB_H))))

We'll get, respectively:

    Makefile:850: *** t/helper/test-tool.h.  Stop.
    Makefile:850: *** .  Stop.

I.e. we only had a discrepancy when it came to
t/helper/test-tool.h. In terms of correctness this was broken before,
but now works:

    $ make t/helper/test-tool.hco
        HDR t/helper/test-tool.h

This speeds things up a lot:

    $ git -c hyperfine.hook.setup= hyperfine -L rev HEAD~1,HEAD~0 -s 'make NO_TCLTK=Y' 'make -j1 NO_TCLTK=Y' --warmup 10 -M 10
    Benchmark 1: make -j1 NO_TCLTK=Y' in 'HEAD~1
      Time (mean ± σ):     159.9 ms ±   6.8 ms    [User: 137.2 ms, System: 28.0 ms]
      Range (min … max):   154.6 ms … 175.9 ms    10 runs

    Benchmark 2: make -j1 NO_TCLTK=Y' in 'HEAD~0
      Time (mean ± σ):     100.0 ms ±   1.3 ms    [User: 84.2 ms, System: 20.2 ms]
      Range (min … max):    98.8 ms … 102.8 ms    10 runs

    Summary
      'make -j1 NO_TCLTK=Y' in 'HEAD~0' ran
        1.60 ± 0.07 times faster than 'make -j1 NO_TCLTK=Y' in 'HEAD~1'

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: disable GNU make built-in wildcard rules
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:14 +0000 (17:04 +0100)] 
Makefile: disable GNU make built-in wildcard rules

Override built-in rules of GNU make that use a wildcard target. This
can speeds things up significantly as we don't need to stat() so many
files. GNU make does that by default to see if it can retrieve their
contents from RCS or SCCS. See [1] for an old mailing list discussion
about how to disable these.

The speed-up may vary. I've seen 1-10% depending on the speed of the
local disk, caches, -jN etc. Running:

    strace -f -c -S calls make -j1 NO_TCLTK=Y

Shows that we reduce the number of syscalls we make, mostly in "stat"
calls.

We could also invoke make with "-r" by setting "MAKEFLAGS = -r"
early. Doing so might make us a bit faster still. But doing so is a
much bigger hammer, since it will disable all built-in rules,
some (all?) of which can be seen with:

    make -f/dev/null -p | grep -v -e ^# -e ^$

We may have something that relies on them, so let's go for the more
isolated optimization here that gives us most or all of the wins.

1. https://lists.gnu.org/archive/html/help-make/2002-11/msg00063.html

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:13 +0000 (17:04 +0100)] 
Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it

We have various behavior that's shared across our Makefiles, or that
really should be (e.g. via defined templates). Let's create a
top-level "shared.mak" to house those sorts of things, and start by
adding the ".DELETE_ON_ERROR" flag to it.

See my own 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR"
flag, 2021-06-29) and db10fc6c09f (doc: simplify Makefile using
.DELETE_ON_ERROR, 2021-05-21) for the addition and use of the
".DELETE_ON_ERROR" flag.

I.e. this changes the behavior of existing rules in the altered
Makefiles (except "Makefile" & "Documentation/Makefile"). I'm
confident that this is safe having read the relevant rules in those
Makfiles, and as the GNU make manual notes that it isn't the default
behavior is out of an abundance of backwards compatibility
caution. From edition 0.75 of its manual, covering GNU make 4.3:

    [Enabling '.DELETE_ON_ERROR' is] almost always what you want
    'make' to do, but it is not historical practice; so for
    compatibility, you must explicitly request it.

This doesn't introduce a bug by e.g. having this
".DELETE_ON_ERROR" flag only apply to this new shared.mak, Makefiles
have no such scoping semantics.

It does increase the danger that any Makefile without an explicit "The
default target of this Makefile is..." snippet to define the default
target as "all" could have its default rule changed if our new
shared.mak ever defines a "real" rule. In subsequent commits we'll be
careful not to do that, and such breakage would be obvious e.g. in the
case of "make -C t".

We might want to make that less fragile still (e.g. by using
".DEFAULT_GOAL" as noted in the preceding commit), but for now let's
simply include "shared.mak" without adding that boilerplate to all the
Makefiles that don't have it already. Most of those are already
exposed to that potential caveat e.g. due to including "config.mak*".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoscalar Makefile: use "The default target of..." pattern
Ævar Arnfjörð Bjarmason [Thu, 3 Mar 2022 16:04:12 +0000 (17:04 +0100)] 
scalar Makefile: use "The default target of..." pattern

Make the "contrib/scalar/Makefile" be stylistically consistent with
the top-level "Makefile" in first declaring "all" to be the default
rule, followed by including other Makefile snippets.

This adjusts code added in 0a43fb22026 (scalar: create a rudimentary
executable, 2021-12-03), it further ensures that when we add another
"include" file in a subsequent commit that the included file won't be
the one to define our default target.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorepo_read_index: add config to expect files outside sparse patterns
Elijah Newren [Sat, 26 Feb 2022 06:12:22 +0000 (22:12 -0800)] 
repo_read_index: add config to expect files outside sparse patterns

Typically with sparse checkouts, we expect files outside the sparsity
patterns to be marked as SKIP_WORKTREE and be missing from the working
tree.  Sometimes this expectation would be violated however; including
in cases such as:
  * users grabbing files from elsewhere and writing them to the worktree
    (perhaps by editing a cached copy in an editor, copying/renaming, or
     even untarring)
  * various git commands having incomplete or no support for the
    SKIP_WORKTREE bit[1,2]
  * users attempting to "abort" a sparse-checkout operation with a
    not-so-early Ctrl+C (updating $GIT_DIR/info/sparse-checkout and the
    working tree is not atomic)[3].
When the SKIP_WORKTREE bit in the index did not reflect the presence of
the file in the working tree, it traditionally caused confusion and was
difficult to detect and recover from.  So, in a sparse checkout, since
af6a51875a (repo_read_index: clear SKIP_WORKTREE bit from files present
in worktree, 2022-01-14), Git automatically clears the SKIP_WORKTREE
bit at index read time for entries corresponding to files that are
present in the working tree.

There is another workflow, however, where it is expected that paths
outside the sparsity patterns appear to exist in the working tree and
that they do not lose the SKIP_WORKTREE bit, at least until they get
modified.  A Git-aware virtual file system[4] takes advantage of its
position as a file system driver to expose all files in the working
tree, fetch them on demand using partial clone on access, and tell Git
to pay attention to them on demand by updating the sparse checkout
pattern on writes.  This means that commands like "git status" only have
to examine files that have potentially been modified, whereas commands
like "ls" are able to show the entire codebase without requiring manual
updates to the sparse checkout pattern.

Thus since af6a51875a, Git with such Git-aware virtual file systems
unsets the SKIP_WORKTREE bit for all files and commands like "git
status" have to fetch and examine them all.

Introduce a configuration setting sparse.expectFilesOutsideOfPatterns to
allow limiting the tracked set of files to a small set once again.  A
Git-aware virtual file system or other application that wants to
maintain files outside of the sparse checkout can set this in a
repository to instruct Git not to check for the presence of
SKIP_WORKTREE files.  The setting defaults to false, so most users of
sparse checkout will still get the benefit of an automatically updating
index to recover from the variety of difficult issues detailed in
af6a51875a for paths with SKIP_WORKTREE set despite the path being
present.

[1] https://lore.kernel.org/git/xmqqbmb1a7ga.fsf@gitster-ct.c.googlers.com/
[2] The three long paragraphs in the middle of
    https://lore.kernel.org/git/CABPp-BH9tju7WVm=QZDOvaMDdZbpNXrVWQdN-jmfN8wC6YVhmw@mail.gmail.com/
[3] https://lore.kernel.org/git/CABPp-BFnFpzwGC11TLoLs8YK5yiisA5D5-fFjXnJsbESVDwZsA@mail.gmail.com/
[4] such as the vfsd described in
https://lore.kernel.org/git/20220207190320.2960362-1-jonathantanmy@google.com/

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomerge-ort: exclude messages from inner merges by default
Elijah Newren [Wed, 2 Mar 2022 04:19:21 +0000 (04:19 +0000)] 
merge-ort: exclude messages from inner merges by default

merge-recursive would only report messages from inner merges when the
GIT_MERGE_VERBOSITY was set to 5.  Do the same for merge-ort.

Note that somewhat reverts 0d83d8240d ("merge-ort: mark conflict/warning
messages from inner merges as omittable", 2022-02-02) based on two
facts:

  * This commit basically removes the showing of messages from inner
    merges as well, at least by default.  The only difference is that
    users can request to get them back by turning up the verbosity.
  * Messages from inner merges are specially annotated since 4a3d86e1bb
    ("merge-ort: make informational messages from recursive merges
    clearer", 2022-02-17).  The ability to distinguish them from outer
    merge comments make them less problematic to include, and easier
    for humans to parse.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocheckout, clone: die if tree cannot be parsed
Glen Choo [Wed, 2 Mar 2022 00:36:13 +0000 (16:36 -0800)] 
checkout, clone: die if tree cannot be parsed

When a tree oid is invalid, parse_tree_indirect() can return NULL. Check
for NULL instead of proceeding as though it were a valid pointer and
segfaulting.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotest-lib: add "fast_unwind_on_malloc=0" to LSAN_OPTIONS
Ævar Arnfjörð Bjarmason [Sun, 27 Feb 2022 10:25:13 +0000 (11:25 +0100)] 
test-lib: add "fast_unwind_on_malloc=0" to LSAN_OPTIONS

Add "fast_unwind_on_malloc=0" to LSAN_OPTIONS to get more meaningful
stack traces from LSAN. This isn't required under ASAN which will emit
traces such as this one for a leak in "t/t0006-date.sh":

    $ ASAN_OPTIONS=detect_leaks=1 ./t0006-date.sh -vixd
    [...]
    Direct leak of 3 byte(s) in 1 object(s) allocated from:
        #0 0x488b94 in strdup (t/helper/test-tool+0x488b94)
        #1 0x9444a4 in xstrdup wrapper.c:29:14
        #2 0x5995fa in parse_date_format date.c:991:24
        #3 0x4d2056 in show_dates t/helper/test-date.c:39:2
        #4 0x4d174a in cmd__date t/helper/test-date.c:116:3
        #5 0x4cce89 in cmd_main t/helper/test-tool.c:127:11
        #6 0x4cd1e3 in main common-main.c:52:11
        #7 0x7fef3c695e49 in __libc_start_main csu/../csu/libc-start.c:314:16
        #8 0x422b09 in _start (t/helper/test-tool+0x422b09)

    SUMMARY: AddressSanitizer: 3 byte(s) leaked in 1 allocation(s).
    Aborted

Whereas LSAN would emit this instead:

    $ ./t0006-date.sh -vixd
    [...]
    Direct leak of 3 byte(s) in 1 object(s) allocated from:
        #0 0x4323b8 in malloc (t/helper/test-tool+0x4323b8)
        #1 0x7f2be1d614aa in strdup string/strdup.c:42:15

    SUMMARY: LeakSanitizer: 3 byte(s) leaked in 1 allocation(s).
    Aborted

Now we'll instead git this sensible stack trace under
LSAN. I.e. almost the same one (but starting with "malloc", as is
usual for LSAN) as under ASAN:

    Direct leak of 3 byte(s) in 1 object(s) allocated from:
        #0 0x4323b8 in malloc (t/helper/test-tool+0x4323b8)
        #1 0x7f012af5c4aa in strdup string/strdup.c:42:15
        #2 0x5cb164 in xstrdup wrapper.c:29:14
        #3 0x495ee9 in parse_date_format date.c:991:24
        #4 0x453aac in show_dates t/helper/test-date.c:39:2
        #5 0x453782 in cmd__date t/helper/test-date.c:116:3
        #6 0x451d95 in cmd_main t/helper/test-tool.c:127:11
        #7 0x451f1e in main common-main.c:52:11
        #8 0x7f012aef5e49 in __libc_start_main csu/../csu/libc-start.c:314:16
        #9 0x42e0a9 in _start (t/helper/test-tool+0x42e0a9)

    SUMMARY: LeakSanitizer: 3 byte(s) leaked in 1 allocation(s).
    Aborted

As the option name suggests this does make things slower, e.g. for
t0001-init.sh we're around 10% slower:

    $ hyperfine -L v 0,1 'LSAN_OPTIONS=fast_unwind_on_malloc={v} make T=t0001-init.sh' -r 3
    Benchmark 1: LSAN_OPTIONS=fast_unwind_on_malloc=0 make T=t0001-init.sh
      Time (mean ± σ):      2.135 s ±  0.015 s    [User: 1.951 s, System: 0.554 s]
      Range (min … max):    2.122 s …  2.152 s    3 runs

    Benchmark 2: LSAN_OPTIONS=fast_unwind_on_malloc=1 make T=t0001-init.sh
      Time (mean ± σ):      1.981 s ±  0.055 s    [User: 1.769 s, System: 0.488 s]
      Range (min … max):    1.941 s …  2.044 s    3 runs

    Summary
      'LSAN_OPTIONS=fast_unwind_on_malloc=1 make T=t0001-init.sh' ran
        1.08 ± 0.03 times faster than 'LSAN_OPTIONS=fast_unwind_on_malloc=0 make T=t0001-init.sh'

I think that's more than worth it to get the more meaningful stack
traces, we can always provide LSAN_OPTIONS=fast_unwind_on_malloc=0 for
one-off "fast" runs.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotest-lib: make $GIT_BUILD_DIR an absolute path
Ævar Arnfjörð Bjarmason [Sun, 27 Feb 2022 10:25:12 +0000 (11:25 +0100)] 
test-lib: make $GIT_BUILD_DIR an absolute path

Change the GIT_BUILD_DIR from a path like "/path/to/build/t/.." to
"/path/to/build". The "TEST_DIRECTORY" here is already made an
absolute path a few lines above this.

We could simply do $(cd "$TEST_DIRECTORY"/.." && pwd) here, but as
noted in the preceding commit the "$TEST_DIRECTORY" can't be anything
except the path containing this test-lib.sh file at this point, so we
can more cheaply and equally strip the "/t" off the end.

This change will be helpful to LSAN_OPTIONS which will want to strip
the build directory path from filenames, which we couldn't do if we
had a "/.." in there.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotest-lib: correct and assert TEST_DIRECTORY overriding
Ævar Arnfjörð Bjarmason [Sun, 27 Feb 2022 10:25:11 +0000 (11:25 +0100)] 
test-lib: correct and assert TEST_DIRECTORY overriding

Correct a misleading comment added by me in 62f539043c7 (test-lib:
Allow overriding of TEST_DIRECTORY, 2010-08-19), and add an assertion
that TEST_DIRECTORY cannot point to any directory except the "t"
directory in the top-level of git.git.

This assertion is in effect not new, since we'd already die if that
wasn't the case[1], but it and the updated commentary help to make
that clearer.

The existing comments were also on the wrong arms of the
"if". I.e. the "allow tests to override this" was on the "test -z"
arm. That came about due to a combination of 62f539043c7 and
85176d72513 (test-lib.sh: convert $TEST_DIRECTORY to an absolute path,
2013-11-17).

Those earlier comments could be read as allowing the "$TEST_DIRECTORY"
to be some path outside of t/. As explained in the updated comment
that's impossible, rather it was meant for *tests* that ran outside of
t/, i.e. the "t0000-basic.sh" tests that use "lib-subtest.sh".

Those tests have a different working directory, but they set the
"TEST_DIRECTORY" to the same path for bootstrapping. The comments now
reflect that, and further comment on why we have a hard dependency on
this.

1. https://lore.kernel.org/git/220222.86o82z8als.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotest-lib: add GIT_SAN_OPTIONS, inherit [AL]SAN_OPTIONS
Ævar Arnfjörð Bjarmason [Sun, 27 Feb 2022 10:25:10 +0000 (11:25 +0100)] 
test-lib: add GIT_SAN_OPTIONS, inherit [AL]SAN_OPTIONS

Change our ASAN_OPTIONS and LSAN_OPTIONS to set defaults for those
variables, rather than punting out entirely if we already have them in
the environment.

We want to take any user-provided settings over our own, but we can do
that by prepending our defaults to the variable. The libsanitizer
options parsing has "last option wins" semantics.

It's now possible to do e.g.:

    LSAN_OPTIONS=report_objects=1 ./t0006-date.sh

And not have the "report_objects=1" setting overwrite our sensible
default of "abort_on_error=1", but by prepending to the list we ensure
that:

    LSAN_OPTIONS=report_objects=1:abort_on_error=0 ./t0006-date.sh

Will take the desired "abort_on_error=0" over our default.

See b0f4c9087e1 (t: support clang/gcc AddressSanitizer, 2014-12-08)
for the original pattern being altered here, and
85b81b35ff9 (test-lib: set LSAN_OPTIONS to abort by default,
2017-09-05) for when LSAN_OPTIONS was added in addition to the
then-existing ASAN_OPTIONS.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorerere-train: two fixes to the use of "git show -s"
Junio C Hamano [Sun, 27 Feb 2022 22:09:24 +0000 (14:09 -0800)] 
rerere-train: two fixes to the use of "git show -s"

The script uses "git show -s" to display the title of the merge
commit being studied, without explicitly disabling the pager, which
is not a safe thing to do in a script.

For example, when the pager is set to "less" with "-SF" options (-S
tells the pager not to fold lines but allow horizontal scrolling to
show the overly long lines, -F tells the pager not to wait if the
output in its entirety is shown on a single page), and the title of
the merge commit is longer than the width of the terminal, the pager
will wait until the end-user tells it to quit after showing the
single line.

Explicitly disable the pager with this "git show" invocation to fix
this.

The command uses the "--pretty=format:..." format, which adds LF in
between each pair of commits it outputs, which means that the label
for the merge being learned from will be followed by the next
message on the same line.  "--pretty=tformat:..." is what we should
instead, which adds LF after each commit, or a more modern way to
spell it, i.e. "--format=...".  This existing breakage becomes
easier to see, now we no longer use the pager.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoswitch: mention the --detach option when dying due to lack of a branch
Alex Henrie [Sat, 26 Feb 2022 06:12:13 +0000 (23:12 -0700)] 
switch: mention the --detach option when dying due to lack of a branch

Users who are accustomed to doing `git checkout <tag>` assume that
`git switch <tag>` will do the same thing. Inform them of the --detach
option so they aren't left wondering why `git switch` doesn't work but
`git checkout` does.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoThe eighth batch
Junio C Hamano [Fri, 25 Feb 2022 23:47:20 +0000 (15:47 -0800)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'tb/coc-plc-update'
Junio C Hamano [Fri, 25 Feb 2022 23:47:38 +0000 (15:47 -0800)] 
Merge branch 'tb/coc-plc-update'

Document Taylor as a new member of Git PLC at SFC.  Welcome.

* tb/coc-plc-update:
  CODE_OF_CONDUCT.md: update PLC members list

2 years agoMerge branch 'en/ort-inner-merge-conflict-report'
Junio C Hamano [Fri, 25 Feb 2022 23:47:38 +0000 (15:47 -0800)] 
Merge branch 'en/ort-inner-merge-conflict-report'

Messages "ort" merge backend prepares while dealing with conflicted
paths were unnecessarily confusing since it did not differentiate
inner merges and outer merges.

* en/ort-inner-merge-conflict-report:
  merge-ort: make informational messages from recursive merges clearer

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 agofast-import.c: use designated initializers for "partial" struct assignments
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:07 +0000 (10:33 +0100)] 
fast-import.c: use designated initializers for "partial" struct assignments

Change a few existing non-designated initializer assignments to use
"partial" designated initializer assignments. I.e. we're now omitting
the "NULL" or "0" fields and letting the initializer take care of them
for us.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorefspec.c: use designated initializers for "struct refspec_item"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:05 +0000 (10:33 +0100)] 
refspec.c: use designated initializers for "struct refspec_item"

Change the "struct refspec_item" at the top of refspec.c to use
designated initializers. Let's keep the "= 0" assignments for
self-documentation purposes, even though they're now redundant.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoconvert.c: use designated initializers for "struct stream_filter*"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:04 +0000 (10:33 +0100)] 
convert.c: use designated initializers for "struct stream_filter*"

Change the "struct stream_filter_vtbl" and "struct stream_filter"
assignments in convert.c to use designated initializers.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agouserdiff.c: use designated initializers for "struct userdiff_driver"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:03 +0000 (10:33 +0100)] 
userdiff.c: use designated initializers for "struct userdiff_driver"

Change the "struct userdiff_driver" assignmentns to use designated
initializers, but let's keep the PATTERNS() and IPATTERN() convenience
macros to avoid churn, but have them defined in terms of designated
initializers.

For the "driver_true" and "driver_false" let's have the compiler
implicitly initialize most of the fields, but let's leave a redundant
".binary = 0" for "driver_true" to make it obvious that it's the
opposite of the the ".binary = 1" for "driver_false".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoarchive-*.c: use designated initializers for "struct archiver"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:02 +0000 (10:33 +0100)] 
archive-*.c: use designated initializers for "struct archiver"

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoobject-file: use designated initializers for "struct git_hash_algo"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:01 +0000 (10:33 +0100)] 
object-file: use designated initializers for "struct git_hash_algo"

As with the preceding commit, change another file-level struct
assignment to use designated initializers.

Retain the ".name = NULL" etc. in the case of the first element of
"unknown hash algorithm", to make it explicit that we're intentionally
not setting those, it's not just that we forgot.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotrace2: use designated initializers for "struct tr2_dst"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:33:00 +0000 (10:33 +0100)] 
trace2: use designated initializers for "struct tr2_dst"

Convert the "static struct tr2_dst" assignments in trace2/* to use
designated initializers. I don't think it improves readability to
include the explicit 0-ing out of the
fd/initialized/need_close/too_many_files members, so let's have those
be initialized implicitly by the compiler.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotrace2: use designated initializers for "struct tr2_tgt"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:32:59 +0000 (10:32 +0100)] 
trace2: use designated initializers for "struct tr2_tgt"

As with the preceding commit, change another set of file-level struct
assignments to use designated initializers.

As before the "= NULL" assignments are redundant, but we're keeping
them for self-documentation purposes. The comments left to explain the
pre-image can now be removed in favor of working code that relays the
same information to the reader.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoimap-send.c: use designated initializers for "struct imap_server_conf"
Ævar Arnfjörð Bjarmason [Thu, 24 Feb 2022 09:32:56 +0000 (10:32 +0100)] 
imap-send.c: use designated initializers for "struct imap_server_conf"

Cut down a lot on the verbosity of the "server" assignment in
imap-send.c using designated initializers, only the "ssl_verify"
member was being set to a non-NULL non-0 value.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agostash: strip "refs/heads/" with skip_prefix
Glen Choo [Mon, 24 Jan 2022 20:53:42 +0000 (12:53 -0800)] 
stash: strip "refs/heads/" with skip_prefix

When generating a message for a stash, "git stash" only records the
part of the branch name to the right of the last "/". e.g. if HEAD is at
"foo/bar/baz", "git stash" generates a message prefixed with "WIP on
baz:" instead of "WIP on foo/bar/baz:".

Fix this by using skip_prefix() to skip "refs/heads/" instead of looking
for the last instance of "/".

Reported-by: Kraymer <kraymer@gmail.com>
Reported-by: Daniel Hahler <git@thequod.de>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoindex-pack: clarify the breached limit
Matt Cooper [Thu, 24 Feb 2022 00:07:20 +0000 (00:07 +0000)] 
index-pack: clarify the breached limit

As a small courtesy to users, report what limit was breached. This
is especially useful when a push exceeds a server-defined limit, since
the user is unlikely to have configured the limit (their host did).
Also demonstrate the human-readable message in a test.

Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agols-files: support --recurse-submodules --stage
Jonathan Tan [Thu, 24 Feb 2022 00:23:03 +0000 (16:23 -0800)] 
ls-files: support --recurse-submodules --stage

e77aa336f1 ("ls-files: optionally recurse into submodules", 2016-10-10)
taught ls-files the --recurse-submodules argument, but only in a limited
set of circumstances. In particular, --stage was unsupported, perhaps
because there was no repo_find_unique_abbrev(), which was only
introduced in 8bb95572b0 ("sha1-name.c: add
repo_find_unique_abbrev_r()", 2019-04-16). This function is needed for
using --recurse-submodules with --stage.

Now that we have repo_find_unique_abbrev(), teach support for this
combination of arguments.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotests: make the code more readable
COGONI Guillaume [Tue, 22 Feb 2022 21:54:30 +0000 (22:54 +0100)] 
tests: make the code more readable

Replace the parsing of the output of "ls -l" by test_path_is_symlink() and
test_readlink().

Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com>
Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotests: allow testing if a path is truly a file or a directory
COGONI Guillaume [Tue, 22 Feb 2022 21:54:29 +0000 (22:54 +0100)] 
tests: allow testing if a path is truly a file or a directory

Add test_path_is_file_not_symlink(), test_path_is_dir_not_symlink()
and test_path_is_symlink(). Case of use for the first one
in test t/t3903-stash.sh to replace "test -f" because that function
explicitly want the file not to be a symlink.
Give more friendly error message.

Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com>
Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot/t3903-stash.sh: replace test [-d|-f] with test_path_is_*
COGONI Guillaume [Tue, 22 Feb 2022 21:54:28 +0000 (22:54 +0100)] 
t/t3903-stash.sh: replace test [-d|-f] with test_path_is_*

Use test_path_is_* to replace test [-d|-f] because that give more
explicit debugging information. And it doesn't change the semantics.

Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com>
Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoamend remaining usage strings according to style guide
Abhradeep Chakraborty [Wed, 23 Feb 2022 14:27:34 +0000 (14:27 +0000)] 
amend remaining usage strings according to style guide

Usage strings for git (sub)command flags has a style guide that
suggests - first letter should not capitalized (unless required)
and it should skip full-stop at the end of line. But there are
some files where usage-strings do not follow the above mentioned
guide.

Amend the usage strings that don't follow the style convention/guide.

Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp: don't print "\n" before single-section output
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:52 +0000 (20:38 +0100)] 
help: don't print "\n" before single-section output

Fix a formatting regression in 1b81d8cb19d (help: use command-list.txt
for the source of guides, 2018-05-20). Adjust the output of "git help
--guides" and any other future single-section commands so that a
newline isn't inserted before the only section being printed.

This changes the output from:

    $ git help --guides

    The Git concept guides are:
    [...]

To:

    $ git help --guides
    The Git concept guides are:
    [...]

That we started printing an extra "\n" in 1b81d8cb19d wasn't intended,
but an emergent effect of moving all of the printing of "git help"
output to code that was ready to handle printing N sections.

With 1b81d8cb19d we started using the "print_cmd_by_category()"
function added earlier in the same series, or in cfb22a02ab5 (help:
use command-list.h for common command list, 2018-05-10).

Fixing this formatting nit is easy enough. Let's have all of the
output that would like to be "\n"-separated from other lines emit its
own "\n". We then adjust "print_cmd_by_category()" to only print a
"\n" to delimit the sections it's printing out.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp: add --no-[external-commands|aliases] for use with --all
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:51 +0000 (20:38 +0100)] 
help: add --no-[external-commands|aliases] for use with --all

Add the ability to only emit git's own usage information under
--all. This also allows us to extend the "test_section_spacing" tests
added in a preceding commit to test "git help --all"
output.

Previously we could not do that, as the tests might find a git-*
command in the "$PATH", which would make the output differ from one
setup to another.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp: error if [-a|-g|-c] and [-i|-m|-w] are combined
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:50 +0000 (20:38 +0100)] 
help: error if [-a|-g|-c] and [-i|-m|-w] are combined

Add more sanity checking to "git help" usage by erroring out if these
man viewer options are combined with incompatible command-modes that
will never use these documentation viewers.

This continues the work started in d35d03cf93e (help: simplify by
moving to OPT_CMDMODE(), 2021-09-22) of adding more sanity checking to
"git help". Doing this allows us to clarify the "SYNOPSIS" in the
documentation, and the "git help -h" output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp: correct usage & behavior of "git help --all"
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:49 +0000 (20:38 +0100)] 
help: correct usage & behavior of "git help --all"

Do the same for the "--all" option that I did for "--guides" in
9856ea6785c (help: correct usage & behavior of "git help --guides",
2021-09-22). I.e. we've documented it as ignoring non-option
arguments, let's have it error out instead.

As with other changes made in 62f035aee3f (Merge branch
'ab/help-config-vars', 2021-10-13) this is technically a change in
behavior, but in practice it's just a bug fix. We were ignoring this
before, but by erroring we can simplify our documentation and
synopsis, as well as avoid user confusion as they wonder what the
difference between e.g. "git help --all" and "git help --all status"
is (there wasn't any difference).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp: note the option name on option incompatibility
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:48 +0000 (20:38 +0100)] 
help: note the option name on option incompatibility

Change the errors added in d35d03cf93e (help: simplify by moving to
OPT_CMDMODE(), 2021-09-22) to quote the offending option at the user
when invoked as e.g.:

    git help --guides garbage

Now instead of:

    fatal: this option doesn't take any other arguments

We'll emit:

    fatal: the '--guides' option doesn't take any non-option arguments

Let's also rename the function, as it will be extended to do other
checks that aren't "no extra argc" in a subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp.c: split up list_all_cmds_help() function
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:47 +0000 (20:38 +0100)] 
help.c: split up list_all_cmds_help() function

Split up the listing of commands and aliases from
list_all_cmds_help(). This will make a subsequent functional change
smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp tests: test "git" and "git help [-a|-g] spacing
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:46 +0000 (20:38 +0100)] 
help tests: test "git" and "git help [-a|-g] spacing

There's logic in "help.c"'s "print_cmd_by_category()" to emit "help"
output with particular spacing, which doesn't make much sense when
emitting only one section with "help -g".

Let's add tests for the current spacing in preparation for a
subsequent whitespace formatting fix, and make sure that that fix
doesn't cause regressions for the "git" and "git help" output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp.c: use puts() instead of printf{,_ln}() for consistency
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:45 +0000 (20:38 +0100)] 
help.c: use puts() instead of printf{,_ln}() for consistency

Change code in "help.c" that used printf_ln() without format
specifiers to use puts() instead, as other existing code in the file
does. Let's also change related code to use puts() instead of the
equivalent of calling "printf" with a "%s\n" format.

This formatting-only change will make a subsequent functional change
easier to read, as it'll be changing code that's consistently using
the same functions to do the same things.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohelp doc: add missing "]" to "[-a|--all]"
Ævar Arnfjörð Bjarmason [Mon, 21 Feb 2022 19:38:44 +0000 (20:38 +0100)] 
help doc: add missing "]" to "[-a|--all]"

Add a missing "]" to documentation added in 63eae83f8f3 (help: add "-a
--verbose" to list all commands with synopsis, 2018-05-20). This made
it seem as though "--[no-]verbose" can only be provided with "--all",
not "-a". The corresponding usage information in the C
code ("builtin_help_usage") does not have the same problem.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: rename writer_stats to reftable_writer_stats
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:10 +0000 (18:46 +0000)] 
reftable: rename writer_stats to reftable_writer_stats

This function is part of the reftable API, so it should use the
reftable_ prefix

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: add test for length of disambiguating prefix
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:09 +0000 (18:46 +0000)] 
reftable: add test for length of disambiguating prefix

The ID => ref map is trimming object IDs to a disambiguating prefix.
Check that we are computing their length correctly.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: ensure that obj_id_len is >= 2 on writing
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:08 +0000 (18:46 +0000)] 
reftable: ensure that obj_id_len is >= 2 on writing

When writing the same hash many times, we might decide to use a
length-1 object ID prefix for the ObjectID => ref table, which is out
of spec.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: avoid writing empty keys at the block layer
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:07 +0000 (18:46 +0000)] 
reftable: avoid writing empty keys at the block layer

The public interface (reftable_writer) already ensures that keys are
written in strictly increasing order, and an empty key by definition
fails this check.

However, by also enforcing this at the block layer, it is easier to
verify that records (which are written into blocks) never have to
consider the possibility of empty keys.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: add a test that verifies that writing empty keys fails
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:06 +0000 (18:46 +0000)] 
reftable: add a test that verifies that writing empty keys fails

Empty keys can only be written as ref records with empty names. The
log record has a logical timestamp in the key, so the key is never
empty.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreftable: reject 0 object_id_len
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:05 +0000 (18:46 +0000)] 
reftable: reject 0 object_id_len

The spec says 2 <= object_id_len <= 31. We are lenient and allow 1,
but we forbid 0, so we can be sure that we never read a 0-length key.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoDocumentation: object_id_len goes up to 31
Han-Wen Nienhuys [Mon, 21 Feb 2022 18:46:04 +0000 (18:46 +0000)] 
Documentation: object_id_len goes up to 31

The value is stored in a 5-bit field, so we can't support more without
a format version upgrade.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoworktree: use 'worktree' over 'working tree'
Derrick Stolee [Wed, 23 Feb 2022 14:29:19 +0000 (14:29 +0000)] 
worktree: use 'worktree' over 'working tree'

It is helpful to distinguish between a 'working tree' and a 'worktree'.
A worktree contains a working tree plus additional metadata. This
metadata includes per-worktree refs and worktree-specific config.

This is the last of multiple changes to git-worktree.txt, starting at
the LIST OUTPUT FORMAT section.

The EXAMPLES section has an instance of "working tree" that must stay as
it is, because it is not talking about a worktree, but an example of why
a user might want to create a worktree.

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoworktree: use 'worktree' over 'working tree'
Derrick Stolee [Wed, 23 Feb 2022 14:29:18 +0000 (14:29 +0000)] 
worktree: use 'worktree' over 'working tree'

It is helpful to distinguish between a 'working tree' and a 'worktree'.
A worktree contains a working tree plus additional metadata. This
metadata includes per-worktree refs and worktree-specific config.

This is the sixth of multiple changes to git-worktree.txt, restricted to
the DETAILS section.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoworktree: use 'worktree' over 'working tree'
Derrick Stolee [Wed, 23 Feb 2022 14:29:17 +0000 (14:29 +0000)] 
worktree: use 'worktree' over 'working tree'

It is helpful to distinguish between a 'working tree' and a 'worktree'.
A worktree contains a working tree plus additional metadata. This
metadata includes per-worktree refs and worktree-specific config.

This is the fifth of multiple changes to git-worktree.txt, restricted to
the CONFIGURATION FILE section.

While here, clear up some language to improve readability.

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>