{"thread":{"id":"56082","subject":"git checkout -b refs/master origin/master","startedAt":"2021-07-09T12:48:34Z","lastAt":"2021-07-09T14:56:32Z","messageCount":2,"participants":["Martin","Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"429540","messageId":"71d3662c-411b-88aa-5cfc-b2f86a067507@mfriebe.de","threadId":"56082","inReplyTo":null,"subject":"git checkout -b refs/master origin/master","fromName":"Martin","fromEmail":"me@mfriebe.de","sentAt":"2021-07-09T12:40:29Z","receivedAt":"2021-07-09T12:48:34Z","isPatch":false,"sender":{"key":"me@mfriebe.de","avatar":null},"body":"Just curious..\n\n\"refs/master\" is allowed as local branch name (git checkout / git branch \n/ git switch)\n\nIs that intentionally allowed?\n\n  git for-each-ref\n6faf346455d0a024cb1edf2d64fc4c42b450c53d commit refs/heads/refs/master\n\n  git for-each-ref --format=\"ref=%(refname)\"\nref=refs/heads/refs/master\n\nEspecially the effect on\ngit for-each-ref --format=\"ref=%(refname:lstrip=-1)\"\nmaster\n\nYou only get part of the branch name.\nBecause \"lstrip\" does not distinguish between the / as separator in the \nrefs, and the \"/\" as part of the name.\n"},{"id":"429549","messageId":"60e8639b87a83_226420859@natae.notmuch","threadId":"56082","inReplyTo":"71d3662c-411b-88aa-5cfc-b2f86a067507@mfriebe.de","subject":"RE: git checkout -b refs/master origin/master","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-09T14:56:27Z","receivedAt":"2021-07-09T14:56:32Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Martin wrote:\n> Especially the effect on\n> git for-each-ref --format=\"ref=%(refname:lstrip=-1)\"\n> master\n\nIt's probably better to do refname:lstrip=2.\n\n> You only get part of the branch name.\n> Because \"lstrip\" does not distinguish between the / as separator in the \n> refs, and the \"/\" as part of the name.\n\nThat shouldn't matter. I use 'fc/area/topic' as names of my branches,\nand I know Junio uses similar names: '<contributor>/topic'.\n\n-- \nFelipe Contreras\n"}]}