]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'jc/builtin-mv-move-array'
Junio C Hamano [Mon, 18 Jul 2022 20:31:53 +0000 (13:31 -0700)] 
Merge branch 'jc/builtin-mv-move-array'

Apply Coccinelle rule to turn raw memmove() into MOVE_ARRAY() cpp
macro, which would improve maintainability and readability.

* jc/builtin-mv-move-array:
  builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove()

2 years agoMerge branch 'fr/vimdiff-layout-fix'
Junio C Hamano [Mon, 18 Jul 2022 20:31:53 +0000 (13:31 -0700)] 
Merge branch 'fr/vimdiff-layout-fix'

Recent update to vimdiff layout code has been made more robust
against different end-user vim settings.

* fr/vimdiff-layout-fix:
  vimdiff: make layout engine more robust against user vim settings

2 years agoThe third batch
Junio C Hamano [Thu, 14 Jul 2022 21:55:10 +0000 (14:55 -0700)] 
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ab/submodule-cleanup'
Junio C Hamano [Thu, 14 Jul 2022 22:04:00 +0000 (15:04 -0700)] 
Merge branch 'ab/submodule-cleanup'

Further preparation to turn git-submodule.sh into a builtin.

* ab/submodule-cleanup:
  git-sh-setup.sh: remove "say" function, change last users
  git-submodule.sh: use "$quiet", not "$GIT_QUIET"
  submodule--helper: eliminate internal "--update" option
  submodule--helper: understand --checkout, --merge and --rebase synonyms
  submodule--helper: report "submodule" as our name in some "-h" output
  submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"
  submodule update: remove "-v" option
  submodule--helper: have --require-init imply --init
  git-submodule.sh: remove unused top-level "--branch" argument
  git-submodule.sh: make the "$cached" variable a boolean
  git-submodule.sh: remove unused $prefix variable
  git-submodule.sh: remove unused sanitize_submodule_env()

2 years agoMerge branch 'sy/mv-out-of-cone'
Junio C Hamano [Thu, 14 Jul 2022 22:03:59 +0000 (15:03 -0700)] 
Merge branch 'sy/mv-out-of-cone'

"git mv A B" in a sparsely populated working tree can be asked to
move a path between directories that are "in cone" (i.e. expected
to be materialized in the working tree) and "out of cone"
(i.e. expected to be hidden).  The handling of such cases has been
improved.

* sy/mv-out-of-cone:
  mv: add check_dir_in_index() and solve general dir check issue
  mv: use flags mode for update_mode
  mv: check if <destination> exists in index to handle overwriting
  mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit
  mv: decouple if/else-if checks using goto
  mv: update sparsity after moving from out-of-cone to in-cone
  t1092: mv directory from out-of-cone to in-cone
  t7002: add tests for moving out-of-cone file/directory

2 years agoMerge branch 'hx/unpack-streaming'
Junio C Hamano [Thu, 14 Jul 2022 22:03:59 +0000 (15:03 -0700)] 
Merge branch 'hx/unpack-streaming'

Allow large objects read from a packstream to be streamed into a
loose object file straight, without having to keep it in-core as a
whole.

* hx/unpack-streaming:
  unpack-objects: use stream_loose_object() to unpack large objects
  core doc: modernize core.bigFileThreshold documentation
  object-file.c: add "stream_loose_object()" to handle large object
  object-file.c: factor out deflate part of write_loose_object()
  object-file.c: refactor write_loose_object() to several steps
  unpack-objects: low memory footprint for get_data() in dry_run mode

2 years agoMerge branch 'en/merge-tree'
Junio C Hamano [Thu, 14 Jul 2022 22:03:58 +0000 (15:03 -0700)] 
Merge branch 'en/merge-tree'

"git merge-tree" learned a new mode where it takes two commits and
computes a tree that would result in the merge commit, if the
histories leading to these two commits were to be merged.

* en/merge-tree:
  git-merge-tree.txt: add a section on potentional usage mistakes
  merge-tree: add a --allow-unrelated-histories flag
  merge-tree: allow `ls-files -u` style info to be NUL terminated
  merge-ort: optionally produce machine-readable output
  merge-ort: store more specific conflict information
  merge-ort: make `path_messages` a strmap to a string_list
  merge-ort: store messages in a list, not in a single strbuf
  merge-tree: provide easy access to `ls-files -u` style info
  merge-tree: provide a list of which files have conflicts
  merge-ort: remove command-line-centric submodule message from merge-ort
  merge-ort: provide a merge_get_conflicted_files() helper function
  merge-tree: support including merge messages in output
  merge-ort: split out a separate display_update_messages() function
  merge-tree: implement real merges
  merge-tree: add option parsing and initial shell for real merge function
  merge-tree: move logic for existing merge into new function
  merge-tree: rename merge_trees() to trivial_merge_trees()

2 years agoMerge branch 'gg/worktree-from-the-above'
Junio C Hamano [Thu, 14 Jul 2022 22:03:58 +0000 (15:03 -0700)] 
Merge branch 'gg/worktree-from-the-above'

In a non-bare repository, the behavior of Git when the
core.worktree configuration variable points at a directory that has
a repository as its subdirectory, regressed in Git 2.27 days.

* gg/worktree-from-the-above:
  dir: minor refactoring / clean-up
  dir: traverse into repository

2 years agoThe second batch
Junio C Hamano [Wed, 13 Jul 2022 21:44:29 +0000 (14:44 -0700)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ds/git-rebase-doc-markup'
Junio C Hamano [Wed, 13 Jul 2022 21:54:56 +0000 (14:54 -0700)] 
Merge branch 'ds/git-rebase-doc-markup'

References to commands-to-be-typed-literally in "git rebase"
documentation mark-up have been corrected.

* ds/git-rebase-doc-markup:
  git-rebase.txt: use back-ticks consistently

2 years agoMerge branch 'tk/rev-parse-doc-clarify-at-u'
Junio C Hamano [Wed, 13 Jul 2022 21:54:55 +0000 (14:54 -0700)] 
Merge branch 'tk/rev-parse-doc-clarify-at-u'

Doc update.

* tk/rev-parse-doc-clarify-at-u:
  rev-parse: documentation adjustment - mention remote tracking with @{u}

2 years agoMerge branch 'cl/grep-max-count'
Junio C Hamano [Wed, 13 Jul 2022 21:54:55 +0000 (14:54 -0700)] 
Merge branch 'cl/grep-max-count'

"git grep -m<max-hits>" is a way to limit the hits shown per file.

* cl/grep-max-count:
  grep: add --max-count command line option

2 years agoMerge branch 'dr/i18n-die-warn-error-usage'
Junio C Hamano [Wed, 13 Jul 2022 21:54:54 +0000 (14:54 -0700)] 
Merge branch 'dr/i18n-die-warn-error-usage'

Give _() markings to fatal/warning/usage: labels that are shown in
front of these messages.

* dr/i18n-die-warn-error-usage:
  i18n: mark message helpers prefix for translation

2 years agoMerge branch 'zk/push-use-bitmaps'
Junio C Hamano [Wed, 13 Jul 2022 21:54:54 +0000 (14:54 -0700)] 
Merge branch 'zk/push-use-bitmaps'

"git push" sometimes perform poorly when reachability bitmaps are
used, even in a repository where other operations are helped by
bitmaps.  The push.useBitmaps configuration variable is introduced
to allow disabling use of reachability bitmaps only for "git push".

* zk/push-use-bitmaps:
  send-pack.c: add config push.useBitmaps

2 years agoMerge branch 'jk/remote-show-with-negative-refspecs'
Junio C Hamano [Wed, 13 Jul 2022 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'jk/remote-show-with-negative-refspecs'

"git remote show [-n] frotz" now pays attention to negative
pathspec.

* jk/remote-show-with-negative-refspecs:
  remote: handle negative refspecs in git remote show

2 years agoMerge branch 'ro/mktree-allow-missing-fix'
Junio C Hamano [Wed, 13 Jul 2022 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'ro/mktree-allow-missing-fix'

"git mktree --missing" lazily fetched objects that are missing from
the local object store, which was totally unnecessary for the purpose
of creating the tree object(s) from its input.

* ro/mktree-allow-missing-fix:
  mktree: do not check type of remote objects

2 years agoMerge branch 'll/ls-files-tests-update'
Junio C Hamano [Wed, 13 Jul 2022 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'll/ls-files-tests-update'

Test update.

* ll/ls-files-tests-update:
  ls-files: update test style

2 years agoMerge branch 'ab/test-quoting-fix'
Junio C Hamano [Wed, 13 Jul 2022 21:54:52 +0000 (14:54 -0700)] 
Merge branch 'ab/test-quoting-fix'

Fixes for tests when the source directory has unusual characters in
its path, e.g. whitespaces, double-quotes, etc.

* ab/test-quoting-fix:
  config tests: fix harmless but broken "rm -r" cleanup
  test-lib.sh: fix prepend_var() quoting issue
  tests: add missing double quotes to included library paths

2 years agoMerge branch 'ds/t5510-brokequote'
Junio C Hamano [Wed, 13 Jul 2022 21:54:52 +0000 (14:54 -0700)] 
Merge branch 'ds/t5510-brokequote'

Test fix.

* ds/t5510-brokequote:
  t5510: replace 'origin' with URL more carefully

2 years agoMerge branch 'tb/pack-objects-remove-pahole-comment'
Junio C Hamano [Wed, 13 Jul 2022 21:54:51 +0000 (14:54 -0700)] 
Merge branch 'tb/pack-objects-remove-pahole-comment'

Comment fix.

* tb/pack-objects-remove-pahole-comment:
  pack-objects.h: remove outdated pahole results

2 years agoMerge branch 'en/t6429-test-must-be-empty-fix'
Junio C Hamano [Wed, 13 Jul 2022 21:54:51 +0000 (14:54 -0700)] 
Merge branch 'en/t6429-test-must-be-empty-fix'

A test fix.

* en/t6429-test-must-be-empty-fix:
  t6429: fix use of non-existent function

2 years agoSync with Git 2.37.1
Junio C Hamano [Mon, 11 Jul 2022 23:08:49 +0000 (16:08 -0700)] 
Sync with Git 2.37.1

2 years agoThe first batch after Git 2.37
Junio C Hamano [Mon, 11 Jul 2022 22:37:53 +0000 (15:37 -0700)] 
The first batch after Git 2.37

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'ds/vscode-settings'
Junio C Hamano [Mon, 11 Jul 2022 22:38:52 +0000 (15:38 -0700)] 
Merge branch 'ds/vscode-settings'

* ds/vscode-settings:
  vscode: improve tab size and wrapping

2 years agoMerge branch 'cr/setup-bug-typo'
Junio C Hamano [Mon, 11 Jul 2022 22:38:52 +0000 (15:38 -0700)] 
Merge branch 'cr/setup-bug-typo'

Typofix in a BUG() message.

* cr/setup-bug-typo:
  setup: fix function name in a BUG() message

2 years agoMerge branch 'rs/archive-with-internal-gzip'
Junio C Hamano [Mon, 11 Jul 2022 22:38:51 +0000 (15:38 -0700)] 
Merge branch 'rs/archive-with-internal-gzip'

Teach "git archive" to (optionally and then by default) avoid
spawning an external "gzip" process when creating ".tar.gz" (and
".tgz") archives.

* rs/archive-with-internal-gzip:
  archive-tar: use internal gzip by default
  archive-tar: use OS_CODE 3 (Unix) for internal gzip
  archive-tar: add internal gzip implementation
  archive-tar: factor out write_block()
  archive: rename archiver data field to filter_command
  archive: update format documentation

2 years agoMerge branch 'ds/branch-checked-out'
Junio C Hamano [Mon, 11 Jul 2022 22:38:51 +0000 (15:38 -0700)] 
Merge branch 'ds/branch-checked-out'

Introduce a helper to see if a branch is already being worked on
(hence should not be newly checked out in a working tree), which
performs much better than the existing find_shared_symref() to
replace many uses of the latter.

* ds/branch-checked-out:
  branch: drop unused worktrees variable
  fetch: stop passing around unused worktrees variable
  branch: fix branch_checked_out() leaks
  branch: use branch_checked_out() when deleting refs
  fetch: use new branch_checked_out() and add tests
  branch: check for bisects and rebases
  branch: add branch_checked_out() helper

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 agobuiltin/mv.c: use the MOVE_ARRAY() macro instead of memmove()
Junio C Hamano [Sun, 10 Jul 2022 01:33:54 +0000 (18:33 -0700)] 
builtin/mv.c: use the MOVE_ARRAY() macro instead of memmove()

The variables 'source', 'destination', and 'submodule_gitfile' are
all of type "const char **", and an element of such an array is of
"type const char *", but these memmove() calls were written as if
these variables are of type "char **".

Once these memmove() calls are fixed to use the correct type to
compute the number of bytes to be moved, e.g.

-      memmove(source + i, source + i + 1, n * sizeof(char *));
+      memmove(source + i, source + i + 1, n * sizeof(const char *));

existing contrib/coccinelle/array.cocci rules can recognize them as
candidates for turning into MOVE_ARRAY().

While at it, use CALLOC_ARRAY() instead of xcalloc() to allocate the
modes[] array that is involved in the change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agovimdiff: make layout engine more robust against user vim settings
Fernando Ramos [Fri, 8 Jul 2022 18:10:24 +0000 (20:10 +0200)] 
vimdiff: make layout engine more robust against user vim settings

'vim' has two configuration options ('splitbelow' and 'splitright') that
change the way the 'split' command behaves. When they are set, the
commands that the layout engine generates no longer work as expected.

In order to fix this we can append special keyword 'leftabove' to each
'split' and 'vertical split' subcommand found inside the command string
generated by the layout engine.

This works because whatever comes after 'leftabove' will temporally
ignore settings 'splitbelow' and 'splitright'.

Reported-by: Matthew Klein <mklein994@gmail.com>
Signed-off-by: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agols-files: update test style
Li Linchao [Sun, 3 Jul 2022 15:49:09 +0000 (15:49 +0000)] 
ls-files: update test style

Update test style in t/t30[*].sh for uniformity, that's to
keep test title the same line with helper function itself,
and fix some indentions.

Add a new section "recommended style" in t/README to
encourage people to use more modern style in test.

Signed-off-by: Li Linchao <lilinchao@oschina.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoGit 2.37.1 v2.37.1
Junio C Hamano [Mon, 4 Jul 2022 20:45:08 +0000 (13:45 -0700)] 
Git 2.37.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge 'js/add-i-delete' into maint-2.37
Junio C Hamano [Mon, 4 Jul 2022 20:40:31 +0000 (13:40 -0700)] 
Merge 'js/add-i-delete' into maint-2.37

Rewrite of "git add -i" in C that appeared in Git 2.25 didn't
correctly record a removed file to the index, which is an old
regression but has become widely known because the C version
has become the default in the latest release.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agomv: add check_dir_in_index() and solve general dir check issue
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:37 +0000 (10:37 +0800)] 
mv: add check_dir_in_index() and solve general dir check issue

Originally, moving a <source> directory which is not on-disk due
to its existence outside of sparse-checkout cone, "giv mv" command
errors out with "bad source".

Add a helper check_dir_in_index() function to see if a directory
name exists in the index. Also add a SKIP_WORKTREE_DIR bit to mark
such directories.

Change the checking logic, so that such <source> directory makes
"giv mv" command warns with "advise_on_updating_sparse_paths()"
instead of "bad source"; also user now can supply a "--sparse" flag so
this operation can be carried out successfully.

Helped-by: Victoria Dye <vdye@github.com>
Helped-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomv: use flags mode for update_mode
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:36 +0000 (10:37 +0800)] 
mv: use flags mode for update_mode

As suggested by Derrick [1], move the in-line definition of
"enum update_mode" to the top of the file and make it use "flags"
mode (each state is a different bit in the word).

Change the flag assignments from '=' (single assignment) to '|='
(additive). Also change flag evaluation from '==' to '&', etc.

[1] https://lore.kernel.org/git/22aadea2-9330-aa9e-7b6a-834585189144@github.com/

Helped-by: Victoria Dye <vdye@github.com>
Helped-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomv: check if <destination> exists in index to handle overwriting
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:35 +0000 (10:37 +0800)] 
mv: check if <destination> exists in index to handle overwriting

Originally, moving a sparse file into cone can result in unwarned
overwrite of existing entry. The expected behavior is that if the
<destination> exists in the entry, user should be prompted to supply
a [-f|--force] to carry out the operation, or the operation should
fail.

Add a check mechanism to do that.

Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomv: check if out-of-cone file exists in index with SKIP_WORKTREE bit
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:34 +0000 (10:37 +0800)] 
mv: check if out-of-cone file exists in index with SKIP_WORKTREE bit

Originally, moving a <source> file which is not on-disk but exists in
index as a SKIP_WORKTREE enabled cache entry, "giv mv" command errors
out with "bad source".

Change the checking logic, so that such <source>
file makes "giv mv" command warns with "advise_on_updating_sparse_paths()"
instead of "bad source"; also user now can supply a "--sparse" flag so
this operation can be carried out successfully.

Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomv: decouple if/else-if checks using goto
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:33 +0000 (10:37 +0800)] 
mv: decouple if/else-if checks using goto

Previous if/else-if chain are highly nested and hard to develop/extend.

Refactor to decouple this if/else-if chain by using goto to jump ahead.

Suggested-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomv: update sparsity after moving from out-of-cone to in-cone
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:32 +0000 (10:37 +0800)] 
mv: update sparsity after moving from out-of-cone to in-cone

Originally, "git mv" a sparse file from out-of-cone to
in-cone does not update the moved file's sparsity (remove its
SKIP_WORKTREE bit). And the corresponding cache entry is, unexpectedly,
not checked out in the working tree.

Update the behavior so that:
1. Moving from out-of-cone to in-cone removes the SKIP_WORKTREE bit from
   corresponding cache entry.
2. The moved cache entry is checked out in the working tree to reflect
   the updated sparsity.

Helped-by: Victoria Dye <vdye@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot1092: mv directory from out-of-cone to in-cone
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:31 +0000 (10:37 +0800)] 
t1092: mv directory from out-of-cone to in-cone

Add test for "mv: add check_dir_in_index() and solve general dir check
issue" in this series.

This change tests the following:

1. mv <source> as a directory on the sparse index boundary (where it
   would be a sparse directory in a sparse index).
2. mv <source> as a directory which is deeper than the boundary (so
   the sparse index would expand in the cache_name_pos() method).

These tests can be written now for correctness, but later the first case
can be updated to use the 'ensure_not_expanded' helper in t1092.

Suggested-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot7002: add tests for moving out-of-cone file/directory
Shaoxuan Yuan [Thu, 30 Jun 2022 02:37:30 +0000 (10:37 +0800)] 
t7002: add tests for moving out-of-cone file/directory

Add corresponding tests to test following situations:

We do not have sufficient coverage of moving files outside
of a sparse-checkout cone. Create new tests covering this
behavior, keeping in mind that the user can include --sparse
(or not), move a file or directory, and the destination can
already exist in the index (in this case user can use --force
to overwrite existing entry).

Helped-by: Victoria Dye <vdye@github.com>
Helped-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agot6429: fix use of non-existent function
Elijah Newren [Fri, 1 Jul 2022 05:19:59 +0000 (05:19 +0000)] 
t6429: fix use of non-existent function

This test had a line reading

    ! test_file_is_empty actual

which was meant to be

    ! test_must_be_empty actual

The test worked despite the error, because even though
test_file_is_empty is a non-existent function, the '!' negated the
return value and made it pass.  It'd be better to avoid the negation,
so something like

    test_file_not_empty actual

would be better, but perhaps it makes even more sense to specify the
number of lines of expected output to make the test a bit tighter.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@palantir.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoconfig tests: fix harmless but broken "rm -r" cleanup
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:36 +0000 (12:18 +0200)] 
config tests: fix harmless but broken "rm -r" cleanup

The "test_when_finished" cleanup phase added in 4179b4897f2 (config:
allow overriding of global and system configuration, 2021-04-19) has
never worked as intended, firstly the ".config/git" is a directory, so
we'd need the "-r" flag, but more importantly the $HOME variable
wasn't properly quoted.

We'd thus end up trying to remove the "trash" part of "trash
directory", which wouldn't fail with "-f", since "rm -f" won't fail on
non-existing files.

It's possible that this would have caused an actual failure if someone
had a $HOME with a space character in it, such that our "rm -f" would
fail to remove an existing directory, but in practice that probably
never happened.

Let's fix both the quoting issue, and the other issue cleanup issue in
4179b4897f2, which is that we were attempting to clean up
~/.config/git, but weren't cleaing up ~/.gitconfig.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotest-lib.sh: fix prepend_var() quoting issue
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:35 +0000 (12:18 +0200)] 
test-lib.sh: fix prepend_var() quoting issue

Fix a quoting issue in the function introduced in
b9638d7286f (test-lib: make $GIT_BUILD_DIR an absolute path,
2022-02-27), running the test suite where the git checkout was on a
path with e.g. a space in it would fail.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agotests: add missing double quotes to included library paths
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:34 +0000 (12:18 +0200)] 
tests: add missing double quotes to included library paths

Fix inclusion errors which would occur if the $TEST_DIRECTORY had $IFS
whitespace in it.

See d42bab442d7 (core.fsyncmethod: tests for batch mode, 2022-04-04)
and a242c150ebb (vimdiff: integrate layout tests in the unit tests
framework ('t' folder), 2022-03-30) for the two relevant commits. Both
were first released with v2.37.0-rc0 (and were also part of v2.37.0).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-rebase.txt: use back-ticks consistently
Derrick Stolee [Wed, 29 Jun 2022 13:21:07 +0000 (13:21 +0000)] 
git-rebase.txt: use back-ticks consistently

While inspecting the 'git rebase' documentation, I noticed that it is
inconsistent with how it uses back-ticks (or other punctuation) for
identifying Git commands, command-line arguments, or values for those
arguments.

Sometimes, an argument (like '--interactive') would appear without any
punctuation, causing the argument to not have any special formatting.
Other times, arguments or 'git rebase' itself would have single-quotes
giving a bold look (in the HTML documentation at least).

By consistently using back-ticks, these types of strings appear in a
monospace font with special highlighting to appear more clearly as text
that exists in a command-line invocation of a Git command.

This rather-large diff is the result of scanning git-rebase.txt and
adding back-ticks as appropriate. Some are adding back-ticks where there
was no punctuation. Others are replacing single quotes.

There are also a few minor cleanups in the process, including those
found by reviewers.

Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agopack-objects.h: remove outdated pahole results
Taylor Blau [Tue, 28 Jun 2022 18:30:20 +0000 (14:30 -0400)] 
pack-objects.h: remove outdated pahole results

The size and padding of `struct object_entry` is an important factor in
determining the memory usage of `pack-objects`. For this reason,
3b13a5f263 (pack-objects: reorder members to shrink struct object_entry,
2018-04-14) added a comment containing some information from pahole
indicating the size and padding of that struct.

Unfortunately, this comment hasn't been updated since 9ac3f0e5b3
(pack-objects: fix performance issues on packing large deltas,
2018-07-22), despite the size of this struct changing many times since
that commit.

To see just how often the size of object_entry changes, I skimmed the
first-parent history with this script:

    for sha in $(git rev-list --first-parent --reverse 9ac3f0e..)
    do
      echo -n "$sha "
      git checkout -q $sha
      make -s pack-objects.o 2>/dev/null
      pahole -C object_entry pack-objects.o | sed -n \
        -e 's/\/\* size: \([0-9]*\).*/size \1/p' \
        -e 's/\/\*.*padding: \([0-9]*\).*/padding \1/p' | xargs
    done | uniq -f1

In between each merge, the size of object_entry changes too often to
record every instance here. But the important merges (along with their
corresponding sizes and bit paddings) in chronological order are:

    ad635e82d6 (Merge branch 'nd/pack-objects-pack-struct', 2018-05-23) size 80 padding 4
    29d9e3e2c4 (Merge branch 'nd/pack-deltify-regression-fix', 2018-08-22) size 80 padding 9
    3ebdef2e1b (Merge branch 'jk/pack-delta-reuse-with-bitmap', 2018-09-17) size 80 padding 8
    33e4ae9c50 (Merge branch 'bc/sha-256', 2019-01-29) size 96 padding 8

(indicating that the current size of the struct is 96 bytes, with 8
padding bits).

Even though this comment was written in a good spirit, it is updated
infrequently enough that it serves to confuse rather than to encourage
contributors to update the appropriate values when the modify the
definition of object_entry.

For that reason, eliminate the confusion by removing the comment
altogether.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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-sh-setup.sh: remove "say" function, change last users
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:34 +0000 (12:05 +0200)] 
git-sh-setup.sh: remove "say" function, change last users

Remove the "say" function, with various rewrites of the remaining
git-*.sh code to C and the preceding change to have git-submodule.sh
stop using the GIT_QUIET variable there were only four uses in
git-subtree.sh. Let's have it use an "arg_quiet" variable instead, and
move the "say" function over to it.

The only other use was a trivial message in git-instaweb.sh, since it
has never supported the --quiet option (or similar) that code added in
0b624b4ceee (instaweb: restart server if already running, 2009-11-22)
can simply use "echo" instead.

The remaining in-tree hits from "say" are all for the sibling function
defined in t/test-lib.sh. It's safe to remove this function since it
has never been documented in Documentation/git-sh-setup.txt.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-submodule.sh: use "$quiet", not "$GIT_QUIET"
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:33 +0000 (12:05 +0200)] 
git-submodule.sh: use "$quiet", not "$GIT_QUIET"

Remove the use of the "$GIT_QUIET" variable in favor of our own
"$quiet", ever since b3c5f5cb048 (submodule: move core cmd_update()
logic to C, 2022-03-15) we have not used the "say" function in
git-sh-setup.sh, which is the only thing that's affected by using
"GIT_QUIET".

We still want to support --quiet for our own use though, but let's use
our own variable for that. Now it's obvious that we only care about
passing "--quiet" to "git submodule--helper", and not to change the
output of any "say" invocation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: eliminate internal "--update" option
Glen Choo [Tue, 28 Jun 2022 10:05:32 +0000 (12:05 +0200)] 
submodule--helper: eliminate internal "--update" option

Follow-up on the preceding commit which taught "git submodule--helper
update" to understand "--merge", "--checkout" and "--rebase" and use
those options instead of "--update=(rebase|merge|checkout|none)" when
the command invokes itself.

Unlike the preceding change this isn't strictly necessary to
eventually change "git-submodule.sh" so that it invokes "git
submodule--helper update" directly, but let's remove this
inconsistency in the command-line interface. We shouldn't need to
carry special synonyms for existing options in "git submodule--helper"
when that command can use the primary documented names instead.

But, as seen in the post-image this makes the control flow within
"builtin/submodule--helper.c" simpler, we can now write directly to
the "update_default" member of "struct update_data" when parsing the
options in "module_update()".

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: understand --checkout, --merge and --rebase synonyms
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:31 +0000 (12:05 +0200)] 
submodule--helper: understand --checkout, --merge and --rebase synonyms

Understand --checkout, --merge and --rebase synonyms for
--update={checkout,merge,rebase}, as well as the short options that
'git submodule' itself understands.

This removes a difference between the CLI API of "git submodule" and
"git submodule--helper", making it easier to make the latter an alias
for the former. See 48308681b07 (git submodule update: have a
dedicated helper for cloning, 2016-02-29) for the initial addition of
--update.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: report "submodule" as our name in some "-h" output
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:30 +0000 (12:05 +0200)] 
submodule--helper: report "submodule" as our name in some "-h" output

Change the user-facing "git submodule--helper" commands so that
they'll report their name as being "git submodule". To a user these
commands are internal implementation details, and it doesn't make
sense to emit usage about an internal helper when "git submodule" is
invoked with invalid options.

Before this we'd emit e.g.:

$ git submodule absorbgitdirs --blah
error: unknown option `blah'
usage: git submodule--helper absorbgitdirs [<options>] [<path>...]
[...]
And:

$ git submodule set-url -- --
usage: git submodule--helper set-url [--quiet] <path> <newurl>
[...]

Now we'll start with "usage: git submodule [...]" in both of those
cases. This change does not alter the "list", "name", "clone",
"config" and "create-branch" commands, those are internal-only (as an
aside; their usage info should probably invoke BUG(...)). This only
changes the user-facing commands.

The "status", "deinit" and "update" commands are not included in this
change, because their usage information already used "submodule"
rather than "submodule--helper".

I don't think it's currently possible to emit some of this usage
information in practice, as git-submodule.sh will catch unknown
options, and e.g. it doesn't seem to be possible to get "add" to emit
its usage information from "submodule--helper".

Though that change may be superfluous now, it's also harmless, and
will allow us to eventually dispatch further into "git
submodule--helper" from git-submodule.sh, while emitting the correct
usage output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:29 +0000 (12:05 +0200)] 
submodule--helper: rename "absorb-git-dirs" to "absorbgitdirs"

Rename the "absorb-git-dirs" subcommand to "absorbgitdirs", which is
what the "git submodule" command itself has called it since the
subcommand was implemented in f6f85861400 (submodule: add
absorb-git-dir function, 2016-12-12).

Having these two be different will make it more tedious to dispatch to
eventually dispatch "git submodule--helper" directly, as we'd need to
retain this name mapping. So let's get rid of this needless
inconsistency.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule update: remove "-v" option
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:28 +0000 (12:05 +0200)] 
submodule update: remove "-v" option

In e84c3cf3dc3 (git-submodule.sh: accept verbose flag in cmd_update to
be non-quiet, 2018-08-14) the "git submodule update" sub-command was
made to understand "-v", but the option was never documented.

The only in-tree user has been this test added in
3ad0401e9e6 (submodule update: silence underlying merge/rebase with
"--quiet", 2020-09-30), it wasn't per-se testing --quiet, but fixing a
bug in e84c3cf3dc3: It used to set "GIT_QUIET=0" instead of unsetting
it on "-v", and thus we'd end up passing "--quiet" to "git
submodule--helper" on "-v", since the "--quiet" option was passed
using the ${parameter:+word} construct.

Furthermore, even if someone had used the "-v" option they'd only be
getting the default output. Our default in both git-submodule.sh and
"git submodule--helper" has been to be "verbose", so the only way this
option could have matter is if it were used as e.g.:

    git submodule --quiet update -v [...]

I.e. to undo the effect of a previous "--quiet" on the command-line.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agosubmodule--helper: have --require-init imply --init
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:27 +0000 (12:05 +0200)] 
submodule--helper: have --require-init imply --init

Adjust code added in 0060fd1511b (clone --recurse-submodules: prevent
name squatting on Windows, 2019-09-12) to have the internal
--require-init option imply --init, rather than having
"git-submodule.sh" add it implicitly.

This change doesn't make any difference now, but eliminates another
special-case where "git submodule--helper update"'s behavior was
different from "git submodule update". This will make it easier to
eventually replace the cmd_update() function in git-submodule.sh.

We'll still need to keep the distinction between "--init" and
"--require-init" in git-submodule.sh. Once cmd_update() gets
re-implemented in C we'll be able to change variables and other code
related to that, but not yet.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-submodule.sh: remove unused top-level "--branch" argument
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:26 +0000 (12:05 +0200)] 
git-submodule.sh: remove unused top-level "--branch" argument

In 5c08dbbdf1a (git-submodule: fix subcommand parser, 2008-01-15) the
"--branch" option was supported as an option to "git submodule"
itself, i.e. "git submodule --branch" as a side-effect of its
implementation.

Then in b57e8119e6e (submodule: teach set-branch subcommand,
2019-02-08) when the "set-branch" subcommand was added the assertion
that we shouldn't have "--branch" anywhere except as an argument to
"add" and "set-branch" was copy/pasted from the adjacent check for
"--cache" added (or rather modified) in 496eeeb19b9 (git-submodule.sh:
avoid "test <cond> -a/-o <cond>", 2014-06-10).

But there's been a logic error in that check, which at a glance looked
like it should be supporting:

    git submodule --branch <branch> (add | set-branch) [<options>]

But due to "||" in the condition (as opposed to "&&" for "--cache") if
we have "--branch" here already we'll emit usage, even for "add" and
"set-branch".

So in addition to never having documented this form, it hasn't worked
since b57e8119e6e was released with v2.22.0.

So it's safe to remove this code. I.e. we don't want to support the
form noted above, but only:

    git submodule (add | set-branch) --branch <branch> [<options>]

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-submodule.sh: make the "$cached" variable a boolean
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:25 +0000 (12:05 +0200)] 
git-submodule.sh: make the "$cached" variable a boolean

Remove the assignment of "$1" to the "$cached" variable. As seen in
the initial implementation in 70c7ac22de6 (Add git-submodule command,
2007-05-26) we only need to keep track of if we've seen the --cached
option, not save the "--cached" string for later use.

In 28f9af5d25e (git-submodule summary: code framework, 2008-03-11)
"$1" was assigned to it, but since there was no reason to do so let's
stop doing it. This trivial change will make it easier to reason about
an eventual change that'll remove the cmd_summary() function in favor
of dispatching to "git submodule--helper summary" directly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-submodule.sh: remove unused $prefix variable
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:24 +0000 (12:05 +0200)] 
git-submodule.sh: remove unused $prefix variable

Remove the $prefix variable which isn't used anymore, and hasn't been
since b3c5f5cb048 (submodule: move core cmd_update() logic to C,
2022-03-15).

Before that we'd use it to invoke "git submodule--helper" with the
"--recursive-prefix" option, but since b3c5f5cb048 that "git
submodule--helper" option is only used when it invokes itself.

So the "--recursive-prefix" option is still in use, but at this point
only when the helper invokes itself during submodule recursion. See
the "--recursive-prefix" option added in
c51f8f94e5b (submodule--helper: run update procedures from C,
2021-08-24).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogit-submodule.sh: remove unused sanitize_submodule_env()
Ævar Arnfjörð Bjarmason [Tue, 28 Jun 2022 10:05:23 +0000 (12:05 +0200)] 
git-submodule.sh: remove unused sanitize_submodule_env()

The sanitize_submodule_env() function was last used before
b3c5f5cb048 (submodule: move core cmd_update() logic to C,
2022-03-15), let's remove it.

This also allows us to remove clear_local_git_env() from
git-sh-setup.sh. That function hasn't been documented in
Documentation/git-sh-setup.sh, and since 14111fc4927 (git: submodule
honor -c credential.* from command line, 2016-02-29) it had only been
used in the sanitize_submodule_env() function being removed here.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agovscode: improve tab size and wrapping
Derrick Stolee [Mon, 27 Jun 2022 18:29:47 +0000 (18:29 +0000)] 
vscode: improve tab size and wrapping

The contrib/vscode/init.sh script initializes the .vscode directory with
some helpful metadata so VS Code handles Git code better.

One big issue that VS Code has is detecting the tab width based on file
type. ".txt" files were not covered by this script before, so add them
with the appropriate tab widths. This prevents inserting spaces instead
of tabs and keeps the tab width to eight instead of four or two.

While we are here, remove the "editor.wordWrap" settings. The editor's
word wrap is only cosmetic: it does not actually insert newlines when
your typing goes over the column limit. This can make it appear like you
have properly wrapped code, but it is incorrect. Further, existing code
that is over the column limit is wrapped even if your editor window is
wider than the limit. This can make reading such code more difficult.
Without these lines, VS Code renders the lines accurately, without
"ghost" newlines.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoSync with Git 2.36.2
Junio C Hamano [Mon, 27 Jun 2022 19:36:11 +0000 (12:36 -0700)] 
Sync with Git 2.36.2

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>
2 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>
2 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>
2 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

2 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>
2 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

2 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>
2 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>
2 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>
2 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

2 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>
2 years agorev-parse: documentation adjustment - mention remote tracking with @{u}
Tao Klerks [Thu, 23 Jun 2022 05:01:52 +0000 (05:01 +0000)] 
rev-parse: documentation adjustment - mention remote tracking with @{u}

The documentation explained the conversion from remote branch path to
local tracking ref path for @{push}, but not for @{upstream}.

Add the explanation to @{upstream}, and reference it in @{push} to avoid
undue repetition.

Signed-off-by: Tao Klerks <tao@klerks.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 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)

2 years agoGit 2.36.2 v2.36.2
Johannes Schindelin [Thu, 23 Jun 2022 10:36:14 +0000 (12:36 +0200)] 
Git 2.36.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.35.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:12 +0000 (12:36 +0200)] 
Sync with 2.35.4

* maint-2.35:
  Git 2.35.4
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.35.4 v2.35.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:05 +0000 (12:36 +0200)] 
Git 2.35.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.34.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:03 +0000 (12:36 +0200)] 
Sync with 2.34.4

* maint-2.34:
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.34.4 v2.34.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:49 +0000 (12:35 +0200)] 
Git 2.34.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.33.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:47 +0000 (12:35 +0200)] 
Sync with 2.33.4

* maint-2.33:
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.33.4 v2.33.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:41 +0000 (12:35 +0200)] 
Git 2.33.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.32.3
Johannes Schindelin [Thu, 23 Jun 2022 10:35:38 +0000 (12:35 +0200)] 
Sync with 2.32.3

* maint-2.32:
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.32.3 v2.32.3
Johannes Schindelin [Thu, 23 Jun 2022 10:35:32 +0000 (12:35 +0200)] 
Git 2.32.3

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.31.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:30 +0000 (12:35 +0200)] 
Sync with 2.31.4

* maint-2.31:
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.31.4 v2.31.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:25 +0000 (12:35 +0200)] 
Git 2.31.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agoSync with 2.30.5
Johannes Schindelin [Thu, 23 Jun 2022 10:35:23 +0000 (12:35 +0200)] 
Sync with 2.30.5

* maint-2.30:
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

2 years agoGit 2.30.5 v2.30.5
Johannes Schindelin [Fri, 27 May 2022 21:38:36 +0000 (23:38 +0200)] 
Git 2.30.5

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agosetup: tighten ownership checks post CVE-2022-24765
Carlo Marcelo Arenas Belón [Tue, 10 May 2022 19:35:29 +0000 (12:35 -0700)] 
setup: tighten ownership checks post CVE-2022-24765

8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if needed, but that
check didn't account for owership of the gitdir, or (when used) the
gitfile that points to that gitdir.

An attacker could create a git repository in a directory that they can
write into but that is owned by the victim to work around the fix that
was introduced with CVE-2022-24765 to potentially run code as the
victim.

An example that could result in privilege escalation to root in *NIX would
be to set a repository in a shared tmp directory by doing (for example):

  $ git -C /tmp init

To avoid that, extend the ensure_valid_ownership function to be able to
check for all three paths.

This will have the side effect of tripling the number of stat() calls
when a repository is detected, but the effect is expected to be likely
minimal, as it is done only once during the directory walk in which Git
looks for a repository.

Additionally make sure to resolve the gitfile (if one was used) to find
the relevant gitdir for checking.

While at it change the message printed on failure so it is clear we are
referring to the repository by its worktree (or gitdir if it is bare) and
not to a specific directory.

Helped-by: Junio C Hamano <junio@pobox.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
2 years agoMerge branch 'cb/path-owner-check-with-sudo'
Junio C Hamano [Thu, 26 May 2022 21:51:32 +0000 (14:51 -0700)] 
Merge branch 'cb/path-owner-check-with-sudo'

With a recent update to refuse access to repositories of other
people by default, "sudo make install" and "sudo git describe"
stopped working.  This series intends to loosen it while keeping
the safety.

* cb/path-owner-check-with-sudo:
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 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>