From: Junio C Hamano <gitster@pobox.com>
To: pknotz@sandia.gov
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make git-clone respect branch.autosetuprebase
Date: Tue, 03 Mar 2009 10:48:19 -0800 [thread overview]
Message-ID: <7v4oyabfyk.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1236105352-21335-1-git-send-email-pknotz@sandia.gov> (pknotz@sandia.gov's message of "Tue, 3 Mar 2009 11:35:52 -0700")
pknotz@sandia.gov 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.
prev parent reply other threads:[~2009-03-03 18:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 18:35 [PATCH] Make git-clone respect branch.autosetuprebase pknotz
2009-03-03 18:48 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v4oyabfyk.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pknotz@sandia.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox