Re: [PATCH v2 2/5] pack-objects: refactor `read_packs_list_from_stdin()` to use `strmap`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 27, 2026, 15:52 UTC
- Message-ID
- <xmqqzf3tmfqf.fsf@gitster.g>
- In-Reply-To
- <acWz48NfB+dlbHAz@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 14 quoted lines
>> If these STDIN_PACK_* constants would ever appear _only_ within the >> context of talking about the .kind member of the stdin_pack_info >> struct and cannot possibly appear anywhere else, then there is no >> point naming the enum. > > Yup, I agree. I'm inclined to leave the enum anonymous for now, since > the only place we would need a name for it is the suggestion Stolee made > above, which I think does not correctly handle an edge case where packs > are specified multiple times. > > As it is currently, the enum is only used in the context of the .kind > member of the stdin_pack_info struct, and we don't ever declare a > int/unsigned variable to hold the kind outside of that context (which > would be gross ;-)).
"As it is currently" is vastly different from "cannot possibly appear", though ;-)