Active
Project:
Google Fonts
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2012 at 06:51 UTC
Updated:
15 Mar 2012 at 21:19 UTC
This project's repository contains both a 7.x-2.x branch and a 7.x-2.x tag.
7.x-2.x is an invalid name for a tag. This tag should be deleted.
Branch and tag naming standards:
http://drupal.org/node/1015226
Instructions for deleting tags:
http://drupal.org/node/1066342
Comments
Comment #1
sreynen commentedIs the tag actually causing a problem or does it just look wrong? http://drupal.org/node/1015226 mentions limitations on release tags, but I'm not aware of any restrictions on tags in general.
Comment #2
tr commentedA little background as to how I found this:
I wrote a script to download the repository and checkout the highest-version minor branch of each project for D7. Because the script can't know ahead of time what branches exist, it has to do a
git clone http://git.drupal.org/projects/project_name.git, then agit branch -a, then parse the branch names andgit checkout branchname. If a tag has the same name as the branch, this results in a checkout of the *tag* instead of the branch.Git doesn't prevent this, but in general you can get into big trouble if you name branches and tags the same. Different git commands make different assumptions about what you mean when you use "7.x-2.x" to identify the object. There's no ambiguity if you always refer to the tag as refs/tags/7.x-2.x and always refer to the branch as refs/heads/7.x-2.x, but in practice what everyone does is something like
git checkout 7.x-2.x, which will give you the *tag* 7.x-2.x instead of the branch.Following the examples in the "Version control" tab:
Now you're on *branch* 7.x-2.x. But try
git checkout 7.x-2.xand not only will you get a warning:But if you now type
git statusyou will see:git diff --stagedshows you that the checkout has put you onto the *tag* 7.x-2.x, even thoughgit statusis telling you you're on the *branch* 7.x-2.x.If however we checkout the project a different way, and instead of
git clone --branchwe just do:Now we will be left on *tag* 7.x-2.x instead of *branch* 7.x-2.x.
Fixing this situation by renaming the tag can be a problem too, because it's ambiguous what you're trying to rename ...
So while you may be technically correct that Drupal doesn't impose standards on the naming of non-release branches or tags, I think having branches and tags with the same name is a very very bad idea. While the project owner might be fully aware of the situation and how to deal with the ambiguity(*), others who check out this project will be blissfully UNaware until it bites them hard.
(*) In practice, I think having a branch and tag with the same name is the result of an *error* by the project owner, in which case even the project owner might now be aware of the situation. I don't think anyone *intentionally* does this, especially if they have ever had to deal with some of the problems it causes.