Re: [PATCH v3 04/11] Prepare `paint_down_to_common()` for handling shallow commits
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 27, 2024, 15:00 UTC
- Message-ID
- <79914d16-f58d-7ab0-5c25-f29870a73402@gmx.de>
- In-Reply-To
- <gha5nmnex4.fsf@gouders.net>
Hi Dirk,
On Tue, 27 Feb 2024, Dirk Gouders wrote:
Show 9 quoted lines
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > Currently, that logic pretends that a missing parent commit is > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > equivalent to a missing parent commit, and for the purpose of > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > `--update-shallow` that is exactly what we need it to do. > > Chances are that I am wrong, but to me the above sounds very irritating.
Not only that, it's also wrong 😜
Show 9 quoted lines
> > Therefore, let's introduce a flag to indicate when that is precisely the
> > logic we want.
> >
> > We need a flag, and cannot rely on `is_repository_shallow()` to indicate
> > that situation, because that function would return 0: There may not
> > actually be a `shallow` file, as demonstrated e.g. by t5537.10 ("add new
>
> Again, I'm not a native speaker but I understand the above as
> "There may not even be an existing `shallow` file...".I'm not a native speaker either, but I'll give it a try anyway. How about this?
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).
Therefore [...]
Better?
Ciao, Johannes