Re: [PATCH 4/4] clone: allow configurable default for `-o`/`--origin`

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

 



Derrick Stolee <stolee@xxxxxxxxx> writes:
> >  static char *option_origin = NULL;
> > +static char *remote_name = "origin";
> 
> This patch could have used a prep patch that had all consumers
> of option_origin use remote_name instead, with this adjustment
> to the way to use option_origin:
>   
> > -	if (!option_origin)
> > -		option_origin = "origin";
> > +	if (option_origin)
> > +		remote_name = option_origin;
> > +	else
> > +		remote_name = "origin";
>   
> Then this patch introducing the config option would have a
> very limited change in the builtin consisting of these two
> hunks:
> 
> >  static int git_clone_config(const char *k, const char *v, void *cb)
> >  {
> > +	if (!strcmp(k, "clone.defaultremotename") && !option_origin)
> > +		remote_name = xstrdup(v);
> >  	return git_default_config(k, v, cb);
> >  }
> ...
> >  	if (option_origin)
> >  		remote_name = option_origin;
> > -	else
> > -		remote_name = "origin"

That's a great idea!  Implemented for v2 :)

Sean



[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]

  Powered by Linux