]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'ti/tcsh-completion-regression-fix'
Junio C Hamano [Fri, 3 Sep 2021 20:49:29 +0000 (13:49 -0700)] 
Merge branch 'ti/tcsh-completion-regression-fix'

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'
Junio C Hamano [Fri, 3 Sep 2021 20:49:29 +0000 (13:49 -0700)] 
Merge branch 'fc/completion-updates'

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 'pw/rebase-r-fixes'
Junio C Hamano [Fri, 3 Sep 2021 20:49:28 +0000 (13:49 -0700)] 
Merge branch 'pw/rebase-r-fixes'

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'
Junio C Hamano [Fri, 3 Sep 2021 20:49:28 +0000 (13:49 -0700)] 
Merge branch 'pw/rebase-skip-final-fix'

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'
Junio C Hamano [Fri, 3 Sep 2021 20:49:28 +0000 (13:49 -0700)] 
Merge branch 'cb/ci-use-upload-artifacts-v1'

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'
Junio C Hamano [Fri, 3 Sep 2021 20:49:27 +0000 (13:49 -0700)] 
Merge branch 'jk/commit-edit-fixup-fix'

"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 'ps/connectivity-optim'
Junio C Hamano [Fri, 3 Sep 2021 20:49:27 +0000 (13:49 -0700)] 
Merge branch 'ps/connectivity-optim'

The revision traversal API has been optimized by taking advantage
of the commit-graph, when available, to determine if a commit is
reachable from any of the existing refs.

* ps/connectivity-optim:
  revision: avoid hitting packfiles when commits are in commit-graph
  commit-graph: split out function to search commit position
  revision: stop retrieving reference twice
  connected: do not sort input revisions
  revision: separate walk and unsorted flags

2 years agoThe second batch
Junio C Hamano [Mon, 30 Aug 2021 23:06:22 +0000 (16:06 -0700)] 
The second batch

The most significant of this batch is of course "merge -sort".
Thanks, Elijah and everybody who helped the topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'cb/ci-freebsd-update'
Junio C Hamano [Mon, 30 Aug 2021 23:06:06 +0000 (16:06 -0700)] 
Merge branch 'cb/ci-freebsd-update'

Update FreeBSD CI job

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

2 years agoMerge branch 'tl/traverse-non-commits-rename'
Junio C Hamano [Mon, 30 Aug 2021 23:06:06 +0000 (16:06 -0700)] 
Merge branch 'tl/traverse-non-commits-rename'

Meh.

* tl/traverse-non-commits-rename:
  list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

2 years agoMerge branch 'bc/t5607-avoid-broken-test-fail-prereqs'
Junio C Hamano [Mon, 30 Aug 2021 23:06:05 +0000 (16:06 -0700)] 
Merge branch 'bc/t5607-avoid-broken-test-fail-prereqs'

The current implementation of GIT_TEST_FAIL_PREREQS is broken in
that checking for the lack of a prerequisite would not work.  Avoid
the use of "if ! test_have_prereq X" in a test script.

* bc/t5607-avoid-broken-test-fail-prereqs:
  t5607: avoid using prerequisites to select algorithm

2 years agoMerge branch 'th/userdiff-more-java'
Junio C Hamano [Mon, 30 Aug 2021 23:06:05 +0000 (16:06 -0700)] 
Merge branch 'th/userdiff-more-java'

The userdiff pattern for "java" language has been updated.

* th/userdiff-more-java:
  userdiff: improve java hunk header regex

2 years agoMerge branch 'jk/range-diff-fixes'
Junio C Hamano [Mon, 30 Aug 2021 23:06:05 +0000 (16:06 -0700)] 
Merge branch 'jk/range-diff-fixes'

"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'
Junio C Hamano [Mon, 30 Aug 2021 23:06:04 +0000 (16:06 -0700)] 
Merge branch 'jk/apply-binary-hunk-parsing-fix'

"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 'jc/userdiff-pattern-hint'
Junio C Hamano [Mon, 30 Aug 2021 23:06:03 +0000 (16:06 -0700)] 
Merge branch 'jc/userdiff-pattern-hint'

Remind developers that the userdiff patterns should be kept simple
and permissive, assuming that the contents they apply are always
syntactically correct.

* jc/userdiff-pattern-hint:
  userdiff: comment on the builtin patterns

2 years agoMerge branch 'cb/builtin-merge-format-string-fix'
Junio C Hamano [Mon, 30 Aug 2021 23:06:02 +0000 (16:06 -0700)] 
Merge branch 'cb/builtin-merge-format-string-fix'

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'
Junio C Hamano [Mon, 30 Aug 2021 23:06:02 +0000 (16:06 -0700)] 
Merge branch 'js/log-protocol-version'

Debugging aid.

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

2 years agoMerge branch 'en/ort-becomes-the-default'
Junio C Hamano [Mon, 30 Aug 2021 23:06:01 +0000 (16:06 -0700)] 
Merge branch 'en/ort-becomes-the-default'

Use `ort` instead of `recursive` as the default merge strategy.

* en/ort-becomes-the-default:
  Update docs for change of default merge backend
  Change default merge backend from recursive to ort

2 years agoMerge branch 'en/merge-strategy-docs'
Junio C Hamano [Mon, 30 Aug 2021 23:06:01 +0000 (16:06 -0700)] 
Merge branch 'en/merge-strategy-docs'

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 'en/pull-conflicting-options'
Junio C Hamano [Mon, 30 Aug 2021 23:06:01 +0000 (16:06 -0700)] 
Merge branch 'en/pull-conflicting-options'

"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 agoThe first batch post 2.33
Junio C Hamano [Tue, 24 Aug 2021 22:33:23 +0000 (15:33 -0700)] 
The first batch post 2.33

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ps/fetch-pack-load-refs-optim'
Junio C Hamano [Tue, 24 Aug 2021 22:32:41 +0000 (15:32 -0700)] 
Merge branch 'ps/fetch-pack-load-refs-optim'

Loading of ref tips to prepare for common ancestry negotiation in
"git fetch-pack" has been optimized by taking advantage of the
commit graph when available.

* ps/fetch-pack-load-refs-optim:
  fetch-pack: speed up loading of refs via commit graph

2 years agoMerge branch 'jt/push-negotiation-fixes'
Junio C Hamano [Tue, 24 Aug 2021 22:32:40 +0000 (15:32 -0700)] 
Merge branch 'jt/push-negotiation-fixes'

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

* 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 'es/trace2-log-parent-process-name'
Junio C Hamano [Tue, 24 Aug 2021 22:32:40 +0000 (15:32 -0700)] 
Merge branch 'es/trace2-log-parent-process-name'

trace2 logs learned to show parent process name to see in what
context Git was invoked.

* es/trace2-log-parent-process-name:
  tr2: log parent process name
  tr2: make process info collection platform-generic

2 years agoMerge branch 'hn/refs-test-cleanup'
Junio C Hamano [Tue, 24 Aug 2021 22:32:39 +0000 (15:32 -0700)] 
Merge branch 'hn/refs-test-cleanup'

A handful of tests that assumed implementation details of files
backend for refs have been cleaned up.

* hn/refs-test-cleanup:
  t6001: avoid direct file system access
  t6500: use "ls -1" to snapshot ref database state
  t7064: use update-ref -d to remove upstream branch
  t1410: mark test as REFFILES
  t1405: mark test for 'git pack-refs' as REFFILES
  t1405: use 'git reflog exists' to check reflog existence
  t2402: use ref-store test helper to create broken symlink
  t3320: use git-symbolic-ref rather than filesystem access
  t6120: use git-update-ref rather than filesystem access
  t1503: mark symlink test as REFFILES
  t6050: use git-update-ref rather than filesystem access

2 years agoMerge branch 'en/ort-perf-batch-15'
Junio C Hamano [Tue, 24 Aug 2021 22:32:39 +0000 (15:32 -0700)] 
Merge branch 'en/ort-perf-batch-15'

Final batch for "merge -sort" optimization.

* en/ort-perf-batch-15:
  merge-ort: remove compile-time ability to turn off usage of memory pools
  merge-ort: reuse path strings in pool_alloc_filespec
  merge-ort: store filepairs and filespecs in our mem_pool
  diffcore-rename, merge-ort: add wrapper functions for filepair alloc/dealloc
  merge-ort: switch our strmaps over to using memory pools
  merge-ort: set up a memory pool
  merge-ort: add pool_alloc, pool_calloc, and pool_strndup wrappers
  diffcore-rename: use a mem_pool for exact rename detection's hashmap
  merge-ort: rename str{map,intmap,set}_func()

2 years agoMerge branch 'js/expand-runtime-prefix'
Junio C Hamano [Tue, 24 Aug 2021 22:32:38 +0000 (15:32 -0700)] 
Merge branch 'js/expand-runtime-prefix'

Pathname expansion (like "~username/") learned a way to specify a
location relative to Git installation (e.g. its $sharedir which is
$(prefix)/share), with "%(prefix)".

* js/expand-runtime-prefix:
  expand_user_path: allow in-flight topics to keep using the old name
  interpolate_path(): allow specifying paths relative to the runtime prefix
  Use a better name for the function interpolating paths
  expand_user_path(): clarify the role of the `real_home` parameter
  expand_user_path(): remove stale part of the comment
  tests: exercise the RUNTIME_PREFIX feature

2 years agoMerge branch 'ab/bundle-doc'
Junio C Hamano [Tue, 24 Aug 2021 22:32:37 +0000 (15:32 -0700)] 
Merge branch 'ab/bundle-doc'

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 agoMerge branch 'zh/ref-filter-raw-data'
Junio C Hamano [Tue, 24 Aug 2021 22:32:37 +0000 (15:32 -0700)] 
Merge branch 'zh/ref-filter-raw-data'

Prepare the "ref-filter" machinery that drives the "--format"
option of "git for-each-ref" and its friends to be used in "git
cat-file --batch".

* zh/ref-filter-raw-data:
  ref-filter: add %(rest) atom
  ref-filter: use non-const ref_format in *_atom_parser()
  ref-filter: --format=%(raw) support --perl
  ref-filter: add %(raw) atom
  ref-filter: add obj-type check in grab contents

2 years agoMerge branch 'ab/pack-stdin-packs-fix'
Junio C Hamano [Tue, 24 Aug 2021 22:32:36 +0000 (15:32 -0700)] 
Merge branch 'ab/pack-stdin-packs-fix'

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 'ab/http-drop-old-curl'
Junio C Hamano [Tue, 24 Aug 2021 22:32:36 +0000 (15:32 -0700)] 
Merge branch 'ab/http-drop-old-curl'

Support for ancient versions of cURL library (pre 7.19.4) has been
dropped.

* ab/http-drop-old-curl:
  http: rename CURLOPT_FILE to CURLOPT_WRITEDATA
  http: drop support for curl < 7.19.3 and < 7.17.0 (again)
  http: drop support for curl < 7.19.4
  http: drop support for curl < 7.16.0
  http: drop support for curl < 7.11.1

2 years agoMerge branch 'ds/add-with-sparse-index'
Junio C Hamano [Tue, 24 Aug 2021 22:32:35 +0000 (15:32 -0700)] 
Merge branch 'ds/add-with-sparse-index'

"git add" can work better with the sparse index.

* ds/add-with-sparse-index:
  add: remove ensure_full_index() with --renormalize
  add: ignore outside the sparse-checkout in refresh()
  pathspec: stop calling ensure_full_index
  add: allow operating on a sparse-only index
  t1092: test merge conflicts outside cone

2 years agoMerge branch 'jc/bisect-sans-show-branch'
Junio C Hamano [Tue, 24 Aug 2021 22:32:35 +0000 (15:32 -0700)] 
Merge branch 'jc/bisect-sans-show-branch'

"git bisect" spawned "git show-branch" only to pretty-print the
title of the commit after checking out the next version to be
tested; this has been rewritten in C.

* jc/bisect-sans-show-branch:
  bisect: simplify return code from bisect_checkout()
  bisect: do not run show-branch just to show the current commit

2 years agorebase -r: fix merge -c with a merge strategy
Phillip Wood [Fri, 20 Aug 2021 15:40:38 +0000 (15:40 +0000)] 
rebase -r: fix merge -c with a merge strategy

If a rebase is started with a --strategy option other than "ort" or
"recursive" then "merge -c" does not allow the user to reword the
commit message.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorebase -r: don't write .git/MERGE_MSG when fast-forwarding
Phillip Wood [Fri, 20 Aug 2021 15:40:37 +0000 (15:40 +0000)] 
rebase -r: don't write .git/MERGE_MSG when fast-forwarding

When fast-forwarding we do not create a new commit so .git/MERGE_MSG
is not removed and can end up seeding the message of a commit made
after the rebase has finished. Avoid writing .git/MERGE_MSG when we
are fast-forwarding by writing the file after the fast-forward
checks. Note that there are no changes to the fast-forward code, it is
simply moved.

Note that the way this change is implemented means we no longer write
the author script when fast-forwarding either. I believe this is safe
for the reasons below but it is a departure from what we do when
fast-forwarding a non-merge commit. If we reword the merge then 'git
commit --amend' will keep the authorship of the commit we're rewording
as it ignores GIT_AUTHOR_* unless --reset-author is passed. It will
also export the correct GIT_AUTHOR_* variables to any hooks and we
already test the authorship of the reworded commit. If we are not
rewording then we no longer call spilt_ident() which means we are no
longer checking the commit author header looks sane. However this is
what we already do when fast-forwarding non-merge commits in
skip_unnecessary_picks() so I don't think we're breaking any promises
by not checking the author here.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorebase -i: add another reword test
Phillip Wood [Fri, 20 Aug 2021 15:40:36 +0000 (15:40 +0000)] 
rebase -i: add another reword test

None of the existing reword tests check that there are no uncommitted
changes when the editor is opened. Reuse the editor script from the
last commit to fix this omission.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorebase -r: make 'merge -c' behave like reword
Phillip Wood [Fri, 20 Aug 2021 15:40:35 +0000 (15:40 +0000)] 
rebase -r: make 'merge -c' behave like reword

If the user runs git log while rewording a commit it is confusing if
sometimes we're amending the commit that's being reworded and at other
times we're creating a new commit depending on whether we could
fast-forward or not[1]. For this reason the reword command ensures
that there are no uncommitted changes when rewording. The reword
command also allows the user to edit the todo list while the rebase is
paused. As 'merge -c' also rewords commits make it behave like reword
and add a test.

[1] https://lore.kernel.org/git/xmqqlfvu4be3.fsf@gitster-ct.c.googlers.com/T/#m133009cb91cf0917bcf667300f061178be56680a

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: tcsh: Fix regression by drop of wrapper functions
Takashi Iwai [Wed, 18 Aug 2021 13:27:29 +0000 (15:27 +0200)] 
completion: tcsh: Fix regression by drop of wrapper functions

The cleanup of old compat wrappers in bash completion caused a
regression on tcsh completion that still uses them.
Let's update the tcsh call site as well for addressing it.

Fixes: 441ecdab37fe ("completion: bash: remove old compat wrappers")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: bash: add correct suffix in variables
Felipe Contreras [Mon, 16 Aug 2021 09:10:25 +0000 (04:10 -0500)] 
completion: bash: add correct suffix in variables

__gitcomp automatically adds a suffix, but __gitcomp_nl and others
don't, we need to specify a space by default.

Can be tested with:

  git config branch.autoSetupMe<tab>

This fix only works for versions of bash greater than 4.0, before that
"local sfx" creates an empty string, therefore the unset expansion
doesn't work. The same happens in zsh.

Therefore we don't add the test for that for now.

The correct fix for all shells requires semantic changes in __gitcomp,
but that can be done later.

Cc: SZEDER Gábor <szeder.dev@gmail.com>
Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: bash: fix for multiple dash commands
Felipe Contreras [Mon, 16 Aug 2021 09:10:24 +0000 (04:10 -0500)] 
completion: bash: fix for multiple dash commands

Otherwise options of commands like 'for-each-ref' are not completed.

Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: bash: fix for suboptions with value
Felipe Contreras [Mon, 16 Aug 2021 09:10:23 +0000 (04:10 -0500)] 
completion: bash: fix for suboptions with value

We need to ignore options that don't start with -- as well.

Depending on the value of COMP_WORDBREAKS the last word could be
duplicated otherwise.

Can be tested with:

  git merge -X diff-algorithm=<tab>

Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocompletion: bash: fix prefix detection in branch.*
Felipe Contreras [Mon, 16 Aug 2021 09:10:22 +0000 (04:10 -0500)] 
completion: bash: fix prefix detection in branch.*

Otherwise we are completely ignoring the --cur argument.

The issue can be tested with:

  git clone --config=branch.<tab>

Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.33 v2.33.0
Junio C Hamano [Mon, 16 Aug 2021 19:15:44 +0000 (12:15 -0700)] 
Git 2.33

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'rs/oidtree-alignment-fix'
Junio C Hamano [Mon, 16 Aug 2021 19:14:35 +0000 (12:14 -0700)] 
Merge branch 'rs/oidtree-alignment-fix'

Codepath to access recently added oidtree data structure had
to make unaligned accesses to oids, which has been corrected.

* rs/oidtree-alignment-fix:
  oidtree: avoid unaligned access to crit-bit tree

2 years agoMerge tag 'l10n-2.33.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Mon, 16 Aug 2021 16:38:57 +0000 (09:38 -0700)] 
Merge tag 'l10n-2.33.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.33.0-rnd2

* tag 'l10n-2.33.0-rnd2' of git://github.com/git-l10n/git-po: (46 commits)
  l10n: sv.po: Update Swedish translation (5230t0f0u)
  l10n: TEAMS: change Simplified Chinese team leader
  l10n: tr: v2.33 (round 2)
  l10n: es: 2.33.0 round 2
  l10n: zh_CN: for git v2.33.0 l10n round 2
  l10n: zh_CN: Revision for git v2.32.0 l10n round 1
  l10n: README: refactor to use GFM syntax
  l10n: update German translation for Git v2.33.0 (rnd2)
  l10n: pt_PT: v2.33.0 round 2
  l10n: pt_PT: git-po-helper update
  l10n: pt_PT: update translation table
  l10n: zh_TW.po: remove the obsolete glossary
  l10n: vi.po(5230t): Updated translation for v2.32.0 round 2
  l10n: fr.po v2.33 rnd 2
  l10n: id: po-id for 2.33.0 round 2
  l10n: zh_TW.po: update for v2.33.0 rnd 2
  l10n: git.pot: v2.33.0 round 2 (11 new, 8 removed)
  l10n: de.po: fix typos
  l10n: update German translation for Git v2.33.0
  l10n: fr.po fix typos in commands and variables
  ...

2 years agol10n: sv.po: Update Swedish translation (5230t0f0u)
Peter Krefting [Sat, 14 Aug 2021 20:15:58 +0000 (21:15 +0100)] 
l10n: sv.po: Update Swedish translation (5230t0f0u)

Also fixed some typos reported by "git-po-helper".

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 years agol10n: TEAMS: change Simplified Chinese team leader
Jiang Xin [Sun, 15 Aug 2021 22:39:30 +0000 (06:39 +0800)] 
l10n: TEAMS: change Simplified Chinese team leader

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 years agooidtree: avoid unaligned access to crit-bit tree
René Scharfe [Sat, 14 Aug 2021 20:00:38 +0000 (22:00 +0200)] 
oidtree: avoid unaligned access to crit-bit tree

The flexible array member "k" of struct cb_node is used to store the key
of the crit-bit tree node.  It offers no alignment guarantees -- in fact
the current struct layout puts it one byte after a 4-byte aligned
address, i.e. guaranteed to be misaligned.

oidtree uses a struct object_id as cb_node key.  Since cf0983213c (hash:
add an algo member to struct object_id, 2021-04-26) it requires 4-byte
alignment.  The mismatch is reported by UndefinedBehaviorSanitizer at
runtime like this:

hash.h:277:2: runtime error: member access within misaligned address 0x00015000802d for type 'struct object_id', which requires 4 byte alignment
0x00015000802d: note: pointer points here
 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior hash.h:277:2 in

We can fix that by:

1. eliminating the alignment requirement of struct object_id,
2. providing the alignment in struct cb_node, or
3. avoiding the issue by only using memcpy to access "k".

Currently we only store one of two values in "algo" in struct object_id.
We could use a uint8_t for that instead and widen it only once we add
support for our twohundredth algorithm or so.  That would not only avoid
alignment issues, but also reduce the memory requirements for each
instance of struct object_id by ca. 9%.

Supporting keys with alignment requirements might be useful to spread
the use of crit-bit trees.  It can be achieved by using a wider type for
"k" (e.g. uintmax_t), using different types for the members "byte" and
"otherbits" (e.g. uint16_t or uint32_t for each), or by avoiding the use
of flexible arrays like khash.h does.

This patch implements the third option, though, because it has the least
potential for causing side-effects and we're close to the next release.
If one of the other options is implemented later as well to get their
additional benefits we can get rid of the extra copies introduced here.

Reported-by: Andrzej Hunt <andrzej@ahunt.org>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoci: use upload-artifacts v1 for dockerized jobs
Carlo Marcelo Arenas Belón [Fri, 13 Aug 2021 09:13:49 +0000 (02:13 -0700)] 
ci: use upload-artifacts v1 for dockerized jobs

e9f79acb28 (ci: upgrade to using actions/{up,down}load-artifacts v2,
2021-06-23) changed all calls to that action from v1 to v2, but there
is still an open bug[1] that affects all nodejs actions and prevents
its use in 32-bit linux (as used by the Linux32 container)

move all dockerized jobs to use v1 that was built in C# and therefore
doesn't have this problem, which will otherwise manifest with confusing
messages like:

  /usr/bin/docker exec  0285adacc4536b7cd962079c46f85fa05a71e66d7905b5e4b9b1a0e8b305722a sh -c "cat /etc/*release | grep ^ID"
  OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: no such file or directory: unknown

[1] https://github.com/actions/runner/issues/1011

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocommit: restore --edit when combined with --fixup
Joel Klinghed [Sat, 14 Aug 2021 21:40:30 +0000 (21:40 +0000)] 
commit: restore --edit when combined with --fixup

Recent changes to --fixup, adding amend suboption, caused the
--edit flag to be ignored as use_editor was always set to zero.

Restore edit_flag having higher priority than fixup_message when
deciding the value of use_editor by moving the edit flag condition
later in the method.

Signed-off-by: Joel Klinghed <the_jk@spawned.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'next' of github.com:ChrisADR/git-po
Jiang Xin [Sun, 15 Aug 2021 10:32:20 +0000 (18:32 +0800)] 
Merge branch 'next' of github.com:ChrisADR/git-po

* 'next' of github.com:ChrisADR/git-po:
  l10n: es: 2.33.0 round 2

2 years agol10n: tr: v2.33 (round 2)
Emir Sarı [Sun, 15 Aug 2021 07:17:15 +0000 (10:17 +0300)] 
l10n: tr: v2.33 (round 2)

Signed-off-by: Emir Sarı <bitigchi@me.com>
2 years agol10n: es: 2.33.0 round 2
Christopher Diaz Riveros [Sat, 14 Aug 2021 16:13:11 +0000 (11:13 -0500)] 
l10n: es: 2.33.0 round 2

Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Javier Spagnoletti phansys@gmail.com
Signed-off-by: Cleydyr Albuquerque <cleydyr@gmail.com>
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Guillermo Ramos <gramosg>
2 years agol10n: zh_CN: for git v2.33.0 l10n round 2
Jiang Xin [Mon, 2 Aug 2021 00:25:39 +0000 (08:25 +0800)] 
l10n: zh_CN: for git v2.33.0 l10n round 2

Translate 48 new messages (5230t0f0u) for git 2.33.0, and also fixed
typos found by "git-po-helper".

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2 years agol10n: zh_CN: Revision for git v2.32.0 l10n round 1
Fangyi Zhou [Mon, 7 Jun 2021 04:59:56 +0000 (12:59 +0800)] 
l10n: zh_CN: Revision for git v2.32.0 l10n round 1

Signed-off-by: Fangyi Zhou <me@fangyi.io>
2 years agol10n: README: refactor to use GFM syntax
Jiang Xin [Fri, 6 Aug 2021 03:07:48 +0000 (11:07 +0800)] 
l10n: README: refactor to use GFM syntax

Format README.md using GFM (GitHub Flavored Markdown) syntax.

- In order to use more than 3 level headings, use ATX style headings
  instead of setext style headings.

- In order to add highlights for code blocks, use fenced code blocks
  instead of indented code blocks.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 years agoMerge branch 'l10n-2.33-rnd2' of github.com:ralfth/git
Jiang Xin [Sun, 15 Aug 2021 02:26:18 +0000 (10:26 +0800)] 
Merge branch 'l10n-2.33-rnd2' of github.com:ralfth/git

* 'l10n-2.33-rnd2' of github.com:ralfth/git:
  l10n: update German translation for Git v2.33.0 (rnd2)

2 years agoMerge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po
Jiang Xin [Sun, 15 Aug 2021 02:24:24 +0000 (10:24 +0800)] 
Merge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po

* 'pt-PT' of github.com:git-l10n-pt-PT/git-po:
  l10n: pt_PT: v2.33.0 round 2
  l10n: pt_PT: git-po-helper update
  l10n: pt_PT: update translation table

2 years agol10n: update German translation for Git v2.33.0 (rnd2)
Ralf Thielow [Sat, 14 Aug 2021 14:35:44 +0000 (16:35 +0200)] 
l10n: update German translation for Git v2.33.0 (rnd2)

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 years agol10n: pt_PT: v2.33.0 round 2
Daniel Santos [Sat, 14 Aug 2021 12:02:31 +0000 (13:02 +0100)] 
l10n: pt_PT: v2.33.0 round 2

 * translation of new entries

Signed-off-by: Daniel Santos <hello@brighterdan.com>
2 years agol10n: pt_PT: git-po-helper update
Daniel Santos [Sat, 14 Aug 2021 11:08:39 +0000 (12:08 +0100)] 
l10n: pt_PT: git-po-helper update

 * run git-po-helper update pt_PT.po

Signed-off-by: Daniel Santos <hello@brighterdan.com>
2 years agol10n: pt_PT: update translation table
Daniel Santos [Thu, 12 Aug 2021 21:13:03 +0000 (22:13 +0100)] 
l10n: pt_PT: update translation table

 * updated translation table

Signed-off-by: Daniel Santos <hello@brighterdan.com>
2 years agoMerge branch 'loc/zh_TW/210814' of github.com:l10n-tw/git-po
Jiang Xin [Sat, 14 Aug 2021 11:30:54 +0000 (19:30 +0800)] 
Merge branch 'loc/zh_TW/210814' of github.com:l10n-tw/git-po

* 'loc/zh_TW/210814' of github.com:l10n-tw/git-po:
  l10n: zh_TW.po: remove the obsolete glossary
  l10n: zh_TW.po: update for v2.33.0 rnd 2

2 years agol10n: zh_TW.po: remove the obsolete glossary
Yi-Jyun Pan [Sat, 14 Aug 2021 06:11:42 +0000 (14:11 +0800)] 
l10n: zh_TW.po: remove the obsolete glossary

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2 years agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Sat, 14 Aug 2021 09:02:54 +0000 (17:02 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi.po(5230t): Updated translation for v2.32.0 round 2

2 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 14 Aug 2021 09:01:27 +0000 (17:01 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: id: po-id for 2.33.0 round 2

2 years agol10n: vi.po(5230t): Updated translation for v2.32.0 round 2
Tran Ngoc Quan [Sat, 14 Aug 2021 07:54:44 +0000 (14:54 +0700)] 
l10n: vi.po(5230t): Updated translation for v2.32.0 round 2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2 years agol10n: fr.po v2.33 rnd 2
Jean-Noël Avila [Sat, 14 Aug 2021 06:28:48 +0000 (08:28 +0200)] 
l10n: fr.po v2.33 rnd 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2 years agol10n: id: po-id for 2.33.0 round 2
Bagas Sanjaya [Sat, 14 Aug 2021 02:35:18 +0000 (09:35 +0700)] 
l10n: id: po-id for 2.33.0 round 2

Update translation for following component:
  * builtin/submodule--helper.c

Translate following new component:
  * builtin/revert.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 years agol10n: zh_TW.po: update for v2.33.0 rnd 2
Yi-Jyun Pan [Sat, 14 Aug 2021 05:48:09 +0000 (13:48 +0800)] 
l10n: zh_TW.po: update for v2.33.0 rnd 2

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2 years agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Sat, 14 Aug 2021 03:52:34 +0000 (11:52 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi.po(5227t): Fixed typo after run git-po-helper

2 years agol10n: git.pot: v2.33.0 round 2 (11 new, 8 removed)
Jiang Xin [Fri, 13 Aug 2021 23:57:34 +0000 (07:57 +0800)] 
l10n: git.pot: v2.33.0 round 2 (11 new, 8 removed)

Generate po/git.pot from v2.33.0-rc2 for git v2.33.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Fri, 13 Aug 2021 23:56:22 +0000 (07:56 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (51 commits)
  Git 2.33-rc2
  object-file: use unsigned arithmetic with bit mask
  Revert 'diff-merges: let "-m" imply "-p"'
  object-store: avoid extra ';' from KHASH_INIT
  oidtree: avoid nested struct oidtree_node
  Git 2.33-rc1
  test: fix for COLUMNS and bash 5
  The eighth batch
  diff: --pickaxe-all typofix
  mingw: align symlinks-related rmdir() behavior with Linux
  t7508: avoid non POSIX BRE
  use fspathhash() everywhere
  t0001: fix broken not-quite getcwd(3) test in bed67874e2
  Documentation: render special characters correctly
  reset: clear_unpack_trees_porcelain to plug leak
  builtin/rebase: fix options.strategy memory lifecycle
  builtin/merge: free found_ref when done
  builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv
  convert: release strbuf to avoid leak
  read-cache: call diff_setup_done to avoid leak
  ...

2 years agoMerge branch 'master' of github.com:nafmo/git-l10n-sv
Jiang Xin [Fri, 13 Aug 2021 23:55:01 +0000 (07:55 +0800)] 
Merge branch 'master' of github.com:nafmo/git-l10n-sv

* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (5227t0f0u)

2 years agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Fri, 13 Aug 2021 23:54:38 +0000 (07:54 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

2 years agoMerge branch 'l10n-2.33' of github.com:ralfth/git
Jiang Xin [Fri, 13 Aug 2021 23:50:33 +0000 (07:50 +0800)] 
Merge branch 'l10n-2.33' of github.com:ralfth/git

* 'l10n-2.33' of github.com:ralfth/git:
  l10n: de.po: fix typos
  l10n: update German translation for Git v2.33.0

2 years agoMerge branch 'fr_fix_typos' of github.com:jnavila/git
Jiang Xin [Fri, 13 Aug 2021 23:45:37 +0000 (07:45 +0800)] 
Merge branch 'fr_fix_typos' of github.com:jnavila/git

* 'fr_fix_typos' of github.com:jnavila/git:
  l10n: fr.po fix typos in commands and variables

2 years agoMerge branch 'master' of github.com:Softcatala/git-po
Jiang Xin [Fri, 13 Aug 2021 23:44:41 +0000 (07:44 +0800)] 
Merge branch 'master' of github.com:Softcatala/git-po

* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

2 years agorebase --continue: remove .git/MERGE_MSG
Phillip Wood [Thu, 12 Aug 2021 13:42:09 +0000 (13:42 +0000)] 
rebase --continue: remove .git/MERGE_MSG

If the user skips the final commit by removing all the changes from
the index and worktree with 'git restore' (or read-tree) and then runs
'git rebase --continue' .git/MERGE_MSG is left behind. This will seed
the commit message the next time the user commits which is not what we
want to happen.

Reported-by: Victor Gambier <vgambier@excilys.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorebase --apply: restore some tests
Phillip Wood [Thu, 12 Aug 2021 13:42:08 +0000 (13:42 +0000)] 
rebase --apply: restore some tests

980b482d28 ("rebase tests: mark tests specific to the am-backend with
--am", 2020-02-15) sought to prepare tests testing the "apply" backend
in preparation for 2ac0d6273f ("rebase: change the default backend
from "am" to "merge"", 2020-02-15). However some tests seem to have
been missed leading to us testing the "merge" backend twice. This
patch fixes some cases that I noticed while adding tests to these
files, I have not audited all the other rebase test files. I've
reworded a couple of the test descriptions to make it clear which
backend they are testing.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot3403: fix commit authorship
Phillip Wood [Thu, 12 Aug 2021 13:42:07 +0000 (13:42 +0000)] 
t3403: fix commit authorship

Setting GIT_AUTHOR_* when committing with --amend will only change the
author if we also pass --reset-author.  This commit is used in some
tests that ensure the author ident does not change when rebasing.
Creating this commit without changing the authorship meant that the
test would not catch regressions that caused rebase to discard the
original authorship information.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agol10n: de.po: fix typos
Ralf Thielow [Fri, 13 Aug 2021 15:07:04 +0000 (17:07 +0200)] 
l10n: de.po: fix typos

Fix some typos found by `./git-po-helper check-po po/de.po`.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 years agol10n: update German translation for Git v2.33.0
Ralf Thielow [Mon, 9 Aug 2021 14:50:31 +0000 (16:50 +0200)] 
l10n: update German translation for Git v2.33.0

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 years agoci: update freebsd 12 cirrus job
Carlo Marcelo Arenas Belón [Thu, 12 Aug 2021 20:22:00 +0000 (13:22 -0700)] 
ci: update freebsd 12 cirrus job

make sure it uses a supported OS branch and uses all the resources
that can be allocated efficiently.

while only 1GB of memory is needed, 2GB is the minimum for a 2 CPU
machine (the default), but by increasing parallelism wall time has
been reduced by 35%.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agolist-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"
Teng Long [Thu, 12 Aug 2021 08:59:31 +0000 (16:59 +0800)] 
list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_non_commits`.

Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agol10n: fr.po fix typos in commands and variables
Jean-Noël Avila [Thu, 12 Aug 2021 19:09:51 +0000 (21:09 +0200)] 
l10n: fr.po fix typos in commands and variables

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2 years agol10n: id: mismatch variable name fixes
Bagas Sanjaya [Thu, 12 Aug 2021 10:18:29 +0000 (17:18 +0700)] 
l10n: id: mismatch variable name fixes

Jiang Xin reported possible typos in po/id.po, all of them are mismatch
variable names. Fix them.

Reported-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 years agol10n: vi.po(5227t): Fixed typo after run git-po-helper
Tran Ngoc Quan [Thu, 12 Aug 2021 07:05:39 +0000 (14:05 +0700)] 
l10n: vi.po(5227t): Fixed typo after run git-po-helper

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2 years agol10n: Update Catalan translation
Jordi Mas [Thu, 12 Aug 2021 06:07:32 +0000 (08:07 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
2 years agot5607: avoid using prerequisites to select algorithm
brian m. carlson [Wed, 11 Aug 2021 23:16:44 +0000 (23:16 +0000)] 
t5607: avoid using prerequisites to select algorithm

In this test, we currently use the SHA1 prerequisite to specify the
algorithm we're using to test, since SHA-256 bundles are always v3,
whereas SHA-1 bundles default to v2, and as a result the default output
differs.

However, this causes a problem if we run with GIT_TEST_FAIL_PREREQS set,
since that means that we'll unexpectedly fail the SHA1 prerequisite,
resulting in incorrect expected output.  Let's fix this by checking
against the built-in data called "algo", which tells us which algorithm
is in use.  This should work in any situation, making our test a little
more robust.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'daniel' of github.com:git-l10n-pt-PT/git-po
Jiang Xin [Thu, 12 Aug 2021 00:23:55 +0000 (08:23 +0800)] 
Merge branch 'daniel' of github.com:git-l10n-pt-PT/git-po

* 'daniel' of github.com:git-l10n-pt-PT/git-po:
  l10n: pt_PT: cleaning flags mismatch
  l10n: pt_PT: cleaning duplicate translations
  l10n: pt_PT: update translation tables
  l10n: pt_PT: translated git v2.33.0
  l10n: pt_PT: update git-po-helper
  l10n: pt_PT: remove trailing comments
  l10n: pt_PT: translation tables
  l10n: pt_PT: add Portuguese translations part 5
  l10n: pt_PT: add Portuguese translations part 4

2 years agoGit 2.33-rc2 v2.33.0-rc2
Junio C Hamano [Wed, 11 Aug 2021 18:54:03 +0000 (11:54 -0700)] 
Git 2.33-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jn/log-m-does-not-imply-p'
Junio C Hamano [Wed, 11 Aug 2021 19:36:18 +0000 (12:36 -0700)] 
Merge branch 'jn/log-m-does-not-imply-p'

Earlier "git log -m" was changed to always produce patch output,
which would break existing scripts, which has been reverted.

* jn/log-m-does-not-imply-p:
  Revert 'diff-merges: let "-m" imply "-p"'

2 years agoMerge branch 'cb/many-alternate-optim-fixup'
Junio C Hamano [Wed, 11 Aug 2021 19:36:17 +0000 (12:36 -0700)] 
Merge branch 'cb/many-alternate-optim-fixup'

Build fix.

* cb/many-alternate-optim-fixup:
  object-file: use unsigned arithmetic with bit mask
  object-store: avoid extra ';' from KHASH_INIT
  oidtree: avoid nested struct oidtree_node

2 years agouserdiff: improve java hunk header regex
Tassilo Horn [Wed, 11 Aug 2021 17:51:04 +0000 (19:51 +0200)] 
userdiff: improve java hunk header regex

Currently, the git diff hunk headers show the wrong method signature if the
method has a qualified return type, an array return type, or a generic return
type because the regex doesn't allow dots (.), [], or < and > in the return
type.  Also, type parameter declarations couldn't be matched.

Add several t4018 tests asserting the right hunk headers for different cases:

  - enum constant change
  - change in generic method with bounded type parameters
  - change in generic method with wildcard
  - field change in a nested class

Signed-off-by: Tassilo Horn <tsdh@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agouserdiff: comment on the builtin patterns
Junio C Hamano [Tue, 10 Aug 2021 22:12:01 +0000 (15:12 -0700)] 
userdiff: comment on the builtin patterns

Remind developers that they do not need to go overboard to implement
patterns to prepare for invalid constructs.  They only have to be
sufficiently permissive, assuming that the payload is syntactically
correct, and that may allow them to be simpler.

Text stolen mostly from, and further improved by, Johannes Sixt.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoobject-file: use unsigned arithmetic with bit mask
René Scharfe [Fri, 6 Aug 2021 17:53:47 +0000 (19:53 +0200)] 
object-file: use unsigned arithmetic with bit mask

33f379eee6 (make object_directory.loose_objects_subdir_seen a bitmap,
2021-07-07) replaced a wasteful 256-byte array with a 32-byte array
and bit operations.  The mask calculation shifts a literal 1 of type
int left by anything between 0 and 31.  UndefinedBehaviorSanitizer
doesn't like that and reports:

object-file.c:2477:18: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Make sure to use an unsigned 1 instead to avoid the issue.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agol10n: pt_PT: cleaning flags mismatch
Daniel Santos [Wed, 11 Aug 2021 04:07:01 +0000 (05:07 +0100)] 
l10n: pt_PT: cleaning flags mismatch

 * corrected git flags mismatch

Signed-off-by: Daniel Santos <hello@brighterdan.com>
2 years agoconnect, protocol: log negotiated protocol version
Josh Steadmon [Tue, 10 Aug 2021 17:20:39 +0000 (10:20 -0700)] 
connect, protocol: log negotiated protocol version

It is useful for performance monitoring and debugging purposes to know
the wire protocol used for remote operations. This may differ from the
version set in local configuration due to differences in version and/or
configuration between the server and the client. Therefore, log the
negotiated wire protocol version via trace2, for both clients and
servers.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoapply: keep buffer/size pair in sync when parsing binary hunks
Jeff King [Tue, 10 Aug 2021 01:01:52 +0000 (21:01 -0400)] 
apply: keep buffer/size pair in sync when parsing binary hunks

We parse through binary hunks by looping through the buffer with code
like:

    llen = linelen(buffer, size);

    ...do something with the line...

    buffer += llen;
    size -= llen;

However, before we enter the loop, there is one call that increments
"buffer" but forgets to decrement "size". As a result, our "size" is off
by the length of that line, and subsequent calls to linelen() may look
past the end of the buffer for a newline.

The fix is easy: we just need to decrement size as we do elsewhere.

This bug goes all the way back to 0660626caf (binary diff: further
updates., 2006-05-05). Presumably nobody noticed because it only
triggers if the patch is corrupted, and even then we are often "saved"
by luck. We use a strbuf to store the incoming patch, so we overallocate
there, plus we add a 16-byte run of NULs as slop for memory comparisons.
So if this happened accidentally, the common case is that we'd just read
a few uninitialized bytes from the end of the strbuf before producing
the expected "this patch is corrupted" error complaint.

However, it is possible to carefully construct a case which reads off
the end of the buffer. The included test does so. It will pass both
before and after this patch when run normally, but using a tool like
ASan shows that we get an out-of-bounds read before this patch, but not
after.

Reported-by: Xingman Chen <xichixingman@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>