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

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

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Jul 6, 2012, 14:37 UTC
Message-ID
<4FF6F811.7000808@xiplink.com>
In-Reply-To
<7vzk7dq0qk.fsf@alter.siamese.dyndns.org>
On 12-07-05 06:52 PM, Junio C Hamano wrote:
Show 23 quoted lines
> marcnarc@xiplink.com writes:
> 
>> From: Marc Branchaud <marcnarc@xiplink.com>
>>
>> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
>> ---
>>  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.
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 18 in “Default remote”
  1. 0/6 Default remotemarcnarc@xiplink.com, Jul 5, 2012
  2. 1/6 Rename remote.c's default_remote_name static variables.marcnarc@xiplink.com, Jul 5, 2012
  3. 2/6 Teach remote.c about the remote.default configuration setting.marcnarc@xiplink.com, Jul 5, 2012
  4. Junio C HamanoJul 5, 2012
  5. Marc BranchaudJul 6, 2012
  6. Junio C HamanoJul 6, 2012
  7. Marc BranchaudJul 6, 2012
  8. 3/6 Teach clone to set remote.default.marcnarc@xiplink.com, Jul 5, 2012
  9. Junio C HamanoJul 5, 2012
  10. Marc BranchaudJul 6, 2012
  11. Junio C HamanoJul 6, 2012
  12. Marc BranchaudJul 6, 2012
  13. Marc BranchaudJul 6, 2012
  14. 4/6 Teach "git remote" about remote.default.marcnarc@xiplink.com, Jul 5, 2012
  15. Phil HordJul 6, 2012
  16. Marc BranchaudJul 6, 2012
  17. 5/6 Test that plain "git fetch" uses remote.default when on a detached HEAD.marcnarc@xiplink.com, Jul 5, 2012
  18. 6/6 Teach get_default_remote to respect remote.default.marcnarc@xiplink.com, Jul 5, 2012

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.