]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
7 weeks agodocs: correct trailer `key_value_separator` description
Brian Lyles [Mon, 18 Mar 2024 05:38:01 +0000 (00:38 -0500)] 
docs: correct trailer `key_value_separator` description

The description for `key_value_separator` incorrectly states that this
separator is inserted between trailer lines, which appears likely to
have been incorrectly copied from `separator` when this option was
added.

Update the description to correctly indicate that it is a separator that
appears between the key and the value of each trailer.

Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Acked-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: use only hyphens as word separators in placeholders
Jean-Noël Avila [Sat, 6 Nov 2021 18:48:52 +0000 (19:48 +0100)] 
doc: use only hyphens as word separators in placeholders

According to CodingGuidelines, multi-word placeholders should use
hyphens as word separators.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: express grammar placeholders between angle brackets
Jean-Noël Avila [Sat, 6 Nov 2021 18:48:51 +0000 (19:48 +0100)] 
doc: express grammar placeholders between angle brackets

This discerns user inputs from verbatim options in the synopsis.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: split placeholders as individual tokens
Jean-Noël Avila [Thu, 28 Oct 2021 16:21:57 +0000 (16:21 +0000)] 
doc: split placeholders as individual tokens

The placeholders represent atoms of tokens and must not be
aggregates.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: fix git credential synopsis
Jean-Noël Avila [Thu, 28 Oct 2021 16:21:56 +0000 (16:21 +0000)] 
doc: fix git credential synopsis

The subcommand of git credential is not optional.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.33.1 v2.33.1
Junio C Hamano [Tue, 12 Oct 2021 20:51:59 +0000 (13:51 -0700)] 
Git 2.33.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ah/connect-parse-feature-v0-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:49 +0000 (13:51 -0700)] 
Merge branch 'ah/connect-parse-feature-v0-fix' into maint

Protocol v0 clients can get stuck parsing a malformed feature line.

* ah/connect-parse-feature-v0-fix:
  connect: also update offset for features without values

2 years agoMerge branch 'ab/make-clean-depend-dirs' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:49 +0000 (13:51 -0700)] 
Merge branch 'ab/make-clean-depend-dirs' into maint

"make clean" has been updated to remove leftover .depend/
directories, even when it is not told to use them to compute header
dependencies.

* ab/make-clean-depend-dirs:
  Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes

2 years agoMerge branch 'jk/http-redact-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:48 +0000 (13:51 -0700)] 
Merge branch 'jk/http-redact-fix' into maint

Sensitive data in the HTTP trace were supposed to be redacted, but
we failed to do so in HTTP/2 requests.

* jk/http-redact-fix:
  http: match headers case-insensitively when redacting

2 years agoMerge branch 'da/difftool-dir-diff-symlink-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:48 +0000 (13:51 -0700)] 
Merge branch 'da/difftool-dir-diff-symlink-fix' into maint

"git difftool --dir-diff" mishandled symbolic links.

* da/difftool-dir-diff-symlink-fix:
  difftool: fix symlink-file writing in dir-diff mode

2 years agoMerge branch 'cb/cvsserver' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:48 +0000 (13:51 -0700)] 
Merge branch 'cb/cvsserver' into maint

"git cvsserver" had a long-standing bug in its authentication code,
which has finally been corrected (it is unclear and is a separate
question if anybody is seriously using it, though).

* cb/cvsserver:
  Documentation: cleanup git-cvsserver
  git-cvsserver: protect against NULL in crypt(3)
  git-cvsserver: use crypt correctly to compare password hashes

2 years agoMerge branch 'jk/clone-unborn-head-in-bare' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:47 +0000 (13:51 -0700)] 
Merge branch 'jk/clone-unborn-head-in-bare' into maint

"git clone" from a repository whose HEAD is unborn into a bare
repository didn't follow the branch name the other side used, which
is corrected.

* jk/clone-unborn-head-in-bare:
  clone: handle unborn branch in bare repos

2 years agoMerge branch 'en/stash-df-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:47 +0000 (13:51 -0700)] 
Merge branch 'en/stash-df-fix' into maint

"git stash", where the tentative change involves changing a
directory to a file (or vice versa), was confused, which has been
corrected.

* en/stash-df-fix:
  stash: restore untracked files AFTER restoring tracked files
  stash: avoid feeding directories to update-index
  t3903: document a pair of directory/file bugs

2 years agoMerge branch 'jk/strvec-typefix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:47 +0000 (13:51 -0700)] 
Merge branch 'jk/strvec-typefix' into maint

Correct nr and alloc members of strvec struct to be of type size_t.

* jk/strvec-typefix:
  strvec: use size_t to store nr and alloc

2 years agoMerge branch 'en/am-abort-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:46 +0000 (13:51 -0700)] 
Merge branch 'en/am-abort-fix' into maint

When "git am --abort" fails to abort correctly, it still exited
with exit status of 0, which has been corrected.

* en/am-abort-fix:
  am: fix incorrect exit status on am fail to abort
  t4151: add a few am --abort tests
  git-am.txt: clarify --abort behavior

2 years agoMerge branch 'ps/update-ref-batch-flush' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:46 +0000 (13:51 -0700)] 
Merge branch 'ps/update-ref-batch-flush' into maint

"git update-ref --stdin" failed to flush its output as needed,
which potentially led the conversation to a deadlock.

* ps/update-ref-batch-flush:
  t1400: avoid SIGPIPE race condition on fifo
  update-ref: fix streaming of status updates

2 years agoMerge branch 'rs/no-mode-to-open-when-appending' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:46 +0000 (13:51 -0700)] 
Merge branch 'rs/no-mode-to-open-when-appending' into maint

The "mode" word is useless in a call to open(2) that does not
create a new file.  Such a call in the files backend of the ref
subsystem has been cleaned up.

* rs/no-mode-to-open-when-appending:
  refs/files-backend: remove unused open mode parameter

2 years agoMerge branch 'tb/pack-finalize-ordering' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:45 +0000 (13:51 -0700)] 
Merge branch 'tb/pack-finalize-ordering' into maint

The order in which various files that make up a single (conceptual)
packfile has been reevaluated and straightened up.  This matters in
correctness, as an incomplete set of files must not be shown to a
running Git.

* tb/pack-finalize-ordering:
  pack-objects: rename .idx files into place after .bitmap files
  pack-write: split up finish_tmp_packfile() function
  builtin/index-pack.c: move `.idx` files into place last
  index-pack: refactor renaming in final()
  builtin/repack.c: move `.idx` files into place last
  pack-write.c: rename `.idx` files after `*.rev`
  pack-write: refactor renaming in finish_tmp_packfile()
  bulk-checkin.c: store checksum directly
  pack.h: line-wrap the definition of finish_tmp_packfile()

2 years agoMerge branch 'rs/range-diff-avoid-segfault-with-I' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:45 +0000 (13:51 -0700)] 
Merge branch 'rs/range-diff-avoid-segfault-with-I' into maint

"git range-diff -I... <range> <range>" segfaulted, which has been
corrected.

* rs/range-diff-avoid-segfault-with-I:
  range-diff: avoid segfault with -I

2 years agoMerge branch 'ab/reverse-midx-optim' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:45 +0000 (13:51 -0700)] 
Merge branch 'ab/reverse-midx-optim' into maint

The code that optionally creates the *.rev reverse index file has
been optimized to avoid needless computation when it is not writing
the file out.

* ab/reverse-midx-optim:
  pack-write: skip *.rev work when not writing *.rev

2 years agoMerge branch 'jc/trivial-threeway-binary-merge' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:44 +0000 (13:51 -0700)] 
Merge branch 'jc/trivial-threeway-binary-merge' into maint

The "git apply -3" code path learned not to bother the lower level
merge machinery when the three-way merge can be trivially resolved
without the content level merge.

* jc/trivial-threeway-binary-merge:
  apply: resolve trivial merge without hitting ll-merge with "--3way"

2 years agoMerge branch 'ab/send-email-config-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:44 +0000 (13:51 -0700)] 
Merge branch 'ab/send-email-config-fix' into maint

Regression fix.

* ab/send-email-config-fix:
  send-email: fix a "first config key wins" regression in v2.33.0

2 years agoMerge branch 'so/diff-index-regression-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:44 +0000 (13:51 -0700)] 
Merge branch 'so/diff-index-regression-fix' into maint

Recent "diff -m" changes broke "gitk", which has been corrected.

* so/diff-index-regression-fix:
  diff-index: restore -c/--cc options handling

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

Doc update plus improved error reporting.

* jk/log-warn-on-bogus-encoding:
  docs: use "character encoding" to refer to commit-object encoding
  logmsg_reencode(): warn when iconv() fails

2 years agoMerge branch 'tk/fast-export-anonymized-tag-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:43 +0000 (13:51 -0700)] 
Merge branch 'tk/fast-export-anonymized-tag-fix' into maint

The output from "git fast-export", when its anonymization feature
is in use, showed an annotated tag incorrectly.

* tk/fast-export-anonymized-tag-fix:
  fast-export: fix anonymized tag using original length

2 years agoMerge branch 'mh/send-email-reset-in-reply-to' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:43 +0000 (13:51 -0700)] 
Merge branch 'mh/send-email-reset-in-reply-to' into maint

Even when running "git send-email" without its own threaded
discussion support, a threading related header in one message is
carried over to the subsequent message to result in an unwanted
threading, which has been corrected.

* mh/send-email-reset-in-reply-to:
  send-email: avoid incorrect header propagation

2 years agoMerge branch 'sg/set-ceiling-during-tests' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:42 +0000 (13:51 -0700)] 
Merge branch 'sg/set-ceiling-during-tests' into maint

Buggy tests could damage repositories outside the throw-away test
area we created.  We now by default export GIT_CEILING_DIRECTORIES
to limit the damage from such a stray test.

* sg/set-ceiling-during-tests:
  test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repository

2 years agoMerge branch 'jh/sparse-index-resize-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:42 +0000 (13:51 -0700)] 
Merge branch 'jh/sparse-index-resize-fix' into maint

The sparse-index support can corrupt the index structure by storing
a stale and/or uninitialized data, which has been corrected.

* jh/sparse-index-resize-fix:
  sparse-index: copy dir_hash in ensure_full_index()

2 years agoMerge branch 'ka/want-ref-in-namespace' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:42 +0000 (13:51 -0700)] 
Merge branch 'ka/want-ref-in-namespace' into maint

"git upload-pack" which runs on the other side of "git fetch"
forgot to take the ref namespaces into account when handling
want-ref requests.

* ka/want-ref-in-namespace:
  docs: clarify the interaction of transfer.hideRefs and namespaces
  upload-pack.c: treat want-ref relative to namespace
  t5730: introduce fetch command helper

2 years agoMerge branch 'sg/column-nl' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:41 +0000 (13:51 -0700)] 
Merge branch 'sg/column-nl' into maint

The parser for the "--nl" option of "git column" has been
corrected.

* sg/column-nl:
  column: fix parsing of the '--nl' option

2 years agoMerge branch 'cb/makefile-apple-clang' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:41 +0000 (13:51 -0700)] 
Merge branch 'cb/makefile-apple-clang' into maint

Build update for Apple clang.

* cb/makefile-apple-clang:
  build: catch clang that identifies itself as "$VENDOR clang"
  build: clang version may not be followed by extra words
  build: update detect-compiler for newer Xcode version

2 years agoMerge branch 'rs/branch-allow-deleting-dangling' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:41 +0000 (13:51 -0700)] 
Merge branch 'rs/branch-allow-deleting-dangling' into maint

"git branch -D <branch>" used to refuse to remove a broken branch
ref that points at a missing commit, which has been corrected.

* rs/branch-allow-deleting-dangling:
  branch: allow deleting dangling branches with --force

2 years agoMerge branch 'mt/quiet-with-delayed-checkout' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:40 +0000 (13:51 -0700)] 
Merge branch 'mt/quiet-with-delayed-checkout' into maint

The delayed checkout code path in "git checkout" etc. were chatty
even when --quiet and/or --no-progress options were given.

* mt/quiet-with-delayed-checkout:
  checkout: make delayed checkout respect --quiet and --no-progress

2 years agoMerge branch 'dd/diff-files-unmerged-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:40 +0000 (13:51 -0700)] 
Merge branch 'dd/diff-files-unmerged-fix' into maint

"git diff --relative" segfaulted and/or produced incorrect result
when there are unmerged paths.

* dd/diff-files-unmerged-fix:
  diff-lib: ignore paths that are outside $cwd if --relative asked

2 years agoMerge branch 'rs/git-mmap-uses-malloc' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:39 +0000 (13:51 -0700)] 
Merge branch 'rs/git-mmap-uses-malloc' into maint

mmap() imitation used to call xmalloc() that dies upon malloc()
failure, which has been corrected to just return an error to the
caller to be handled.

* rs/git-mmap-uses-malloc:
  compat: let git_mmap use malloc(3) directly

2 years agoMerge branch 'pw/rebase-r-fixes' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:39 +0000 (13:51 -0700)] 
Merge branch 'pw/rebase-r-fixes' into maint

Various bugs in "git rebase -r" have been fixed.

* pw/rebase-r-fixes:
  rebase -r: fix merge -c with a merge strategy
  rebase -r: don't write .git/MERGE_MSG when fast-forwarding
  rebase -i: add another reword test
  rebase -r: make 'merge -c' behave like reword

2 years agoMerge branch 'pw/rebase-skip-final-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:39 +0000 (13:51 -0700)] 
Merge branch 'pw/rebase-skip-final-fix' into maint

Checking out all the paths from HEAD during the last conflicted
step in "git rebase" and continuing would cause the step to be
skipped (which is expected), but leaves MERGE_MSG file behind in
$GIT_DIR and confuses the next "git commit", which has been
corrected.

* pw/rebase-skip-final-fix:
  rebase --continue: remove .git/MERGE_MSG
  rebase --apply: restore some tests
  t3403: fix commit authorship

2 years agoMerge branch 'cb/ci-use-upload-artifacts-v1' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:38 +0000 (13:51 -0700)] 
Merge branch 'cb/ci-use-upload-artifacts-v1' into maint

Use upload-artifacts v1 (instead of v2) for 32-bit linux, as the
new version has a blocker bug for that architecture.

* cb/ci-use-upload-artifacts-v1:
  ci: use upload-artifacts v1 for dockerized jobs

2 years agoMerge branch 'jk/commit-edit-fixup-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:38 +0000 (13:51 -0700)] 
Merge branch 'jk/commit-edit-fixup-fix' into maint

"git commit --fixup" now works with "--edit" again, after it was
broken in v2.32.

* jk/commit-edit-fixup-fix:
  commit: restore --edit when combined with --fixup

2 years agoMerge branch 'jk/range-diff-fixes' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:38 +0000 (13:51 -0700)] 
Merge branch 'jk/range-diff-fixes' into maint

"git range-diff" code clean-up.

* jk/range-diff-fixes:
  range-diff: use ssize_t for parsed "len" in read_patches()
  range-diff: handle unterminated lines in read_patches()
  range-diff: drop useless "offset" variable from read_patches()

2 years agoMerge branch 'jk/apply-binary-hunk-parsing-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:37 +0000 (13:51 -0700)] 
Merge branch 'jk/apply-binary-hunk-parsing-fix' into maint

"git apply" miscounted the bytes and failed to read to the end of
binary hunks.

* jk/apply-binary-hunk-parsing-fix:
  apply: keep buffer/size pair in sync when parsing binary hunks

2 years agoMerge branch 'en/pull-conflicting-options' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:36 +0000 (13:51 -0700)] 
Merge branch 'en/pull-conflicting-options' into maint

"git pull" had various corner cases that were not well thought out
around its --rebase backend, e.g. "git pull --ff-only" did not stop
but went ahead and rebased when the history on other side is not a
descendant of our history.  The series tries to fix them up.

* en/pull-conflicting-options:
  pull: fix handling of multiple heads
  pull: update docs & code for option compatibility with rebasing
  pull: abort by default when fast-forwarding is not possible
  pull: make --rebase and --no-rebase override pull.ff=only
  pull: since --ff-only overrides, handle it first
  pull: abort if --ff-only is given and fast-forwarding is impossible
  t7601: add tests of interactions with multiple merge heads and config
  t7601: test interaction of merge/rebase/fast-forward flags and options

2 years agoMerge branch 'jt/push-negotiation-fixes' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:36 +0000 (13:51 -0700)] 
Merge branch 'jt/push-negotiation-fixes' into maint

Bugfix for common ancestor negotiation recently introduced in "git
push" codepath.

* jt/push-negotiation-fixes:
  fetch: die on invalid --negotiation-tip hash
  send-pack: fix push nego. when remote has refs
  send-pack: fix push.negotiate with remote helper

2 years agoMerge branch 'ab/pack-stdin-packs-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:35 +0000 (13:51 -0700)] 
Merge branch 'ab/pack-stdin-packs-fix' into maint

Input validation of "git pack-objects --stdin-packs" has been
corrected.

* ab/pack-stdin-packs-fix:
  pack-objects: fix segfault in --stdin-packs option
  pack-objects tests: cover blindspots in stdin handling

2 years agoMerge branch 'en/typofixes' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:35 +0000 (13:51 -0700)] 
Merge branch 'en/typofixes' into maint

Typofixes.

* en/typofixes:
  merge-ort: fix completely wrong comment
  trace2.h: fix trivial comment typo

2 years agoMerge branch 'cb/unicode-14' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:35 +0000 (13:51 -0700)] 
Merge branch 'cb/unicode-14' into maint

The unicode character width table (used for output alignment) has
been updated.

* cb/unicode-14:
  unicode: update the width tables to Unicode 14

2 years agoMerge branch 'po/git-config-doc-mentions-help-c' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:34 +0000 (13:51 -0700)] 
Merge branch 'po/git-config-doc-mentions-help-c' into maint

Doc update.

* po/git-config-doc-mentions-help-c:
  doc: config, tell readers of `git help --config`

2 years agoMerge branch 'kz/revindex-comment-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:34 +0000 (13:51 -0700)] 
Merge branch 'kz/revindex-comment-fix' into maint

Header comment fix.

* kz/revindex-comment-fix:
  pack-revindex.h: correct the time complexity descriptions

2 years agoMerge branch 'cb/plug-leaks-in-alloca-emu-users' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:34 +0000 (13:51 -0700)] 
Merge branch 'cb/plug-leaks-in-alloca-emu-users' into maint

Leakfix.

* cb/plug-leaks-in-alloca-emu-users:
  t0000: avoid masking git exit value through pipes
  tree-diff: fix leak when not HAVE_ALLOCA_H

2 years agoMerge branch 'ma/doc-git-version' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:34 +0000 (13:51 -0700)] 
Merge branch 'ma/doc-git-version' into maint

Doc update.

* ma/doc-git-version:
  documentation: add documentation for 'git version'

2 years agoMerge branch 'rs/drop-core-compression-vars' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:33 +0000 (13:51 -0700)] 
Merge branch 'rs/drop-core-compression-vars' into maint

Code clean-up.

* rs/drop-core-compression-vars:
  compression: drop write-only core_compression_* variables

2 years agoMerge branch 'jk/t5562-racefix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:33 +0000 (13:51 -0700)] 
Merge branch 'jk/t5562-racefix' into maint

Test update.

* jk/t5562-racefix:
  t5562: use alarm() to interrupt timed child-wait

2 years agoMerge branch 'rs/setup-use-xopen-and-xdup' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:33 +0000 (13:51 -0700)] 
Merge branch 'rs/setup-use-xopen-and-xdup' into maint

Code clean-up.

* rs/setup-use-xopen-and-xdup:
  setup: use xopen and xdup in sanitize_stdfds

2 years agoMerge branch 'jc/prefix-filename-allocates' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:32 +0000 (13:51 -0700)] 
Merge branch 'jc/prefix-filename-allocates' into maint

Leakfix.

* jc/prefix-filename-allocates:
  hash-object: prefix_filename() returns allocated memory these days

2 years agoMerge branch 'ab/no-more-check-bindir' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:32 +0000 (13:51 -0700)] 
Merge branch 'ab/no-more-check-bindir' into maint

Build simplification.

* ab/no-more-check-bindir:
  Makefile: remove the check_bindir script

2 years agoMerge branch 'bs/doc-bugreport-outdir' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:32 +0000 (13:51 -0700)] 
Merge branch 'bs/doc-bugreport-outdir' into maint

Docfix.

* bs/doc-bugreport-outdir:
  Documentation: fix default directory of git bugreport -o

2 years agoMerge branch 'cb/ci-build-pedantic' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:31 +0000 (13:51 -0700)] 
Merge branch 'cb/ci-build-pedantic' into maint

CI update.

* cb/ci-build-pedantic:
  ci: run a pedantic build as part of the GitHub workflow

2 years agoMerge branch 'rs/archive-use-object-id' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:31 +0000 (13:51 -0700)] 
Merge branch 'rs/archive-use-object-id' into maint

Code cleanup.

* rs/archive-use-object-id:
  archive: convert queue_directory to struct object_id

2 years agoMerge branch 'rs/show-branch-simplify' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:31 +0000 (13:51 -0700)] 
Merge branch 'rs/show-branch-simplify' into maint

Code cleanup.

* rs/show-branch-simplify:
  show-branch: simplify rev_is_head()

2 years agoMerge branch 'cb/remote-ndebug-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:30 +0000 (13:51 -0700)] 
Merge branch 'cb/remote-ndebug-fix' into maint

Build fix.

* cb/remote-ndebug-fix:
  remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG

2 years agoMerge branch 'ab/mailmap-leakfix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:30 +0000 (13:51 -0700)] 
Merge branch 'ab/mailmap-leakfix' into maint

Leakfix.

* ab/mailmap-leakfix:
  mailmap.c: fix a memory leak in free_mailap_{info,entry}()

2 years agoMerge branch 'ab/gc-log-rephrase' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:30 +0000 (13:51 -0700)] 
Merge branch 'ab/gc-log-rephrase' into maint

A pathname in an advice message has been made cut-and-paste ready.

* ab/gc-log-rephrase:
  gc: remove trailing dot from "gc.log" line

2 years agoMerge branch 'ba/object-info' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:29 +0000 (13:51 -0700)] 
Merge branch 'ba/object-info' into maint

Leakfix.

* ba/object-info:
  protocol-caps.c: fix memory leak in send_info()

2 years agoMerge branch 'es/walken-tutorial-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:29 +0000 (13:51 -0700)] 
Merge branch 'es/walken-tutorial-fix' into maint

Typofix.

* es/walken-tutorial-fix:
  doc: fix syntax error and the format of printf

2 years agoMerge branch 'rs/xopen-reports-open-failures' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:28 +0000 (13:51 -0700)] 
Merge branch 'rs/xopen-reports-open-failures' into maint

Error diagnostics improvement.

* rs/xopen-reports-open-failures:
  use xopen() to handle fatal open(2) failures
  xopen: explicitly report creation failures

2 years agoMerge branch 'dd/t6300-wo-gpg-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:28 +0000 (13:51 -0700)] 
Merge branch 'dd/t6300-wo-gpg-fix' into maint

Test fix.

* dd/t6300-wo-gpg-fix:
  t6300: check for cat-file exit status code
  t6300: don't run cat-file on non-existent object

2 years agoMerge branch 'mh/credential-leakfix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:28 +0000 (13:51 -0700)] 
Merge branch 'mh/credential-leakfix' into maint

Leak fix.

* mh/credential-leakfix:
  credential: fix leak in credential_apply_config()

2 years agoMerge branch 'jk/t5323-no-pack-test-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:27 +0000 (13:51 -0700)] 
Merge branch 'jk/t5323-no-pack-test-fix' into maint

Test fix.

* jk/t5323-no-pack-test-fix:
  t5323: drop mentions of "master"

2 years agoMerge branch 'js/maintenance-launchctl-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:27 +0000 (13:51 -0700)] 
Merge branch 'js/maintenance-launchctl-fix' into maint

"git maintenance" scheduler fix for macOS.

* js/maintenance-launchctl-fix:
  maintenance: skip bootout/bootstrap when plist is registered
  maintenance: create `launchctl` configuration using a lock file

2 years agoMerge branch 'ab/rebase-fatal-fatal-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:27 +0000 (13:51 -0700)] 
Merge branch 'ab/rebase-fatal-fatal-fix' into maint

Error message fix.

* ab/rebase-fatal-fatal-fix:
  rebase: emit one "fatal" in "fatal: fatal: <error>"

2 years agoMerge branch 'ab/ls-remote-packet-trace' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:26 +0000 (13:51 -0700)] 
Merge branch 'ab/ls-remote-packet-trace' into maint

Debugging aid fix.

* ab/ls-remote-packet-trace:
  ls-remote: set packet_trace_identity(<name>)

2 years agoMerge branch 'ga/send-email-sendmail-cmd' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:26 +0000 (13:51 -0700)] 
Merge branch 'ga/send-email-sendmail-cmd' into maint

Test fix.

* ga/send-email-sendmail-cmd:
  t9001: PATH must not use Windows-style paths

2 years agoMerge branch 'me/t5582-cleanup' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:25 +0000 (13:51 -0700)] 
Merge branch 'me/t5582-cleanup' into maint

Test fix.

* me/t5582-cleanup:
  t5582: remove spurious 'cd "$D"' line

2 years agoMerge branch 'sg/make-fix-ar-invocation' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:25 +0000 (13:51 -0700)] 
Merge branch 'sg/make-fix-ar-invocation' into maint

Build fix.

* sg/make-fix-ar-invocation:
  Makefile: remove archives before manipulating them with 'ar'

2 years agoMerge branch 'ti/tcsh-completion-regression-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:24 +0000 (13:51 -0700)] 
Merge branch 'ti/tcsh-completion-regression-fix' into maint

Update to the command line completion (in contrib/) for tcsh.

* ti/tcsh-completion-regression-fix:
  completion: tcsh: Fix regression by drop of wrapper functions

2 years agoMerge branch 'fc/completion-updates' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:24 +0000 (13:51 -0700)] 
Merge branch 'fc/completion-updates' into maint

Command line completion updates.

* fc/completion-updates:
  completion: bash: add correct suffix in variables
  completion: bash: fix for multiple dash commands
  completion: bash: fix for suboptions with value
  completion: bash: fix prefix detection in branch.*

2 years agoMerge branch 'cb/ci-freebsd-update' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:24 +0000 (13:51 -0700)] 
Merge branch 'cb/ci-freebsd-update' into maint

Update FreeBSD CI job

* cb/ci-freebsd-update:
  ci: update freebsd 12 cirrus job

2 years agoMerge branch 'cb/builtin-merge-format-string-fix' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:23 +0000 (13:51 -0700)] 
Merge branch 'cb/builtin-merge-format-string-fix' into maint

Code clean-up.

* cb/builtin-merge-format-string-fix:
  builtin/merge: avoid -Wformat-extra-args from ancient Xcode

2 years agoMerge branch 'js/log-protocol-version' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:22 +0000 (13:51 -0700)] 
Merge branch 'js/log-protocol-version' into maint

Debugging aid.

* js/log-protocol-version:
  connect, protocol: log negotiated protocol version

2 years agoMerge branch 'en/merge-strategy-docs' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:22 +0000 (13:51 -0700)] 
Merge branch 'en/merge-strategy-docs' into maint

Documentation updates.

* en/merge-strategy-docs:
  Update error message and code comment
  merge-strategies.txt: add coverage of the `ort` merge strategy
  git-rebase.txt: correct out-of-date and misleading text about renames
  merge-strategies.txt: fix simple capitalization error
  merge-strategies.txt: avoid giving special preference to patience algorithm
  merge-strategies.txt: do not imply using copy detection is desired
  merge-strategies.txt: update wording for the resolve strategy
  Documentation: edit awkward references to `git merge-recursive`
  directory-rename-detection.txt: small updates due to merge-ort optimizations
  git-rebase.txt: correct antiquated claims about --rebase-merges

2 years agoMerge branch 'ab/bundle-doc' into maint
Junio C Hamano [Tue, 12 Oct 2021 20:51:22 +0000 (13:51 -0700)] 
Merge branch 'ab/bundle-doc' into maint

Doc update.

* ab/bundle-doc:
  bundle doc: replace "basis" with "prerequsite(s)"
  bundle doc: elaborate on rev<->ref restriction
  bundle doc: elaborate on object prerequisites
  bundle doc: rewrite the "DESCRIPTION" section

2 years agoconnect: also update offset for features without values
Andrzej Hunt [Sun, 26 Sep 2021 15:58:33 +0000 (15:58 +0000)] 
connect: also update offset for features without values

parse_feature_value() takes an offset, and uses it to seek past the
point in features_list that we've already seen. However if the feature
being searched for does not specify a value, the offset is not
updated. Therefore if we call parse_feature_value() in a loop on a
value-less feature, we'll keep on parsing the same feature over and over
again. This usually isn't an issue: there's no point in using
next_server_feature_value() to search for repeated instances of the same
capability unless that capability typically specifies a value - but a
broken server could send a response that omits the value for a feature
even when we are expecting a value.

Therefore we add an offset update calculation for the no-value case,
which helps ensure that loops using next_server_feature_value() will
always terminate.

next_server_feature_value(), and the offset calculation, were first
added in 2.28 in 2c6a403d96 (connect: add function to parse multiple
v1 capability values, 2020-05-25).

Thanks to Peff for authoring the test.

Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Andrzej Hunt <andrzej@ahunt.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodifftool: fix symlink-file writing in dir-diff mode
David Aguilar [Thu, 23 Sep 2021 04:12:50 +0000 (21:12 -0700)] 
difftool: fix symlink-file writing in dir-diff mode

The difftool dir-diff mode handles symlinks by replacing them with their
readlink(2) values. This allows diff tools to see changes to symlinks
as if they were regular text diffs with the old and new path values.
This is analogous to what "git diff" displays when symlinks change.

The temporary diff directories that are created initially contain
symlinks because they get checked-out using a temporary index that
retains the original symlinks as checked-in to the repository.

A bug was introduced when difftool was rewritten in C that made
difftool write the readlink(2) contents into the pointed-to file rather
than the symlink itself. The write was going through the symlink and
writing to its target rather than writing to the symlink path itself.

Replace symlinks with raw text files by unlinking the symlink path
before writing the readlink(2) content into them.

When 18ec800512 (difftool: handle modified symlinks in dir-diff mode,
2017-03-15) added handling for modified symlinks this bug got recorded
in the test suite. The tests included the pointed-to symlink target
paths. These paths were being reported because difftool was erroneously
writing to them, but they should have never been reported nor written.

Correct the modified-symlinks test cases by removing the target files
from the expected output.

Add a test to ensure that symlinks are written with the readlink(2)
values and that the target files contain their original content.

Reported-by: Alan Blotz <work@blotz.org>
Helped-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agohttp: match headers case-insensitively when redacting
Jeff King [Wed, 22 Sep 2021 22:11:53 +0000 (18:11 -0400)] 
http: match headers case-insensitively when redacting

When HTTP/2 is in use, we fail to correctly redact "Authorization" (and
other) headers in our GIT_TRACE_CURL output.

We get the headers in our CURLOPT_DEBUGFUNCTION callback, curl_trace().
It passes them along to curl_dump_header(), which in turn checks
redact_sensitive_header(). We see the headers as a text buffer like:

  Host: ...
  Authorization: Basic ...

After breaking it into lines, we match each header using skip_prefix().
This is case-sensitive, even though HTTP headers are case-insensitive.
This has worked reliably in the past because these headers are generated
by curl itself, which is predictable in what it sends.

But when HTTP/2 is in use, instead we get a lower-case "authorization:"
header, and we fail to match it. The fix is simple: we should match with
skip_iprefix().

Testing is more complicated, though. We do have a test for the redacting
feature, but we don't hit the problem case because our test Apache setup
does not understand HTTP/2. You can reproduce the issue by applying this
on top of the test change in this patch:

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index afa91e38b0..19267c7107 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -29,6 +29,9 @@ ErrorLog error.log
  LoadModule setenvif_module modules/mod_setenvif.so
 </IfModule>

+LoadModule http2_module modules/mod_http2.so
+Protocols h2c
+
 <IfVersion < 2.4>
 LockFile accept.lock
 </IfVersion>
@@ -64,8 +67,8 @@ LockFile accept.lock
 <IfModule !mod_access_compat.c>
  LoadModule access_compat_module modules/mod_access_compat.so
 </IfModule>
-<IfModule !mod_mpm_prefork.c>
- LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+<IfModule !mod_mpm_event.c>
+ LoadModule mpm_event_module modules/mod_mpm_event.so
 </IfModule>
 <IfModule !mod_unixd.c>
  LoadModule unixd_module modules/mod_unixd.so
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 1c2a444ae7..ff74f0ae8a 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -24,6 +24,10 @@ test_expect_success 'create http-accessible bare repository' '
  git push public main:main
 '

+test_expect_success 'prefer http/2' '
+ git config --global http.version HTTP/2
+'
+
 setup_askpass_helper

 test_expect_success 'clone http repository' '

but this has a few issues:

  - it's not necessarily portable. The http2 apache module might not be
    available on all systems. Further, the http2 module isn't compatible
    with the prefork mpm, so we have to switch to something else. But we
    don't necessarily know what's available. It would be nice if we
    could have conditional config, but IfModule only tells us if a
    module is already loaded, not whether it is available at all.

    This might be a non-issue. The http tests are already optional, and
    modern-enough systems may just have both of these. But...

  - if we do this, then we'd no longer be testing HTTP/1.1 at all. I'm
    not sure how much that matters since it's all handled by curl under
    the hood, but I'd worry that some detail leaks through. We'd
    probably want two scripts running similar tests, one with HTTP/2 and
    one with HTTP/1.1.

  - speaking of which, a later test fails with the patch above! The
    problem is that it is making sure we used a chunked
    transfer-encoding by looking for that header in the trace. But
    HTTP/2 doesn't support that, as it has its own streaming mechanisms
    (the overall operation works fine; we just don't see the header in
    the trace).

Furthermore, even with the changes above, this test still does not
detect the current failure, because we see _both_ HTTP/1.1 and HTTP/2
requests, which confuse it. Quoting only the interesting bits from the
resulting trace file, we first see:

  => Send header: GET /auth/smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
  => Send header: Connection: Upgrade, HTTP2-Settings
  => Send header: Upgrade: h2c
  => Send header: HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA

  <= Recv header: HTTP/1.1 401 Unauthorized
  <= Recv header: Date: Wed, 22 Sep 2021 20:03:32 GMT
  <= Recv header: Server: Apache/2.4.49 (Debian)
  <= Recv header: WWW-Authenticate: Basic realm="git-auth"

So the client asks for HTTP/2, but Apache does not do the upgrade for
the 401 response. Then the client repeats with credentials:

  => Send header: GET /auth/smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
  => Send header: Authorization: Basic <redacted>
  => Send header: Connection: Upgrade, HTTP2-Settings
  => Send header: Upgrade: h2c
  => Send header: HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA

  <= Recv header: HTTP/1.1 101 Switching Protocols
  <= Recv header: Upgrade: h2c
  <= Recv header: Connection: Upgrade
  <= Recv header: HTTP/2 200
  <= Recv header: content-type: application/x-git-upload-pack-advertisement

So the client does properly redact there, because we're speaking
HTTP/1.1, and the server indicates it can do the upgrade. And then the
client will make further requests using HTTP/2:

  => Send header: POST /auth/smart/repo.git/git-upload-pack HTTP/2
  => Send header: authorization: Basic dXNlckBob3N0OnBhc3NAaG9zdA==
  => Send header: content-type: application/x-git-upload-pack-request

And there we can see that the credential is _not_ redacted. This part of
the test is what gets confused:

# Ensure that there is no "Basic" followed by a base64 string, but that
# the auth details are redacted
! grep "Authorization: Basic [0-9a-zA-Z+/]" trace &&
grep "Authorization: Basic <redacted>" trace

The first grep does not match the un-redacted HTTP/2 header, because
it insists on an uppercase "A". And the second one does find the
HTTP/1.1 header. So as far as the test is concerned, everything is OK,
but it failed to notice the un-redacted lines.

We can make this test (and the other related ones) more robust by adding
"-i" to grep case-insensitively. This isn't really doing anything for
now, since we're not actually speaking HTTP/2, but it future-proofs the
tests for a day when we do (either we add explicit HTTP/2 test support,
or it's eventually enabled by default by our Apache+curl test setup).
And it doesn't hurt in the meantime for the tests to be more careful.

The change to use "grep -i", coupled with the changes to use HTTP/2
shown above, causes the test to fail with the current code, and pass
after this patch is applied.

And finally, there's one other way to demonstrate the issue (and how I
actually found it originally). Looking at GIT_TRACE_CURL output against
github.com, you'll see the unredacted output, even if you didn't set
http.version. That's because setting it is only necessary for curl to
send the extra headers in its HTTP/1.1 request that say "Hey, I speak
HTTP/2; upgrade if you do, too". But for a production site speaking
https, the server advertises via ALPN, a TLS extension, that it supports
HTTP/2, and the client can immediately start using it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMakefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes
Ævar Arnfjörð Bjarmason [Wed, 22 Sep 2021 20:17:06 +0000 (22:17 +0200)] 
Makefile: clean .depend dirs under COMPUTE_HEADER_DEPENDENCIES != yes

Fix a logic error in dfea575017d (Makefile: lazily compute header
dependencies, 2010-01-26) where we'd make whether we cleaned the
.depend dirs contingent on the currently configured
COMPUTE_HEADER_DEPENDENCIES value. Before this running e.g.:

    make COMPUTE_HEADER_DEPENDENCIES=yes grep.o
    make COMPUTE_HEADER_DEPENDENCIES=no clean

Would leave behind the .depend directory, now it'll be removed.

Normally we'd need to use another variable, but in this case there's
no other uses of $(dep_dirs), as opposed to $(dep_args) which is used
as an argument to $(CC). So just deleting this line makes everything
work correctly.

See http://lore.kernel.org/git/xmqqmto48ufz.fsf@gitster.g for a report
about this issue.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoclone: handle unborn branch in bare repos
Jeff King [Mon, 20 Sep 2021 19:04:10 +0000 (15:04 -0400)] 
clone: handle unborn branch in bare repos

When cloning a repository with an unborn HEAD, we'll set the local HEAD
to match it only if the local repository is non-bare. This is
inconsistent with all other combinations:

  remote HEAD       | local repo | local HEAD
  -----------------------------------------------
  points to commit  | non-bare   | same as remote
  points to commit  | bare       | same as remote
  unborn            | non-bare   | same as remote
  unborn            | bare       | local default

So I don't think this is some clever or subtle behavior, but just a bug
in 4f37d45706 (clone: respect remote unborn HEAD, 2021-02-05). And it's
easy to see how we ended up there. Before that commit, the code to set
up the HEAD for an empty repo was guarded by "if (!option_bare)". That's
because the only thing it did was call install_branch_config(), and we
don't want to do so for a bare repository (unborn HEAD or not).

That commit put the handling of unborn HEADs into the same block, since
those also need to call install_branch_config(). But the unborn case has
an additional side effect of calling create_symref(), and we want that
to happen whether we are bare or not.

This patch just pulls all of the "figure out the default branch" code
out of the "!option_bare" block. Only the actual config installation is
kept there.

Note that this does mean we might allocate "ref" and not use it (if the
remote is empty but did not advertise an unborn HEAD). But that's not
really a big deal since this isn't a hot code path, and it keeps the
code simple. The alternative would be handling unborn_head_target
separately, but that gets confusing since its memory ownership is
tangled up with the "ref" variable.

There's just one new test, for the case we're fixing. The other ones in
the table are handled elsewhere (the unborn non-bare case just above,
and the actually-born cases in t5601, t5606, and t5609, as they do not
require v2's "unborn" protocol extension).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomerge-ort: fix completely wrong comment
Elijah Newren [Sun, 19 Sep 2021 01:48:55 +0000 (01:48 +0000)] 
merge-ort: fix completely wrong comment

Not sure what happened, but the comment is describing code elsewhere in
the file.  Fix the comment to actually discuss the code that follows.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotrace2.h: fix trivial comment typo
Elijah Newren [Sun, 19 Sep 2021 01:48:54 +0000 (01:48 +0000)] 
trace2.h: fix trivial comment typo

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agounicode: update the width tables to Unicode 14
Carlo Marcelo Arenas Belón [Fri, 17 Sep 2021 19:19:20 +0000 (12:19 -0700)] 
unicode: update the width tables to Unicode 14

Released[0] after a long beta period and including several additional
zero/double width characters.

[0] https://home.unicode.org/announcing-the-unicode-standard-version-14-0/

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoDocumentation: cleanup git-cvsserver
Carlo Marcelo Arenas Belón [Wed, 15 Sep 2021 08:09:48 +0000 (01:09 -0700)] 
Documentation: cleanup git-cvsserver

Fix a few typos and alignment issues, and while at it update the
example hashes to show most of the ones available in recent crypt(3).

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-cvsserver: protect against NULL in crypt(3)
Carlo Marcelo Arenas Belón [Wed, 15 Sep 2021 08:09:47 +0000 (01:09 -0700)] 
git-cvsserver: protect against NULL in crypt(3)

Some versions of crypt(3) will return NULL when passed an unsupported
hash type (ex: OpenBSD with DES), so check for undef instead of using
it directly.

Also use this to probe the system and select a better hash function in
the tests, so it can pass successfully.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
[jc: <CAPUEspjqD5zy8TLuFA96usU7FYi=0wF84y7NgOVFqegtxL9zbw@mail.gmail.com>]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-cvsserver: use crypt correctly to compare password hashes
Carlo Marcelo Arenas Belón [Wed, 15 Sep 2021 08:09:46 +0000 (01:09 -0700)] 
git-cvsserver: use crypt correctly to compare password hashes

c057bad370 (git-cvsserver: use a password file cvsserver pserver,
2010-05-15) adds a way for `git cvsserver` to provide authenticated
pserver accounts without having clear text passwords, but uses the
username instead of the password to the call for crypt(3).

Correct that, and make sure the documentation correctly indicates how
to obtain hashed passwords that could be used to populate this
configuration, as well as correcting the hash that was used for the
tests.

This change will require that any user of this feature updates the
hashes in their configuration, but has the advantage of using a more
similar format than cvs uses, probably also easying any migration.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot0000: avoid masking git exit value through pipes
Carlo Marcelo Arenas Belón [Thu, 16 Sep 2021 08:55:23 +0000 (01:55 -0700)] 
t0000: avoid masking git exit value through pipes

9af0b8dbe2 (t0000-basic: more commit-tree tests., 2006-04-26) adds
tests for commit-tree that mask the return exit from git as described
in a378fee5b07 (Documentation: add shell guidelines, 2018-10-05).

Fix the tests, to avoid pipes by using a temporary file instead.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotree-diff: fix leak when not HAVE_ALLOCA_H
Carlo Marcelo Arenas Belón [Thu, 16 Sep 2021 08:55:22 +0000 (01:55 -0700)] 
tree-diff: fix leak when not HAVE_ALLOCA_H

b8ba412bf7 (tree-diff: avoid alloca for large allocations, 2016-06-07)
adds a way to route some bigger allocations out of the stack and free
them through the addition of two conveniently named macros, but leaves
the calls to free the xalloca part, which could be also in the heap,
if the system doesn't HAVE_ALLOCA_H (ex: macOS and other BSD).

Add the missing free call, xalloca_free(), which is a noop if we
allocated memory in the stack frame, but a real free() if we
allocated in the heap instead, and while at it, change the expression
to match in both macros for ease of readability.

This avoids a leak reported by LSAN while running t0000 but that
wouldn't fail the test (which is fixed in the next patch):

  SUMMARY: LeakSanitizer: 1034 byte(s) leaked in 15 allocation(s).

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agopack-revindex.h: correct the time complexity descriptions
Kyle Zhao [Wed, 15 Sep 2021 09:09:23 +0000 (09:09 +0000)] 
pack-revindex.h: correct the time complexity descriptions

Time complexities for pack_pos_to_midx and midx_to_pack_pos are swapped,
correct it.

Signed-off-by: Kyle Zhao <kylezhao@tencent.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot1400: avoid SIGPIPE race condition on fifo
Jeff King [Wed, 15 Sep 2021 17:24:52 +0000 (13:24 -0400)] 
t1400: avoid SIGPIPE race condition on fifo

t1400.190 sometimes fails or even hangs because of the way it uses
fifos. Our goal is to interactively read and write lines from
update-ref, so we have two fifos, in and out. We open a descriptor
connected to "in" and redirect output to that, so that update-ref does
not see EOF as it would if we opened and closed it for each "echo" call.

But we don't do the same for the output. This leads to a race where our
"read response <out" has not yet opened the fifo, but update-ref tries
to write to it and gets SIGPIPE. This can result in the test failing, or
worse, hanging as we wait forever for somebody to write to the pipe.

This is the same proble we fixed in 4783e7ea83 (t0008: avoid SIGPIPE
race condition on fifo, 2013-07-12), and we can fix it the same way, by
opening a second long-running descriptor.

Before this patch, running:

  ./t1400-update-ref.sh --run=1,190 --stress

failed or hung within a few dozen iterations. After it, I ran it for
several hundred without problems.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodocumentation: add documentation for 'git version'
Matthias Aßhauer [Tue, 14 Sep 2021 13:27:18 +0000 (13:27 +0000)] 
documentation: add documentation for 'git version'

While 'git version' is probably the least complex git command,
it is a non-experimental user-facing builtin command. As such
it should have a help page.

Both `git help` and `git version` can be called as options
(`--help`/`--version`) that internally get converted to the
corresponding command. Add a small paragraph to
Documentation/git.txt describing how these two options
interact with each other and link to this help page for the
sub-options that `--version` can take. Well, currently there
is only one sub-option, but that could potentially increase
in future versions of Git.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodoc: config, tell readers of `git help --config`
Philip Oakley [Mon, 13 Sep 2021 21:23:05 +0000 (22:23 +0100)] 
doc: config, tell readers of `git help --config`

The `git help` command gained the ability to list config variables in
3ac68a93fd (help: add --config to list all available config, 2018-05-26)
but failed to tell readers of the config documenation itself.

Provide that cross reference.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agostrvec: use size_t to store nr and alloc
Jeff King [Sat, 11 Sep 2021 15:01:16 +0000 (11:01 -0400)] 
strvec: use size_t to store nr and alloc

We converted argv_array (which later became strvec) to use size_t in
819f0e76b1 (argv-array: use size_t for count and alloc, 2020-07-28) in
order to avoid the possibility of integer overflow. But later, commit
d70a9eb611 (strvec: rename struct fields, 2020-07-28) accidentally
converted these back to ints!

Those two commits were part of the same patch series. I'm pretty sure
what happened is that they were originally written in the opposite order
and then cleaned up and re-ordered during an interactive rebase. And
when resolving the inevitable conflict, I mistakenly took the "rename"
patch completely, accidentally dropping the type change.

We can correct it now; better late than never.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompression: drop write-only core_compression_* variables
René Scharfe [Sat, 11 Sep 2021 11:45:43 +0000 (13:45 +0200)] 
compression: drop write-only core_compression_* variables

Since 8de7eeb54b (compression: unify pack.compression configuration
parsing, 2016-11-15) the variables core_compression_level and
core_compression_seen are only set, but never read.  Remove them.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>