Denton Liu [Thu, 22 Apr 2021 10:00:52 +0000 (03:00 -0700)]
git-completion.bash: consolidate cases in _git_stash()
The $subcommand case statement in _git_stash() is quite repetitive.
Consolidate the cases together into one catch-all case to reduce the
repetition.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Thu, 22 Apr 2021 10:00:51 +0000 (03:00 -0700)]
git-completion.bash: use $__git_cmd_idx in more places
With the introduction of the $__git_cmd_idx variable in
e94fb44042
(git-completion.bash: pass $__git_subcommand_idx from __git_main(),
2021-03-24), completion functions were able to know the index at which
the git command is listed, allowing them to skip options that are given
to the underlying git itself, not the corresponding command (e.g.
`-C asdf` in `git -C asdf branch`).
While most of the changes here are self-explanatory, some bear further
explanation.
For the __git_find_on_cmdline() and __git_find_last_on_cmdline() pair of
functions, these functions are only ever called in the context of a git
command completion function. These functions will only care about words
after the command so we can safely ignore the words before this.
For _git_worktree(), this change is technically a no-op (once the
__git_find_last_on_cmdline change is also applied). It was in poor style
to have hard-coded on the index right after `worktree`. In case
`git worktree` were to ever learn to accept options, the current
situation would be inflexible.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Thu, 22 Apr 2021 10:00:50 +0000 (03:00 -0700)]
git-completion.bash: rename to $__git_cmd_idx
In
e94fb44042 (git-completion.bash: pass $__git_subcommand_idx from
__git_main(), 2021-03-24), the $__git_subcommand_idx variable was
introduced. Naming it after the index of the subcommand is needlessly
confusing as, when this variable is used, it is in the completion
functions for commands (e.g. _git_remote()) where for `git remote add`,
the `remote` is referred to as the command and `add` is referred to as
the subcommand.
Rename this variable so that it's obvious it's about git commands. While
we're at it, shorten up its name so that it's still readable without
being a handful to type.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Tue, 20 Apr 2021 09:19:47 +0000 (02:19 -0700)]
git-completion.bash: separate some commands onto their own line
In
e94fb44042 (git-completion.bash: pass $__git_subcommand_idx from
__git_main(), 2021-03-24), a line was introduced which contained
multiple statements. This is difficult to read so break it into multiple
lines.
While we're at it, follow this convention for the rest of the
__git_main() and break up lines that contain multiple statements.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Wed, 24 Mar 2021 08:36:29 +0000 (01:36 -0700)]
git-completion.bash: use __gitcomp_builtin() in _git_stash()
The completion for 'git stash' has not changed in a major way since it
was converted from shell script to builtin. Now that it's a builtin, we
can take advantage of the groundwork laid out by parse-options and use
the generated options.
Rewrite _git_stash() to take use __gitcomp_builtin() to generate
completions for subcommands.
The main `git stash` command does not take any arguments directly. If no
subcommand is given, it automatically defaults to `git stash push`. This
means that we can simplify the logic for when no subcommands have been
given yet. We only have to offer subcommand completions when we're
completing a non-option after "stash".
One area that this patch could improve upon is that the `git stash list`
command accepts log-options. It would be nice if the completion for this
were unified with that of _git_log() and _git_show() which would allow
completions to be provided for options such as `--pretty` but that is
outside the scope of this patch.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Wed, 24 Mar 2021 08:36:28 +0000 (01:36 -0700)]
git-completion.bash: extract from else in _git_stash()
To save a level of indentation, perform an early return in the "if" arm
so we can move the "else" code out of the block.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Wed, 24 Mar 2021 08:36:27 +0000 (01:36 -0700)]
git-completion.bash: pass $__git_subcommand_idx from __git_main()
Many completion functions perform hardcoded comparisons with $cword.
This fails in the case where the main git command is given arguments
(e.g. `git -C . bundle<TAB>` would fail to complete its subcommands).
Even _git_worktree(), which uses __git_find_on_cmdline(), could still
fail. With something like `git -C add worktree move<TAB>`, the
subcommand would be incorrectly identified as "add" instead of "move".
Assign $__git_subcommand_idx in __git_main(), where the git subcommand
is actually found and the corresponding completion function is called.
Use this variable to replace hardcoded comparisons with $cword.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 15 Mar 2021 18:51:51 +0000 (11:51 -0700)]
Git 2.31
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 14 Mar 2021 23:01:41 +0000 (16:01 -0700)]
Merge branch 'jn/mergetool-hideresolved-is-optional'
Disable the recent mergetool's hideresolved feature by default for
backward compatibility and safety.
* jn/mergetool-hideresolved-is-optional:
doc: describe mergetool configuration in git-mergetool(1)
mergetool: do not enable hideResolved by default
Junio C Hamano [Sun, 14 Mar 2021 23:01:40 +0000 (16:01 -0700)]
Merge branch 'tb/pack-revindex-on-disk'
Fix for a topic in 'master'.
* tb/pack-revindex-on-disk:
pack-revindex.c: don't close unopened file descriptors
Junio C Hamano [Sun, 14 Mar 2021 22:50:36 +0000 (15:50 -0700)]
Merge tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po
l10n for Git 2.31.0 round 2
* tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: zh_CN: for git v2.31.0 l10n round 1 and 2
l10n: de.po: Update German translation for Git v2.31.0
l10n: pt_PT: add Portuguese translations part 1
l10n: vi.po(5104t): for git v2.31.0 l10n round 2
l10n: es: 2.31.0 round 2
l10n: Add translation team info
l10n: start Indonesian translation
l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
l10n: bg.po: Updated Bulgarian translation (5104t)
l10n: fr: v2.31 rnd 2
l10n: tr: v2.31.0-rc1
l10n: sv.po: Update Swedish translation (5104t0f0u)
l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)
l10n: tr: v2.31.0-rc0
l10n: sv.po: Update Swedish translation (5103t0f0u)
l10n: pl.po: Update translation
l10n: fr: v2.31.0 rnd 1
l10n: git.pot: v2.31.0 round 1 (155 new, 89 removed)
l10n: Update Catalan translation
l10n: ru.po: update Russian translation
Jiang Xin [Thu, 4 Mar 2021 14:44:43 +0000 (22:44 +0800)]
l10n: zh_CN: for git v2.31.0 l10n round 1 and 2
Translate 161 new messages (5104t0f0u) for git 2.31.0.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Sun, 14 Mar 2021 16:04:47 +0000 (00:04 +0800)]
Merge branch 'master' of github.com:vnwildman/git
* 'master' of github.com:vnwildman/git:
l10n: vi.po(5104t): for git v2.31.0 l10n round 2
Jiang Xin [Sun, 14 Mar 2021 14:35:44 +0000 (22:35 +0800)]
Merge branch 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po
* 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po:
l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
Jiang Xin [Sun, 14 Mar 2021 14:35:17 +0000 (22:35 +0800)]
Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
l10n: Add translation team info
l10n: start Indonesian translation
Jiang Xin [Sun, 14 Mar 2021 14:34:46 +0000 (22:34 +0800)]
Merge branch 'master' of github.com:Softcatala/git-po
* 'master' of github.com:Softcatala/git-po:
l10n: Update Catalan translation
Jiang Xin [Sun, 14 Mar 2021 14:34:12 +0000 (22:34 +0800)]
Merge branch 'russian-l10n' of github.com:DJm00n/git-po-ru
* 'russian-l10n' of github.com:DJm00n/git-po-ru:
l10n: ru.po: update Russian translation
Jiang Xin [Sun, 14 Mar 2021 14:33:26 +0000 (22:33 +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: add Portuguese translations part 1
Jonathan Nieder [Sat, 13 Mar 2021 08:41:33 +0000 (00:41 -0800)]
doc: describe mergetool configuration in git-mergetool(1)
In particular, this describes mergetool.hideResolved, which can help
users discover this setting (either because it may be useful to them
or in order to understand mergetool's behavior if they have forgotten
setting it in the past).
Tested by running
make -C Documentation git-mergetool.1
man Documentation/git-mergetool.1
and reading through the page.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder [Sat, 13 Mar 2021 08:38:48 +0000 (00:38 -0800)]
mergetool: do not enable hideResolved by default
When
98ea309b3f (mergetool: add hideResolved configuration,
2021-02-09) introduced the mergetool.hideResolved setting to reduce
the clutter in viewing non-conflicted sections of files in a
mergetool, it enabled it by default, explaining:
No adverse effects were noted in a small survey of popular mergetools[1]
so this behavior defaults to `true`.
In practice, alas, adverse effects do appear. A few issues:
1. No indication is shown in the UI that the base, local, and remote
versions shown have been modified by additional resolution. This
is inherent in the design: the idea of mergetool.hideResolved is to
convince a mergetool that expects pristine local, base, and remote
files to show partially resolved verisons of those files instead;
there is no additional source of information accessible to the
mergetool to see where the resolution has happened.
(By contrast, a mergetool generating the partial resolution from
conflict markers for itself would be able to hilight the resolved
sections with a different color.)
A user accustomed to seeing the files without partial resolution
gets no indication that this behavior has changed when they upgrade
Git.
2. If the computed merge did not line up the files correctly (for
example due to repeated sections in the file), the partially
resolved files can be misleading and do not have enough information
to reconstruct what happened and compute the correct merge result.
3. Resolving a conflict can involve information beyond the textual
conflict. For example, if the local and remote versions added
overlapping functionality in different ways, seeing the full
unresolved versions of each alongside the base gives information
about each side's intent that makes it possible to come up with a
resolution that combines those two intents. By contrast, when
starting with partially resolved versions of those files, one can
produce a subtly wrong resolution that includes redundant extra
code added by one side that is not needed in the approach taken
on the other.
All that said, a user wanting to focus on textual conflicts with
reduced clutter can still benefit from mergetool.hideResolved=true as
a way to deemphasize sections of the code that resolve cleanly without
requiring any changes to the invoked mergetool. The caveats described
above are reduced when the user has explicitly turned this on, because
then the user is aware of them.
Flip the default to 'false'.
Reported-by: Dana Dahlstrom <dahlstrom@google.com>
Helped-by: Seth House <seth@eseth.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 9 Mar 2021 00:09:43 +0000 (16:09 -0800)]
Git 2.31-rc2
Junio C Hamano [Tue, 9 Mar 2021 00:09:07 +0000 (16:09 -0800)]
Sync with Git 2.30.2 for CVE-2021-21300
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 9 Mar 2021 00:04:47 +0000 (16:04 -0800)]
Merge branch 'jt/transfer-fsck-across-packs-fix'
The code to fsck objects received across multiple packs during a
single git fetch session has been broken when the packfile URI
feature was in use. A workaround has been added by disabling the
codepath to avoid keeping a packfile that is too small.
* jt/transfer-fsck-across-packs-fix:
fetch-pack: do not mix --pack_header and packfile uri
Matthias Rüster [Sun, 28 Feb 2021 14:40:23 +0000 (15:40 +0100)]
l10n: de.po: Update German translation for Git v2.31.0
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Daniel Santos [Thu, 22 Oct 2020 09:52:22 +0000 (10:52 +0100)]
l10n: pt_PT: add Portuguese translations part 1
* Newlines corrected.
* Add concept translation table.
* Translated some.
* Corrected some.
* Corrected some 'Negation of Emptiness'.
Signed-off-by: Daniel Santos <hello@brighterdan.com>
Tran Ngoc Quan [Mon, 8 Mar 2021 02:00:45 +0000 (09:00 +0700)]
l10n: vi.po(5104t): for git v2.31.0 l10n round 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
Christopher Diaz Riveros [Sun, 7 Mar 2021 23:31:14 +0000 (18:31 -0500)]
l10n: es: 2.31.0 round 2
Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
Bagas Sanjaya [Tue, 2 Mar 2021 06:38:43 +0000 (13:38 +0700)]
l10n: Add translation team info
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Bagas Sanjaya [Sat, 20 Feb 2021 11:21:42 +0000 (18:21 +0700)]
l10n: start Indonesian translation
* Initialize PO file
* Translate init-db.c
* Translate wt-status.c
* Translate builtin/clone.c
* Translate builtin/checkout.c
* Translate builtin/fetch.c
* Complete core translations:
* builtin/remote.c
* builtin/index-pack.c
* push.c
* reset.c
* Sync with l10n upstream
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Jonathan Tan [Fri, 5 Mar 2021 01:16:20 +0000 (17:16 -0800)]
fetch-pack: do not mix --pack_header and packfile uri
When fetching (as opposed to cloning) from a repository with packfile
URIs enabled, an error like this may occur:
fatal: pack has bad object at offset 12: unknown object type 5
fatal: finish_http_pack_request gave result -1
fatal: fetch-pack: expected keep then TAB at start of http-fetch output
This bug was introduced in
b664e9ffa1 ("fetch-pack: with packfile URIs,
use index-pack arg", 2021-02-22), when the index-pack args used when
processing the inline packfile of a fetch response and when processing
packfile URIs were unified.
This bug happens because fetch, by default, partially reads (and
consumes) the header of the inline packfile to determine if it should
store the downloaded objects as a packfile or loose objects, and thus
passes --pack_header=<...> to index-pack to inform it that some bytes
are missing. However, when it subsequently fetches the additional
packfiles linked by URIs, it reuses the same index-pack arguments, thus
wrongly passing --index-pack-arg=--pack_header=<...> when no bytes are
missing.
This does not happen when cloning because "git clone" always passes
do_keep, which instructs the fetch mechanism to always retain the
packfile, eliminating the need to read the header.
There are a few ways to fix this, including filtering out pack_header
arguments when downloading the additional packfiles, but I decided to
stick to always using index-pack throughout when packfile URIs are
present - thus, Git no longer needs to read the bytes, and no longer
needs --pack_header here.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Yi-Jyun Pan [Mon, 1 Mar 2021 13:17:36 +0000 (21:17 +0800)]
l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
Alexander Shopov [Fri, 26 Feb 2021 07:00:26 +0000 (08:00 +0100)]
l10n: bg.po: Updated Bulgarian translation (5104t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Jiang Xin [Fri, 5 Mar 2021 05:47:07 +0000 (13:47 +0800)]
Merge branch 'fr_next' of github.com:jnavila/git
* 'fr_next' of github.com:jnavila/git:
l10n: fr: v2.31 rnd 2
Jiang Xin [Fri, 5 Mar 2021 05:46:25 +0000 (13:46 +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 (5104t0f0u)
Junio C Hamano [Thu, 4 Mar 2021 23:42:50 +0000 (15:42 -0800)]
Merged the open-eintr workaround for macOS
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Thu, 4 Mar 2021 22:51:32 +0000 (22:51 +0000)]
Documentation/RelNotes: improve release note for rename detection work
There were some early changes in the 2.31 cycle to optimize some setup
in diffcore-rename.c[1], some later changes to measure performance[2],
and finally some significant changes to improve rename detection
performance. The final one was merged with the note
Performance optimization work on the rename detection continues.
That works for the commit log, but feels misleading as a release note
since all the changes were within one cycle. Simplify this to just
Performance improvements for rename detection.
The former wording could be seen as hinting that more performance
improvements will come in 2.32, which is true, but we can just cover
those in the 2.32 release notes when the time comes.
[1]
a5ac31b5b1 (Merge branch 'en/diffcore-rename', 2021-01-25)
[2]
d3a035b055 (Merge branch 'en/merge-ort-perf', 2021-02-11)
[3]
12bd17521c (Merge branch 'en/diffcore-rename', 2021-03-01)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 4 Mar 2021 23:34:45 +0000 (15:34 -0800)]
Merge branch 'jk/open-returns-eintr'
Work around platforms whose open() is reported to return EINTR (it
shouldn't, as we do our signals with SA_RESTART).
* jk/open-returns-eintr:
config.mak.uname: enable OPEN_RETURNS_EINTR for macOS Big Sur
Makefile: add OPEN_RETURNS_EINTR knob
Jean-Noël Avila [Thu, 4 Mar 2021 20:53:45 +0000 (21:53 +0100)]
l10n: fr: v2.31 rnd 2
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Junio C Hamano [Thu, 4 Mar 2021 20:38:50 +0000 (12:38 -0800)]
Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
Revert "git-gui: remove lines starting with the comment character"
Emir Sarı [Thu, 4 Mar 2021 19:29:24 +0000 (22:29 +0300)]
l10n: tr: v2.31.0-rc1
Signed-off-by: Emir Sarı <bitigchi@me.com>
Peter Krefting [Thu, 4 Mar 2021 18:10:43 +0000 (19:10 +0100)]
l10n: sv.po: Update Swedish translation (5104t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Jiang Xin [Thu, 4 Mar 2021 14:41:21 +0000 (22:41 +0800)]
l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)
Generate po/git.pot from v2.31.0-rc1 for git v2.31.0 l10n round 2.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Thu, 4 Mar 2021 14:40:13 +0000 (22:40 +0800)]
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (63 commits)
Git 2.31-rc1
Hopefully the last batch before -rc1
Revert "commit-graph: when incompatible with graphs, indicate why"
read-cache: make the index write buffer size 128K
dir: fix malloc of root untracked_cache_dir
commit-graph.c: display correct number of chunks when writing
doc/reftable: document how to handle windows
fetch-pack: print and use dangling .gitmodules
fetch-pack: with packfile URIs, use index-pack arg
http-fetch: allow custom index-pack args
http: allow custom index-pack args
chunk-format: add technical docs
chunk-format: restore duplicate chunk checks
midx: use 64-bit multiplication for chunk sizes
midx: use chunk-format read API
commit-graph: use chunk-format read API
chunk-format: create read chunk API
midx: use chunk-format API in write_midx_internal()
midx: drop chunk progress during write
midx: return success/failure in chunk write methods
...
Pratyush Yadav [Thu, 4 Mar 2021 08:29:45 +0000 (13:59 +0530)]
Merge branch 'py/revert-commit-comments'
This commit causes breakage on macOS, or in fact any platform using
older versions of Tcl. Revert it.
* py/revert-commit-comments:
Revert "git-gui: remove lines starting with the comment character"
Pratyush Yadav [Thu, 4 Mar 2021 08:23:27 +0000 (13:53 +0530)]
Revert "git-gui: remove lines starting with the comment character"
This reverts commit
b9a43869c9f96d3577d6f568c1bda1940c8f0e31.
This commit causes breakage on macOS (10.13). It causes errors on
startup and completely breaks the commit functionality. There are two
main problems. First, it uses `string cat` which is not supported on
older Tcl versions. Second, it does a half close of the bidirectional
pipe to git-stripspace which is also not supported on older Tcl
versions.
Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Junio C Hamano [Wed, 3 Mar 2021 06:41:13 +0000 (22:41 -0800)]
Git 2.31-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Emir Sarı [Sat, 27 Feb 2021 09:02:50 +0000 (12:02 +0300)]
l10n: tr: v2.31.0-rc0
Signed-off-by: Emir Sarı <bitigchi@me.com>
Junio C Hamano [Mon, 1 Mar 2021 22:02:42 +0000 (14:02 -0800)]
Hopefully the last batch before -rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 1 Mar 2021 22:02:58 +0000 (14:02 -0800)]
Merge branch 'jh/untracked-cache-fix'
An under-allocation for the untracked cache data has been corrected.
* jh/untracked-cache-fix:
dir: fix malloc of root untracked_cache_dir
Junio C Hamano [Mon, 1 Mar 2021 22:02:58 +0000 (14:02 -0800)]
Merge branch 'ns/raise-write-index-buffer-size'
Raise the buffer size used when writing the index file out from
(obviously too small) 8kB to (clearly sufficiently large) 128kB.
* ns/raise-write-index-buffer-size:
read-cache: make the index write buffer size 128K
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)]
Merge branch 'hv/trailer-formatting'
The logic to handle "trailer" related placeholders in the
"--format=" mechanisms in the "log" family and "for-each-ref"
family is getting unified.
* hv/trailer-formatting:
ref-filter: use pretty.c logic for trailers
pretty.c: capture invalid trailer argument
pretty.c: refactor trailer logic to `format_set_trailers_options()`
t6300: use function to test trailer options
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)]
Merge branch 'hn/reftable-tables-doc-update'
Documentation update.
* hn/reftable-tables-doc-update:
doc/reftable: document how to handle windows
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)]
Merge branch 'sv/t7001-modernize'
Test script modernization.
* sv/t7001-modernize:
t7001: use `test` rather than `[`
t7001: use here-docs instead of echo
t7001: put each command on a separate line
t7001: use '>' rather than 'touch'
t7001: avoid using `cd` outside of subshells
t7001: remove whitespace after redirect operators
t7001: modernize subshell formatting
t7001: remove unnecessary blank lines
t7001: indent with TABs instead of spaces
t7001: modernize test formatting
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)]
Merge branch 'jt/transfer-fsck-across-packs'
The approach to "fsck" the incoming objects in "index-pack" is
attractive for performance reasons (we have them already in core,
inflated and ready to be inspected), but fundamentally cannot be
applied fully when we receive more than one pack stream, as a tree
object in one pack may refer to a blob object in another pack as
".gitmodules", when we want to inspect blobs that are used as
".gitmodules" file, for example. Teach "index-pack" to emit
objects that must be inspected later and check them in the calling
"fetch-pack" process.
* jt/transfer-fsck-across-packs:
fetch-pack: print and use dangling .gitmodules
fetch-pack: with packfile URIs, use index-pack arg
http-fetch: allow custom index-pack args
http: allow custom index-pack args
Junio C Hamano [Mon, 1 Mar 2021 22:02:57 +0000 (14:02 -0800)]
Merge branch 'ds/chunked-file-api'
The common code to deal with "chunked file format" that is shared
by the multi-pack-index and commit-graph files have been factored
out, to help codepaths for both filetypes to become more robust.
* ds/chunked-file-api:
commit-graph.c: display correct number of chunks when writing
chunk-format: add technical docs
chunk-format: restore duplicate chunk checks
midx: use 64-bit multiplication for chunk sizes
midx: use chunk-format read API
commit-graph: use chunk-format read API
chunk-format: create read chunk API
midx: use chunk-format API in write_midx_internal()
midx: drop chunk progress during write
midx: return success/failure in chunk write methods
midx: add num_large_offsets to write_midx_context
midx: add pack_perm to write_midx_context
midx: add entries to write_midx_context
midx: use context in write_midx_pack_names()
midx: rename pack_info to write_midx_context
commit-graph: use chunk-format write API
chunk-format: create chunk format write API
commit-graph: anonymize data in chunk_write_fn
Junio C Hamano [Mon, 1 Mar 2021 22:02:56 +0000 (14:02 -0800)]
Merge branch 'en/diffcore-rename'
Performance optimization work on the rename detection continues.
* en/diffcore-rename:
merge-ort: call diffcore_rename() directly
gitdiffcore doc: mention new preliminary step for rename detection
diffcore-rename: guide inexact rename detection based on basenames
diffcore-rename: complete find_basename_matches()
diffcore-rename: compute basenames of source and dest candidates
t4001: add a test comparing basename similarity and content similarity
diffcore-rename: filter rename_src list when possible
diffcore-rename: no point trying to find a match better than exact
Junio C Hamano [Mon, 1 Mar 2021 22:02:56 +0000 (14:02 -0800)]
Merge branch 'jh/fsmonitor-prework'
Preliminary changes to fsmonitor integration.
* jh/fsmonitor-prework:
fsmonitor: refactor initialization of fsmonitor_last_update token
fsmonitor: allow all entries for a folder to be invalidated
fsmonitor: log FSMN token when reading and writing the index
fsmonitor: log invocation of FSMonitor hook to trace2
read-cache: log the number of scanned files to trace2
read-cache: log the number of lstat calls to trace2
preload-index: log the number of lstat calls to trace2
p7519: add trace logging during perf test
p7519: move watchman cleanup earlier in the test
p7519: fix watchman watch-list test on Windows
p7519: do not rely on "xargs -d" in test
Junio C Hamano [Mon, 1 Mar 2021 17:22:18 +0000 (09:22 -0800)]
Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
git-gui: remove lines starting with the comment character
git-gui: fix typo in russian locale
Junio C Hamano [Mon, 1 Mar 2021 17:21:24 +0000 (09:21 -0800)]
Merge branch 'js/commit-graph-warning'
* js/commit-graph-warning:
Revert "commit-graph: when incompatible with graphs, indicate why"
Junio C Hamano [Mon, 1 Mar 2021 17:19:37 +0000 (09:19 -0800)]
Revert "commit-graph: when incompatible with graphs, indicate why"
This reverts commit
c85eec7fc37e1ca79072f263ae6ea1ee305ba38c, as
it is a bit overzealous, we are in prerelease freeze, and we want
to have enough time to get this right and cook in 'next'.
cf. <8735xgkvuo.fsf@evledraar.gmail.com>
Jeff King [Mon, 1 Mar 2021 09:29:47 +0000 (04:29 -0500)]
config.mak.uname: enable OPEN_RETURNS_EINTR for macOS Big Sur
We've had mixed reports on whether the latest release of macOS needs
this Makefile knob set. In most reported cases, there's antivirus
software running (which one might imagine could cause an open() call to
be delayed). However, one of the (off-list) reports I've gotten
indicated that it happened on an otherwise clean install of Big Sur.
Since the symptom is so bad (checkout randomly fails to write several
fails when the progress meter kicks in), and since the workaround is so
lightweight (if we don't see EINTR, it's just an extra conditional
check), let's just turn it on by default.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Mon, 1 Mar 2021 02:01:02 +0000 (10:01 +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 (5103t0f0u)
Jiang Xin [Mon, 1 Mar 2021 01:59:07 +0000 (09:59 +0800)]
Merge branch 'pl' of github.com:Arusekk/git-po
* 'pl' of github.com:Arusekk/git-po:
l10n: pl.po: Update translation
Peter Krefting [Sun, 28 Feb 2021 21:22:46 +0000 (22:22 +0100)]
l10n: sv.po: Update Swedish translation (5103t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Arusekk [Sat, 27 Feb 2021 15:12:59 +0000 (16:12 +0100)]
l10n: pl.po: Update translation
Signed-off-by: Arusekk <arek_koz@o2.pl>
Jean-Noël Avila [Sat, 27 Feb 2021 14:47:45 +0000 (15:47 +0100)]
l10n: fr: v2.31.0 rnd 1
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Taylor Blau [Fri, 26 Feb 2021 16:31:02 +0000 (11:31 -0500)]
pack-revindex.c: don't close unopened file descriptors
When opening a reverse index, load_revindex_from_disk() jumps to the
'cleanup' label in case something goes wrong: the reverse index had the
wrong size, an unrecognized version, or similar.
It also jumps to this label when the reverse index couldn't be opened in
the first place, which will cause an error with the unguarded close()
call in the label.
Guard this call with "if (fd >= 0)" to make sure that we have a valid
file descriptor to close before attempting to close it.
Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 26 Feb 2021 06:14:35 +0000 (01:14 -0500)]
Makefile: add OPEN_RETURNS_EINTR knob
On some platforms, open() reportedly returns EINTR when opening regular
files and we receive a signal (usually SIGALRM from our progress meter).
This shouldn't happen, as open() should be a restartable syscall, and we
specify SA_RESTART when setting up the alarm handler. So it may actually
be a kernel or libc bug for this to happen. But it has been reported on
at least one version of Linux (on a network filesystem):
https://lore.kernel.org/git/
c8061cce-71e4-17bd-a56a-
a5fed93804da@neanderfunk.de/
as well as on macOS starting with Big Sur even on a regular filesystem.
We can work around it by retrying open() calls that get EINTR, just as
we do for read(), etc. Since we don't ever _want_ to interrupt an open()
call, we can get away with just redefining open, rather than insisting
all callsites use xopen().
We actually do have an xopen() wrapper already (and it even does this
retry, though there's no indication of it being an observed problem back
then; it seems simply to have been lifted from xread(), etc). But it is
used hardly anywhere, and isn't suitable for general use because it will
die() on error. In theory we could combine the two, but it's awkward to
do so because of the variable-args interface of open().
This patch adds a Makefile knob for enabling the workaround. It's not
enabled by default for any platforms in config.mak.uname yet, as we
don't have enough data to decide how common this is (I have not been
able to reproduce on either Linux or Big Sur myself). It may be worth
enabling preemptively anyway, since the cost is pretty low (if we don't
see an EINTR, it's just an extra conditional).
However, note that we must not enable this on Windows. It doesn't do
anything there, and the macro overrides the existing mingw_open()
redirection. I've added a preemptive #undef here in the mingw header
(which is processed first) to just quietly disable it (we could also
make it an #error, but there is little point in being so aggressive).
Reported-by: Aleksey Kliger <alklig@microsoft.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Fri, 26 Feb 2021 14:09:42 +0000 (22:09 +0800)]
l10n: git.pot: v2.31.0 round 1 (155 new, 89 removed)
Generate po/git.pot from v2.31.0-rc0 for git v2.31.0 l10n round 1.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Junio C Hamano [Fri, 26 Feb 2021 00:34:59 +0000 (16:34 -0800)]
Git 2.31-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'jc/push-delete-nothing'
"git push $there --delete ''" should have been diagnosed as an
error, but instead turned into a matching push, which has been
corrected.
* jc/push-delete-nothing:
push: do not turn --delete '' into a matching push
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'sh/mergetools-vimdiff1'
Mergetools update.
* sh/mergetools-vimdiff1:
mergetools/vimdiff: add vimdiff1 merge tool variant
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'dl/doc-config-camelcase'
A handful of multi-word configuration variable names in
documentation that are spelled in all lowercase have been corrected
to use the more canonical camelCase.
* dl/doc-config-camelcase:
index-format doc: camelCase core.excludesFile
blame-options.txt: camelcase blame.blankBoundary
i18n.txt: camel case and monospace "i18n.commitEncoding"
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'js/params-vs-args'
Messages update.
* js/params-vs-args:
replace "parameters" by "arguments" in error messages
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'ug/doc-commit-approxidate'
Doc update.
* ug/doc-commit-approxidate:
doc: mention approxidates for git-commit --date
Junio C Hamano [Fri, 26 Feb 2021 00:43:32 +0000 (16:43 -0800)]
Merge branch 'es/maintenance-of-bare-repositories'
The "git maintenance register" command had trouble registering bare
repositories, which had been corrected.
* es/maintenance-of-bare-repositories:
maintenance: fix incorrect `maintenance.repo` path with bare repository
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'mt/add-chmod-fixes'
Various fixes on "git add --chmod".
* mt/add-chmod-fixes:
add: propagate --chmod errors to exit status
add: mark --chmod error string for translation
add --chmod: don't update index when --dry-run is used
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'ds/merge-base-independent'
The code to implement "git merge-base --independent" was poorly
done and was kept from the very beginning of the feature.
* ds/merge-base-independent:
commit-reach: stale commits may prune generation further
commit-reach: use heuristic in remove_redundant()
commit-reach: move compare_commits_by_gen
commit-reach: use one walk in remove_redundant()
commit-reach: reduce requirements for remove_redundant()
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'ah/rebase-no-fork-point-config'
"git rebase --[no-]fork-point" gained a configuration variable
rebase.forkPoint so that users do not have to keep specifying a
non-default setting.
* ah/rebase-no-fork-point-config:
rebase: add a config option for --no-fork-point
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'mt/grep-sparse-checkout'
"git grep" has been tweaked to be limited to the sparse checkout
paths.
* mt/grep-sparse-checkout:
grep: honor sparse-checkout on working tree searches
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'ah/commit-graph-leakplug'
Plug a minor memory leak.
* ah/commit-graph-leakplug:
commit-graph: avoid leaking topo_levels slab in write_commit_graph()
Junio C Hamano [Fri, 26 Feb 2021 00:43:31 +0000 (16:43 -0800)]
Merge branch 'zh/difftool-skip-to'
"git difftool" learned "--skip-to=<path>" option to restart an
interrupted session from an arbitrary path.
* zh/difftool-skip-to:
difftool.c: learn a new way start at specified file
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'cw/pack-config-doc'
Doc update.
* cw/pack-config-doc:
doc: mention bigFileThreshold for packing
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'jc/maint-column-doc-typofix'
Doc update.
* jc/maint-column-doc-typofix:
Documentation: typofix --column description
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'ma/doc-markup-fix'
Docfix.
* ma/doc-markup-fix:
gitmailmap.txt: fix rendering of e-mail addresses
git.txt: fix monospace rendering
rev-list-options.txt: fix rendering of bonus paragraph
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'jc/diffcore-rotate'
"git {diff,log} --{skip,rotate}-to=<path>" allows the user to
discard diff output for early paths or move them to the end of the
output.
* jc/diffcore-rotate:
diff: --{rotate,skip}-to=<path>
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'mt/checkout-index-corner-cases'
The error codepath around the "--temp/--prefix" feature of "git
checkout-index" has been improved.
* mt/checkout-index-corner-cases:
checkout-index: omit entries with no tempname from --temp output
write_entry(): fix misuses of `path` in error messages
Junio C Hamano [Fri, 26 Feb 2021 00:43:30 +0000 (16:43 -0800)]
Merge branch 'js/doc-proto-v2-response-end'
Docfix.
* js/doc-proto-v2-response-end:
doc: fix naming of response-end-pkt
Junio C Hamano [Fri, 26 Feb 2021 00:43:29 +0000 (16:43 -0800)]
Merge branch 'rs/blame-optim'
Optimization in "git blame"
* rs/blame-optim:
blame: remove unnecessary use of get_commit_info()
Junio C Hamano [Fri, 26 Feb 2021 00:43:29 +0000 (16:43 -0800)]
Merge branch 'mz/doc-notes-are-not-anchors'
Objects that lost references can be pruned away, even when they
have notes attached to it (and these notes will become dangling,
which in turn can be pruned with "git notes prune"). This has been
clarified in the documentation.
* mz/doc-notes-are-not-anchors:
docs: clarify that refs/notes/ do not keep the attached objects alive
Junio C Hamano [Fri, 26 Feb 2021 00:43:29 +0000 (16:43 -0800)]
Merge branch 'ab/detox-gettext-tests'
Removal of GIT_TEST_GETTEXT_POISON continues.
* ab/detox-gettext-tests:
tests: remove most uses of test_i18ncmp
tests: remove last uses of C_LOCALE_OUTPUT
tests: remove most uses of C_LOCALE_OUTPUT
tests: remove last uses of GIT_TEST_GETTEXT_POISON=false
Junio C Hamano [Fri, 26 Feb 2021 00:43:28 +0000 (16:43 -0800)]
Merge branch 'jk/rev-list-disk-usage'
"git rev-list" command learned "--disk-usage" option.
* jk/rev-list-disk-usage:
docs/rev-list: add some examples of --disk-usage
docs/rev-list: add an examples section
rev-list: add --disk-usage option for calculating disk usage
t: add --no-tag option to test_commit
Junio C Hamano [Wed, 24 Feb 2021 20:26:41 +0000 (12:26 -0800)]
index-format doc: camelCase core.excludesFile
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 24 Feb 2021 20:26:40 +0000 (12:26 -0800)]
blame-options.txt: camelcase blame.blankBoundary
All other references to blame.* configuration variables are
camelCased already. Update this one to match.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu [Wed, 24 Feb 2021 20:26:39 +0000 (12:26 -0800)]
i18n.txt: camel case and monospace "i18n.commitEncoding"
In
95791be750 (doc: camelCase the i18n config variables to improve
readability, 2017-07-17), the other i18n config variables were
camel cased. However, this one instance was missed.
Camel case and monospace "i18n.commitEncoding" so that it matches the
surrounding text.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
[jc: fixed 3 other mistakes that are exactly the same]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Neeraj Singh [Thu, 18 Feb 2021 02:48:26 +0000 (02:48 +0000)]
read-cache: make the index write buffer size 128K
Writing an index 8K at a time invokes the OS filesystem and caching code
very frequently, introducing noticeable overhead while writing large
indexes. When experimenting with different write buffer sizes on Windows
writing the Windows OS repo index (260MB), most of the benefit came by
bumping the index write buffer size to 64K. I picked 128K to ensure that
we're past the knee of the curve.
With this change, the time under do_write_index for an index with 3M
files goes from ~1.02s to ~0.72s.
Signed-off-by: Neeraj Singh <neerajsi@ntdev.microsoft.com>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matheus Tavares [Tue, 23 Feb 2021 01:10:35 +0000 (22:10 -0300)]
add: propagate --chmod errors to exit status
If `add` encounters an error while applying the --chmod changes, it
prints a message to stderr, but exits with a success code. This might
have been an oversight, as the command does exit with a non-zero code in
other situations where it cannot (or refuses to) update all of the
requested paths (e.g. when some of the given paths are ignored). So make
the exit behavior more consistent by also propagating --chmod errors to
the exit status.
Note: the test "all statuses changed in folder if . is given" uses paths
added by previous test cases, some of which might be symbolic links.
Because `git add --chmod` will now fail with such paths, this test would
depend on whether all the previous tests were executed, or only some
of them. Avoid that by running the test on a fresh repo with only
regular files.
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matheus Tavares [Tue, 23 Feb 2021 01:10:34 +0000 (22:10 -0300)]
add: mark --chmod error string for translation
This error message is intended for humans, so mark it for translation.
Also use error() instead of fprintf(stderr, ...), to make the
corresponding line a bit cleaner, and to display the "error:" prefix,
which helps classifying the nature/severity of the message.
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matheus Tavares [Tue, 23 Feb 2021 01:10:33 +0000 (22:10 -0300)]
add --chmod: don't update index when --dry-run is used
`git add --chmod` applies the mode changes even when `--dry-run` is
used. Fix that and add some tests for this option combination.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff Hostetler [Wed, 24 Feb 2021 14:31:57 +0000 (14:31 +0000)]
dir: fix malloc of root untracked_cache_dir
Use FLEX_ALLOC_STR() to allocate the `struct untracked_cache_dir`
for the root directory. Get rid of unsafe code that might fail to
initialize the `name` field (if FLEX_ARRAY is not 1). This will
make it clear that we intend to have a structure with an empty
string following it.
A problem was observed on Windows where the length of the memset() was
too short, so the first byte of the name field was not zeroed. This
resulted in the name field having garbage from a previous use of that
area of memory.
The record for the root directory was then written to the untracked-cache
extension in the index. This garbage would then be visible to future
commands when they reloaded the untracked-cache extension.
Since the directory record for the root directory had garbage in the
`name` field, the `t/helper/test-tool dump-untracked-cache` tool
printed this garbage as the path prefix (rather than '/') for each
directory in the untracked cache as it recursed.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>