~sircmpwn/sr.ht-discuss

4 3

git.sr.ht is confused over no "master" branch

Details
Message ID
<20200714002348.a7d5515eb385d3865956a954@disroot.org>
DKIM signature
pass
Download raw message
I created a brand new repository using the branch name "main" instead
of "master". Everything seemed to be going fine when I sent it to
sourcehut. I could see all the files online.

However, when I tried to set its README file as the README for a
project, viewing the project page would actually show a blank space
where the README should be. Other repos which only had the branch
"master" would show up fine, but not this one which only had the
branch "main".

I renamed the branch using from "main" to "master" using `git branch
-m` and pushed it, so remote now has both "master" and "main" for the
repo. The correct README instantly appeared on the project.

I then renamed my local branch from "master" back to "main", set its
upstream, and then attempted to delete the remote "master" branch with
`git push origin :master`. This normally works, however I encountered
this error, and cannot delete the "master" branch:

remote: error: By default, deleting the current branch is denied,
because the next remote: 'git clone' won't result in any file checked
out, causing confusion. remote: 
remote: You can set 'receive.denyDeleteCurrent' configuration variable
to remote: 'warn' or 'ignore' in the remote repository to allow
deleting the remote: current branch, with or without a warning message.
remote: 
remote: To squelch this message, you can set it to 'refuse'.
remote: error: refusing to delete the current branch: refs/heads/master

Looks like a problem with sourcehut. I'm not sure if this is the right
place to post bug reports, but other people seem to be posting their
annoyances here, so I assume I'm in the right place.
Details
Message ID
<C45IJPLIAITN.2HJPLWG1R51W3@homura>
In-Reply-To
<20200714002348.a7d5515eb385d3865956a954@disroot.org> (view parent)
DKIM signature
pass
Download raw message
We don't presently support naming your primary branch anything other
than "master".
Details
Message ID
<20200714010619.57b80051cce6cf20f5f5c591@disroot.org>
In-Reply-To
<C45IJPLIAITN.2HJPLWG1R51W3@homura> (view parent)
DKIM signature
pass
Download raw message
Okay, thanks for the reply. I'll keep that in mind when I create repos
in future.
Details
Message ID
<20200805222946.fwxdmz5fwaagzyw4@tarta.local.nabijaczleweli.xyz>
In-Reply-To
<20200714010619.57b80051cce6cf20f5f5c591@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Hi Cadence!

As of git.sr.ht 0.55.0, so roughly yesterday, any branch name is
first-class-supported as being the default, and you can change it
either on the settings page, or semi-automagically by removing
the current default branch and pushing another in one fell swoop:

  git push origin :master HEAD:trunk

Best,
наб

Please keep me in CC as I'm not subscribed.
Details
Message ID
<de175efa-2fea-4c24-8ee8-e8b8eef32310@disroot.org>
In-Reply-To
<20200805222946.fwxdmz5fwaagzyw4@tarta.local.nabijaczleweli.xyz> (view parent)
DKIM signature
pass
Download raw message
Whoa, okay, awesome! I will definitely have to try this out. Thanks!

-- Cadence
Export thread (mbox)