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

[RFC] pull --set-upstream implementation

From
BOMPARD CORENTIN p1603631 <corentin.bompard@etu.univ-lyon1.fr>
Date
Feb 27, 2019, 14:05 UTC
Message-ID
<1551276325342.31383@etu.univ-lyon1.fr>

We are currently working on adding "--set-upstream <remote> <branch>" to pull, that will work like "push --set-upstream <remote> <branch>" The main usage should be "git pull --set-upstream <remote> <branch>" However:

* <branch> could be a refspec like "refs/heads/*"
* If there is an error such as invalid URL or unreachable host we don't want to edit the config

It makes more sense to us to implement the "--set-upstream" logic in git fetch which would let us test the remote and manage when called with a refspec. As a side effect: it will add the "--set-upstream" argument to fetch. Essentialy we see 3 options:

1- add the "--set-upstream" argument directly in builtin/pull.c it will make it harder to parse the refspec and test the remote
2- add the "--set-upstream" as a visible argument of fetch as fetch --set-upstream could be useful
3- add the "--set-upstream" as a hidden argument of fetch
Option 2 seems the best choice to us, any suggestion? 
Thanks in advance.
Corentin BOMPARD, Nathan BERBEZIER, Pablo CHABANNE.
    
Message 1 of 1 in “[RFC] pull --set-upstream implementation”
  1. BOMPARD CORENTIN p1603631Feb 27, 2019

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.