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

Re: [PATCH 2/2] remote: "rename o foo" should not rename ref "origin/bar"

From
Jeff King <peff@peff.net>
Date
Sep 1, 2011, 02:46 UTC
Message-ID
<20110901024617.GD31838@sigill.intra.peff.net>
In-Reply-To
<1314841843-19868-2-git-send-email-martin.von.zweigbergk@gmail.com>
On Wed, Aug 31, 2011 at 09:50:43PM -0400, Martin von Zweigbergk wrote:
Show 5 quoted lines
> When renaming a remote called 'o' using 'git remote rename o foo', git
> should also rename any remote-tracking branches for the remote. This
> does happen, but any remote-tracking branches starting with
> 'refs/remotes/o', such as 'refs/remotes/origin/bar', will also be
> renamed (to 'refs/remotes/foorigin/bar' in this case).

To be totally correct, shouldn't this check each ref against the RHS of the remote's old refspec, and rename it according to the remote's new refspec?

Maybe that is just being pedantic, though. This should work fine with the default config[1].

-Peff
[1] Since this part of the renaming process obviously depends heavily on
    refs/remotes/$OLD being the naming convention, shouldn't the
    renaming of the refspecs do the same thing? I.e., it's another
    reason that your patch 1/2 should only tweak refs/remotes/$OLD.
    Otherwise you will get renamed refspecs, but the actual refs won't
    be moved.
Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 3 of 8 in “remote: write correct fetch spec when renaming remote 'remote'”
  1. 1/2 remote: write correct fetch spec when renaming remote 'remote'Martin von Zweigbergk, Sep 1, 2011
  2. 2/2 remote: "rename o foo" should not rename ref "origin/bar"Martin von Zweigbergk, Sep 1, 2011
  3. Jeff KingSep 1, 2011
  4. Martin von ZweigbergkSep 2, 2011
  5. Jeff KingSep 2, 2011
  6. Jeff KingSep 1, 2011
  7. Junio C HamanoSep 1, 2011
  8. Martin von ZweigbergkSep 2, 2011

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.