Re: [PATCH 3/6] Teach clone to set remote.default.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 3/6] Teach clone to set remote.default.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:13

marcnarc@xiplink.com writes:
quoted hunk
From: Marc Branchaud <redacted>

Signed-off-by: Marc Branchaud <redacted>
---
 builtin/clone.c          |  2 ++
 t/t5601-clone.sh         | 10 ++++++++++
 t/t5702-clone-options.sh |  7 +++++--
 3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index a4d8d25..b198456 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -770,6 +770,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	git_config_set(key.buf, repo);
 	strbuf_reset(&key);
 
+	git_config_set("remote.default", option_origin);
+
Is this something we would want to do unconditionally?  If so why?

Or is this what we want to do only when the "--origin name" option
is used?

Re: [PATCH 3/6] Teach clone to set remote.default.

From: Marc Branchaud <hidden>
Date: 2016-06-15 22:54:13

On 12-07-05 06:52 PM, Junio C Hamano wrote:
marcnarc@xiplink.com writes:
quoted
From: Marc Branchaud <redacted>

Signed-off-by: Marc Branchaud <redacted>
---
 builtin/clone.c          |  2 ++
 t/t5601-clone.sh         | 10 ++++++++++
 t/t5702-clone-options.sh |  7 +++++--
 3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index a4d8d25..b198456 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -770,6 +770,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	git_config_set(key.buf, repo);
 	strbuf_reset(&key);
 
+	git_config_set("remote.default", option_origin);
+
Is this something we would want to do unconditionally?  If so why?
I think so, yes.
Or is this what we want to do only when the "--origin name" option
is used?
If remote.default isn't set, then if someone does
		git remote rename origin foo
the default remote will still be "origin" (modulo the currently-checked-out
branch stuff).

		M.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help