Re: [PATCH] branch: optionally setup branch.*.merge from upstream local branches

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

 



Hi,

On Mon, 18 Feb 2008, Jay Soffian wrote:

> diff --git a/branch.h b/branch.h
> index d30abe0..771d6ce 100644
> --- a/branch.h
> +++ b/branch.h
> @@ -1,6 +1,12 @@
>  #ifndef BRANCH_H
>  #define BRANCH_H
>  
> +enum branch_track {
> +	BRANCH_TRACK_FALSE = 0,
> +	BRANCH_TRACK_TRUE = 1,

BRANCH_TRACK_REMOTES would be a better name here.  And you do not need the 
"= 1" and "= 2".

> +	BRANCH_TRACK_ALWAYS = 2,
> +};
> +
>  /* Functions for acting on the information about branches. */
>  
>  /*
> diff --git a/builtin-branch.c b/builtin-branch.c
> index 5094e0d..231bff4 100644
> --- a/builtin-branch.c
> +++ b/builtin-branch.c
> @@ -30,7 +30,7 @@ static const char * const builtin_branch_usage[] = {
>  static const char *head;
>  static unsigned char head_sha1[20];
>  
> -static int branch_track = 1;
> +static enum branch_track branch_track = BRANCH_TRACK_FALSE;

That is a clear regression.

> @@ -77,6 +77,10 @@ static int git_branch_config(const char *var, const char *value)
>  		return 0;
>  	}
>  	if (!strcmp(var, "branch.autosetupmerge")) {
> +		if (value && !strcasecmp(value, "always")) {
> +			branch_track = BRANCH_TRACK_ALWAYS;
> +			return 0;
> +		}
>  		branch_track = git_config_bool(var, value);
>  		return 0;
>  	}

You have this in builtin-branch.c and builtin-checkout.c.  Duplicated 
code.  IMHO it is time to move this into the git_default_config() function 
(with "branch_track" being renamed to "git_branch_track", and moved to 
environment.c).

Personally, I have no problem with typing "git merge <branch>" in your 
workflow.  I would even avoid saying "git pull" for obviously-local 
branches, because I would have forgotten which branch it tracked 
originally.

But hey, if you really want to... ;-)

Ciao,
Dscho

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

  Powered by Linux