]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'jk/optim-promisor-object-enumeration'
Junio C Hamano [Mon, 11 Jul 2022 22:38:50 +0000 (15:38 -0700)] 
Merge branch 'jk/optim-promisor-object-enumeration'

Collection of what is referenced by objects in promisor packs have
been optimized to inspect these objects in the in-pack order.

* jk/optim-promisor-object-enumeration:
  is_promisor_object(): walk promisor packs in pack-order

2 years agoMerge branch 'ac/bitmap-format-doc'
Junio C Hamano [Mon, 11 Jul 2022 22:38:50 +0000 (15:38 -0700)] 
Merge branch 'ac/bitmap-format-doc'

Adjust technical/bitmap-format to be formatted by AsciiDoc, and
add some missing information to the documentation.

* ac/bitmap-format-doc:
  bitmap-format.txt: add information for trailing checksum
  bitmap-format.txt: fix some formatting issues
  bitmap-format.txt: feed the file to asciidoc to generate html

2 years agoMerge branch 'pb/diff-doc-raw-format'
Junio C Hamano [Mon, 11 Jul 2022 22:38:49 +0000 (15:38 -0700)] 
Merge branch 'pb/diff-doc-raw-format'

Update "git diff/log --raw" format documentation.

* pb/diff-doc-raw-format:
  diff-index.txt: update raw output format in examples
  diff-format.txt: correct misleading wording
  diff-format.txt: dst can be 0* SHA-1 when path is deleted, too

2 years agoMerge branch 'jk/revisions-doc-markup-fix'
Junio C Hamano [Mon, 11 Jul 2022 22:38:49 +0000 (15:38 -0700)] 
Merge branch 'jk/revisions-doc-markup-fix'

Documentation mark-up fix.

* jk/revisions-doc-markup-fix:
  revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis

2 years agoMerge branch 'rs/combine-diff-with-incompatible-options'
Junio C Hamano [Mon, 11 Jul 2022 22:38:48 +0000 (15:38 -0700)] 
Merge branch 'rs/combine-diff-with-incompatible-options'

Certain diff options are currently ignored when combined-diff is
shown; mark them as incompatible with the feature.

* rs/combine-diff-with-incompatible-options:
  combine-diff: abort if --output is given
  combine-diff: abort if --ignore-matching-lines is given

2 years agoA regression fix for 2.37
Junio C Hamano [Sun, 3 Jul 2022 00:01:34 +0000 (17:01 -0700)] 
A regression fix for 2.37

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'js/add-i-delete'
Junio C Hamano [Sun, 3 Jul 2022 04:56:08 +0000 (21:56 -0700)] 
Merge branch 'js/add-i-delete'

Rewrite of "git add -i" in C that appeared in Git 2.25 didn't
correctly record a removed file to the index, which was fixed.

* js/add-i-delete:
  add --interactive: allow `update` to stage deleted files

2 years agoadd --interactive: allow `update` to stage deleted files
Johannes Schindelin [Tue, 28 Jun 2022 22:22:44 +0000 (22:22 +0000)] 
add --interactive: allow `update` to stage deleted files

The scripted version of `git add -i` used `git update-index --add
--remove`, but the built-in version implemented only the `--add` part.

This fixes https://github.com/msys2/MSYS2-packages/issues/3066

Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.37 v2.37.0
Junio C Hamano [Mon, 27 Jun 2022 16:17:55 +0000 (09:17 -0700)] 
Git 2.37

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jc/revert-show-parent-info'
Junio C Hamano [Mon, 27 Jun 2022 16:13:41 +0000 (09:13 -0700)] 
Merge branch 'jc/revert-show-parent-info'

* jc/revert-show-parent-info:
  revert: config documentation fixes

2 years agoMerge tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 27 Jun 2022 15:39:10 +0000 (08:39 -0700)] 
Merge tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po

l10n-2.37.0-rnd1

* tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po:
  l10n: sv.po: Update Swedish translation (5367t0f0u)
  l10n: ru.po: update Russian translation
  l10n: zh_TW: v2.37.0 round 1
  l10n: vi(5367t): Updated translation
  l10n: fr v2.37 round 1
  l10n: Update Catalan translation
  l10n: po-id for 2.37 (first batch)
  l10n: tr: v2.37.0 round #1
  l10n: README: fix typo
  l10n: TEAMS: Change German translation team leader
  l10n: de.po: Update German translation
  l10n: bg.po: Updated Bulgarian translation (5367t)
  l10n: zh_CN: v2.37.0 round 1
  l10n: es: update translation

2 years agorevert: config documentation fixes
René Scharfe [Sun, 26 Jun 2022 09:29:35 +0000 (11:29 +0200)] 
revert: config documentation fixes

43966ab315 (revert: optionally refer to commit in the "reference"
format, 2022-05-26) added the documentation file config/revert.txt.
Actually include it in config.txt.

Make is used with a bare infinitive after the object; remove the "to".

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: sv.po: Update Swedish translation (5367t0f0u)
Peter Krefting [Fri, 24 Jun 2022 20:23:54 +0000 (21:23 +0100)] 
l10n: sv.po: Update Swedish translation (5367t0f0u)

Run msgmerge with --no-location to drop file locations to decrease the
size of future patches. Also removed old translations.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agol10n: ru.po: update Russian translation
Dimitriy Ryazantcev [Mon, 20 Jun 2022 13:02:39 +0000 (16:02 +0300)] 
l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po
Jiang Xin [Sun, 26 Jun 2022 05:54:26 +0000 (13:54 +0800)] 
Merge branch 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po

* 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po:
  l10n: zh_TW: v2.37.0 round 1

3 years agol10n: zh_TW: v2.37.0 round 1
Yi-Jyun Pan [Thu, 23 Jun 2022 13:08:28 +0000 (21:08 +0800)] 
l10n: zh_TW: v2.37.0 round 1

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Sat, 25 Jun 2022 03:01:20 +0000 (11:01 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi(5367t): Updated translation

3 years agol10n: vi(5367t): Updated translation
Tran Ngoc Quan [Sat, 25 Jun 2022 01:40:42 +0000 (08:40 +0700)] 
l10n: vi(5367t): Updated translation

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agol10n: fr v2.37 round 1
Jean-Noël Avila [Fri, 24 Jun 2022 09:04:25 +0000 (11:04 +0200)] 
l10n: fr v2.37 round 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agol10n: Update Catalan translation
Jordi Mas [Fri, 24 Jun 2022 11:30:45 +0000 (13:30 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agoMerge branch 'ab/credentials-in-url-more'
Junio C Hamano [Thu, 23 Jun 2022 20:22:35 +0000 (13:22 -0700)] 
Merge branch 'ab/credentials-in-url-more'

* ab/credentials-in-url-more:
  Documentation/config/transfer.txt: fix typo

3 years agoDocumentation/config/transfer.txt: fix typo
Taylor Blau [Thu, 23 Jun 2022 19:02:01 +0000 (15:02 -0400)] 
Documentation/config/transfer.txt: fix typo

Commit 7281c196b1 (transfer doc: move fetch.credentialsInUrl to
"transfer" config namespace, 2022-06-15) propagates a typo from
6dcbdc0d66 (remote: create fetch.credentialsInUrl config, 2022-06-06),
where "other" is misspelled as "oher". Fix the typo accordingly.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Thu, 23 Jun 2022 13:01:47 +0000 (21:01 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.37 (first batch)

3 years agol10n: po-id for 2.37 (first batch)
Bagas Sanjaya [Wed, 15 Jun 2022 07:33:28 +0000 (14:33 +0700)] 
l10n: po-id for 2.37 (first batch)

Update following components:

  - apply.c
  - builtin/bisect--helper.c
  - builtin/fetch.c
  - builtin/fsck.c
  - builtin/log.c
  - builtin/notes.c
  - builtin/push.c
  - builtin/submodule--helper.c
  - builtin/worktree.c
  - index-pack.c
  - init-db.c
  - remote.c

Translate following new components:

  - attr.c
  - builtin/name-rev.c
  - builtin/pack-objects.c
  - builtin/pack-refs.c
  - builtin/prune.c
  - builtin/update-server-info.c
  - object-file.c
  - object-name.c
  - object.c
  - pack-bitmap.c
  - pack-mtimes.c
  - pack-revindex.c
  - pack-write.c
  - packfile.c

Besides above, fix minor grammatical issues.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agol10n: tr: v2.37.0 round #1
Emir SARI [Wed, 15 Jun 2022 14:48:40 +0000 (17:48 +0300)] 
l10n: tr: v2.37.0 round #1

Signed-off-by: Emir SARI <emir_sari@icloud.com>
3 years agoMerge branch 'master' of github.com:ruester/git-po-de
Jiang Xin [Thu, 23 Jun 2022 02:45:03 +0000 (10:45 +0800)] 
Merge branch 'master' of github.com:ruester/git-po-de

* 'master' of github.com:ruester/git-po-de:
  l10n: TEAMS: Change German translation team leader
  l10n: de.po: Update German translation

3 years agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Thu, 23 Jun 2022 02:44:43 +0000 (10:44 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5367t)

3 years agoMerge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
Jiang Xin [Thu, 23 Jun 2022 02:44:30 +0000 (10:44 +0800)] 
Merge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po

* 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po:
  l10n: zh_CN: v2.37.0 round 1

3 years agol10n: README: fix typo
Arthur Milchior [Wed, 22 Jun 2022 19:50:44 +0000 (19:50 +0000)] 
l10n: README: fix typo

This 10-year old typo was introduced at 75b182ae (Update l10n guide:
change the repository URL, etc, 2012-03-02). The word "l10" should be
"l10n".

Signed-off-by: Arthur Milchior <arthur@milchior.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agorevisions.txt: escape "..." to avoid asciidoc horizontal ellipsis
Jeff King [Wed, 22 Jun 2022 23:33:04 +0000 (19:33 -0400)] 
revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis

In asciidoc's HTML output of the "gitrevisions" and "git-rev-parse"
documentation, the header:

  The ... (three-dot) Symmetric Difference Notation

is rendered using "&8230;", a horizontal ellipsis. This is visually
ugly, but also hard to search for or cut-and-paste. We really mean three
ascii dots (0x2e) here, so let's make sure it renders as such.

The simplest way to do that is just escaping the leading dot, as the
instances in the rest of the section do. Arguably this should all be
converted to use backticks, which would let us drop the quoting here and
elsewhere (e.g., {carat}). But that does change the rendering slightly.
So let's fix the bug first, and we can decide on migrating the whole
section separately.

Note that this produces an empty doc-diff of the manpages. Curiously,
asciidoc produces the same ellipsis entity in the XML file, but docbook
then converts it back into three literal dots for the roff output! So
the roff manpages have been correct all along (which may be a reason
nobody noticed this until now).

Reported-by: Arthur Milchior
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: TEAMS: Change German translation team leader
Matthias Rüster [Tue, 21 Jun 2022 18:24:14 +0000 (20:24 +0200)] 
l10n: TEAMS: Change German translation team leader

Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
3 years agol10n: de.po: Update German translation
Matthias Rüster [Sun, 19 Jun 2022 18:55:59 +0000 (20:55 +0200)] 
l10n: de.po: Update German translation

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
3 years agoGit 2.37-rc2 v2.37.0-rc2
Junio C Hamano [Wed, 22 Jun 2022 16:07:56 +0000 (09:07 -0700)] 
Git 2.37-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'tb/cruft-packs'
Junio C Hamano [Wed, 22 Jun 2022 16:06:37 +0000 (09:06 -0700)] 
Merge branch 'tb/cruft-packs'

Docfix.

* tb/cruft-packs:
  gc: simplify --cruft description

3 years agol10n: bg.po: Updated Bulgarian translation (5367t)
Alexander Shopov [Sun, 12 Jun 2022 08:56:04 +0000 (10:56 +0200)] 
l10n: bg.po: Updated Bulgarian translation (5367t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agol10n: zh_CN: v2.37.0 round 1
Fangyi Zhou [Wed, 22 Jun 2022 09:28:36 +0000 (10:28 +0100)] 
l10n: zh_CN: v2.37.0 round 1

Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Wed, 22 Jun 2022 07:46:22 +0000 (15:46 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git:
  name-rev: prefix annotate-stdin with '--' in message
  git-prompt: fix expansion of branch colour codes
  git-prompt: make colourization consistent

3 years agoMerge branch 'jp/prompt-clear-before-upstream-mark'
Junio C Hamano [Tue, 21 Jun 2022 17:07:50 +0000 (10:07 -0700)] 
Merge branch 'jp/prompt-clear-before-upstream-mark'

Bash command line prompt (in contrib/) update.

* jp/prompt-clear-before-upstream-mark:
  git-prompt: fix expansion of branch colour codes
  git-prompt: make colourization consistent

3 years agocombine-diff: abort if --output is given
René Scharfe [Sat, 18 Jun 2022 11:12:34 +0000 (13:12 +0200)] 
combine-diff: abort if --output is given

The code for combined diffs currently only writes to stdout.  Abort and
report that fact instead of silently ignoring the --output option.  The
(empty) output file has already been created at that point, though.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocombine-diff: abort if --ignore-matching-lines is given
René Scharfe [Sat, 18 Jun 2022 11:12:28 +0000 (13:12 +0200)] 
combine-diff: abort if --ignore-matching-lines is given

The code for combined diffs doesn't currently support ignoring changes
that match a regex.  Abort and report that fact instead of running into
a segfault.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogc: simplify --cruft description
René Scharfe [Sun, 19 Jun 2022 05:38:50 +0000 (07:38 +0200)] 
gc: simplify --cruft description

Remove duplicate "loose objects".

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoname-rev: prefix annotate-stdin with '--' in message
Alexander Shopov [Mon, 20 Jun 2022 16:44:34 +0000 (18:44 +0200)] 
name-rev: prefix annotate-stdin with '--' in message

This is an option rather than command.  Make the message convey this
similar to the other messages in the file.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Sat, 18 Jun 2022 06:02:07 +0000 (14:02 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (22 commits)
  Git 2.37-rc1
  git-compat-util: allow root to access both SUDO_UID and root owned
  i18n: fix mismatched camelCase config variables
  Another batch of fixes before -rc1
  bug_fl(): correctly initialize trace2 va_list
  relative_url(): fix incorrect condition
  pack-mtimes: avoid closing a bogus file descriptor
  read_index_from(): avoid memory leak
  submodule--helper: avoid memory leak when fetching submodules
  submodule-config: avoid memory leak
  fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`
  cache-tree: remove cache_tree_find_path()
  pack-write: drop always-NULL parameter
  t5329: test 'git gc --cruft' without '--prune=now'
  t2107: test 'git update-index --verbose'
  perf-lib: fix missing test titles in output
  transfer doc: move fetch.credentialsInUrl to "transfer" config namespace
  fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate
  ci(github): also mark up compile errors
  ci(github): use grouping also in the `win-build` job
  ...

3 years agoGit 2.37-rc1 v2.37.0-rc1
Junio C Hamano [Sat, 18 Jun 2022 00:15:13 +0000 (17:15 -0700)] 
Git 2.37-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'cb/path-owner-check-with-sudo-plus'
Junio C Hamano [Sat, 18 Jun 2022 00:12:31 +0000 (17:12 -0700)] 
Merge branch 'cb/path-owner-check-with-sudo-plus'

"sudo git foo" used to consider a repository owned by the original
user a safe one to access; it now also considers a repository owned
by root a safe one, too (after all, if an attacker can craft a
malicious repository owned by root, the box is 0wned already).

* cb/path-owner-check-with-sudo-plus:
  git-compat-util: allow root to access both SUDO_UID and root owned

3 years agogit-compat-util: allow root to access both SUDO_UID and root owned
Carlo Marcelo Arenas Belón [Fri, 17 Jun 2022 20:23:38 +0000 (13:23 -0700)] 
git-compat-util: allow root to access both SUDO_UID and root owned

Previous changes introduced a regression which will prevent root for
accessing repositories owned by thyself if using sudo because SUDO_UID
takes precedence.

Loosen that restriction by allowing root to access repositories owned
by both uid by default and without having to add a safe.directory
exception.

A previous workaround that was documented in the tests is no longer
needed so it has been removed together with its specially crafted
prerequisite.

Helped-by: Johanness Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoi18n: fix mismatched camelCase config variables
Jiang Xin [Fri, 17 Jun 2022 10:03:09 +0000 (18:03 +0800)] 
i18n: fix mismatched camelCase config variables

Some config variables are combinations of multiple words, and we
typically write them in camelCase forms in manpage and translatable
strings. It's not easy to find mismatches for these camelCase config
variables during code reviews, but occasionally they are identified
during localization translations.

To check for mismatched config variables, I introduced a new feature
in the helper program for localization[^1]. The following mismatched
config variables have been identified by running the helper program,
such as "git-po-helper check-pot".

Lowercase in manpage should use camelCase:

 * Documentation/config/http.txt: http.pinnedpubkey

Lowercase in translable strings should use camelCase:

 * builtin/fast-import.c:  pack.indexversion
 * builtin/gc.c:           gc.logexpiry
 * builtin/index-pack.c:   pack.indexversion
 * builtin/pack-objects.c: pack.indexversion
 * builtin/repack.c:       pack.writebitmaps
 * commit.c:               i18n.commitencoding
 * gpg-interface.c:        user.signingkey
 * http.c:                 http.postbuffer
 * submodule-config.c:     submodule.fetchjobs

Mismatched camelCases, choose the former:

 * Documentation/config/transfer.txt: transfer.credentialsInUrl
   remote.c:                          transfer.credentialsInURL

[^1]: https://github.com/git-l10n/git-po-helper

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoAnother batch of fixes before -rc1
Junio C Hamano [Fri, 17 Jun 2022 17:33:42 +0000 (10:33 -0700)] 
Another batch of fixes before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jk/bug-fl-va-list-fix'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'jk/bug-fl-va-list-fix'

Fix buggy va_list usage in recent code.

* jk/bug-fl-va-list-fix:
  bug_fl(): correctly initialize trace2 va_list

3 years agoMerge branch 'ab/credentials-in-url-more'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'ab/credentials-in-url-more'

Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the
single configuration variable should work both in pushing and
fetching.

* ab/credentials-in-url-more:
  transfer doc: move fetch.credentialsInUrl to "transfer" config namespace
  fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate

3 years agoMerge branch 'js/ci-github-workflow-markup'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'js/ci-github-workflow-markup'

Recent CI update hides certain failures in test jobs, which has
been corrected.

* js/ci-github-workflow-markup:
  ci(github): also mark up compile errors
  ci(github): use grouping also in the `win-build` job
  ci(github): bring back the 'print test failures' step

3 years agoMerge branch 'js/misc-fixes'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'js/misc-fixes'

Assorted fixes to problems found by Coverity.

* js/misc-fixes:
  relative_url(): fix incorrect condition
  pack-mtimes: avoid closing a bogus file descriptor
  read_index_from(): avoid memory leak
  submodule--helper: avoid memory leak when fetching submodules
  submodule-config: avoid memory leak
  fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`

3 years agoMerge branch 'jc/cocci-cleanup'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'jc/cocci-cleanup'

Remove a coccinelle rule that is no longer relevant.

* jc/cocci-cleanup:
  cocci: retire is_null_sha1() rule

3 years agoMerge branch 'ds/more-test-coverage'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'ds/more-test-coverage'

Improve test coverage with a handful of tests.

* ds/more-test-coverage:
  cache-tree: remove cache_tree_find_path()
  pack-write: drop always-NULL parameter
  t5329: test 'git gc --cruft' without '--prune=now'
  t2107: test 'git update-index --verbose'

3 years agoMerge branch 'jk/perf-lib-test-titles'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'jk/perf-lib-test-titles'

Show test titles to the performance test output again.

* jk/perf-lib-test-titles:
  perf-lib: fix missing test titles in output

3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Fri, 17 Jun 2022 00:57:35 +0000 (08:57 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git:
  builtin/rebase: remove a redundant space in l10n string

3 years agobug_fl(): correctly initialize trace2 va_list
Jeff King [Thu, 16 Jun 2022 20:04:25 +0000 (16:04 -0400)] 
bug_fl(): correctly initialize trace2 va_list

The code added 0cc05b044f (usage.c: add a non-fatal bug() function to go
with BUG(), 2022-06-02) sets up two va_list variables: one to output to
stderr, and one to trace2. But the order of initialization is wrong:

  va_list ap, cp;
  va_copy(cp, ap);
  va_start(ap, fmt);

We copy the contents of "ap" into "cp" before it is initialized, meaning
it is full of garbage. The two should be swapped.

However, there's another bug, noticed by Johannes Schindelin: we forget
to call va_end() for the copy. So instead of just fixing the copy's
initialization, let's do two separate start/end pairs. This is allowed
by the standard, and we don't need to use copy here since we have access
to the original varargs. Matching the pairs with the calls makes it more
obvious that everything is being done correctly.

Note that we do call bug_fl() in the tests, but it didn't trigger this
problem because our format string doesn't have any placeholders. So even
though we were passing a garbage va_list through the stack, nobody ever
needed to look at it. We can easily adjust one of the trace2 tests to
trigger this, both for bug() and for BUG(). The latter isn't broken, but
it's nice to exercise both a bit more. Without the fix in this patch
(but with the test change), the bug() case causes a segfault.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agorelative_url(): fix incorrect condition
Johannes Schindelin [Wed, 15 Jun 2022 23:35:44 +0000 (23:35 +0000)] 
relative_url(): fix incorrect condition

In 63e95beb085c (submodule: port resolve_relative_url from shell to C,
2016-04-15), we added a loop over `url` where we are looking for `../`
or `./` components.

The loop condition we used is the pointer `url` itself, which is clearly
not what we wanted.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agopack-mtimes: avoid closing a bogus file descriptor
Johannes Schindelin [Wed, 15 Jun 2022 23:35:43 +0000 (23:35 +0000)] 
pack-mtimes: avoid closing a bogus file descriptor

In 94cd775a6c52 (pack-mtimes: support reading .mtimes files,
2022-05-20), code was added to close the file descriptor corresponding
to the mtimes file.

However, it is possible that opening that file failed, in which case we
are closing a file descriptor with the value `-1`. Let's guard that
`close()` call.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoread_index_from(): avoid memory leak
Johannes Schindelin [Wed, 15 Jun 2022 23:35:42 +0000 (23:35 +0000)] 
read_index_from(): avoid memory leak

In 998330ac2e7c (read-cache: look for shared index files next to the
index, too, 2021-08-26), we added code that allocates memory to store
the base path of a shared index, but we never released that memory.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosubmodule--helper: avoid memory leak when fetching submodules
Johannes Schindelin [Wed, 15 Jun 2022 23:35:41 +0000 (23:35 +0000)] 
submodule--helper: avoid memory leak when fetching submodules

In c51f8f94e5b3 (submodule--helper: run update procedures from C,
2021-08-24), we added code that first obtains the default remote, and
then adds that to a `strvec`.

However, we never released the default remote's memory.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosubmodule-config: avoid memory leak
Johannes Schindelin [Wed, 15 Jun 2022 23:35:39 +0000 (23:35 +0000)] 
submodule-config: avoid memory leak

In 961b130d20c9 (branch: add --recurse-submodules option for branch
creation, 2022-01-28), a funny pattern was introduced where first some
struct is `xmalloc()`ed, then we resize an array whose element type is
the same struct, and then the first struct's contents are copied into
the last element of that array.

Crucially, the `xmalloc()`ed memory never gets released.

Let's avoid that memory leak and that memory allocation dance altogether
by first reallocating the array, then using a pointer to the last array
element to go forward.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`
Johannes Schindelin [Wed, 15 Jun 2022 23:35:36 +0000 (23:35 +0000)] 
fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocache-tree: remove cache_tree_find_path()
Derrick Stolee [Thu, 16 Jun 2022 13:13:50 +0000 (13:13 +0000)] 
cache-tree: remove cache_tree_find_path()

This reverts 080ab56a46 (cache-tree: implement cache_tree_find_path(),
2022-05-23). The cache_tree_find_path() method was never actually called
in the topic that added it. I cannot find any reference to it in any of
my forks, so this appears to not be needed at the moment.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agopack-write: drop always-NULL parameter
Derrick Stolee [Thu, 16 Jun 2022 13:13:49 +0000 (13:13 +0000)] 
pack-write: drop always-NULL parameter

write_mtimes_file() takes an mtimes parameter as its first option, but
the only caller passes a NULL constant. Drop this parameter to simplify
logic. This can be reverted if that parameter is needed in the future.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot5329: test 'git gc --cruft' without '--prune=now'
Derrick Stolee [Thu, 16 Jun 2022 13:13:48 +0000 (13:13 +0000)] 
t5329: test 'git gc --cruft' without '--prune=now'

Replace a 'git repack --cruft -d' with the wrapper 'git gc --cruft' to
exercise some logic in builtin/gc.c that adds the '--cruft' option to
the underlying 'git repack' command.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot2107: test 'git update-index --verbose'
Derrick Stolee [Thu, 16 Jun 2022 13:13:47 +0000 (13:13 +0000)] 
t2107: test 'git update-index --verbose'

The '--verbose' option reports what is being added and removed from the
index, but has not been tested up to this point. Augment the tests in
t2107 to check the '--verbose' option in some scenarios.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoperf-lib: fix missing test titles in output
Jeff King [Thu, 16 Jun 2022 07:09:32 +0000 (03:09 -0400)] 
perf-lib: fix missing test titles in output

Commit 5dccd9155f (t/perf: add iteration setup mechanism to perf-lib,
2022-04-04) modified the parameter parsing of test_wrapper() such that
the test title was no longer in $1, and is instead in $test_title_.

We correctly pass the new variable to the code which outputs the title
to the log, but missed the spot in test_wrapper() where the title is
written to the ".descr" file which is used to produce the final output
table. As a result, all of the titles are missing from that table (or
worse, using whatever was left in $1):

  $ ./p0000-perf-lib-sanity.sh
  [...]
  Test           this tree
  ------------------------------
  0000.1:        0.01(0.01+0.00)
  0000.2:        0.01(0.00+0.01)
  0000.4:        0.00(0.00+0.00)
  0000.5: true   0.00(0.00+0.00)
  0000.7:        0.00(0.00+0.00)
  0000.8:        0.00(0.00+0.00)

After this patch, we get the pre-5dccd9155f output:

  Test                                                       this tree
  --------------------------------------------------------------------------
  0000.1: test_perf_default_repo works                       0.00(0.00+0.00)
  0000.2: test_checkout_worktree works                       0.01(0.00+0.01)
  0000.4: export a weird var                                 0.00(0.00+0.00)
  0000.5: éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś                          0.00(0.00+0.00)
  0000.7: important variables available in subshells         0.00(0.00+0.00)
  0000.8: test-lib-functions correctly loaded in subshells   0.00(0.00+0.00)

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobitmap-format.txt: add information for trailing checksum
Abhradeep Chakraborty [Thu, 16 Jun 2022 05:03:54 +0000 (05:03 +0000)] 
bitmap-format.txt: add information for trailing checksum

Bitmap file has a trailing checksum at the end of the file. However
there is no information in the bitmap-format documentation about it.

Add a trailer section to include the trailing checksum info in the
`Documentation/technical/bitmap-format.txt` file.

Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobitmap-format.txt: fix some formatting issues
Abhradeep Chakraborty [Thu, 16 Jun 2022 05:03:53 +0000 (05:03 +0000)] 
bitmap-format.txt: fix some formatting issues

The asciidoc generated html for `Documentation/technical/bitmap-
format.txt` is broken. This is mainly because `-` is used for nested
lists (which is not allowed in asciidoc) instead of `*`.

Fix these and also reformat it for better readability of the html page.

Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobitmap-format.txt: feed the file to asciidoc to generate html
Abhradeep Chakraborty [Thu, 16 Jun 2022 05:03:52 +0000 (05:03 +0000)] 
bitmap-format.txt: feed the file to asciidoc to generate html

Documentation/Makefile does not include bitmap-format.txt to generate
a html page using asciidoc.

Teach Documentation/Makefile to also generate a html page for
Documentation/technical/bitmap-format.txt file.

Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobuiltin/rebase: remove a redundant space in l10n string
Fangyi Zhou [Thu, 16 Jun 2022 17:18:58 +0000 (17:18 +0000)] 
builtin/rebase: remove a redundant space in l10n string

Found in l10n.

Signed-off-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agois_promisor_object(): walk promisor packs in pack-order
Jeff King [Thu, 16 Jun 2022 06:54:41 +0000 (02:54 -0400)] 
is_promisor_object(): walk promisor packs in pack-order

When we generate the list of promisor objects, we walk every pack with a
.promisor file and examine its objects for any links to other objects.
By default, for_each_packed_object() will go in pack .idx order.

This is the worst case with respect to our delta base cache. If we have
a delta chain of A->B->C->D, then visiting A may require reconstructing
both B and C, unless we also visited B recently, in which case we may
have cached its value. Because .idx order is based on sha1, it's random
with respect to the actual object contents and deltas, and thus we're
unlikely to get many cache hits.

If we instead traverse in pack order, then we get the optimal case:
packs are written to keep delta families together, and to place bases
before their children.

Even on a modest repository like git.git, this has a noticeable speedup
on p5600.4, which runs "fsck" on a partial clone with blob:none (so lots
of trees which need to be walked, and which delta well):

Test       HEAD^               HEAD
-------------------------------------------------------
5600.4:    17.87(17.83+0.04)   15.42(15.35+0.06) -13.7%

On a larger repository like linux.git, the speedup is even more
pronounced:

Test       HEAD^                 HEAD
-----------------------------------------------------------
5600.4:    322.47(322.01+0.42)   186.41(185.76+0.63) -42.2%

Any other operations that call is_promisor_object(), like "rev-list
--exclude-promisor-objects", would similarly benefit, but the
invocations in p5600 don't actually trigger any such cases.

Note that we may pay a small price to build a rev-index in-memory to do
the pack-order traversal. But it's still a big net win, and even that
small cost goes away if you are using pack.writeReverseIndex.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: es: update translation
Alex Henrie [Thu, 16 Jun 2022 14:39:06 +0000 (08:39 -0600)] 
l10n: es: update translation

* fix more translation mistakes
* consistently translate "amend" as "enmendar"
* consistently translate "chunk" as "fragmento"
* consistently translate "prune" as "recortar" or "recorte"
* consistently translate "push" as "empujar" or "empuje"
* consistently translate "rephrase" as "refrasear" or "refraseo"
* consistently translate "squash" as "aplastar" or "aplastamiento"

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
3 years agoFixes and updates post -rc0
Junio C Hamano [Wed, 15 Jun 2022 22:09:35 +0000 (15:09 -0700)] 
Fixes and updates post -rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'fs/ssh-default-key-command-doc'
Junio C Hamano [Wed, 15 Jun 2022 22:09:28 +0000 (15:09 -0700)] 
Merge branch 'fs/ssh-default-key-command-doc'

Doc update.

* fs/ssh-default-key-command-doc:
  gpg docs: explain better use of ssh.defaultKeyCommand

3 years agoMerge branch 'po/rebase-preserve-merges'
Junio C Hamano [Wed, 15 Jun 2022 22:09:28 +0000 (15:09 -0700)] 
Merge branch 'po/rebase-preserve-merges'

Various error messages that talk about the removal of
"--preserve-merges" in "rebase" have been strengthened, and "rebase
--abort" learned to get out of a state that was left by an earlier
use of the option.

* po/rebase-preserve-merges:
  rebase: translate a die(preserve-merges) message
  rebase: note `preserve` merges may be a pull config option
  rebase: help users when dying with `preserve-merges`
  rebase.c: state preserve-merges has been removed

3 years agoMerge branch 'jc/revert-show-parent-info'
Junio C Hamano [Wed, 15 Jun 2022 22:09:27 +0000 (15:09 -0700)] 
Merge branch 'jc/revert-show-parent-info'

"git revert" learns "--reference" option to use more human-readable
reference to the commit it reverts in the message template it
prepares for the user.

* jc/revert-show-parent-info:
  revert: --reference should apply only to 'revert', not 'cherry-pick'
  revert: optionally refer to commit in the "reference" format

3 years agotests: add LIBCURL prerequisite to tests needing libcurl
Ævar Arnfjörð Bjarmason [Wed, 15 Jun 2022 10:36:32 +0000 (12:36 +0200)] 
tests: add LIBCURL prerequisite to tests needing libcurl

Add and use a LIBCURL prerequisite for tests added in
6dcbdc0d661 (remote: create fetch.credentialsInUrl config,
2022-06-06).

These tests would get as far as emitting a couple of the warnings we
were testing for, but would then die as we had no "git-remote-https"
program compiled.

It would be more consistent with other prerequisites (e.g. PERL for
NO_PERL) to name this "CURL", but since e9184b0789a (t5561: skip tests
if curl is not available, 2018-04-03) we've had that prerequisite
defined for checking of we have the curl(1) program.

The existing "CURL" prerequisite is only used in one place, and we
should probably name it "CURL_PROGRAM", then rename "LIBCURL" to
"CURL" as a follow-up, but for now (pre-v2.37.0) let's aim for the
most minimal fix possible.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agopush: fix capitalisation of the option name autoSetupMerge
Fangyi Zhou [Wed, 15 Jun 2022 15:35:44 +0000 (15:35 +0000)] 
push: fix capitalisation of the option name autoSetupMerge

This was found during l10n process by Jiang Xin.

Reported-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotransfer doc: move fetch.credentialsInUrl to "transfer" config namespace
Ævar Arnfjörð Bjarmason [Wed, 15 Jun 2022 10:44:12 +0000 (12:44 +0200)] 
transfer doc: move fetch.credentialsInUrl to "transfer" config namespace

Rename the "fetch.credentialsInUrl" configuration variable introduced
in 6dcbdc0d661 (remote: create fetch.credentialsInUrl config,
2022-06-06) to "transfer".

There are existing exceptions, but generally speaking the
"<namespace>.<var>" configuration should only apply to command
described in the "namespace" (and its sub-commands, so e.g. "clone.*"
or "fetch.*" might also configure "git-remote-https").

But in the case of "fetch.credentialsInUrl" we've got a configuration
variable that configures the behavior of all of "clone", "push" and
"fetch", someone adjusting "fetch.*" configuration won't expect to
have the behavior of "git push" altered, especially as we have the
pre-existing "{transfer,fetch,receive}.fsckObjects", which configures
different parts of the transfer dialog.

So let's move this configuration variable to the "transfer" namespace
before it's exposed in a release. We could add all of
"{transfer,fetch,pull}.credentialsInUrl" at some other time, but once
we have "fetch" configure "pull" such an arrangement would would be a
confusing mess, as we'd at least need to have "fetch" configure
"push" (but not the other way around), or change existing behavior.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agofetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate
Ævar Arnfjörð Bjarmason [Wed, 15 Jun 2022 10:44:11 +0000 (12:44 +0200)] 
fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate

Amend the documentation and release notes entry for the
"fetch.credentialsInUrl" feature added in 6dcbdc0d661 (remote: create
fetch.credentialsInUrl config, 2022-06-06), it currently doesn't
detect passwords in `remote.<name>.pushurl` configuration. We
shouldn't lull users into a false sense of security, so we need to
mention that prominently.

This also elaborates and clarifies the "exposes the password in
multiple ways" part of the documentation. As noted in [1] a user
unfamiliar with git's implementation won't know what to make of that
scary claim, e.g. git hypothetically have novel git-specific ways of
exposing configured credentials.

The reality is that this configuration is intended as an aid for users
who can't fully trust their OS's or system's security model, so lets
say that's what this is intended for, and mention the most common ways
passwords stored in configuration might inadvertently get exposed.

1. https://lore.kernel.org/git/220524.86ilpuvcqh.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoadd -i tests: mark "TODO" depending on GIT_TEST_ADD_I_USE_BUILTIN
Ævar Arnfjörð Bjarmason [Tue, 14 Jun 2022 15:40:07 +0000 (17:40 +0200)] 
add -i tests: mark "TODO" depending on GIT_TEST_ADD_I_USE_BUILTIN

Fix an issue that existed before 0527ccb1b55 (add -i: default to the
built-in implementation, 2021-11-30), but which became the default
with that change, we should not be marking tests that are known to
pass as "TODO" tests.

When GIT_TEST_ADD_I_USE_BUILTIN=1 was made the default we started
passing the tests added in 0f0fba2cc87 (t3701: add a test for advanced
split-hunk editing, 2019-12-06) and 1bf01040f0c (add -p: demonstrate
failure when running 'edit' after a split, 2015-04-16).

Thus we've been emitting this sort of output:

$ prove ./t3701-add-interactive.sh
./t3701-add-interactive.sh .. ok
All tests successful.

Test Summary Report
-------------------
./t3701-add-interactive.sh (Wstat: 0 Tests: 70 Failed: 0)
  TODO passed:   45, 47
Files=1, Tests=70,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.86 cusr  0.33 csys =  1.22 CPU)
Result: PASS

Which isn't just cosmetic, but due to issues with
test_expect_failure (see [1]) we could e.g. be hiding something as bad
as a segfault in the new implementation. It makes sense catch that,
especially before we put out a release with the built-in "add -i", so
let's generalize the check we were already doing in 0527ccb1b55 with a
new "ADD_I_USE_BUILTIN" prerequisite.

1. https://lore.kernel.org/git/patch-1.7-4624abc2591-20220318T002951Z-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.37-rc0 v2.37.0-rc0
Junio C Hamano [Mon, 13 Jun 2022 22:42:40 +0000 (15:42 -0700)] 
Git 2.37-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'gc/document-config-worktree-scope'
Junio C Hamano [Mon, 13 Jun 2022 22:53:44 +0000 (15:53 -0700)] 
Merge branch 'gc/document-config-worktree-scope'

Doc update.

* gc/document-config-worktree-scope:
  config: document and test the 'worktree' scope

3 years agoMerge branch 'js/wait-or-whine-can-fail'
Junio C Hamano [Mon, 13 Jun 2022 22:53:44 +0000 (15:53 -0700)] 
Merge branch 'js/wait-or-whine-can-fail'

We used to log an error return from wait_or_whine() as process
termination of the waited child, which was incorrect.

* js/wait-or-whine-can-fail:
  run-command: don't spam trace2_child_exit()

3 years agoMerge branch 'ab/remote-free-fix'
Junio C Hamano [Mon, 13 Jun 2022 22:53:43 +0000 (15:53 -0700)] 
Merge branch 'ab/remote-free-fix'

Use-after-free (with another forget-to-free) fix.

* ab/remote-free-fix:
  remote.c: don't dereference NULL in freeing loop
  remote.c: remove braces from one-statement "for"-loops

3 years agoMerge branch 'sn/fsmonitor-missing-clock'
Junio C Hamano [Mon, 13 Jun 2022 22:53:43 +0000 (15:53 -0700)] 
Merge branch 'sn/fsmonitor-missing-clock'

Sample watchman interface hook sometimes failed to produce
correctly formatted JSON message, which has been corrected.

* sn/fsmonitor-missing-clock:
  fsmonitor: query watchman with right valid json

3 years agoMerge branch 'zh/read-cache-copy-name-entry-fix'
Junio C Hamano [Mon, 13 Jun 2022 22:53:43 +0000 (15:53 -0700)] 
Merge branch 'zh/read-cache-copy-name-entry-fix'

Remove redundant copying (with index v3 and older) or possible
over-reading beyond end of mmapped memory (with index v4) has been
corrected.

* zh/read-cache-copy-name-entry-fix:
  read-cache.c: reduce unnecessary cache entry name copying

3 years agoMerge branch 'tb/show-ref-optim'
Junio C Hamano [Mon, 13 Jun 2022 22:53:42 +0000 (15:53 -0700)] 
Merge branch 'tb/show-ref-optim'

"git show-ref --heads" (and "--tags") still iterated over all the
refs only to discard refs outside the specified area, which has
been corrected.

* tb/show-ref-optim:
  builtin/show-ref.c: avoid over-iterating with --heads, --tags

3 years agoMerge branch 'ds/credentials-in-url'
Junio C Hamano [Mon, 13 Jun 2022 22:53:42 +0000 (15:53 -0700)] 
Merge branch 'ds/credentials-in-url'

The "fetch.credentialsInUrl" configuration variable controls what
happens when a URL with embedded login credential is used.

* ds/credentials-in-url:
  remote: create fetch.credentialsInUrl config

3 years agoMerge branch 'jt/unparse-commit-upon-graft-change'
Junio C Hamano [Mon, 13 Jun 2022 22:53:42 +0000 (15:53 -0700)] 
Merge branch 'jt/unparse-commit-upon-graft-change'

Updating the graft information invalidates the list of parents of
in-core commit objects that used to be in the graft file.

* jt/unparse-commit-upon-graft-change:
  commit,shallow: unparse commits if grafts changed

3 years agoMerge branch 'ab/hooks-regression-fix'
Junio C Hamano [Mon, 13 Jun 2022 22:53:41 +0000 (15:53 -0700)] 
Merge branch 'ab/hooks-regression-fix'

In Git 2.36 we revamped the way how hooks are invoked.  One change
that is end-user visible is that the output of a hook is no longer
directly connected to the standard output of "git" that spawns the
hook, which was noticed post release.  This is getting corrected.

* ab/hooks-regression-fix:
  hook API: fix v2.36.0 regression: hooks should be connected to a TTY
  run-command: add an "ungroup" option to run_process_parallel()

3 years agoMerge branch 'tl/ls-tree-oid-only'
Junio C Hamano [Mon, 13 Jun 2022 22:53:41 +0000 (15:53 -0700)] 
Merge branch 'tl/ls-tree-oid-only'

Add tests for a regression fixed earlier.

* tl/ls-tree-oid-only:
  ls-tree: test for the regression in 9c4d58ff2c3

3 years agoMerge branch 'pb/range-diff-with-submodule'
Junio C Hamano [Mon, 13 Jun 2022 22:53:41 +0000 (15:53 -0700)] 
Merge branch 'pb/range-diff-with-submodule'

"git -c diff.submodule=log range-diff" did not show anything for
submodules that changed in the ranges being compared, and
"git -c diff.submodule=diff range-diff" did not work correctly.
Fix this by including the "--submodule=short" output
unconditionally to be compared.

* pb/range-diff-with-submodule:
  range-diff: show submodule changes irrespective of diff.submodule

3 years agodiff-index.txt: update raw output format in examples
Philippe Blain [Mon, 13 Jun 2022 12:29:43 +0000 (12:29 +0000)] 
diff-index.txt: update raw output format in examples

The two examples in the doc for 'git diff-index' were not updated when
the raw output format was changed in 81e50eabf0 ([PATCH] The diff-raw
format updates., 2005-05-21) (first example) and in b6d8f309d9 ([PATCH]
diff-raw format update take #2., 2005-05-23) and 7cb6ac1e4b (diff:
diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value,
2017-12-03) (second example).

Update the output, inventing some characters to complete the source
hash in the second example. Also correct the destination mode in the
second example, which was wrongly '100664' since the addition of the
example in c64b9b8860 (Reference documentation for the core git
commands., 2005-05-05).

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff-format.txt: correct misleading wording
Philippe Blain [Mon, 13 Jun 2022 12:29:42 +0000 (12:29 +0000)] 
diff-format.txt: correct misleading wording

Near the end of the "Raw output format" section, an example shows the
output of 'git diff-files' for a tracked file modified on disk but not
yet added to the index. However the wording is:

    <sha1> is shown as all 0's if a file is new on the filesystem
    and it is out of sync with the index.

which is confusing since it can be understood to mean that 'file' is a
new, yet untracked file, in which case 'git diff-files' does not care
about it at all.

When this example was introduced all the way back in c64b9b8860
(Reference documentation for the core git commands., 2005-05-05), 'old'
and 'new' referred to the two entities being compared, depending on the
command being used (diff-index, diff-tree or diff-files - which at the
time were diff-cache, diff-tree and show-diff). The wording used at the
time was:

    <new-sha1> is shown as all 0's if new is a file on the
    filesystem and it is out of sync with the cache.

This section was reworked in 81e50eabf0 ([PATCH] The diff-raw
format updates., 2005-05-21) and the mention of the meaning of 'new' and
'old' was removed. Then in f73ae1fc5d (Some typos and light editing of
various manpages, 2005-10-05), the wording was changed to what it is
now.

In addition, in b6d8f309d9 ([PATCH] diff-raw format update take #2.,
2005-05-23), the section was further reworked and did not use '<sha1>'
anymore, making the example the sole user of this token.

Rework the introductory sentence of the example to instead refer to
'sha1 for "dst"', which is what the text description above it uses, and
fix the wording so that we do not mention a "new file".

While at it, also tweak the wording used in the description of the raw
format to explicitely state that all 0's are used for the destination
hash if the working tree is out of sync with the index, instead of the
more vague "look at worktree".

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff-format.txt: dst can be 0* SHA-1 when path is deleted, too
Philippe Blain [Mon, 13 Jun 2022 12:29:41 +0000 (12:29 +0000)] 
diff-format.txt: dst can be 0* SHA-1 when path is deleted, too

"dst" can legitimately be "0\{40\}" for a creation patch, e.g. when
the stat information is stale, but it falls into "look at work tree"
case.  The original description in b6d8f309 ([PATCH] diff-raw format
update take #2., 2005-05-23) forgot that deletion also makes the
"dst" 0* SHA-1.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci(github): also mark up compile errors
Johannes Schindelin [Mon, 13 Jun 2022 13:13:08 +0000 (13:13 +0000)] 
ci(github): also mark up compile errors

When GCC produces those helpful errors, we will want to present them in
the GitHub workflow runs in the most helpful manner. To that end, we
want to use workflow commands to render errors and warnings:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

In the previous commit, we ensured that grouping is used for the build
in all jobs, and this allows us to piggy-back onto the `group` function
to transmogrify the output.

Note: If `set -o pipefail` was available, we could do this in a little
more elegant way. But since some of the steps are run using `dash`, we
have to do a little `{ ...; echo $? >exit.status; } | ...` dance.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci(github): use grouping also in the `win-build` job
Johannes Schindelin [Mon, 13 Jun 2022 13:13:07 +0000 (13:13 +0000)] 
ci(github): use grouping also in the `win-build` job

We already do the same when building Git in all the other jobs.

This will allow us to piggy-back on top of grouping to mark up compiler
errors in the next commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>