Re: [PATCH v7] describe: refresh the index when 'broken' flag is used
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jul 2, 2024, 10:13 UTC
- Message-ID
- <CAOLa=ZR-g4G0FaxnQjjkOST-zeRxBXXK1gpJ=P3xdbi_9eN_rg@mail.gmail.com>
- In-Reply-To
- <xmqqle2lvsmz.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes: > >> This explains for why 'broken' must use a subprocess, but there is >> nothing stopping 'dirty' from also using a subprocess, right? It >> currently uses an in-process index refresh but it _could_ be a >> subprocess too. > > Correct, except that it does not make sense to do any and all things > that you _could_ do. So...
Well, In this context, I think there is some merit though. There are two blocks of code `--broken` and `--dirty` one after the other which both need to refresh the index. With this patch, 'broken' will use a child process to do so while 'dirty' will use `refresh_index(...)`. To someone reading the code it would seem a bit confusing. I agree there is no merit in using a child process in 'dirty' by itself. But I also think we should leave a comment there for readers to understand the distinction.