Re: [PATCH v3 04/11] Prepare `paint_down_to_common()` for handling shallow commits
- From
Dirk Gouders <dirk@gouders.net>
- Date
- Feb 27, 2024, 14:46 UTC
- Message-ID
- <gha5nmnex4.fsf@gouders.net>
- In-Reply-To
- <84e7fbc07e08956e6c493baf499fee455887b16c.1709040499.git.gitgitgadget@gmail.com>
"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.
Show 6 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 newAgain, I'm not a native speaker but I understand the above as "There may not even be an existing `shallow` file...".
I'm not sure -- the sentence just "feels" uncomfortable to me.
Dirk