Re: [PATCH] Make git-clone respect branch.autosetuprebase

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

 



pknotz@xxxxxxxxxx writes:

> diff --git a/builtin-clone.c b/builtin-clone.c
> index c338910..f547267 100644
> --- a/builtin-clone.c
> +++ b/builtin-clone.c
> @@ -360,6 +360,14 @@ static void install_branch_config(const char *local,
>  	strbuf_reset(&key);
>  	strbuf_addf(&key, "branch.%s.merge", local);
>  	git_config_set(key.buf, remote);
> +	switch (autorebase) {
> +	case AUTOREBASE_REMOTE:
> +	case AUTOREBASE_ALWAYS:
> +		strbuf_reset(&key);
> +		strbuf_addf(&key, "branch.%s.rebase", local);
> +		git_config_set(key.buf, "true");
> +		printf("Default branch '%s' will rebase on pull.\n", local);
> +	}
>  	strbuf_release(&key);
>  }

I think this whole function should be moved to to branch.c to be usable
across "git checkout -b", "git branch" and "git clone", and make the two
existing callers in builtin-clone.c and setup_tracking() in branch.c call
it.  "git checkout -b" already shares the same codepath with "git branch",
and you would allow "git clone" to be in the family.  That would help
supporting new tracking options without having to maintain more than one
copy of the code.
--
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