git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 3, 2009, 18:48 UTC
Message-ID
<7v4oyabfyk.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1236105352-21335-1-git-send-email-pknotz@sandia.gov>
pknotz@sandia.gov writes:
Show 18 quoted lines
> 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.

Previous: pknotz@sandia.gov
Message 2 of 2 in “Make git-clone respect branch.autosetuprebase”
  1. Make git-clone respect branch.autosetuprebasepknotz@sandia.gov, Mar 3, 2009
  2. Junio C HamanoMar 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.