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

Re: [PATCH 0/2] Make it easy to use branch --track on existing branch

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Jan 17, 2010, 14:40 UTC
Message-ID
<20100117144031.GA20335@Knoppix>
In-Reply-To
<1263737212-8101-1-git-send-email-Matthieu.Moy@imag.fr>
On Sun, Jan 17, 2010 at 03:06:50PM +0100, Matthieu Moy wrote:
> 
> The first patch makes it possible to use branch --track on an existing
> branch (checked-out or not, regardless of -f), and the second warns on
> a newly introduced irrelevant case.

Yay. This is one of smaller entries from my todo list (the remaining entry that's small enough to still make it into 1.7 is command to set URL remote points to[*]).

But If I read the patch correctly, you can't just arbitrarily set the tracking branch since the IDs must match. So if somebody screws the ref creation so that it lacks upstream data, then both local and upstream change. Push will fail. Pull will fail. And now neither checkout --track (due to same-hash check) nor push --set-upstream (due to pushed or up to date) help.

[*] Yes, I know you can edit .git/config, but I would want "official sounding" (read: git remote subcommand) command to edit it (and no, delete & recreate doesn't do the right thing).

-Ilari
Previous: Matthieu MoyNext: Matthieu Moy
Message 5 of 7 in “Make it easy to use branch --track on existing branch”
  1. 0/2 Make it easy to use branch --track on existing branchMatthieu Moy, Jan 17, 2010
  2. 1/2 branch: allow creating a branch with same name and same starting point.Matthieu Moy, Jan 17, 2010
  3. Junio C HamanoJan 17, 2010
  4. 2/2 branch: warn and refuse to set a branch as a tracking branch of itself.Matthieu Moy, Jan 17, 2010
  5. Ilari LiusvaaraJan 17, 2010
  6. Matthieu MoyJan 17, 2010
  7. Ilari LiusvaaraJan 17, 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.