Obscure VCS weirdness at BitBucket
I was curious to see what issues would be labeled “trivial” in the NixOS/nixpkgs tracker and found one where a user couldn’t fetch rev V 1.9.1
(with a space) from Bitbucket.
The repo with this rev has moved, and I couldn’t find another repo with space-containing tags. The issue author suggested creating my own repo so I dug out my old Bitbucket account from back when compas-rrc was hosted there.
I quickly found that there was no way to get git to create a tag, branch or even note with a space in it. Bitbucket’s REST API did not allow this either. I think the original tag was created with subversion, but I haven’t confirmed that.
However, creating a tag with URL encoded whitespace (%20
for space)—tag%20with%20spaces
—was possible, and if you use that in an URL you get a 404. You actually need tag%25%20with%25%20spaces
). See this repro repo.
So I did write a fix and a test for that, mostly motivated by the sunk cost fallacy. So feel free to create tags with URL encoded tags, and use fetchFromBitbucket
to fetch them ;).