Re: [PATCH 2] Add default merge options for all branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/2/11 6:36 PM, Junio C Hamano wrote:
> Michael Grubb <devel@xxxxxxxxxxxxx> writes:
> 
>> diff --git a/builtin/merge.c b/builtin/merge.c
>> index 0bdd19a..9e5b6bd 100644
>> --- a/builtin/merge.c
>> +++ b/builtin/merge.c
>> @@ -505,9 +505,18 @@ cleanup:
>>  
>>  static int git_merge_config(const char *k, const char *v, void *cb)
>>  {
>> -	if (branch && !prefixcmp(k, "branch.") &&
>> -		!prefixcmp(k + 7, branch) &&
>> -		!strcmp(k + 7 + strlen(branch), ".mergeoptions")) {
>> +	static int branch_merge_options_set = 0;
> 
> I prefer to avoid "static int" that you cannot easily clear here.  It
> would make it impossible to call the function twice.
>
> I think it is easily doable by using the callback parameter (cb).
>
Too right.  I've reworked that bit to use the cb parameter.  With an eye
to the future I've created a new struct for this for future's sake, so
that this one feature doesn't monopolize the cb parameter in the future.
 
> I am also wondering how this will scale, both in the direction of "later
> it is likely that we would want to support a glob not just '*' here", and
> also "later it is likely that we would want to support other per-branch
> variables, not just "mergeoptions" here".
It seems that the easiest way would be to move this particular feature out into
it's own function at some point to pave the way for doing more complex things with
the branch configurations.

New patch forthcoming.

> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]