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

Re: [PATCHv2 1/2] remote: write correct fetch spec when renaming remote 'remote'

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2011, 03:43 UTC
Message-ID
<7vzkifzol6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.2.00.1109062136350.12564@debian>
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
> same pattern both when updating refspecs and when renaming refs. Of
> course, we can never be certain that a ref "refs/remotes/origin/foo"
> is really related to the remote called "origin". The user could have
> simply created the ref manually. Is that what you are getting at?

You have two separate and independent code that are not linked together but should logically be.

One updates fetch refspec whose RHS is "refs/remotes/$OLD/<anything>" to "refs/remotes/$NEW/<the same thing>". If you do not find any such fetch refspec, then you do not update these configuration variables, which is good.

Later in the same mv() function, the other one renames refs/remotes/$OLD/ to refs/remotes/$NEW/, even when you did not find any fetch refspec that stores under "refs/remotes/$OLD/<anything>" in the earlier logic.

Now, these actual refs may have been placed manually by the user. They may have been placed by an old config that the user may have edited. You simply do not know.

But you know one thing. You _do_ know is that these refs did _not_ come from any "[remote "$OLD"] fetch = ..." configuration, and by inference, it will not come from any "[remote "$NEW"] fetch = ...", in other words, they do not have any relation with the "$NEW" remote. So I do not see a good reason to move them from refs/remotes/$OLD/ to refs/remotes/$NEW/. That was what I was pointing out.

Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 7 of 10 in “[PATCHv2 1/2] remote: write correct fetch spec when renaming remote 'remote'”
  1. Martin von ZweigbergkSep 2, 2011
  2. 2/2 remote: "rename o foo" should not rename ref "origin/bar"Martin von Zweigbergk, Sep 2, 2011
  3. Jeff KingSep 2, 2011
  4. 3/2 remote rename: warn when refspec was not updatedMartin von Zweigbergk, Sep 3, 2011
  5. Junio C HamanoSep 6, 2011
  6. Martin von ZweigbergkSep 8, 2011
  7. Junio C HamanoSep 8, 2011
  8. Martin von ZweigbergkSep 8, 2011
  9. Junio C HamanoSep 8, 2011
  10. 4/2 remote: only update remote-tracking branch if updating refspecMartin von Zweigbergk, Sep 10, 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.