Re: [PATCH v3 04/11] Prepare `paint_down_to_common()` for handling shallow commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 27, 2024, 18:08 UTC
- Message-ID
- <xmqqcyshu6es.fsf@gitster.g>
- In-Reply-To
- <79914d16-f58d-7ab0-5c25-f29870a73402@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> Currently, that logic pretends that a commit whose parent > commit is missing is a root commit (and likewise merge commits > with missing parent commits are handled incorrectly, too). > However, for the purpose of `--update-shallow` that is exactly > what we need to do (and only then).
I suspect that what made it harder to follow in the original construct is that we called the behaviour "incorrect" upfront and then come back with "that incorrectness is what we want". I wonder if it makes it easier to follow by flipping them around.
For the purpose of `--update-shallow`, when some of the parent
commits of a commit are missing from the repository, we need to
treat as if the parents of the commit are only the ones that do
exist in the repository and these missing commits have no
ancestry relationship with it. If all its parent commits are
missing, the commit needs to be treated as if it were a root
commit. Add a flag to optionally ask for such a behaviour, while
detecting missing objects as a repository corruption error by
default ...or something?
Show 6 quoted lines
> Therefore [...] > > Better? > > Ciao, > Johannes