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

Re: Renaming the "master" branch without breaking existing clones

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Aug 3, 2020, 18:20 UTC
Message-ID
<c014fe87-9663-3ff4-9527-bf60ff30d0d9@gmail.com>
In-Reply-To
<xmqqlfivwvtw.fsf@gitster.c.googlers.com>
On 03-08-2020 21:44, Junio C Hamano wrote:
Show 21 quoted lines
> 
> If we wanted to do this properly, I'd imagine we'd need to add a
> mechanism for repositories to convey "this branch that used to exist
> got renamed to this other name", not specifically for any "special"
> branch name (like 'master').  If we plan to never allow reusing the
> old and banned name, it probably is enough to turn the old name into
> a symbolic ref that points at the new name, e.g. in my repository
> 
>     $ git update-ref refs/heads/seen refs/heads/pu
>     $ git update-ref -d refs/heads/pu
>     $ git symbolic-ref refs/heads/pu refs/heads/seen
> 
> which would create a symbolic reference 'pu' that points at 'seen'
> to say "pu used to exist but it is now seen".
> 
> But that would not work well, as we must allow reusing the old name,
> as the primary point of renaming 'pu' to 'seen' in this project was
> so that we can accept topics from contributors whose anglicized name
> has 'p' and 'u' in capital letters as pu/$topicname branches.  Having
> a symbolic ref 'pu' would defeat that plan.
> 

Of course. Though, having a symbolic ref of 'pu/seen' to 'seen' would hopefully not defeat the plan while being a little helpful ;)

Sharing a thing that just crossed my mind while reading this.
-- 
Sivaraam
Previous: Matt McCutchenNext: Junio C Hamano
Message 15 of 17 in “Renaming the "master" branch without breaking existing clones”
  1. Matt McCutchenAug 3, 2020
  2. Taylor BlauAug 3, 2020
  3. Junio C HamanoAug 3, 2020
  4. Taylor BlauAug 3, 2020
  5. Jeff KingAug 3, 2020
  6. Junio C HamanoAug 3, 2020
  7. Jeff KingAug 3, 2020
  8. Junio C HamanoAug 3, 2020
  9. Jeff KingAug 3, 2020
  10. Junio C HamanoAug 3, 2020
  11. Matt McCutchenAug 4, 2020
  12. Matt McCutchenAug 4, 2020
  13. Junio C HamanoAug 3, 2020
  14. Matt McCutchenAug 3, 2020
  15. Kaartic SivaraamAug 3, 2020
  16. Junio C HamanoAug 3, 2020
  17. Kaartic SivaraamAug 4, 2020

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.