Граф коммитов

72324 Коммитов

Автор SHA1 Сообщение Дата
Johannes Schindelin 5317380521 commit-reach(repo_get_merge_bases_many): pass on "missing commits" errors
The `merge_bases_many()` function was just taught to indicate parsing
errors, and now the `repo_get_merge_bases_many()` function is aware of
that, too.

Naturally, there are a lot of callers that need to be adjusted now, too.

Next stop: `repo_get_merge_bases_dirty()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin f87056ce40 commit-reach(get_octopus_merge_bases): pass on "missing commits" errors
The `merge_bases_many()` function was just taught to indicate parsing
errors, and now the `repo_get_merge_bases()` function (which is also
surfaced via the `get_merge_bases()` macro) is aware of that, too.

Naturally, the callers need to be adjusted now, too.

Next step: adjust `repo_get_merge_bases_many()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin 76e2a09999 commit-reach(repo_get_merge_bases): pass on "missing commits" errors
The `merge_bases_many()` function was just taught to indicate parsing
errors, and now the `repo_get_merge_bases()` function (which is also
surfaced via the `repo_get_merge_bases()` macro) is aware of that, too.

Naturally, there are a lot of callers that need to be adjusted now, too.

Next step: adjust the callers of `get_octopus_merge_bases()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin 8226e157a9 commit-reach(get_merge_bases_many_0): pass on "missing commits" errors
The `merge_bases_many()` function was just taught to indicate
parsing errors, and now the `get_merge_bases_many_0()` function is aware
of that, too.

Next step: adjust the callers of `get_merge_bases_many_0()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin fb02c523a3 commit-reach(merge_bases_many): pass on "missing commits" errors
The `paint_down_to_common()` function was just taught to indicate
parsing errors, and now the `merge_bases_many()` function is aware of
that, too.

One tricky aspect is that `merge_bases_many()` parses commits of its
own, but wants to gracefully handle the scenario where NULL is passed as
a merge head, returning the empty list of merge bases. The way this was
handled involved calling `repo_parse_commit(NULL)` and relying on it to
return an error. This has to be done differently now so that we can
handle missing commits correctly by producing a fatal error.

Next step: adjust the caller of `merge_bases_many()`:
`get_merge_bases_many_0()`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin 896a0e11f3 commit-reach(paint_down_to_common): start reporting errors
If a commit cannot be parsed, it is currently ignored when looking for
merge bases. That's undesirable as the operation can pretend success in
a corrupt repository, even though the command should fail with an error
message.

Let's start at the bottom of the stack by teaching the
`paint_down_to_common()` function to return an `int`: if negative, it
indicates fatal error, if 0 success.

This requires a couple of callers to be adjusted accordingly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:06:01 -08:00
Johannes Schindelin 2d2da172f3 commit-reach(paint_down_to_common): prepare for handling shallow commits
When `git fetch --update-shallow` needs to test for commit ancestry, it
can naturally run into a missing object (e.g. if it is a parent of a
shallow commit). For the purpose of `--update-shallow`, this needs to be
treated as if the child commit did not even have that parent, i.e. the
commit history needs to be clamped.

For all other scenarios, clamping the commit history is actually a bug,
as it would hide repository corruption (for an analysis regarding
shallow and partial clones, see the analysis further down).

Add a flag to optionally ask the function to ignore missing commits, as
`--update-shallow` needs it to, while detecting missing objects as a
repository corruption error by default.

This flag is needed, and cannot be replaced by `is_repository_shallow()`
to indicate that situation, because that function would return 0 in the
`--update-shallow` scenario: There is not actually a `shallow` file in
that scenario, as demonstrated e.g. by t5537.10 ("add new shallow root
with receive.updateshallow on") and t5538.4 ("add new shallow root with
receive.updateshallow on").

Note: shallow commits' parents are set to `NULL` internally already,
therefore there is no need to special-case shallow repositories here, as
the merge-base logic will not try to access parent commits of shallow
commits.

Likewise, partial clones aren't an issue either: If a commit is missing
during the revision walk in the merge-base logic, it is fetched via
`promisor_remote_get_direct()`. And not only the single missing commit
object: Due to the way the "promised" objects are fetched (in
`fetch_objects()` in `promisor-remote.c`, using `fetch
--filter=blob:none`), there is no actual way to fetch a single commit
object, as the remote side will pass that commit OID to `pack-objects
--revs [...]` which in turn passes it to `rev-list` which interprets
this as a commit _range_ instead of a single object. Therefore, in
partial clones (unless they are shallow in addition), all commits
reachable from a commit that is in the local object database are also
present in that local database.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-29 08:05:45 -08:00
Johannes Schindelin 24876ebf68 commit-reach(repo_in_merge_bases_many): report missing commits
Some functions in Git's source code follow the convention that returning
a negative value indicates a fatal error, e.g. repository corruption.

Let's use this convention in `repo_in_merge_bases()` to report when one
of the specified commits is missing (i.e. when `repo_parse_commit()`
reports an error).

Also adjust the callers of `repo_in_merge_bases()` to handle such
negative return values.

Note: As of this patch, errors are returned only if any of the specified
merge heads is missing. Over the course of the next patches, missing
commits will also be reported by the `paint_down_to_common()` function,
which is called by `repo_in_merge_bases_many()`, and those errors will
be properly propagated back to the caller at that stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-28 09:47:03 -08:00
Johannes Schindelin 207c40e1e4 commit-reach(repo_in_merge_bases_many): optionally expect missing commits
Currently this function treats unrelated commit histories the same way
as commit histories with missing commit objects.

Typically, missing commit objects constitute a corrupt repository,
though, and should be reported as such. The next commits will make it
so, but there is one exception: In `git fetch --update-shallow` we
_expect_ commit objects to be missing, and we do want to treat the
now-incomplete commit histories as unrelated.

To allow for that, let's introduce an additional parameter that is
passed to `repo_in_merge_bases_many()` to trigger this behavior, and use
it in the two callers in `shallow.c`.

This commit changes behavior slightly: unless called from the
`shallow.c` functions that set the `ignore_missing_commits` bit, any
non-existing tip commit that is passed to `repo_in_merge_bases_many()`
will now result in an error.

Note: When encountering missing commits while traversing the commit
history in search for merge bases, with this commit there won't be a
change in behavior just yet, their children will still be interpreted as
root commits. This bug will get fixed by follow-up commits.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-28 09:47:03 -08:00
Johannes Schindelin e67431d496 commit-reach(paint_down_to_common): plug two memory leaks
When a commit is missing, we return early (currently pretending that no
merge basis could be found in that case). At that stage, it is possible
that a merge base could have been found already, and added to the
`result`, which is now leaked.

The priority queue has a similar issue: There might still be a commit in
that queue.

Let's release both, to address the potential memory leaks.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-28 09:47:03 -08:00
Junio C Hamano f41f85c9ec Git 2.44-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-19 21:01:01 -08:00
Junio C Hamano 58aa645fc0 Merge branch 'la/trailer-cleanups'
Fix to an already-graduated topic.

* la/trailer-cleanups:
  trailer: fix comment/cut-line regression with opts->no_divider
2024-02-19 20:58:06 -08:00
Jeff King bc47139f4f trailer: fix comment/cut-line regression with opts->no_divider
Commit 97e9d0b78a (trailer: find the end of the log message, 2023-10-20)
combined two code paths for finding the end of the log message. For the
"no_divider" case, we used to use find_trailer_end(), and that has now
been rolled into find_end_of_log_message(). But there's a regression;
that function returns early when no_divider is set, returning the whole
string.

That's not how find_trailer_end() behaved. Although it did skip the
"---" processing (which is what "no_divider" is meant to do), we should
still respect ignored_log_message_bytes(), which covers things like
comments, "commit -v" cut lines, and so on.

The bug is actually in the interpret-trailers command, but the obvious
way to experience it is by running "commit -v" with a "--trailer"
option. The new trailer will be added at the end of the verbose diff,
rather than before it (and consequently will be ignored entirely, since
everything after the diff's intro scissors line is thrown away).

I've added two tests here: one for interpret-trailers directly, which
shows the bug via the parsing routines, and one for "commit -v".

The fix itself is pretty simple: instead of returning early, no_divider
just skips the "---" handling but still calls ignored_log_message_bytes().

Reported-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-19 19:06:18 -08:00
Junio C Hamano 96c8a0712e l10n-2.44.0-rnd3
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmXSpeoACgkQk24VDd1F
 MtX7RA/9HXk19TQPI/8YHL2Z29Yax2yPcgy+kq/UzXJ3YbNAsEBZyLwqfkv1bi6h
 S67Ggc0tmQdE0BDDAwG54+kzCUnRh6WFzHXyU0Mazena+7kxRuyCdmKNj9a9W7Jn
 2NLiS37a8KB83nlUn7coIrbFfs7P80J50Ax6oJFSPTEqZM8unNw/QEitufodaju2
 XdAbO8wofZZDn+i+HiCQnUT3loV8XxJdCk/ZM7RMtLRLzxKx78GsazLjkbYG1ci1
 4yAw3A6M+w1AvppplToZiH4JYvpMg7Box4tow0EKcYL5yOMk9tx2kVAbc26Mpm4Q
 IrADtuilhyHr8UI/VrD1frkNW+BByaE3WAJ2IgSzFmOv2eqe2aVtvkmga0DG1zyl
 P0ZGAKjfH0cSpEvuG16XGHYQjqp/ulWDedx9bdFJg2iFnjHj7F2DEubm08tUW7OG
 cNs6uYGTyfq9VLtvc4qIHFQNtMrUtnYETNK1Sn++11CYWoYpFzdUk75oEB8SkxYq
 JPn9xFbhzz5K9vKE1jAp1XIYLaKwD1up71VPCL6bhHyOwvgJ1RcWtbK+h58xqGAw
 n+w5epstdOGeKkmtrpYC1R6Y/ejckdk++/K8ml5owFeQ7u1l1zNsonpf9qtjnBLI
 utf3YmfkfBd767kAqfeqdcjV9+hLgpaegl8ElWChRLOushfhj18=
 =ZD+B
 -----END PGP SIGNATURE-----

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

l10n-2.44.0-rnd3

* tag 'l10n-2.44.0-rnd3' of https://github.com/git-l10n/git-po:
  l10n: zh_TW: Git 2.44
  l10n: zh_CN: for git 2.44 rounds
  l10n: Update German translation
  l10n: tr: Update Turkish translations for 2.44
  l10n: fr.po: v2.44.0 round 3
  l10n: bg.po: Updated Bulgarian translation (5610t)
  l10n: sv.po: Update Swedish translation
  l10n: Update Catalan translation
  l10n: po-id for 2.44 (round 1)
  l10n: ci: disable cache for setup-go to suppress warnings
  l10n: ci: remove unused param for add-pr-comment@v2
  l10n: uk: v2.44 update (round 3)
  l10n: uk: v2.44 update (round 2)
  l10n: uk: v2.44 localization update
  l10n: bump Actions versions in l10n.yml
2024-02-19 08:35:40 -08:00
Yi-Jyun Pan 5fdd5b989c
l10n: zh_TW: Git 2.44
Co-Authored-By: lumynou5 <lumynou5.tw@gmail.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2024-02-18 21:03:43 +08:00
Jiang Xin 63e81f22a6 Merge branch 'master' of github.com:ralfth/git
* 'master' of github.com:ralfth/git:
  l10n: Update German translation
2024-02-18 20:33:01 +08:00
Jiang Xin 9c4289b3db Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.44 (round 1)
2024-02-18 20:31:55 +08:00
Jiang Xin 3a00233815 Merge branch '2.44-uk-update' of github.com:arkid15r/git-ukrainian-l10n
* '2.44-uk-update' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: v2.44 update (round 3)
  l10n: uk: v2.44 update (round 2)
  l10n: uk: v2.44 localization update
2024-02-18 20:30:05 +08:00
Jiang Xin ce2f6a001f Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5610t)
2024-02-18 20:28:57 +08:00
Jiang Xin 499f952da0 Merge branch 'tr-l10n' of github.com:bitigchi/git-po
* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations for 2.44
2024-02-18 20:27:47 +08:00
Jiang Xin 45ebe3fcf6 Merge branch 'fr_2.44.0' of github.com:jnavila/git
* 'fr_2.44.0' of github.com:jnavila/git:
  l10n: fr.po: v2.44.0 round 3
2024-02-18 20:26:45 +08:00
Jiang Xin 61ad0f6484 Merge branch 'catalan-l10n' of github.com:Softcatala/git-po
* 'catalan-l10n' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2024-02-18 20:25:32 +08:00
Jiang Xin 362f27f8a8 Merge branch 'master' of github.com:nafmo/git-l10n-sv
* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation
2024-02-18 20:24:48 +08:00
Teng Long 3c58354a53 l10n: zh_CN: for git 2.44 rounds
In addition to the localized translation in 2.44, for zh_CN, we have
uniformly modified the translation of the word "commit-graph" to make it
more consistent with language usage habits.

Signed-off-by: Teng Long <dyroneteng@gmail.com>
2024-02-18 11:48:52 +08:00
Todd Zullinger d44a018852 RelNotes: minor typo fixes in 2.44.0 draft
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-17 10:11:55 -08:00
Ralf Thielow 37c2ad6535 l10n: Update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2024-02-17 18:14:54 +01:00
Emir SARI b927408183 l10n: tr: Update Turkish translations for 2.44
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2024-02-16 22:06:18 +03:00
Jean-Noël Avila 2675562081 l10n: fr.po: v2.44.0 round 3
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2024-02-16 19:20:07 +01:00
Alexander Shopov 330e4198b8 l10n: bg.po: Updated Bulgarian translation (5610t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2024-02-16 09:39:04 +01:00
Peter Krefting 20657a8b43 l10n: sv.po: Update Swedish translation
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2024-02-16 07:59:21 +01:00
Jordi Mas 6f5e31bec7 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2024-02-16 07:18:20 +01:00
Bagas Sanjaya c293cf8c47 l10n: po-id for 2.44 (round 1)
Update following components:

  * builtin/replay.c
  * command-list.h
  * commit-graph.c
  * pack-bitmap.c
  * sequencer.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2024-02-16 11:01:11 +07:00
Jiang Xin 1bb7fcbffc l10n: ci: disable cache for setup-go to suppress warnings
After we upgraded actions/setup-go to v5, the following warning message
was reported every time we ran the CI.

    Restore cache failed: Dependencies file is not found ...

Disable cache to suppress warning messages as described in the solution
below.

    https://github.com/actions/setup-go/issues/427

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2024-02-16 11:51:19 +08:00
Jiang Xin 4d733f09f0 l10n: ci: remove unused param for add-pr-comment@v2
When we upgraded GitHub Actions "mshick/add-pr-comment" to v2, the
following warning message was reported every time we ran the CI.

    Unexpected input(s) 'repo-token-user-login', valid inputs ...

Removed the obsolete parameter "repo-token-user-login" to suppress
warning messages.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2024-02-16 11:40:58 +08:00
Arkadii Yakovets a2e183e065
l10n: uk: v2.44 update (round 3)
Signed-off-by: Arkadii Yakovets <ark@cho.red>
2024-02-15 18:05:05 -08:00
Arkadii Yakovets 6ad5961c91
l10n: uk: v2.44 update (round 2)
Signed-off-by: Arkadii Yakovets <ark@cho.red>
2024-02-15 18:02:14 -08:00
Arkadii Yakovets ed8e89ec8c
l10n: uk: v2.44 localization update
Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
2024-02-15 18:02:13 -08:00
Jiang Xin c68ee9b9cc Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git:
  diff: mark param1 and param2 as placeholders
2024-02-16 09:39:06 +08:00
Junio C Hamano 3e0d3cd5c7 Merge branch 'jx/dirstat-parseopt-help'
The mark-up of diff options has been updated to help translators.

* jx/dirstat-parseopt-help:
  diff: mark param1 and param2 as placeholders
2024-02-15 15:14:48 -08:00
Jiang Xin f98643fcb2 Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (51 commits)
  Hopefully the last batch of fixes before 2.44 final
  Git 2.43.2
  A few more fixes before -rc1
  write-or-die: fix the polarity of GIT_FLUSH environment variable
  A few more topics before -rc1
  completion: add and use __git_compute_second_level_config_vars_for_section
  completion: add and use __git_compute_first_level_config_vars_for_section
  completion: complete 'submodule.*' config variables
  completion: add space after config variable names also in Bash 3
  receive-pack: use find_commit_header() in check_nonce()
  ci(linux32): add a note about Actions that must not be updated
  ci: bump remaining outdated Actions versions
  unit-tests: do show relative file paths on non-Windows, too
  receive-pack: use find_commit_header() in check_cert_push_options()
  prune: mark rebase autostash and orig-head as reachable
  sequencer: unset GIT_CHERRY_PICK_HELP for 'exec' commands
  ref-filter.c: sort formatted dates by byte value
  ssh signing: signal an error with a negative return value
  bisect: document command line arguments for "bisect start"
  bisect: document "terms" subcommand more fully
  ...
2024-02-15 09:48:25 +08:00
Junio C Hamano 4fc51f00ef Hopefully the last batch of fixes before 2.44 final
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-14 15:36:06 -08:00
Junio C Hamano 89400c3615 Merge branch 'pb/complete-config'
The command line completion script (in contrib/) learned to
complete configuration variable names better.

* pb/complete-config:
  completion: add and use __git_compute_second_level_config_vars_for_section
  completion: add and use __git_compute_first_level_config_vars_for_section
  completion: complete 'submodule.*' config variables
  completion: add space after config variable names also in Bash 3
2024-02-14 15:36:06 -08:00
Junio C Hamano c59ba68ea7 Merge branch 'js/check-null-from-read-object-file'
The code paths that call repo_read_object_file() have been
tightened to react to errors.

* js/check-null-from-read-object-file:
  Always check the return value of `repo_read_object_file()`
2024-02-14 15:36:06 -08:00
Junio C Hamano e864023188 Merge branch 'rs/receive-pack-remove-find-header'
Code simplification.

* rs/receive-pack-remove-find-header:
  receive-pack: use find_commit_header() in check_nonce()
  receive-pack: use find_commit_header() in check_cert_push_options()
2024-02-14 15:36:05 -08:00
Junio C Hamano c036a145c3 Merge branch 'vn/rebase-with-cherry-pick-authorship'
"git cherry-pick" invoked during "git rebase -i" session lost
the authorship information, which has been corrected.

* vn/rebase-with-cherry-pick-authorship:
  sequencer: unset GIT_CHERRY_PICK_HELP for 'exec' commands
2024-02-14 15:36:05 -08:00
Junio C Hamano 09e0aa64b3 Merge branch 'pw/gc-during-rebase'
The sequencer machinery does not use the ref API and instead
records names of certain objects it needs for its correct operation
in temporary files, which makes these objects susceptible to loss
by garbage collection.  These temporary files have been added as
starting points for reachability analysis to fix this.

* pw/gc-during-rebase:
  prune: mark rebase autostash and orig-head as reachable
2024-02-14 15:36:05 -08:00
Jiang Xin 5e7013aa14 diff: mark param1 and param2 as placeholders
Some l10n translators translated the parameters "files", "param1" and
"param2" in the following message:

    "synonym for --dirstat=files,param1,param2..."

Translating "param1" and "param2" is OK, but changing the parameter
"files" is wrong. The parameters that are not meant to be used verbatim
should be marked as placeholders, but the verbatim parameter not marked
as a placeholder should be left as is.

This change is a complement for commit 51e846e673 (doc: enforce
placeholders in documentation, 2023-12-25).

With the help of Jean-Noël,some parameter combinations in one
placeholder (e.g. "<param1,param2>...") are splited into seperate
placeholders.

Helped-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-14 09:29:10 -08:00
Junio C Hamano edae91a4cf Git 2.44-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13 15:12:53 -08:00
Junio C Hamano efb050becb Git 2.43.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13 14:44:51 -08:00
Junio C Hamano dc55772259 Merge branch 'pb/template-for-single-commit-pr' into maint-2.43
Doc update.

* pb/template-for-single-commit-pr:
  .github/PULL_REQUEST_TEMPLATE.md: add a note about single-commit PRs
2024-02-13 14:44:51 -08:00