]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agogenerate-cmdlist.sh: don't call get_categories() from category_list()
Ævar Arnfjörð Bjarmason [Fri, 5 Nov 2021 14:08:02 +0000 (15:08 +0100)] 
generate-cmdlist.sh: don't call get_categories() from category_list()

This isn't for optimization as the get_categories() is a purely shell
function, but rather for ease of readability, let's just inline these
two lines. We'll be changing this code some more in subsequent commits
to make this worth it.

Rename the get_categories() function to get_category_line(), since
that's what it's doing now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogenerate-cmdlist.sh: spawn fewer processes
Johannes Sixt [Fri, 5 Nov 2021 14:08:01 +0000 (15:08 +0100)] 
generate-cmdlist.sh: spawn fewer processes

The function get_categories() is invoked in a loop over all commands.
As it runs several processes, this takes an awful lot of time on
Windows. To reduce the number of processes, move the process that
filters empty lines to the other invoker of the function, where it is
needed. The invocation of get_categories() in the loop does not need
the empty line filtered away because the result is word-split by the
shell, which eliminates the empty line automatically.

Furthermore, use sort -u instead of sort | uniq to remove yet another
process.

[Ævar: on Linux this seems to speed things up a bit, although with
hyperfine(1) the results are fuzzy enough to land within the
confidence interval]:

$ git show HEAD~:generate-cmdlist.sh >generate-cmdlist.sh.old
$ hyperfine --warmup 1 -L s ,.old -p 'make clean' 'sh generate-cmdlist.sh{s} command-list.txt'
Benchmark #1: sh generate-cmdlist.sh command-list.txt
  Time (mean ± σ):     371.3 ms ±  64.2 ms    [User: 430.4 ms, System: 72.5 ms]
  Range (min … max):   320.5 ms … 517.7 ms    10 runs

Benchmark #2: sh generate-cmdlist.sh.old command-list.txt
  Time (mean ± σ):     489.9 ms ± 185.4 ms    [User: 724.7 ms, System: 141.3 ms]
  Range (min … max):   346.0 ms … 885.3 ms    10 runs

Summary
  'sh generate-cmdlist.sh command-list.txt' ran
    1.32 ± 0.55 times faster than 'sh generate-cmdlist.sh.old command-list.txt'

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogenerate-cmdlist.sh: trivial whitespace change
Ævar Arnfjörð Bjarmason [Fri, 5 Nov 2021 14:08:00 +0000 (15:08 +0100)] 
generate-cmdlist.sh: trivial whitespace change

Add " " before a "|" at the end of a line in generate-cmdlist.sh for
consistency with other code in the file. Some of the surrounding code
will be modified in subsequent commits.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocommand-list.txt: sort with "LC_ALL=C sort"
Ævar Arnfjörð Bjarmason [Fri, 5 Nov 2021 14:07:59 +0000 (15:07 +0100)] 
command-list.txt: sort with "LC_ALL=C sort"

We should keep these files sorted in the C locale, e.g. in the C
locale the order is:

    git-check-mailmap
    git-check-ref-format
    git-checkout

But under en_US.UTF-8 it's:

    git-check-mailmap
    git-checkout
    git-check-ref-format

In a subsequent commit I'll change generate-cmdlist.sh to use C sort
order, and without this change we'd be led to believe that that change
caused a meaningful change in the output, so let's do this as a
separate step, right now the generate-cmdlist.sh script just uses the
order found in this file.

Note that this refers to the sort order of the lines in
command-list.txt, a subsequent commit will also change how we treat
the sort order of the "category" fields, but that's unrelated to this
change.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoA few fixes before -rc2
Junio C Hamano [Thu, 4 Nov 2021 19:24:46 +0000 (12:24 -0700)] 
A few fixes before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoSync with maint
Junio C Hamano [Thu, 4 Nov 2021 19:24:40 +0000 (12:24 -0700)] 
Sync with maint

2 years agoMerge branch 'vd/pthread-setspecific-g11-fix' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:24:20 +0000 (12:24 -0700)] 
Merge branch 'vd/pthread-setspecific-g11-fix' into maint

One CI task based on Fedora image noticed a not-quite-kosher
consturct recently, which has been corrected.

* vd/pthread-setspecific-g11-fix:
  async_die_is_recursing: work around GCC v11.x issue on Fedora

2 years agoMerge branch 'ma/doc-git-version' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:22:10 +0000 (12:22 -0700)] 
Merge branch 'ma/doc-git-version' into maint

Typofix.

* ma/doc-git-version:
  git.txt: fix typo

2 years agoMerge branch 'pw/rebase-r-fixes' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:20:14 +0000 (12:20 -0700)] 
Merge branch 'pw/rebase-r-fixes' into maint

Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date

2 years agoMerge branch 'jk/log-warn-on-bogus-encoding' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:20:13 +0000 (12:20 -0700)] 
Merge branch 'jk/log-warn-on-bogus-encoding' into maint

Squelch over-eager warning message added during this cycle.

* jk/log-warn-on-bogus-encoding:
  log: document --encoding behavior on iconv() failure
  Revert "logmsg_reencode(): warn when iconv() fails"

2 years agoMerge branch 'vd/pthread-setspecific-g11-fix'
Junio C Hamano [Thu, 4 Nov 2021 19:07:47 +0000 (12:07 -0700)] 
Merge branch 'vd/pthread-setspecific-g11-fix'

One CI task based on Fedora image noticed a not-quite-kosher
consturct recently, which has been corrected.

* vd/pthread-setspecific-g11-fix:
  async_die_is_recursing: work around GCC v11.x issue on Fedora

2 years agoMerge branch 'rd/http-backend-code-simplification'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
Merge branch 'rd/http-backend-code-simplification'

Code simplification.

* rd/http-backend-code-simplification:
  http-backend: remove a duplicated code branch

2 years agoMerge branch 'ar/no-verify-doc'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
Merge branch 'ar/no-verify-doc'

Doc update.

* ar/no-verify-doc:
  Document positive variant of commit and merge option "--no-verify"

2 years agoMerge branch 'ar/fix-git-pull-no-verify'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
Merge branch 'ar/fix-git-pull-no-verify'

"git pull --no-verify" did not affect the underlying "git merge".

* ar/fix-git-pull-no-verify:
  pull: honor --no-verify and do not call the commit-msg hook

2 years agoasync_die_is_recursing: work around GCC v11.x issue on Fedora
Victoria Dye [Thu, 4 Nov 2021 04:01:03 +0000 (04:01 +0000)] 
async_die_is_recursing: work around GCC v11.x issue on Fedora

This fix corrects an issue found in the `dockerized(pedantic, fedora)` CI
build, first appearing after the introduction of a new version of the Fedora
docker image version. This image includes a version of `glibc` with the
attribute `__attr_access_none` added to `pthread_setspecific` [1], the
implementation of which only exists for GCC 11.X - the version included in
the Fedora image. The attribute requires that the pointer provided in the
second argument of `pthread_getspecific` must, if not NULL, be a pointer to
a valid object. In the usage in `async_die_is_recursing`, `(void *)1` is not
valid, causing the error.

This fix imitates a workaround added in SELinux [2] by using the pointer to
the static `async_die_counter` itself as the second argument to
`pthread_setspecific`. This guaranteed non-NULL, valid pointer matches the
intent of the current usage while not triggering the build error.

[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a1561c3bbe8
[2] https://lore.kernel.org/all/20211021140519.6593-1-cgzones@googlemail.com/

Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.34-rc1 v2.34.0-rc1
Junio C Hamano [Wed, 3 Nov 2021 20:32:40 +0000 (13:32 -0700)] 
Git 2.34-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'pw/rebase-r-fixes'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'pw/rebase-r-fixes'

Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date

2 years agoMerge branch 'ds/add-rm-with-sparse-index'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'ds/add-rm-with-sparse-index'

Regression fix.

* ds/add-rm-with-sparse-index:
  dir: fix directory-matching bug

2 years agoMerge branch 'jx/message-fixes'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'jx/message-fixes'

Fixes to recently added messages.

* jx/message-fixes:
  i18n: fix typos found during l10n for git 2.34.0

2 years agoMerge branch 'rs/ssh-signing-fix'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'rs/ssh-signing-fix'

Fixes to recently merged topic.

* rs/ssh-signing-fix:
  gpg-interface: avoid buffer overrun in parse_ssh_output()
  gpg-interface: handle missing " with " gracefully in parse_ssh_output()

2 years agorebase -i: fix rewording with --committer-date-is-author-date
Phillip Wood [Tue, 2 Nov 2021 21:30:51 +0000 (21:30 +0000)] 
rebase -i: fix rewording with --committer-date-is-author-date

baf8ec8d3a (rebase -r: don't write .git/MERGE_MSG when
fast-forwarding, 2021-08-20) stopped reading the author script in
run_git_commit() when rewording a commit. This is normally safe
because "git commit --amend" preserves the authorship. However if the
user passes "--committer-date-is-author-date" then we need to read the
author date from the author script when rewording. Fix this regression
by tightening the check for when it is safe to skip reading the author
script.

Reported-by: Jonas Kittner <jonas.kittner@ruhr-uni-bochum.de>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodir: fix directory-matching bug
Derrick Stolee [Tue, 2 Nov 2021 14:40:06 +0000 (10:40 -0400)] 
dir: fix directory-matching bug

This reverts the change from ed49584 (dir: fix pattern matching on dirs,
2021-09-24), which claimed to fix a directory-matching problem without a
test case. It turns out to _create_ a bug, but it is a bit subtle.

The bug would have been revealed by the first of two tests being added to
t0008-ignores.sh. The first uses a pattern "/git/" inside the a/.gitignores
file, which matches against 'a/git/foo' but not 'a/git-foo/bar'. This test
would fail before the revert.

The second test shows what happens if the test instead uses a pattern "git/"
and this test passes both before and after the revert.

The difference in these two cases are due to how
last_matching_pattern_from_list() checks patterns both if they have the
PATTERN_FLAG_MUSTBEDIR and PATTERN_FLAG_NODIR flags. In the case of "git/",
the PATTERN_FLAG_NODIR is also provided, making the change in behavior in
match_pathname() not affect the end result of
last_matching_pattern_from_list().

Reported-by: Glen Choo <chooglen@google.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogpg-interface: avoid buffer overrun in parse_ssh_output()
René Scharfe [Sat, 30 Oct 2021 17:07:38 +0000 (19:07 +0200)] 
gpg-interface: avoid buffer overrun in parse_ssh_output()

If the string "key" we found in the output of ssh-keygen happens to be
located at the very end of the line, then going four characters further
leaves us beyond the end of the string.  Explicitly search for the
space after "key" to handle a missing one gracefully.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogpg-interface: handle missing " with " gracefully in parse_ssh_output()
René Scharfe [Sat, 30 Oct 2021 17:04:56 +0000 (19:04 +0200)] 
gpg-interface: handle missing " with " gracefully in parse_ssh_output()

If the output of ssh-keygen starts with "Good \"git\" signature for ",
but is not followed by " with " for some reason, then parse_ssh_output()
uses -1 as the len parameter of xmemdupz(), which in turn will end the
program.  Reject the signature and carry on instead in that case.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoA few more topics before -rc1
Junio C Hamano [Mon, 1 Nov 2021 20:33:18 +0000 (13:33 -0700)] 
A few more topics before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/test-lib'
Junio C Hamano [Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)] 
Merge branch 'ab/test-lib'

Test (cosmetic) fix.

* ab/test-lib:
  t5310: drop lib-bundle.sh include

2 years agoMerge branch 'jc/doc-format-patch-clarify-auto-base'
Junio C Hamano [Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)] 
Merge branch 'jc/doc-format-patch-clarify-auto-base'

Rephrase the description of "format-patch --base=auto".

* jc/doc-format-patch-clarify-auto-base:
  format-patch (doc): clarify --base=auto

2 years agoMerge branch 'gc/use-repo-settings'
Junio C Hamano [Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)] 
Merge branch 'gc/use-repo-settings'

It is wrong to read some settings directly from the config
subsystem, as things like feature.experimental can affect their
default values.

* gc/use-repo-settings:
  gc: perform incremental repack when implictly enabled
  fsck: verify multi-pack-index when implictly enabled
  fsck: verify commit graph when implicitly enabled

2 years agoMerge branch 'ab/ignore-replace-while-working-on-commit-graph'
Junio C Hamano [Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)] 
Merge branch 'ab/ignore-replace-while-working-on-commit-graph'

Teach "git commit-graph" command not to allow using replace objects
at all, as we do not use the commit-graph at runtime when we see
object replacement.

* ab/ignore-replace-while-working-on-commit-graph:
  commit-graph: don't consider "replace" objects with "verify"
  commit-graph tests: fix another graph_git_two_modes() helper
  commit-graph tests: fix error-hiding graph_git_two_modes() helper

2 years agoMerge branch 'hm/paint-hits-in-log-grep'
Junio C Hamano [Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)] 
Merge branch 'hm/paint-hits-in-log-grep'

"git log --grep=string --author=name" learns to highlight hits just
like "git grep string" does.

* hm/paint-hits-in-log-grep:
  grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data
  pretty: colorize pattern matches in commit messages
  grep: refactor next_match() and match_one_pattern() for external use

2 years agoi18n: fix typos found during l10n for git 2.34.0
Jiang Xin [Mon, 1 Nov 2021 02:14:17 +0000 (10:14 +0800)] 
i18n: fix typos found during l10n for git 2.34.0

Emir and Jean-Noël reported typos in some i18n messages when preparing
l10n for git 2.34.0.

* Fix unstable spelling of config variable "gpg.ssh.defaultKeyCommand"
  which was introduced in commit fd9e226776 (ssh signing: retrieve a
  default key from ssh-agent, 2021-09-10).

* Add missing space between "with" and "--python" which was introduced
  in commit bd0708c7eb (ref-filter: add %(raw) atom, 2021-07-26).

* Fix unmatched single quote in 'builtin/index-pack.c' which was
  introduced in commit 8737dab346 (index-pack: refactor renaming in
  final(), 2021-09-09)

[1] https://github.com/git-l10n/git-po/pull/567

Reported-by: Emir Sarı <bitigchi@me.com>
Reported-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.34-rc0 v2.34.0-rc0
Junio C Hamano [Fri, 29 Oct 2021 22:43:50 +0000 (15:43 -0700)] 
Git 2.34-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 're/completion-fix-test-equality'
Junio C Hamano [Fri, 29 Oct 2021 22:43:16 +0000 (15:43 -0700)] 
Merge branch 're/completion-fix-test-equality'

Fix long-standing shell syntax error in the completion script.

* re/completion-fix-test-equality:
  completion: fix incorrect bash/zsh string equality check

2 years agoMerge branch 'mt/fix-add-rm-with-sparse-index'
Junio C Hamano [Fri, 29 Oct 2021 22:43:16 +0000 (15:43 -0700)] 
Merge branch 'mt/fix-add-rm-with-sparse-index'

Fix-up to a topic already merged to 'master'.

* mt/fix-add-rm-with-sparse-index:
  add, rm, mv: fix bug that prevents the update of non-sparse dirs

2 years agoMerge branch 'cm/drop-xunsetenv'
Junio C Hamano [Fri, 29 Oct 2021 22:43:15 +0000 (15:43 -0700)] 
Merge branch 'cm/drop-xunsetenv'

Drop a helper function that has never been used since its addition.

* cm/drop-xunsetenv:
  wrapper: remove xunsetenv()

2 years agoMerge branch 'jk/log-warn-on-bogus-encoding'
Junio C Hamano [Fri, 29 Oct 2021 22:43:15 +0000 (15:43 -0700)] 
Merge branch 'jk/log-warn-on-bogus-encoding'

Squelch over-eager warning message added during this cycle.

* jk/log-warn-on-bogus-encoding:
  log: document --encoding behavior on iconv() failure
  Revert "logmsg_reencode(): warn when iconv() fails"

2 years agoMerge branch 'ab/unbundle-progress'
Junio C Hamano [Fri, 29 Oct 2021 22:43:15 +0000 (15:43 -0700)] 
Merge branch 'ab/unbundle-progress'

Doc clarification.

* ab/unbundle-progress:
  git-bundle.txt: add missing words and punctuation

2 years agoMerge branch 'jc/branch-copy-doc'
Junio C Hamano [Fri, 29 Oct 2021 22:43:15 +0000 (15:43 -0700)] 
Merge branch 'jc/branch-copy-doc'

"git branch -c/-m new old" was not described to copy config, which
has been corrected.

* jc/branch-copy-doc:
  branch (doc): -m/-c copies config and reflog

2 years agoMerge branch 'ma/doc-folder-to-directory'
Junio C Hamano [Fri, 29 Oct 2021 22:43:15 +0000 (15:43 -0700)] 
Merge branch 'ma/doc-folder-to-directory'

Consistently use 'directory', not 'folder', to call the filesystem
entity that collects a group of files and, eh, directories.

* ma/doc-folder-to-directory:
  gitweb.txt: change "folder" to "directory"
  gitignore.txt: change "folder" to "directory"
  git-multi-pack-index.txt: change "folder" to "directory"

2 years agoMerge branch 'sg/sparse-index-not-that-common-a-command'
Junio C Hamano [Fri, 29 Oct 2021 22:43:14 +0000 (15:43 -0700)] 
Merge branch 'sg/sparse-index-not-that-common-a-command'

Drop "git sparse-index" from the list of common commands.

* sg/sparse-index-not-that-common-a-command:
  command-list.txt: remove 'sparse-index' from main help

2 years agoMerge branch 'ma/doc-git-version'
Junio C Hamano [Fri, 29 Oct 2021 22:43:14 +0000 (15:43 -0700)] 
Merge branch 'ma/doc-git-version'

Typofix.

* ma/doc-git-version:
  git.txt: fix typo

2 years agoMerge branch 'js/expand-runtime-prefix'
Junio C Hamano [Fri, 29 Oct 2021 22:43:14 +0000 (15:43 -0700)] 
Merge branch 'js/expand-runtime-prefix'

Typofix.

* js/expand-runtime-prefix:
  config.txt: fix typo

2 years agoMerge branch 'bs/archive-doc-compression-level'
Junio C Hamano [Fri, 29 Oct 2021 22:43:14 +0000 (15:43 -0700)] 
Merge branch 'bs/archive-doc-compression-level'

Update "git archive" documentation and give explicit mention on the
compression level for both zip and tar.gz format.

* bs/archive-doc-compression-level:
  archive: describe compression level option

2 years agoMerge branch 'ks/submodule-add-message-fix'
Junio C Hamano [Fri, 29 Oct 2021 22:43:14 +0000 (15:43 -0700)] 
Merge branch 'ks/submodule-add-message-fix'

Message regression fix.

* ks/submodule-add-message-fix:
  submodule: drop unused sm_name parameter from append_fetch_remotes()
  submodule--helper: fix incorrect newlines in an error message

2 years agoMerge branch 'ab/fix-make-lint-docs'
Junio C Hamano [Fri, 29 Oct 2021 22:43:13 +0000 (15:43 -0700)] 
Merge branch 'ab/fix-make-lint-docs'

Hotfix for a topic recently merged to 'master'.

* ab/fix-make-lint-docs:
  Documentation/Makefile: fix lint-docs mkdir dependency

2 years agoMerge branch 'ab/sh-retire-rebase-preserve-merges'
Junio C Hamano [Fri, 29 Oct 2021 22:43:13 +0000 (15:43 -0700)] 
Merge branch 'ab/sh-retire-rebase-preserve-merges'

Code clean-up to remove unused helpers.

* ab/sh-retire-rebase-preserve-merges:
  git-sh-setup: remove messaging supporting --preserve-merges
  git-sh-i18n: remove unused eval_ngettext()

2 years agoMerge branch 'ab/plug-random-leaks'
Junio C Hamano [Fri, 29 Oct 2021 22:43:13 +0000 (15:43 -0700)] 
Merge branch 'ab/plug-random-leaks'

Leakfix.

* ab/plug-random-leaks:
  reflog: free() ref given to us by dwim_log()
  submodule--helper: fix small memory leaks
  clone: fix a memory leak of the "git_dir" variable
  grep: fix a "path_list" memory leak
  grep: use object_array_clear() in cmd_grep()
  grep: prefer "struct grep_opt" over its "void *" equivalent

2 years agoMerge branch 'ab/plug-handle-path-exclude-leak'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'ab/plug-handle-path-exclude-leak'

Leakfix.

* ab/plug-handle-path-exclude-leak:
  config.c: don't leak memory in handle_path_include()

2 years agoMerge branch 'ab/ref-filter-leakfix'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'ab/ref-filter-leakfix'

"git for-each-ref" family of commands were leaking the ref_sorting
instances that hold sorting keys specified by the user; this has
been corrected.

* ab/ref-filter-leakfix:
  branch: use ref_sorting_release()
  ref-filter API user: add and use a ref_sorting_release()
  tag: use a "goto cleanup" pattern, leak less memory

2 years agoMerge branch 'jk/http-push-status-fix'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'jk/http-push-status-fix'

"git push" client talking to an HTTP server did not diagnose the
lack of the final status report from the other side correctly,
which has been corrected.

* jk/http-push-status-fix:
  transport-helper: recognize "expecting report" error from send-pack
  send-pack: complain about "expecting report" with --helper-status

2 years agoMerge branch 'ab/test-bail'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'ab/test-bail'

A new feature has been added to abort early in the test framework.

* ab/test-bail:
  test-lib.sh: use "Bail out!" syntax on bad SANITIZE=leak use
  test-lib.sh: de-duplicate error() teardown code

2 years agoMerge branch 'ab/make-sparse-for-real'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'ab/make-sparse-for-real'

Fix-up for a recent topic.

* ab/make-sparse-for-real:
  Makefile: remove redundant GIT-CFLAGS dependency from "sparse"

2 years agoMerge branch 'bs/doc-blame-color-lines'
Junio C Hamano [Fri, 29 Oct 2021 22:43:12 +0000 (15:43 -0700)] 
Merge branch 'bs/doc-blame-color-lines'

Doc fix.

* bs/doc-blame-color-lines:
  git config doc: fix recent ASCIIDOC formatting regression

2 years agowrapper: remove xunsetenv()
Carlo Marcelo Arenas Belón [Fri, 29 Oct 2021 21:27:05 +0000 (14:27 -0700)] 
wrapper: remove xunsetenv()

Remove the unused wrapper function.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agolog: document --encoding behavior on iconv() failure
Jeff King [Fri, 29 Oct 2021 21:10:03 +0000 (17:10 -0400)] 
log: document --encoding behavior on iconv() failure

We already note that we may produce invalid output when we skip calling
iconv() altogether. But we may also do so if iconv() fails, and we have
no good alternative. Let's document this to avoid surprising users.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoRevert "logmsg_reencode(): warn when iconv() fails"
Junio C Hamano [Fri, 29 Oct 2021 20:48:58 +0000 (13:48 -0700)] 
Revert "logmsg_reencode(): warn when iconv() fails"

This reverts commit fd680bc5 (logmsg_reencode(): warn when iconv()
fails, 2021-08-27).  Throwing a warning for each and every commit
that gets reencoded, without allowing a way to squelch, would make
it unpleasant for folks who have to deal with an ancient part of the
history in an old project that used wrong encoding in the commits.

2 years agoDocument positive variant of commit and merge option "--no-verify"
Alex Riesen [Fri, 29 Oct 2021 13:45:45 +0000 (15:45 +0200)] 
Document positive variant of commit and merge option "--no-verify"

This documents "--verify" option of the commands. It can be used to re-enable
the hooks disabled by an earlier "--no-verify" in command-line.

Signed-off-by: Alexander Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot5310: drop lib-bundle.sh include
Jeff King [Thu, 28 Oct 2021 19:20:27 +0000 (15:20 -0400)] 
t5310: drop lib-bundle.sh include

Commit ddfe900612 (test-lib-functions: move function to lib-bitmap.sh,
2021-02-09) meant to include lib-bitmap.sh in t5310, but also includes
lib-bundle.sh. Yet we don't use any of its functions, nor have anything
to do with bundles. This is probably just a typo/copy-paste error, as
lib-bundle.sh was added (correctly) to other scripts in the same series.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agopull: honor --no-verify and do not call the commit-msg hook
Alex Riesen [Thu, 28 Oct 2021 15:46:19 +0000 (17:46 +0200)] 
pull: honor --no-verify and do not call the commit-msg hook

The option was incorrectly auto-translated to "--no-verify-signatures",
which causes the unexpected effect of the hook being called.
And an even more unexpected effect of disabling verification of signatures.

The manual page describes the option to behave same as the similarly
named option of "git merge", which seems to be the original intention
of this option in the "pull" command.

Signed-off-by: Alexander Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: fix incorrect bash/zsh string equality check
Robert Estelle [Mon, 25 Oct 2021 22:29:33 +0000 (22:29 +0000)] 
completion: fix incorrect bash/zsh string equality check

In the basic `[`/`test` command, the string equality operator is a
single `=`. The `==` operator is only available in `[[`, which is a
bash-ism also supported by zsh.

This mix-up was causing the following completion error in zsh:
> __git_ls_files_helper:7: = not found

(That message refers to the extraneous symbol in `==` ← `=`).

This updates that comparison to use a single `=` inside the
basic `[ … ]` test conditional.

Although this fix is inconsistent with the other comparisons in this
file, which use `[[ … == … ]]`, and the two expressions are functionally
identical in this context, that approach was rejected due to a
preference for `[`.

Signed-off-by: Robert Estelle <robertestelle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoadd, rm, mv: fix bug that prevents the update of non-sparse dirs
Matheus Tavares [Thu, 28 Oct 2021 14:21:11 +0000 (11:21 -0300)] 
add, rm, mv: fix bug that prevents the update of non-sparse dirs

These three commands recently learned to avoid updating paths outside
the sparse checkout even if they are missing the SKIP_WORKTREE bit. This
is done using path_in_sparse_checkout(), which checks whether a given
path matches the current list of sparsity rules, similar to what
clear_ce_flags() does when we run "git sparse checkout init" or "git
sparse-checkout reapply". However, clear_ce_flags() uses a recursive
approach, applying the match results from parent directories on paths
that get the UNDECIDED result, whereas path_in_sparse_checkout() only
attempts to match the full path and immediately considers UNDECIDED as
NOT_MATCHED. This makes the function miss matches with leading
directories. For example, if the user has the sparsity patterns "!/a"
and "b/", add, rm, and mv will fail to update the path "a/b/c" and end
up displaying a warning about it being outside the sparse checkout even
though it isn't. This problem only occurs in full pattern mode as the
pattern matching functions never return UNDECIDED for cone mode.

To fix this, replicate the recursive behavior of clear_ce_flags() in
path_in_sparse_checkout(), falling back to the parent directory match
when a path gets the UNDECIDED result. (If this turns out to be too
expensive in some cases, we may want to later add some form of caching
to accelerate multiple queries within the same directory. This is not
implemented in this patch, though.) Also add two tests for each affected
command (add, rm, and mv) to check that they behave correctly with the
recursive pattern matching. The first test would previously fail without
this patch while the second already succeeded. It is added mostly to
make sure that we are not breaking the existing pattern matching for
directories that are really sparse, and also as a protection against any
future regressions.

Two other existing tests had to be changed as well: one test in t3602
checks that "git rm -r <dir>" won't remove sparse entries, but it didn't
allow the non-sparse entries inside <dir> to be removed. The other one,
in t7002, tested that "git mv" would correctly display a warning message
for sparse paths, but it accidentally expected the message to include
two non-sparse paths as well.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-bundle.txt: add missing words and punctuation
Martin Ågren [Sun, 24 Oct 2021 17:08:21 +0000 (19:08 +0200)] 
git-bundle.txt: add missing words and punctuation

Add an "and" to separate the two halves of the first sentence of the
paragraph more. Add a comma to similarly separate the two halves of the
second sentence a bit better. Add a period at the end of the paragraph.

Further down in the file, add the missing "be" in "must be accompanied".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoDocumentation/Makefile: fix lint-docs mkdir dependency
Jeff King [Tue, 26 Oct 2021 07:31:44 +0000 (03:31 -0400)] 
Documentation/Makefile: fix lint-docs mkdir dependency

Since 8650c6298c (doc lint: make "lint-docs" non-.PHONY, 2021-10-15), we
put the output for gitlink linter into .build/lint-docs/gitlink. There
are order-only dependencies to create the sequence of subdirs like:

  .build/lint-docs: | .build
          $(QUIET)mkdir $@
  .build/lint-docs/gitlink: | .build/lint-docs
          $(QUIET)mkdir $@

where each level has to depend on the prior one (since the parent
directory must exist for us to create something inside it). But the
"howto" and "config" subdirectories of gitlink have the wrong
dependency; they depend on "lint-docs", not "lint-docs/gitlink".

This usually works out, because the LINT_DOCS_GITLINK targets which
depend on "gitlink/howto" also depend on just "gitlink", so the
directory gets created anyway. But since we haven't given make an
explicit ordering, things can racily happen out of order.

If you stick a "sleep 1" in the rule to build "gitlink" like this:

   ## Lint: gitlink
   .build/lint-docs/gitlink: | .build/lint-docs
  - $(QUIET)mkdir $@
  + $(QUIET)sleep 1 && mkdir $@

then "make clean; make lint-docs" will fail reliably. Or you can see it
as-is just by building the directory in isolation:

  $ make clean
  [...]
  $ make .build/lint-docs/gitlink/howto
      GEN mergetools-list.made
      GEN cmd-list.made
      GEN doc.dep
      SUBDIR ../
  make[1]: 'GIT-VERSION-FILE' is up to date.
      SUBDIR ../
  make[1]: 'GIT-VERSION-FILE' is up to date.
  mkdir: cannot create directory ‘.build/lint-docs/gitlink/howto’: No such file or directory
  make: *** [Makefile:476: .build/lint-docs/gitlink/howto] Error 1

The fix is easy: we just need to depend on the correct parent directory.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule: drop unused sm_name parameter from append_fetch_remotes()
Jeff King [Tue, 26 Oct 2021 05:25:10 +0000 (01:25 -0400)] 
submodule: drop unused sm_name parameter from append_fetch_remotes()

Commit c21fb4676f (submodule--helper: fix incorrect newlines in an error
message, 2021-10-23) accidentally added a new, unused parameter while
changing the name and signature of show_fetch_remotes() to
append_fetch_remotes(). We can drop this to keep things simpler (and
satisfy -Wunused-parameter).

The error is likely because c21fb4676f is fixing a problem from
8c8195e9c3 (submodule--helper: introduce add-clone subcommand,
2021-07-10). An earlier iteration of that second commit introduced the
same unused parameter (though it was dropped before it finally made it
to 'next'), and the fix on top accidentally carried forward the extra
parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoThe fifteenth batch
Junio C Hamano [Mon, 25 Oct 2021 23:07:12 +0000 (16:07 -0700)] 
The fifteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/test-lib-diff-cleanup'
Junio C Hamano [Mon, 25 Oct 2021 23:07:01 +0000 (16:07 -0700)] 
Merge branch 'ab/test-lib-diff-cleanup'

Test clean-up.

* ab/test-lib-diff-cleanup:
  tests: stop using top-level "README" and "COPYING" files
  "lib-diff" tests: make "README" and "COPYING" test data smaller

2 years agoMerge branch 'ab/fix-make-lint-docs'
Junio C Hamano [Mon, 25 Oct 2021 23:07:01 +0000 (16:07 -0700)] 
Merge branch 'ab/fix-make-lint-docs'

Build fix.

* ab/fix-make-lint-docs:
  doc lint: make "lint-docs" non-.PHONY
  doc build: speed up "make lint-docs"
  doc lint: emit errors on STDERR
  doc lint: fix error-hiding regression

2 years agoMerge branch 'ab/pkt-line-cleanup'
Junio C Hamano [Mon, 25 Oct 2021 23:07:00 +0000 (16:07 -0700)] 
Merge branch 'ab/pkt-line-cleanup'

Code clean-up.

* ab/pkt-line-cleanup:
  pkt-line.[ch]: remove unused packet_read_line_buf()
  pkt-line.[ch]: remove unused packet_buf_write_len()

2 years agoMerge branch 'tb/fix-midx-rename-while-mapped'
Junio C Hamano [Mon, 25 Oct 2021 23:07:00 +0000 (16:07 -0700)] 
Merge branch 'tb/fix-midx-rename-while-mapped'

The codepath to write a new version of .midx multi-pack index files
has learned to release the mmaped memory holding the current
version of .midx before removing them from the disk, as some
platforms do not allow removal of a file that still has mapping.

* tb/fix-midx-rename-while-mapped:
  midx.c: guard against commit_lock_file() failures
  midx.c: lookup MIDX by object directory during repack
  midx.c: lookup MIDX by object directory during expire
  midx.c: extract MIDX lookup by object_dir

2 years agoMerge branch 'ab/test-cleanly-recreate-trash-directory'
Junio C Hamano [Mon, 25 Oct 2021 23:07:00 +0000 (16:07 -0700)] 
Merge branch 'ab/test-cleanly-recreate-trash-directory'

Improve test framework around unwritable directories.

* ab/test-cleanly-recreate-trash-directory:
  test-lib.sh: try to re-chmod & retry on failed trash removal

2 years agoMerge branch 'jc/doc-commit-header-continuation-line'
Junio C Hamano [Mon, 25 Oct 2021 23:07:00 +0000 (16:07 -0700)] 
Merge branch 'jc/doc-commit-header-continuation-line'

Doc update.

* jc/doc-commit-header-continuation-line:
  signature-format.txt: explain and illustrate multi-line headers

2 years agoMerge branch 'ab/mark-leak-free-tests-more'
Junio C Hamano [Mon, 25 Oct 2021 23:06:59 +0000 (16:06 -0700)] 
Merge branch 'ab/mark-leak-free-tests-more'

Bunch of tests are marked as "passing leak check".

* ab/mark-leak-free-tests-more:
  merge: add missing strbuf_release()
  ls-files: add missing string_list_clear()
  ls-files: fix a trivial dir_clear() leak
  tests: fix test-oid-array leak, test in SANITIZE=leak
  tests: fix a memory leak in test-oidtree.c
  tests: fix a memory leak in test-parse-options.c
  tests: fix a memory leak in test-prio-queue.c

2 years agoMerge branch 'ab/mark-leak-free-tests'
Junio C Hamano [Mon, 25 Oct 2021 23:06:59 +0000 (16:06 -0700)] 
Merge branch 'ab/mark-leak-free-tests'

Bunch of tests are marked as "passing leak check".

* ab/mark-leak-free-tests:
  leak tests: mark some misc tests as passing with SANITIZE=leak
  leak tests: mark various "generic" tests as passing with SANITIZE=leak
  leak tests: mark some read-tree tests as passing with SANITIZE=leak
  leak tests: mark some ls-files tests as passing with SANITIZE=leak
  leak tests: mark all checkout-index tests as passing with SANITIZE=leak
  leak tests: mark all trace2 tests as passing with SANITIZE=leak
  leak tests: mark all ls-tree tests as passing with SANITIZE=leak
  leak tests: run various "test-tool" tests in t00*.sh SANITIZE=leak
  leak tests: run various built-in tests in t00*.sh SANITIZE=leak

2 years agoMerge branch 'ab/parse-options-cleanup'
Junio C Hamano [Mon, 25 Oct 2021 23:06:59 +0000 (16:06 -0700)] 
Merge branch 'ab/parse-options-cleanup'

Random changes to parse-options implementation.

* ab/parse-options-cleanup:
  parse-options: change OPT_{SHORT,UNSET} to an enum
  parse-options tests: test optname() output
  parse-options.[ch]: make opt{bug,name}() "static"
  commit-graph: stop using optname()
  parse-options.c: move optname() earlier in the file
  parse-options.h: make the "flags" in "struct option" an enum
  parse-options.c: use exhaustive "case" arms for "enum parse_opt_result"
  parse-options.[ch]: consistently use "enum parse_opt_result"
  parse-options.[ch]: consistently use "enum parse_opt_flags"
  parse-options.h: move PARSE_OPT_SHELL_EVAL between enums

2 years agoMerge branch 'js/userdiff-cpp'
Junio C Hamano [Mon, 25 Oct 2021 23:06:59 +0000 (16:06 -0700)] 
Merge branch 'js/userdiff-cpp'

Userdiff patterns for the C++ language has been updated.

* js/userdiff-cpp:
  userdiff-cpp: back out the digit-separators in numbers
  userdiff-cpp: learn the C++ spaceship operator
  userdiff-cpp: permit the digit-separating single-quote in numbers
  userdiff-cpp: prepare test cases with yet unsupported features
  userdiff-cpp: tighten word regex
  t4034: add tests showing problematic cpp tokenizations
  t4034/cpp: actually test that operator tokens are not split

2 years agoMerge branch 'da/mergetools-special-case-xxdiff-exit-128'
Junio C Hamano [Mon, 25 Oct 2021 23:06:58 +0000 (16:06 -0700)] 
Merge branch 'da/mergetools-special-case-xxdiff-exit-128'

The xxdiff difftool backend can exit with status 128, which the
difftool-helper that launches the backend takes as a significant
failure, when it is not significant at all.  Work it around.

* da/mergetools-special-case-xxdiff-exit-128:
  mergetools/xxdiff: prevent segfaults from stopping difftool

2 years agoMerge branch 'fs/ssh-signing-fix'
Junio C Hamano [Mon, 25 Oct 2021 23:06:58 +0000 (16:06 -0700)] 
Merge branch 'fs/ssh-signing-fix'

Fix-up for the other topic already in 'next'.

* fs/ssh-signing-fix:
  gpg-interface: fix leak of strbufs in get_ssh_key_fingerprint()
  gpg-interface: fix leak of "line" in parse_ssh_output()
  ssh signing: clarify trustlevel usage in docs
  ssh signing: fmt-merge-msg tests & config parse

2 years agoMerge branch 'fs/ssh-signing'
Junio C Hamano [Mon, 25 Oct 2021 23:06:58 +0000 (16:06 -0700)] 
Merge branch 'fs/ssh-signing'

Use ssh public crypto for object and push-cert signing.

* fs/ssh-signing:
  ssh signing: test that gpg fails for unknown keys
  ssh signing: tests for logs, tags & push certs
  ssh signing: duplicate t7510 tests for commits
  ssh signing: verify signatures using ssh-keygen
  ssh signing: provide a textual signing_key_id
  ssh signing: retrieve a default key from ssh-agent
  ssh signing: add ssh key format and signing code
  ssh signing: add test prereqs
  ssh signing: preliminary refactoring and clean-up

2 years agoMerge branch 'pw/sparse-cache-tree-verify-fix'
Junio C Hamano [Mon, 25 Oct 2021 23:06:57 +0000 (16:06 -0700)] 
Merge branch 'pw/sparse-cache-tree-verify-fix'

Recent sparse-index addition, namely any use of index_name_pos(),
can expand sparse index entries and breaks any code that walks
cache-tree or existing index entries.  One such instance of such a
breakage has been corrected.

* pw/sparse-cache-tree-verify-fix:
  t1092: run "rebase --apply" without "-q" in testing
  sparse index: fix use-after-free bug in cache_tree_verify()

2 years agoMerge branch 'ab/fix-commit-error-message-upon-unwritable-object-store'
Junio C Hamano [Mon, 25 Oct 2021 23:06:57 +0000 (16:06 -0700)] 
Merge branch 'ab/fix-commit-error-message-upon-unwritable-object-store'

"git commit" gave duplicated error message when the object store
was unwritable, which has been corrected.

* ab/fix-commit-error-message-upon-unwritable-object-store:
  commit: fix duplication regression in permission error output
  unwritable tests: assert exact error output

2 years agoMerge branch 'rs/add-dry-run-without-objects'
Junio C Hamano [Mon, 25 Oct 2021 23:06:57 +0000 (16:06 -0700)] 
Merge branch 'rs/add-dry-run-without-objects'

Stop "git add --dry-run" from creating new blob and tree objects.

* rs/add-dry-run-without-objects:
  add: don't write objects with --dry-run

2 years agoMerge branch 'rs/disable-gc-during-perf-tests'
Junio C Hamano [Mon, 25 Oct 2021 23:06:57 +0000 (16:06 -0700)] 
Merge branch 'rs/disable-gc-during-perf-tests'

Avoid performance measurements from getting ruined by gc and other
housekeeping pauses interfering in the middle.

* rs/disable-gc-during-perf-tests:
  perf: disable automatic housekeeping

2 years agoMerge branch 'jt/no-abuse-alternate-odb-for-submodules'
Junio C Hamano [Mon, 25 Oct 2021 23:06:56 +0000 (16:06 -0700)] 
Merge branch 'jt/no-abuse-alternate-odb-for-submodules'

Follow through the work to use the repo interface to access
submodule objects in-process, instead of abusing the alternate
object database interface.

* jt/no-abuse-alternate-odb-for-submodules:
  submodule: trace adding submodule ODB as alternate
  submodule: pass repo to check_has_commit()
  object-file: only register submodule ODB if needed
  merge-{ort,recursive}: remove add_submodule_odb()
  refs: peeling non-the_repository iterators is BUG
  refs: teach arbitrary repo support to iterators
  refs: plumb repo into ref stores

2 years agoMerge branch 'ab/unpack-trees-leakfix'
Junio C Hamano [Mon, 25 Oct 2021 23:06:56 +0000 (16:06 -0700)] 
Merge branch 'ab/unpack-trees-leakfix'

Leakfix.

* ab/unpack-trees-leakfix:
  sequencer: fix a memory leak in do_reset()
  sequencer: add a "goto cleanup" to do_reset()
  unpack-trees: don't leak memory in verify_clean_subdirectory()

2 years agoMerge branch 'jh/perf-remove-test-times'
Junio C Hamano [Mon, 25 Oct 2021 23:06:56 +0000 (16:06 -0700)] 
Merge branch 'jh/perf-remove-test-times'

Perf test fix.

* jh/perf-remove-test-times:
  t/perf/perf-lib.sh: remove test_times.* at the end test_perf_()

2 years agoMerge branch 'ab/fsck-unexpected-type'
Junio C Hamano [Mon, 25 Oct 2021 23:06:56 +0000 (16:06 -0700)] 
Merge branch 'ab/fsck-unexpected-type'

"git fsck" has been taught to report mismatch between expected and
actual types of an object better.

* ab/fsck-unexpected-type:
  fsck: report invalid object type-path combinations
  fsck: don't hard die on invalid object types
  object-file.c: stop dying in parse_loose_header()
  object-file.c: return ULHR_TOO_LONG on "header too long"
  object-file.c: use "enum" return type for unpack_loose_header()
  object-file.c: simplify unpack_loose_short_header()
  object-file.c: make parse_loose_header_extended() public
  object-file.c: return -1, not "status" from unpack_loose_header()
  object-file.c: don't set "typep" when returning non-zero
  cat-file tests: test for current --allow-unknown-type behavior
  cat-file tests: add corrupt loose object test
  cat-file tests: test for missing/bogus object with -t, -s and -p
  cat-file tests: move bogus_* variable declarations earlier
  fsck tests: test for garbage appended to a loose object
  fsck tests: test current hash/type mismatch behavior
  fsck tests: refactor one test to use a sub-repo
  fsck tests: add test for fsck-ing an unknown type

2 years agogitweb.txt: change "folder" to "directory"
Martin Ågren [Sun, 24 Oct 2021 17:09:17 +0000 (19:09 +0200)] 
gitweb.txt: change "folder" to "directory"

We prefer "directory" over "folder" when discussing the file system
concept. Change this instance for consistency.

After this, the only hits for '\<folder\>' in Documentation/ relate to
IMAP folders.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogitignore.txt: change "folder" to "directory"
Martin Ågren [Sun, 24 Oct 2021 17:09:16 +0000 (19:09 +0200)] 
gitignore.txt: change "folder" to "directory"

We prefer "directory" over "folder" when discussing the file system
concept. Change this instance for consistency -- indeed, even within
this paragraph, we already use "directory".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-multi-pack-index.txt: change "folder" to "directory"
Martin Ågren [Sun, 24 Oct 2021 17:09:15 +0000 (19:09 +0200)] 
git-multi-pack-index.txt: change "folder" to "directory"

We prefer "directory" over "folder" when discussing the file system
concept. In all of our documentation, these are the only spots where we
refer to the `.git` directory as a folder. Switch to "directory", and
while doing so, add backticks to the ".git" filename to set it in
monospace.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit.txt: fix typo
Martin Ågren [Sun, 24 Oct 2021 17:08:20 +0000 (19:08 +0200)] 
git.txt: fix typo

Fix the spelling of "internally".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoarchive: describe compression level option
Bagas Sanjaya [Fri, 22 Oct 2021 06:45:44 +0000 (13:45 +0700)] 
archive: describe compression level option

Describe the only <extra> option in `git archive`, that is the compression
level option. Previously this option is only described for zip backend;
add description also for tar backend.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoconfig.txt: fix typo
Martin Ågren [Sun, 24 Oct 2021 17:07:43 +0000 (19:07 +0200)] 
config.txt: fix typo

Fix the spelling of "substituted".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocommand-list.txt: remove 'sparse-index' from main help
SZEDER Gábor [Sun, 24 Oct 2021 17:07:30 +0000 (19:07 +0200)] 
command-list.txt: remove 'sparse-index' from main help

Ever since 'git sparse-checkout' was introduced [1] it is included in
'git --help' in the section "work on the current change" along with
the commands 'add', 'mv', 'restore', and 'rm'.  It clearly doesn't
belong to that group, moreover it can't be considered such a common
command to belong to 'git --help' in the first place, so remove it
from there.

[1] 94c0956b60 (sparse-checkout: create builtin with 'list'
                subcommand, 2019-11-21)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohttp-backend: remove a duplicated code branch
Robin Dupret [Sun, 24 Oct 2021 16:28:59 +0000 (18:28 +0200)] 
http-backend: remove a duplicated code branch

Try to make reading the computation of the gzipped flag a bit more
natural.

Signed-off-by: Robin Dupret <robin.dupret@hey.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agouserdiff-cpp: back out the digit-separators in numbers
Johannes Sixt [Sun, 24 Oct 2021 09:56:43 +0000 (11:56 +0200)] 
userdiff-cpp: back out the digit-separators in numbers

The implementation of digit-separating single-quotes introduced a
note-worthy regression: the change of a character literal with a
digit would splice the digit and the closing single-quote. For
example, the change from 'a' to '2' is now tokenized as
'[-a'-]{+2'+} instead of '[-a-]{+2+}'.

The options to fix the regression are:

- Tighten the regular expression such that the single-quote can only
  occur between digits (that would match the official syntax).

- Remove support for digit separators.

I chose to remove support, because

- I have not seen a lot of code make use of digit separators.

- If code does use digit separators, then the numbers are typically
  long. If a change in one of the segments occurs, it is actually
  better visible if only that segment is highlighted as the word
  that changed instead of the whole long number.

This choice does introduce another minor regression, though, which
is highlighted in the test case: when a change occurs in the second
or later segment of a hexadecimal number where the segment begins
with a digit, but also has letters, the segment is mistaken as
consisting of a number and an identifier. I can live with that.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: fix incorrect newlines in an error message
Kaartic Sivaraam [Sat, 23 Oct 2021 12:57:22 +0000 (18:27 +0530)] 
submodule--helper: fix incorrect newlines in an error message

A refactoring[1] done as part of the recent conversion of
'git submodule add' to builtin, changed the error message
shown when a Git directory already exists locally for a submodule
name. Before the refactoring, the error used to appear like so:

  --- START OF OUTPUT ---
  $ git submodule add ../sub/ subm
  A git directory for 'subm' is found locally with remote(s):
    origin        /me/git-repos-for-test/sub
  If you want to reuse this local git directory instead of cloning again from
    /me/git-repos-for-test/sub
  use the '--force' option. If the local git directory is not the correct repo
  or you are unsure what this means choose another name with the '--name' option.
  ---  END OF OUTPUT  ---

After the refactoring the error started appearing like so:

  --- START OF OUTPUT ---
  $ git submodule add ../sub/ subm
  A git directory for 'subm' is found locally with remote(s):  origin     /me/git-repos-for-test/sub
  fatal: If you want to reuse this local git directory instead of cloning again from
  /me/git-repos-for-test/sub
  use the '--force' option. If the local git directory is not the correct repo
  or if you are unsure what this means, choose another name with the '--name' option.

  ---  END OF OUTPUT  ---

As one could observe the remote information is printed along with the
first line rather than on its own line. Also, there's an additional
newline following output.

Make the error message consistent with the error message that used to be
printed before the refactoring.

This also moves the 'fatal:' prefix that appears in the middle of the
error message to the first line as it would more appropriate to have
it in the first line. The output after the change would look like:

  --- START OF OUTPUT ---
  $ git submodule add ../sub/ subm
  fatal: A git directory for 'subm' is found locally with remote(s):
    origin        /me/git-repos-for-test/sub
  If you want to reuse this local git directory instead of cloning again from
    /me/git-repos-for-test/sub
  use the '--force' option. If the local git directory is not the correct repo
  or you are unsure what this means choose another name with the '--name' option.
  ---  END OF OUTPUT  ---

[1]: https://lore.kernel.org/git/20210710074801.19917-5-raykar.ath@gmail.com/#t

Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agobranch (doc): -m/-c copies config and reflog
Junio C Hamano [Sat, 23 Oct 2021 23:57:30 +0000 (16:57 -0700)] 
branch (doc): -m/-c copies config and reflog

The description section for the command mentions config and reflog
are moved or copied by these options, but the description for these
options did not.  Make them match.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoformat-patch (doc): clarify --base=auto
Junio C Hamano [Sat, 23 Oct 2021 21:01:33 +0000 (14:01 -0700)] 
format-patch (doc): clarify --base=auto

What --base=auto tells format-patch is to compute the base commit
itself, using the tracking information.  It does not make anything
track anything.

Tighten the phrasing so that it won't be copied and pasted to other
places.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoreflog: free() ref given to us by dwim_log()
Ævar Arnfjörð Bjarmason [Fri, 22 Oct 2021 08:55:44 +0000 (10:55 +0200)] 
reflog: free() ref given to us by dwim_log()

When dwim_log() returns the "ref" is always ether NULL or an
xstrdup()'d string.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: fix small memory leaks
Ævar Arnfjörð Bjarmason [Fri, 22 Oct 2021 08:55:43 +0000 (10:55 +0200)] 
submodule--helper: fix small memory leaks

Add a missing strbuf_release() and a clear_pathspec() to the
submodule--helper.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>