On Mon, Nov 11, 2024 at 1:15 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > So if the caller wants to eventually run both, it has to spawn this > program twice, the first time with one option and the second time > with the other option? Somehow it feels a bit unsatisfying. If the > caller says "I want to run both classes", and if your safe/unsafe > classification system knows which task belongs to which class and > the classification system that unsafe ones should be run before safe > ones (or whatever), wouldn't it be easier to use for the caller to > be able to say "run both", and let your classification system take > care of the ordering? Yes this felt unsatisfactory to me as well for now. The issue is that, when invoked from maintenance, whether gc is detached or not is dependent on maintenance being detached or not. That is why in the commit message of the first patch, I left a "WIP: automatically run gc unsafe tasks when gc is invoked but not from maintenance". When I turn this into v1, however, I do intend on making this satisfactory.