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

Re: [PATCH 1/2] Add branch --set-upstream

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jan 19, 2010, 07:22 UTC
Message-ID
<vpqy6juy2x9.fsf@bauges.imag.fr>
In-Reply-To
<1263847452-29634-2-git-send-email-ilari.liusvaara@elisanet.fi>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> writes:
Show 6 quoted lines
> Add --set-upstream option to branch that works like --track, except that
> when branch exists already, its upstream info is changed without changing
> the ref value.
>
> Based-on-patch-from: Matthieu Moy <Matthieu.Moy@imag.fr>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>

I'm short on Git time budget, so I happily let you take over on this patch.

I'm a bit worried about the vocabulary: my understanding is that "--track" is considered confusing, and should have been called "--set-upstream" since the beginning.

With your patch, we have both --set-upstream and --track, with different meanings. Should we consider --track as semi-deprecated, and --set-upstream as "--track done right"? If so, you can consider squashing this to promote your option instead of --track, and perhaps reword git-branch.txt so that --track says it does like --set-upstream, and not the other way around.

diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index b169836..4c66f19 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -2114,12 +2114,12 @@ linkgit:git-fetch[1] to keep them up-to-date; see
 
 Now create the branches in which you are going to work; these start out
 at the current tip of origin/master branch, and should be set up (using
-the --track option to linkgit:git-branch[1]) to merge changes in from
+the --set-upstream option to linkgit:git-branch[1]) to merge changes in from
 Linus by default.
 
 -------------------------------------------------
-$ git branch --track test origin/master
-$ git branch --track release origin/master
+$ git branch --set-upstream test origin/master
+$ git branch --set-upstream release origin/master
 -------------------------------------------------
 
 These can be easily kept up to date using linkgit:git-pull[1].
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ilari LiusvaaraNext: Ilari Liusvaara
Message 3 of 4 in “Branch --set-upstream”
  1. 0/2 Branch --set-upstreamIlari Liusvaara, Jan 18, 2010
  2. 1/2 Add branch --set-upstreamIlari Liusvaara, Jan 18, 2010
  3. Matthieu MoyJan 19, 2010
  4. 2/2 branch: warn and refuse to set a branch as a tracking branch of itself.Ilari Liusvaara, Jan 18, 2010

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.