1
0
mirror of https://github.com/git/git.git synced 2024-10-19 11:48:53 +02:00
Commit Graph

68147 Commits

Author SHA1 Message Date
Jeff King
0ada4b9bfe diffcore-pickaxe: mark unused parameters in pickaxe functions
We have a virtual pickaxe_fn for handling -G versus -S pickaxe options.
They need to take the same set of parameters, but of course they care
about different ones (e.g., a regex -G will never use a kwset).

Mark the unused ones to appease -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
dfd2a23885 convert: mark unused parameter in null stream filter
The null stream filter unsurprisingly does not look at its "filter"
argument, since it just eats bytes. But we can't drop it, since it has
to conform to the same virtual interface that real filters do. Mark the
unused parameter to appease -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
7506535775 apply: mark unused parameters in noop error/warning routine
We squelch error/warning output by passing a noop handler to
set_error_routine(). We need to tell the compiler that this is intended
so that it doesn't trigger -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
0cff86990c apply: mark unused parameters in handlers
In parse_git_diff_header(), we have a table-driven parser that maps
strings to handler functions. Not all handlers need all of the
parameters; let's mark the unused ones to appease -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
7829746a6c date: mark unused parameters in handler functions
When parsing approxidates, we use a table to map special strings (like
"noon") to functions which handle them. Not all functions need the "now"
parameter, as they are not relative (e.g., "yesterday" does, but "pm"
does not). Let's annotate those to make -Wunused-parameter happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
1ee3471045 string-list: mark unused callback parameters
String-lists may be used with callbacks for clearing or iteration. These
callbacks need to conform to a particular interface, even though not
every callback needs all of its parameters. Mark the unused ones to make
-Wunused-parameter happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:04 -07:00
Jeff King
9eb6cdadd1 object-file: mark unused parameters in hash_unknown functions
The 0'th entry of our hash_algos array fills out the virtual methods
with a series of functions which simply BUG(). This is the right thing
to do, since the point is to catch use of an invalid algo parameter, but
we need to annotate them to appease -Wunused-parameters.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:03 -07:00
Jeff King
808e91956d mark unused parameters in trivial compat functions
When a platform feature isn't available or in use, we sometimes
conditionally compile empty or trivial functions to turn these into
noops. We need to annotate their parameters so that -Wunused-parameters
won't complain about them.

Note that there are many more of these in compat/mingw.h, but we'll
leave them for now, as there's some trickery required to get the UNUSED
macro available there.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:03 -07:00
Jeff King
827f8305c4 update-index: drop unused argc from do_reupdate()
The parse-options callback for --again soaks up all remaining options by
manipulating the parse_opt_ctx's argc and argv fields. Even though it
has to look at both, the actual parsing happens via the do_reupdate()
helper, which only looks at the argv half (by passing it along to
parse_pathspec). So that helper doesn't need to see argc at all.

Note that the helper does look at "argv + 1" without confirming that
argc is greater than 0. We know this is correct because it is skipping
past the actual "--again" string, which will always be present. However,
to make what's going on more obvious, let's move that "+1" into the
caller, which has the matching "-1" when fixing up the ctx's argc/argv.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:03 -07:00
Jeff King
70aa1d7576 submodule--helper: drop unused argc from module_list_compute()
The module_list_compute() function takes an argc/argv pair, but never
looks at argc. This is OK, as the NULL terminator in argv is sufficient
for our purposes (we feed it to parse_pathspec(), which takes only the
array, not a count).

Note that one of the callers _looks_ like it would be buggy, but isn't:
we pass 0/NULL for argc/argv from module_foreach(), so finding the
terminating NULL in that argv naively would segfault. However,
parse_pathspec() is smart enough to interpret a bare NULL as an empty
argv.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:03 -07:00
Jeff King
0e5a87e042 diffstat_consume(): assert non-zero length
The callback interface for xdiff_emit_line_fn gives us a line/len pair,
but diffstat_consume() never looks at "len". At first glance this seems
like a bug that could cause us to read further than xdiff intends. But
in practice, we read only the first character, and xdiff would never
pass us an empty line.

Let's add a run-time assertion that this is true, which clarifies our
assumption and silences -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-17 21:24:03 -07:00
Junio C Hamano
3dcec76d9d Git 2.38
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.38.0
2022-10-02 08:43:56 -07:00
Junio C Hamano
c03bee6e9f l10n-2.38.0-rnd3
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmM5XYMACgkQk24VDd1F
 MtUgqQ//X/+7AOMeG/jzPaiWd5f0PrwHX0lFC0VJnXLOGHkd4Ext0T8+W9HVc+FS
 q2Zo3mXrRVQIvqUDJ1UMko4dwRwnMiDpYXm7bD23b6rmvicBUU/tDjWuYXygWOzI
 Fvyq14wiJsvBA0y6zWfa7tsrRSgS+sVSlelaxxK0ijMMhGtiRWHF/pH1naNfiQ02
 ZLKHMuPQ6CAEU+Z9CkJhyeXT9mHMLKBBHgkB6FbYed436pG8w8iTDfNesmsRZhRK
 RJpv94MtMRXL54ni3giJWuH47WNh4kU4l/vcgj/24qUCSE60EP6c+86DqehxDx9i
 4jcNYjEEqFP4UgaU4lzWMSKFK6bx0lEI4IGdPN0VA1oLGozI1eX9uUemYisn+d4J
 kRx6peOYwaPAyikaxinEYB7WVwRr6eMsQ+JWc+PoD6zinXMB/w9KiN9U0dlRc5yE
 xOUm0i2Ulpaez/i61UTMnXgOUFiKXe9gAtU8FlVoym9X1ygPk7QFD6MIu/mNjtfz
 Eg2uLCmF3UpSlakTwGXPsHEY2gNfCxsh2wQnYA+YRQYeCCJAoJwx5KdT9kbNiFxj
 CJTr6kv5nH5l+ROK/jFHnV3Tqqjhqu4tYCajnsOduOz6aupyLwhe3hT4AeOx4TEy
 M6ngR9xfPEInLgkxrsUxZoQGH6vIkfTvWw1tCgOI3okmBWSnCMg=
 =lJz/
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.38.0-rnd3' of https://github.com/git-l10n/git-po

l10n-2.38.0-rnd3

* tag 'l10n-2.38.0-rnd3' of https://github.com/git-l10n/git-po: (25 commits)
  l10n: zh_TW.po: Git 2.38.0, round 3
  l10n: fr: v2.38.0 round 3
  l10n: Update Catalan translation
  l10n: de.po: update German translation
  l10n: zh_CN: 2.38.0 round 3
  l10n: tr: v2.38.0 3rd round
  l10n: bg.po: Updated Bulgarian translation (5484t)
  l10n: po-id for 2.38 (round 3)
  l10n: es: update translation
  l10n: sv.po: Update Swedish translation (5484t0f0u)
  l10n: Update Catalan translation
  l10n: fr: don't say that merge is "the default strategy"
  l10n: zh_CN v2.38.0 rounds 1 & 2
  l10n: po-id for 2.38 (round 2)
  l10n: tr: v2.38.0 round 2
  l10n: bg.po: Updated Bulgarian translation (5484t)
  l10n: fr: v2.38.0 round 2
  l10n: fr: v2.38 round 1
  l10n: fr: The word 'branche' is only feminine
  l10n: Update Catalan translation
  ...
2022-10-02 08:24:32 -07:00
Yi-Jyun Pan
dedb2883ce
l10n: zh_TW.po: Git 2.38.0, round 3
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2022-10-01 19:10:41 +08:00
Jiang Xin
d7f69b76ec Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.38 (round 3)
2022-10-01 10:02:03 +08:00
Jiang Xin
21cefac967 Merge branch 'l10n-de-2.38-rnd3' of github.com:ralfth/git
* 'l10n-de-2.38-rnd3' of github.com:ralfth/git:
  l10n: de.po: update German translation
2022-09-29 18:54:12 +08:00
Jiang Xin
48bf511320 Merge branch 'fr_2.38_rnd3' of github.com:jnavila/git
* 'fr_2.38_rnd3' of github.com:jnavila/git:
  l10n: fr: v2.38.0 round 3
2022-09-29 08:00:30 +08:00
Jiang Xin
08f41b8171 Merge branch 'catalan' of github.com:Softcatala/git-po
* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2022-09-29 07:59:44 +08:00
Jean-Noël Avila
48fe8e6a63 l10n: fr: v2.38.0 round 3
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2022-09-28 21:46:22 +02:00
Jordi Mas
42fe2b951a l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2022-09-28 19:05:55 +02:00
Ralf Thielow
92e51feec5 l10n: de.po: update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2022-09-28 17:15:53 +02:00
Fangyi Zhou
b796ca1cd4
l10n: zh_CN: 2.38.0 round 3
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2022-09-28 15:51:07 +01:00
Jiang Xin
37db9416c4 Merge branch 'turkish' of github.com:bitigchi/git-po
* 'turkish' of github.com:bitigchi/git-po:
  l10n: tr: v2.38.0 3rd round
2022-09-28 20:54:29 +08:00
Jiang Xin
8d500614f7 Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5484t)
2022-09-28 20:52:34 +08:00
Emir SARI
2c30dfa7d7 l10n: tr: v2.38.0 3rd round
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2022-09-28 12:32:13 +03:00
Alexander Shopov
88fda53a16 l10n: bg.po: Updated Bulgarian translation (5484t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2022-09-28 11:07:07 +02:00
Bagas Sanjaya
55b1c1ab1c l10n: po-id for 2.38 (round 3)
Update following components:

  * sequencer.c
  * wt-status.c

Translate following new components:

  * compat/compiler.h
  * compat/disk.h
  * compat/fsmonitor/fsm-health-win32.c
  * compat/fsmonitor/fsm-listen-darwin.c
  * compat/fsmonitor/fsm-listen-win32.c
  * compat/fsmonitor/fsm-settings-win32.c
  * compat/mingw.c
  * compat/obstack.c
  * compat/regex/regcomp.c
  * compat/simple-ipc/ipc-unix-socket.c
  * compat/simple-ipc/ipc-win32.c
  * compat/terminal.c
  * convert.c
  * entry.c
  * environment.c
  * exec-cmd.c
  * git-merge-octopus.sh
  * git-sh-setup.sh
  * list-objects-filter-options.c
  * list-objects-filter-options.h
  * list-objects.c
  * lockfile.c
  * ls-refs.c
  * mailinfo.c
  * name-hash.c
  * notes-merge.c
  * notes-utils.c
  * pkt-line.c
  * preload-index.c
  * pretty.c
  * promisor-remote.c
  * protocol-caps.c
  * read-cache.c
  * scalar.c
  * transport-helper.c
  * transport.c
  * tree-walk.c
  * urlmatch.c
  * walker.c
  * wrapper.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2022-09-28 15:06:14 +07:00
Alex Henrie
9af6cb88b6 l10n: es: update translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2022-09-27 22:56:55 -06:00
Jiang Xin
4ff58e9690 Merge branch 'main' of github.com:git/git
* 'main' of github.com:git/git:
  Git 2.38-rc2
  pack-bitmap: remove trace2 region from hot path
2022-09-28 08:03:38 +08:00
Junio C Hamano
bcd6bc478a Git 2.38-rc2
We have small updates since -rc1 but none of them is about a new
thing and there is no updates to the release notes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.38.0-rc2
2022-09-27 11:25:52 -07:00
Junio C Hamano
2a7d63a245 Merge branch 'ds/bitmap-lookup-remove-tracing'
Perf-fix.

* ds/bitmap-lookup-remove-tracing:
  pack-bitmap: remove trace2 region from hot path
2022-09-26 21:46:51 -07:00
Derrick Stolee
89a1ab8fb5 pack-bitmap: remove trace2 region from hot path
The trace2 region around the call to lazy_bitmap_for_commit() in
bitmap_for_commit() was added in 28cd730680d (pack-bitmap: prepare to
read lookup table extension, 2022-08-14). While adding trace2 regions is
typically helpful for tracking performance, this method is called
possibly thousands of times as a commit walk explores commit history
looking for a matching bitmap. When trace2 output is enabled, this
region is emitted many times and performance is throttled by that
output.

For now, remove these regions entirely.

This is a critical path, and it would be valuable to measure that the
time spent in bitmap_for_commit() does not increase when using the
commit lookup table. The best way to do that would be to use a mechanism
that sums the time spent in a region and reports a single value at the
end of the process. This technique was introduced but not merged by [1]
so maybe this example presents some justification to revisit that
approach.

[1] https://lore.kernel.org/git/pull.1099.v2.git.1640720202.gitgitgadget@gmail.com/

To help with the 'git blame' output in this region, add a comment that
warns against adding a trace2 region. Delete a test from t5310 that used
that trace output to check that this lookup optimization was activated.
To create this kind of test again in the future, the stopwatch traces
mentioned earlier could be used as a signal that we activated this code
path.

Helpedy-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-09-26 12:09:18 -07:00
Peter Krefting
33ccfd1e5b l10n: sv.po: Update Swedish translation (5484t0f0u)
Also fix a couple of typos.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2022-09-26 06:36:23 +01:00
Jordi Mas
6c9165c07a l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2022-09-25 21:04:22 +02:00
Jiang Xin
54e1f9f66d Merge branch 'main' of github.com:git/git
* 'main' of github.com:git/git:
  cmd-list.perl: fix identifying man sections
  pack-bitmap: improve grammar of "xor chain" error message
2022-09-24 21:51:06 +08:00
Jiang Xin
456a75f814 Merge branch 'fr_quickfix' of github.com:jnavila/git
* 'fr_quickfix' of github.com:jnavila/git:
  l10n: fr: don't say that merge is "the default strategy"
2022-09-24 21:12:37 +08:00
Jiang Xin
9865dce557 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.38 (round 2)
2022-09-24 21:09:22 +08:00
Jiang Xin
1d8177c6fa Merge branch 'turkish' of github.com:bitigchi/git-po
* 'turkish' of github.com:bitigchi/git-po:
  l10n: tr: v2.38.0 round 2
2022-09-24 21:08:11 +08:00
Alex Henrie
d1e76d5ddc l10n: fr: don't say that merge is "the default strategy"
The text of this message was changed in commit
71076d0edde43a7672a9a0f555753ff078602a64 to avoid making any
suggestion about which strategy is better for the situation at hand.
Update the Franch translation to match.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2022-09-23 20:42:58 +02:00
Junio C Hamano
4fd6c5e444 Merge branch 'ac/bitmap-lookup-table'
Grammofix.

* ac/bitmap-lookup-table:
  pack-bitmap: improve grammar of "xor chain" error message
2022-09-23 11:07:49 -07:00
Junio C Hamano
0d14f80f94 Merge branch 'ma/scalar-to-main-fix'
Fix manpage generation.

* ma/scalar-to-main-fix:
  cmd-list.perl: fix identifying man sections
2022-09-23 11:07:48 -07:00
Martin Ågren
32c6fff4b8 cmd-list.perl: fix identifying man sections
We attribute each documentation text file to a man section by finding a
line in the file that looks like "gitfoo(<digit>)". Commit cc75e556a9
("scalar: add to 'git help -a' command list", 2022-09-02) updated this
logic to look not only for "gitfoo" but also "scalarfoo". In doing so,
it forgot to account for the fact that after the updated regex has found
a match, the man section is no longer to be found in `$1` but now lives
in `$2`.

This makes our git(1) manpage look as follows:

  Main porcelain commands
       git-add(git)
           Add file contents to the index.

  [...]

       gitk(git)
           The Git repository browser.

       scalar(scalar)
           A tool for managing large Git repositories.

Restore the man sections by not capturing the (git|scalar) part of the
match into `$1`.

As noted by Ævar [1], we could even match any "foo" rather than just
"gitfoo" and "scalarfoo", but that's a larger change. For now, just fix
the regression in cc75e556a9.

[1] https://lore.kernel.org/git/220923.86wn9u4joo.gmgdl@evledraar.gmail.com/#t

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-09-23 10:01:07 -07:00
Alex Henrie
711340c797 pack-bitmap: improve grammar of "xor chain" error message
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-09-23 08:54:05 -07:00
Fangyi Zhou
d5be499eed
l10n: zh_CN v2.38.0 rounds 1 & 2
Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Li Linchao <lilinchao@oschina.cn>
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2022-09-23 14:53:24 +01:00
Bagas Sanjaya
d4df8609f3 l10n: po-id for 2.38 (round 2)
Update following components:

  * branch.c
  * builtin/log.c
  * builtin/rebase.c
  * builtin/remote.c
  * builtin/reset.c
  * builtin/rev-list.c
  * builtin/rev-parse.c
  * builtin/revert.c
  * builtin/sparse-checkout.c
  * builtin/submodule--helper.c
  * command-list.h
  * help.c
  * merge.c

Translate following new components:

  * builtin/check-attr.c
  * builtin/check-ignore.c
  * builtin/check-mailmap.c
  * builtin/column.c
  * builtin/credential-cache--daemon.c
  * builtin/credential-cache.c
  * builtin/credential-store.c
  * builtin/diagnose.c
  * builtin/env--helper.c
  * builtin/fsmonitor--daemon.c
  * builtin/interpret-trailers.c
  * builtin/mailinfo.c
  * builtin/mailsplit.c
  * builtin/mktag.c
  * builtin/mktree.c
  * builtin/pack-redundant.c
  * builtin/replace.c
  * builtin/rerere.c
  * builtin/stripspace.c
  * bulk-checkin.c
  * commit.c
  * credential.c
  * fsmonitor-ipc.c
  * fsmonitor-settings.c
  * http-fetch.c
  * http.c

Also remove unused strings.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2022-09-23 20:02:42 +07:00
Emir SARI
20f5a4f114 l10n: tr: v2.38.0 round 2
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2022-09-23 13:10:04 +03:00
Alexander Shopov
471ae3e297 l10n: bg.po: Updated Bulgarian translation (5484t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2022-09-23 11:21:03 +02:00
Jiang Xin
f2d1418080 Merge branch 'fr_v2.38_rnd2' of github.com:jnavila/git
* 'fr_v2.38_rnd2' of github.com:jnavila/git:
  l10n: fr: v2.38.0 round 2
  l10n: fr: v2.38 round 1
  l10n: fr: The word 'branche' is only feminine
2022-09-23 17:06:12 +08:00
Jiang Xin
f5e09d5711 Merge branch 'catalan' of github.com:Softcatala/git-po
* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2022-09-23 16:58:14 +08:00
Jiang Xin
e3be58c005 Merge branch 'l10n-de-2.38' of github.com:ralfth/git
* 'l10n-de-2.38' of github.com:ralfth/git:
  l10n: de.po: update German translation
2022-09-23 16:51:23 +08:00