Difference between revisions of "Talk:VCS package guidelines"

From ArchWiki
Jump to: navigation, search
(Sed -> tr: new section)
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Updating a CVS repo ==
 
I don't use cvs. How can you describe the pkgver for cvs (for pacman 4.1)? --[[User:Dracorp|Dracorp]] ([[User talk:Dracorp|talk]]) 09:31, 6 April 2013 (UTC)
 
 
 
== https:// vs git:// ==
 
== https:// vs git:// ==
  
Line 7: Line 4:
 
--[[User:Mitch feaster|Mitch feaster]] 14:34, 15 November 2011 (EST)
 
--[[User:Mitch feaster|Mitch feaster]] 14:34, 15 November 2011 (EST)
  
== Some leftover changes ==
+
== Updating a CVS repo ==
 +
I don't use cvs. How can you describe the pkgver for cvs (for pacman 4.1)? <br>
 +
-- [[User:Dracorp|Dracorp]] ([[User talk:Dracorp|talk]]) 09:31, 6 April 2013 (UTC)
  
Since [[User:Thestinger|Thestinger]] decided to [https://wiki.archlinux.org/index.php?title=VCS_PKGBUILD_Guidelines&diff=253547&oldid=253546 protect] the entire page (for whatever reason):
+
:CVS is not supported in pacman 4.1 like the other VCS tools. You will need to update pkgver manually until CVS support is added.
 +
:-- [[User:Jstjohn|Jstjohn]] ([[User talk:Jstjohn|talk]]) 22:44, 15 April 2013 (UTC)
  
=== <s>$SRCDEST <u>is</u> required for SVN</s> ===
+
== checking out branches/tags needs clarification ==
  
Thestinger's [https://wiki.archlinux.org/index.php?title=VCS_PKGBUILD_Guidelines&diff=253555&oldid=253552 change] (7:03, 10 April 2013 (UTC)):
+
The #fragment part of the VCS source URL has a different meaning for each type of VCS.
''→‎Subversion:  $SRCDEST not necessary''
+
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.
  
Wrong, see the [[VCS_PKGBUILD_Guidelines#Subversion|note]] you left behind. {{ic|svn export}} doesn't copy {{ic|.svn}}, which means getting the version won't work anymore:
+
fictional examples for git and svn (don't have experience with bzr or HG)
{{hc|[$srcdir]$ svnversion|
+
Unversioned directory
+
}}
+
  
::Thanks, reverted. -- [[User:Thestinger|thestinger]] ([[User talk:Thestinger|talk]]) 16:45, 10 April 2013 (UTC)
+
check out branch git_test of git://myproject.com into folder my_git_code :
 +
my_git_code::git://myproject.com/#branch=git_test
  
=== The Git functions ===
+
Check out branch svn_test of svn://myproject.com into folder my_svn_code :
 +
my_svn_code::svn://myproject.com/branches/svn_test
  
[[Danielwallace]]'s [https://wiki.archlinux.org/index.php?title=VCS_PKGBUILD_Guidelines&diff=253546&oldid=253520 change] (04:32, 10 April 2013 (UTC)):
+
[[User:Lone Wolf|Lone_Wolf]] ([[User talk:Lone Wolf|talk]]) 20:49, 16 April 2013 (UTC)
{{hc|pkgver() {
+
  cd local_repo
+
<s>−  git rev-list --count HEAD</s>
+
+  echo $(git rev-list --count master).$(git rev-parse --short master)
+
}
+
- [...]
+
|1142}}
+
That's good but you left the title and the <s>sample output</s> intact. Also, the first example still uses {{ic|git describe}}.
+
  
--[[User:Det|Det]] ([[User talk:Det|talk]]) 16:41, 10 April 2013 (UTC)
+
== pkgver() for git ==
  
==== Incomplete Git function ====
+
I'd like to suggest using HEAD instead of master in example pkgver(), i.e.
The following function will list not only the total number of commits, but also the tag of the last commit
+
{{bc|
{{hc|pkgver() {
+
pkgver() {
 +
  cd local_repo
 +
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
 +
}
 +
}}
 +
instead of
 +
{{bc|
 +
pkgver() {
 
   cd local_repo
 
   cd local_repo
 
   echo $(git rev-list --count master).$(git rev-parse --short master)
 
   echo $(git rev-list --count master).$(git rev-parse --short master)
 
}
 
}
 +
}}
  
|1142}}
+
Pros:
So the following should be used as the example title:
+
If source line contains fragment, e.g. {{ic|source&#61;("$pkgname::git://path.git#branch&#61;name")}}, offered version will not work correct. User may forget to fix it (from master to specified branch or commit). My version lacks this bug.
  
{{ic|Using the total count of commits and the tag of the last commit. }}
+
Cons:
 +
Don't see. But I'd like this fix to be reviewed if I miss something. Bug in such example may hurt many package maintainers.
  
<s>And the example output should be changed to something like</s>
+
== More on git pkgver()'s ==
  
<s>1142.a17a017</s>
+
I would also like to see packages use pkgver fucntions like this:
  
--[[User:X33a|X33a]] ([[User talk:X33a|talk]]) 17:50, 10 April 2013 (UTC)
+
git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
  
:Or "tag of the last one" to prevent unnecessary repetition, but I fear even the most obvious changes like this will take a very long time now that we can't do them anymore. --[[User:Det|Det]] ([[User talk:Det|talk]]) 18:50, 10 April 2013 (UTC)
+
so they are more friendly to vercmp.  
 +
Current behaviour using git-git as an example:
  
::Thanks, Thestinger but the title still only mentions the first {{ic|git}} command, while the other example should use {{ic|git rev-parse}} as well. --[[User:Det|Det]] ([[User talk:Det|talk]]) 13:15, 11 April 2013 (UTC)
+
current ver: {{ic|1.8.2.210.g123abc-1}}
 +
next ver: {{ic|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
  
== Mercurial pkgver() broken ==
+
Right now, the current version is actually greater than the new version, causing a downgrade. If {{ic|r}} is appended to the patch level (the numbers just before the g<hex> bit), then vercmp would order the versions correctly.
{{ic|hg identify -ni | awk 'BEGIN{OFS=".";} {print $2,$1}'}}
+
  
The above command does not change my pkgver variable of the placeholder. Can someone look into this? Additionally, I'm getting a sed warning about an unterminated substitution.
+
current ver: {{ic|1.8.2.r210.g123abc-1}}
 +
next ver: {{ic|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
  
--[[User:Schala|Schala]] ([[User talk:Schala|talk]]) 04:25, 14 April 2013 (UTC)
+
[[User:KaiSforza|KaiSforza]] ([[User talk:KaiSforza|talk]]) 20:42, 18 April 2013 (UTC)
  
=== Shorter and simpler Mercurial pkgver() ===
+
== Sed -> tr ==
  
{{hc|pkgver() {
+
{{ic|<nowiki>sed 's|-|.|g'</nowiki>}}'s could be replaced with just {{ic|tr - .}}'s as well. --[[User:Det|Det]] ([[User talk:Det|talk]]) 13:10, 2 May 2013 (UTC)
  cd local_repo
+
  <del><nowiki>hg identify -ni | awk 'BEGIN{OFS=".";} {print $2,$1}'</nowiki></del>
+
  <ins>echo $(hg identify -n).$(hg identify -i)</ins>
+
}|
+
2813.75881cc5391e
+
}}
+
--[[User:N30N|N30N]] ([[User talk:N30N|talk]]) 12:21, 15 April 2013 (UTC)
+

Revision as of 13:10, 2 May 2013

https:// vs git://

Could we consider a guideline to use firewall-friendly protocols when possible (e.g. https://github.com/matplotlib/matplotlib.git instead of git://github.com/matplotlib/matplotlib.git)? --Mitch feaster 14:34, 15 November 2011 (EST)

Updating a CVS repo

I don't use cvs. How can you describe the pkgver for cvs (for pacman 4.1)?
-- Dracorp (talk) 09:31, 6 April 2013 (UTC)

CVS is not supported in pacman 4.1 like the other VCS tools. You will need to update pkgver manually until CVS support is added.
-- Jstjohn (talk) 22:44, 15 April 2013 (UTC)

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)

check out branch git_test of git://myproject.com into folder my_git_code :

my_git_code::git://myproject.com/#branch=git_test

Check out branch svn_test of svn://myproject.com into folder my_svn_code :

my_svn_code::svn://myproject.com/branches/svn_test

Lone_Wolf (talk) 20:49, 16 April 2013 (UTC)

pkgver() for git

I'd like to suggest using HEAD instead of master in example pkgver(), i.e.

pkgver() {
  cd local_repo
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

instead of

pkgver() {
  cd local_repo
  echo $(git rev-list --count master).$(git rev-parse --short master)
}

Pros: If source line contains fragment, e.g. source=("$pkgname::git://path.git#branch=name"), offered version will not work correct. User may forget to fix it (from master to specified branch or commit). My version lacks this bug.

Cons: Don't see. But I'd like this fix to be reviewed if I miss something. Bug in such example may hurt many package maintainers.

More on git pkgver()'s

I would also like to see packages use pkgver fucntions like this:

git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'

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

KaiSforza (talk) 20:42, 18 April 2013 (UTC)

Sed -> tr

sed 's|-|.|g''s could be replaced with just tr - .'s as well. --Det (talk) 13:10, 2 May 2013 (UTC)