Checking out branches/tags needs clarification

The #fragment part of the VCS source URL has a different meaning for each type of VCS.
This can be confusing for people, especially when they are trying to checkout a specific branch or tag.
Examples would reduce the chance for confusion a lot.

fictional examples for git and svn (don't have experience with bzr or HG)

More on git pkgver()'s

so they are more friendly to vercmp.
Current behaviour using git-git as an example:

current ver: 1.8.2.210.g123abc-1
next ver: 1.8.2.1.50.g123abc-1

vercmp 1.8.2.210.g123abc 1.8.2.1.50.g123abc
1 # the first is greater than the second

Right now, the current version is actually greater than the new version, causing a downgrade. If r is appended to the patch level (the numbers just before the g<hex> bit), then vercmp would order the versions correctly.

current ver: 1.8.2.r210.g123abc-1
next ver: 1.8.2.1.r50.g123abc-1

vercmp 1.8.2.r210.g123abc 1.8.2.1.r50.g123abc
-1 # the first is less than the second

Clarifying the first Git function

Instead of just sed 's|-|.|g' it'd probably be better to give some example with cut (which you're probably gonna end up using anyway) and tr (which is simpler than sed). Then you could either explain it like this or just mention the man pages: "cut -d "-" -f2- cuts from the first hyphen (-) to the end, tr - . converts hyphens to dots (.) and tr -d - removes the hyphens".

Also the output should be something like 2.0.6.a17a017 to include the $(git rev-parse --short HEAD) part for clarification.

Did you test this before posting? It doesn't do anything like you think it does. Scimmia (talk) 22:29, 4 May 2013 (UTC)

Well, my friend, that's what makes it an example. The reason I'm using cut is to remove the actual project names that are often included in their tags. All the sed example does is change the hyphens (-) to dots (.), which is simpler to do with tr - . anyway.

What _makes_ it so hard is that there isn't a single solution that somehow magicly worked on all scenarios. Even if you decided to be clever and started cutting the output up until the first number (with something like $ sed 's/\([^0-9]*\)\(.*\)/\2/g'), you'd still end up with the wrong result whenever the "version" starts with a letter or the project name ends with a number.

Ah, I see now, you were addressing a special case. You're right, there isn't a single solution. You're also right that tr is simpler and should probably be used in the example if that's all the example is going to show. It seems to be fairly common, though, to include a "v" at the beginning of the version number, in which case you'd already be using sed anyway so you can just do sed 's/^v//;s/-/./g' So many ways of doing the same job. Scimmia (talk) 02:15, 8 May 2013 (UTC)

That only works when they do. It doesn't remove the names from the tags, which are included in things like Wine and the entire X stack.

git describe --always | sed 's/\([^0-9]*\)\(.*\)/\2/g; s/-/./g' is the most universal approach I can think of. But it's unreadable and a lot harder to edit than some cut/tr combination.

Edit or remove "Removing VCS leftovers" section

This section is meant for people who look in $pkgdir and see that the .git or .svn dir is there for some reason. What's actually happening is that people are adding it to their PKGBUILDs for no reason at all, not realizing what it's for. Honestly, has anyone seen an installer that installs the VCS dir? IMO, this section should just be removed, but if it needs to be kept, it should be clarified somehow so that people realize that it only needs to be used in very rare circumstances.
Scimmia (talk) 08:07, 4 May 2013 (UTC)

I agree that back when I was clarifying that thing I didn't think there was really a single package even using it, but since somebody decided to include it, I let it be.