Re: [PATCH 14/21] Convert ce_path_match() to use struct pathspec
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2010, 20:29 UTC
- Message-ID
- <7voc8ki1o3.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTinfzd8wOFTymVGeKH6cBg-6Ua6U+4N8x1TrQcHZ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 14 quoted lines
> On Fri, Dec 17, 2010 at 10:09 PM, Junio C Hamano <gitster@pobox.com> wrote: >> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes: >> >>>> I wonder if it makes more sense to change the type of revs->prune_data >>>> from an array of pointers to strings to a pointer to struct pathspec. >>>> Is there a downside? >>> >>> Converting a pointer to another pointer means mis typecasting can >>> happen and the compiler won't help catching them. >> >> You can rename the field at the same time, and the compiler will catch >> anything you forgot to touch, no? >> > Yes. I didn't think of that :(
And it would have an added benefit that it would catch new callsites somebody else added while being unaware of your conversion--the merge result will not compile.