Lurking in #Drupal-gitsupport, I've noticed several people who apparently have created branches (not tags, branches), named 7.x-1.0 (or similar). While that is the only supported format for *tags*, it is meaningless for a branch. Although we currently allow any branch name, branch names that are named the same as tags cause Git, and therefore users, to become all sorts of confused when they can't check out what they mean to check out.
While we cannot prevent people from making that mistake locally, we could add a push validation hook (or whatever that's called) to not allow people to push a branch that matches the magic format for supported tags. That has two advantages:
1) It tells people right away that they just did something that is going to bite them in the butt later, and it is a very clear place to provide instructions on what to do instead and how to recover from it.
2) It keeps the confusing branch name from getting onto the server, where cleaning it up later is more difficult. (The syntax to delete a remote branch in git is totally weird and non-intuitive.)
While we can still allow "any" branch name, we should at least blacklist those that we know for a fact are going to cause a problem and turn it into a "teachable moment".
Comments
Comment #1
rfayAgreed - important to do. Crell's approach is the most obvious way to deal with this problem.
Comment #2
eliza411 commentedThis makes a lot of sense to me. Since this validation happens on push, does this fall into your territory, chizu?
Comment #3
chizu commentedTook a stab at this on the weekend, should have a patch sorted out soon.
Comment #4
chizu commentedI don't actually have as much time for this as I thought.