Re: [PATCH] http: add_fill_function checks if function has been added
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 7, 2009, 21:49 UTC
- Message-ID
- <7vd4ctm29m.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <be6fef0d0903071249s42ac7f94o82461ca32dcdfcd5@mail.gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
Show 6 quoted lines
> Calling a fill function repeatedly won't break behaviour, because fill > functions (those that are currently defined in git) are designed to be > called repeatedly. But it's just useless to call the same fill > function repeatedly without any reason. > > So should I still address the "THIS and THAT breakages"?
Your above explanation is good, but it was given after I asked ;-). Making unnecessary call repeatedly counts as a breakage your patch fixes, right?
I didn't look at the callers of add_fill_function(), but "fill" takes a callback data and different invocation of add_fill_function() could be passing different callback data. In such a case, doesn't it feel wrong to omit the "duplicated" calls to register the fill callback? Your patch makes me suspect that it _might_ be better to fix the callers not to call the function repeatedly when they know they only want one-shot invocation.