Re: [PATCH v4] revision: add `--ignore-missing-links` user option
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Sep 24, 2023, 16:14 UTC
- Message-ID
- <CAOLa=ZThB0DrRKg98tr7JLu8yPRyDXe_ngkpS3ZfesHQ-f1DLg@mail.gmail.com>
- In-Reply-To
- <xmqq5y435obx.fsf@gitster.g>
On Thu, Sep 21, 2023 at 9:16 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> > Karthik Nayak <karthik.188@gmail.com> writes: > > > I was thinking about this, but mostly didn't do this, because the > > interaction with `--missing` is only for non-commit > > objects. Because for missing commits, `--ignore-missing-links` > > skips the commit and the value of `--missing` doesn't make any > > difference. > > Hmph, somehow that smells like an existing bug. So does the "trees > are not shown by --missing=print, and show_object() is never called > for missing objects unless they are blobs" you mention. When the > user asks "instead of dying, list them so that I can ask around and > fetch them to repair this repository", shouldn't we do just that? > > I wonder if these bugs are something people may be taking advatage > of and cannot be fixed retroactively? If we can fix these and nobody > complains, that would give us the ideal outcome, I would think. >
Let me prefix with saying that I was partly wrong. `--missing` does work for trees, only that it's ineffective when used along with the `ignore_missing_links` bit.
But for commits, `--missing` was never configured to work with. I did a quick look at the code, we can do something like this for commits too, i.e. add support for the `--missing` option. We'll have to add a new flag (maybe MISSING) so it can be set during within `repo_parse_commit_gently` so we can parse this as a missing object in rev-list.c and act accordingly.
It would invalidate this patch series in some sense. But I'm okay with that. Does that sound good to you?