1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-31 14:16:08 +02:00
Commit Graph

70930 Commits

Author SHA1 Message Date
Jeff King e46a25b05d trace2: mark unused us_elapsed_absolute parameters
Many trace2 targets ignore the absolute elapsed time parameters.
However, the virtual interface needs to retain the parameter since it is
used by others (e.g., the perf target).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:25 -07:00
Jeff King 71006d77c5 stash: mark unused parameter in diff callback
This is similar to the cases in 61bdc7c5d8 (diff: mark unused parameters
in callbacks, 2022-12-13), but I missed it when making that commit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King c5cb97cbbf ls-tree: mark unused parameter in callback
The formatting functions are dispatched from a table of function
pointers. The "path name only" function unsurprisingly does not need to
look at its "oid" parameter, but we must mark it as unused to make
-Wunused-parameter happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King e1cba404db commit-graph: mark unused data parameters in generation callbacks
The compute_generation_info code uses function pointers to abstract the
get/set generation operations. Some callers don't need the extra void
data pointer, which should be annotated to appease -Wunused-parameter.

Note that we can drop the assignment of the "data" parameter in
compute_generation_numbers(), as we've just shown that neither of the
callbacks it uses will access it. This matches the caller in
ensure_generations_valid(), which already does not bother to set "data".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King bbfc4f53b9 worktree: mark unused parameters in each_ref_fn callback
This is similar to the cases in 63e14ee2d6 (refs: mark unused
each_ref_fn parameters, 2022-08-19), but it was added after that commit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King d79b9f7cdb pack-bitmap: mark unused parameters in show_object callback
This is similar to the cases in c50dca2a18 (list-objects: mark unused
callback parameters, 2023-02-24), but was added after that commit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King 29c9f2c366 ref-filter: mark unused parameters in parser callbacks
These are similar to the cases annotated in 5fe9e1ce2f (ref-filter: mark
unused callback parameters, 2023-02-24), but were added after that
commit.

Note that the ahead/behind callback ignores its "atom" parameter, which
is a little unusual, since that struct usually stores the result. But in
this case, the data is stored centrally in ref_array->counts, since we
want to compute all ahead/behinds at once, not per ref.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:24 -07:00
Jeff King c9f7b1e8f2 sequencer: mark repository argument as unused
In sequencer_get_last_command(), we don't ever look at the repository
parameter. This is due to ed5b1ca10b (status: do not report errors in
sequencer/todo, 2019-06-27), which dropped the call to parse_insn_line().

However, it _should_ be used when calling into git_path_* functions,
but the one we use here is declared with the non-REPO variant of
GIT_PATH_FUNC(), and so just uses the_repository internally.

We could change the path helper to use REPO_GIT_PATH_FUNC(), but doing
so piecemeal is not great. There are 41 uses of GIT_PATH_FUNC() in
sequencer.c, and inconsistently switching one makes the code more
confusing. Likewise, this one function is used in half a dozen other
spots, all of which would need to start passing in a repository argument
(with rippling effects up the call stack).

So let's punt on that for now and just silence any -Wunused-parameter
warning.

Note that we could also drop this parameter entirely, as the function is
always called directly, and not as a callback that has to conform to
some external interface. But since we'd eventually want to use the
repository parameter, let's leave it in place to avoid disrupting the
callers twice.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:23 -07:00
Jeff King cb646ffb0a sequencer: use repository parameter in short_commit_name()
Instead of just using the_repository, we can take a repository parameter
from the caller. Most of them already have one, and doing so clears up a
few -Wunused-parameter warnings. There are still a few callers which use
the_repository, but this pushes us one small step forward to eventually
getting rid of those.

Note that a few of these functions have a "rev_info" whose "repo"
parameter could probably be used instead of the_repository. I'm leaving
that for further cleanups, as it's not immediately obvious that
revs->repo is always valid, and there's quite a bit of other possible
refactoring here (even getting rid of some "struct repository" arguments
in favor of revs->repo).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-29 17:56:23 -07:00
Junio C Hamano 6807fcfeda The second batch for 2.43
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-25 10:37:38 -07:00
Junio C Hamano eccee1854c Merge branch 'jk/function-pointer-mismatches-fix'
Code clean-up to please clang-18.

* jk/function-pointer-mismatches-fix:
  hashmap: use expected signatures for comparison functions
2023-08-25 10:37:38 -07:00
Junio C Hamano 23013a49c8 Merge branch 'ob/t9001-indent-fix'
Test style fix.

* ob/t9001-indent-fix:
  t9001: fix indentation in test_no_confirm()
2023-08-25 10:37:37 -07:00
Junio C Hamano 05c8603564 Merge branch 'ja/worktree-orphan'
Typofix in an error message.

* ja/worktree-orphan:
  builtin/worktree.c: fix typo in "forgot fetch" msg
2023-08-25 10:37:37 -07:00
Junio C Hamano 6d159f5757 Merge branch 'rs/parse-options-negation-help'
"git cmd -h" learned to signal which options can be negated by
listing such options like "--[no-]opt".

* rs/parse-options-negation-help:
  parse-options: simplify usage_padding()
  parse-options: no --[no-]no-...
  parse-options: factor out usage_indent() and usage_padding()
  parse-options: show negatability of options in short help
  t1502: test option negation
  t1502: move optionspec help output to a file
  t1502, docs: disallow --no-help
  subtree: disallow --no-{help,quiet,debug,branch,message}
2023-08-25 10:37:37 -07:00
Junio C Hamano cd9da15a85 Start the 2.43 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-24 09:32:34 -07:00
Junio C Hamano c7b6a6c0be Merge branch 'ds/maintenance-schedule-fuzz'
Hourly and other schedule of "git maintenance" jobs are randomly
distributed now.

* ds/maintenance-schedule-fuzz:
  maintenance: update schedule before config
  maintenance: fix systemd schedule overlaps
  maintenance: use random minute in systemd scheduler
  maintenance: swap method locations
  maintenance: use random minute in cron scheduler
  maintenance: use random minute in Windows scheduler
  maintenance: use random minute in launchctl scheduler
  maintenance: add get_random_minute()
2023-08-24 09:32:34 -07:00
Junio C Hamano 004a383091 Merge branch 'ob/test-lib-rebase-fake-editor-updates'
Test updates.

* ob/test-lib-rebase-fake-editor-updates:
  t/lib-rebase: improve documentation of set_fake_editor()
  t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently
  t/lib-rebase: set_fake_editor(): fix recognition of reset's short command
2023-08-24 09:32:34 -07:00
Junio C Hamano aaf0a421e2 Merge branch 'mp/rebase-label-length-limit'
Overly long label names used in the sequencer machinery are now
chopped to fit under filesystem limitation.

* mp/rebase-label-length-limit:
  rebase: allow overriding the maximal length of the generated labels
  sequencer: truncate labels to accommodate loose refs
2023-08-24 09:32:33 -07:00
Junio C Hamano 84d79009d9 Merge branch 'ds/upload-pack-error-sequence-fix'
Error message generation fix.

* ds/upload-pack-error-sequence-fix:
  upload-pack: fix exit code when denying fetch of unreachable object ID
  upload-pack: fix race condition in error messages
2023-08-24 09:32:33 -07:00
Junio C Hamano 2f8aa2c3a0 Merge branch 'ws/git-push-doc-grammofix'
Doc update.

* ws/git-push-doc-grammofix:
  git-push.txt: fix grammar
2023-08-24 09:32:33 -07:00
Junio C Hamano 987a85accb Merge branch 'tb/repack-geometry-cleanup'
Code clean-up.

* tb/repack-geometry-cleanup:
  repack: move `pack_geometry` struct to the stack
2023-08-24 09:32:33 -07:00
Junio C Hamano e9608bbc35 Merge branch 'ob/sequencer-rearrange-cleanup'
Code clean-up.

* ob/sequencer-rearrange-cleanup:
  sequencer: simplify allocation of result array in todo_list_rearrange_squash()
2023-08-24 09:32:33 -07:00
Junio C Hamano f5f23a430f Merge branch 'rj/branch-in-use-error-message'
A message written in olden time prevented a branch from getting
checked out saying it is already checked out elsewhere, but these
days, we treat a branch that is being bisected or rebased just like
a branch that is checked out and protect it.  Rephrase the message
to say that the branch is in use.

* rj/branch-in-use-error-message:
  branch: error message checking out a branch in use
  branch: error message deleting a branch in use
2023-08-24 09:32:33 -07:00
Junio C Hamano 43c8a30d15 Git 2.42
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-21 09:34:58 -07:00
Junio C Hamano 915e51b74e Merge branch 'jk/function-pointer-mismatches-fix' (early part)
Fix a minor regression that some compiler might notice.

* 'jk/function-pointer-mismatches-fix' (early part):
  fsck: use enum object_type for fsck_walk callback
2023-08-21 09:27:44 -07:00
Junio C Hamano 5a50dd7eda l10n-2.42.0-rnd2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmTinJwACgkQk24VDd1F
 MtXNfw/9Hn8LCB7MXV0FGvS7BYcijWuXZxGa+3o4mxKREwmHe3R7AYVTcVKADw03
 YE77oHVCcG6EiVldfUDOdwIO3bgKTlp8On4LpLzGAoB8+oT4dLntQvIQK+W0vw8A
 zCgTR5c0IMahdUxJgFMoYsTxN3bScTMJgdrQZ6OLJ8OaP4nTOhrzyoGIPWKE7QMt
 zQ058zUJi+OA/Z7arKJG72IiwB6u+/xSdnf94+qjIbvCaQf1HDs2E/eniNMKY/do
 u4ETO5mgqnAZdowWvp18uBwStkGZTmucYb5D9aq1lUDeUKGXEIRZlYCIz8h7g318
 9ZYVJlj8L2y/vCw4C/jdpcjGvZeIWQYibIHPItWLGo3HgKXp41phCsGPi4TkBi61
 dwpizSkCXpUMr7EVj4ngBiqCLvjqIrX/WPU3KrAgUYLvsUwPtczAHsCrT1EA7gXR
 Wbpv6yEDRjdvqgId4oL2UvJK6EANIug6ZJt29LdkegAH9lCB4Q13ULeHgS9CsWpZ
 xwmmR8ybxoSmjsjvpcMFKfBLuB/kc9JjqGx852w2GQMDOTtVGxLMTPGrkMWr2pfw
 WpbQ/HImNG6UEFpstW7/pEP/0OQV/oUZjGD39/NJBEcIImS89LUV+MXeZj+3DwbO
 TqZ+Q5eF+ScgCD32CNM/CU7x2o5xs+42dYk09r8cGdqzB4NUBQc=
 =bnqd
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.42.0-rnd2' of https://github.com/git-l10n/git-po

l10n-2.42.0-rnd2

* tag 'l10n-2.42.0-rnd2' of https://github.com/git-l10n/git-po:
  l10n: zh_TW.po: Git 2.42
  l10n: zh_CN: 2.42.0 round 2
  l10n: zh_CN: v2.42.0 round 1
  l10n: Update German translation
  l10n: Update Catalan translation
  l10n: tr: git 2.42.0
  l10n: fr v2.42.0 rnd 2
  l10n: fr v2.42.0 rnd 1
  l10n: sv.po: Update Swedish translation 5549t0f0u
  l10n: uk: update translation (2.42.0)
  l10n: po-id for 2.42 (round 1)
  l10n: ru.po: update Russian translation
2023-08-21 08:43:46 -07:00
Jiang Xin d1f87c2148 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.42 (round 1)
2023-08-21 07:05:38 +08:00
Yi-Jyun Pan 5e2dff212a
l10n: zh_TW.po: Git 2.42
Co-authored-by: Lumynous <lumynou5.tw@gmail.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2023-08-20 22:01:37 +08:00
Jeff King beaa1d952b hashmap: use expected signatures for comparison functions
We prefer for callback functions to match the signature with which
they'll be called, rather than casting them to the correct type when
assigning function pointers. Even though casting often works in the real
world, it is a violation of the standard.

We did a mass conversion in 939af16eac (hashmap_cmp_fn takes
hashmap_entry params, 2019-10-06), but have grown a few new cases since
then. Because of the cast, the compiler does not complain. However, as
of clang-18, UBSan will catch these at run-time, and the case in
range-diff.c triggers when running t3206.

After seeing that one, I scanned the results of:

  git grep '_fn)[^(]' '*.c' | grep -v typedef

and found a similar case in compat/terminal.c (which presumably isn't
called in the test suite, since it doesn't trigger UBSan). There might
be other cases lurking if the cast is done using a typedef that doesn't
end in "_fn", but loosening it finds too many false positives. I also
looked for:

  git grep ' = ([a-z_]*) *[a-z]' '*.c'

to find assignments that cast, but nothing looked like a function.

The resulting code is unfortunately a little longer, but the bonus of
using container_of() is that we are no longer restricted to the
hashmap_entry being at the start of the struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-19 21:17:53 -07:00
Jeff King 2bbeddee5d fsck: use enum object_type for fsck_walk callback
We switched the function interface for fsck callbacks in a1aad71601
(fsck.h: use "enum object_type" instead of "int", 2021-03-28). However,
we accidentally flipped the type back to "int" as part of 0b4e9013f1
(fsck: mark unused parameters in various fsck callbacks, 2023-07-03).
The mistake happened because that commit was written before a1aad71601
and rebased forward, and I screwed up while resolving the conflict.

Curiously, the compiler does not warn about this mismatch, at least not
when using gcc and clang on Linux (nor in any of our CI environments).
Based on 28abf260a5 (builtin/fsck.c: don't conflate "int" and "enum" in
callback, 2021-06-01), I'd guess that this would cause the AIX xlc
compiler to complain. I noticed because clang-18's UBSan now identifies
mis-matched function calls at runtime, and does complain of this case
when running the test suite.

I'm not entirely clear on whether this mismatch is a problem in
practice. Compilers are certainly free to make enums smaller than "int"
if they don't need the bits, but I suspect that they have to promote
back to int for function calls (though I didn't dig in the standard, and
I won't be surprised if I'm simply wrong and the real-world impact would
depend on the ABI).

Regardless, switching it back to enum is obviously the right thing to do
here; the switch to "int" was simply a mistake.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-19 21:17:32 -07:00
Jiang Xin 3cf978718f Merge branch 'l10n-de-2.42' of github.com:ralfth/git
* 'l10n-de-2.42' of github.com:ralfth/git:
  l10n: Update German translation
2023-08-19 21:09:31 +08:00
Jiang Xin 6fb0e532d5 Merge branch 'catalan' of github.com:Softcatala/git-po
* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2023-08-19 21:08:22 +08:00
Jiang Xin d731a52e4d Merge branch 'update-uk-l10n' of github.com:arkid15r/git-ukrainian-l10n
* 'update-uk-l10n' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: update translation (2.42.0)
2023-08-19 21:07:47 +08:00
Jiang Xin c04e26683f Merge branch 'tl/zh_CN_2.42.0_rnd1' of github.com:dyrone/git
* 'tl/zh_CN_2.42.0_rnd1' of github.com:dyrone/git:
  l10n: zh_CN: 2.42.0 round 2
  l10n: zh_CN: v2.42.0 round 1
2023-08-19 21:07:03 +08:00
Jiang Xin 7fdd36c22b Merge branch 'master' of github.com:nafmo/git-l10n-sv
* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation 5549t0f0u
2023-08-19 21:05:00 +08:00
Jiang Xin d0d403b8bc Merge branch 'l10n-tr' of github.com:bitigchi/git-po
* 'l10n-tr' of github.com:bitigchi/git-po:
  l10n: tr: git 2.42.0
2023-08-19 21:04:09 +08:00
Teng Long 9441efe212 l10n: zh_CN: 2.42.0 round 2
Signed-off-by: Teng Long <dyroneteng@gmail.com>
2023-08-18 19:30:03 +08:00
Teng Long bb9c886334 l10n: zh_CN: v2.42.0 round 1
Signed-off-by: Teng Long <dyroneteng@gmail.com>
2023-08-18 19:29:01 +08:00
Junio C Hamano f9972720e9 Merge branch 'ps/revision-stdin-with-options'
Typofix to documentation added during this cycle.

* ps/revision-stdin-with-options:
  rev-list-options: fix typo in `--stdin` documentation
2023-08-17 15:50:05 -07:00
Junio C Hamano 62ce3dcd67 Merge branch 'sa/doc-ls-remote'
Mark-up fix to documentation added during this cycle.

* sa/doc-ls-remote:
  show-ref doc: fix carets in monospace
2023-08-17 15:50:05 -07:00
Junio C Hamano fa43131a09 Merge branch 'tl/notes-separator'
Typo/grammofix to documentation added during this cycle.

* tl/notes-separator:
  notes doc: tidy up `--no-stripspace` paragraph
  notes doc: split up run-on sentences
2023-08-17 15:50:05 -07:00
Ralf Thielow a1d7c65007 l10n: Update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2023-08-17 17:00:36 +02:00
Martin Ågren c81f1a1676 rev-list-options: fix typo in `--stdin` documentation
With `--stdin`, we read *from* standard input, not *for*.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-16 11:42:54 -07:00
Martin Ågren 18c4aac0dd show-ref doc: fix carets in monospace
When commit 00bf685975 (show-ref doc: update for internal consistency,
2023-05-19) switched from double quotes to backticks around our {caret}
macro, we started rendering "{caret}" literally. Fix this by replacing
by a "^" character.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-16 11:40:10 -07:00
Martin Ågren 3a6e1ad80b notes doc: tidy up `--no-stripspace` paragraph
Where we document the `--no-stripspace` option, remove a superfluous
"For" to fix the grammar. Mark option names and command names using
`backticks` to set them in monospace.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-16 11:37:25 -07:00
Martin Ågren 95b6ae9d74 notes doc: split up run-on sentences
When commit c4e2aa7d45 (notes.c: introduce "--[no-]stripspace" option,
2023-05-27) mentioned the new `--no-stripspace` in the documentation for
`-m` and `-F`, it created run-on sentences. It also used slightly
different language in the two sections for no apparent reason. Split the
sentences in two to improve readability, and while touching the two
sites, make them more similar.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-16 11:36:36 -07:00
Jordi Mas f8a7795b7a l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2023-08-16 18:25:02 +02:00
Patrick Steinhardt 5f33a843de upload-pack: fix exit code when denying fetch of unreachable object ID
In 7ba7c52d76 (upload-pack: fix race condition in error messages,
2023-08-10), we have fixed a race in t5516-fetch-push.sh where sometimes
error messages got intermingled. This was done by splitting up the call
to `die()` such that we print the error message before writing to the
remote side, followed by a call to `exit(1)` afterwards.

This causes a subtle regression though as `die()` causes us to exit with
exit code 128, whereas we now call `exit(1)`. It's not really clear
whether we want to guarantee any specific error code in this case, and
neither do we document anything like that. But on the other hand, it
seems rather clear that this is an unintended side effect of the change
given that this change in behaviour was not mentioned at all.

Restore the status-quo by exiting with 128.  The test in t5703 to
ensure that "git fetch" fails by using test_must_fail, which does
not care between exiting 1 and 128, so this changes will not affect
any test.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-08-16 09:17:46 -07:00
Emir SARI d9dec13dde l10n: tr: git 2.42.0
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2023-08-16 14:40:44 +03:00
Jean-Noël Avila 87afb88801 l10n: fr v2.42.0 rnd 2
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2023-08-16 11:50:23 +02:00