On 13.03.2012 04:58, Allan McRae wrote:
1) URL: There were previous patches to the mailing list that never really got finished, but I think we were fairly happy with this syntax:
source=(git://projects.archlinux.org/pacman.git) source=(git@@http://projects.archlinux.org/git/pacman.git)
Does it make any sense to allow the "::" syntax here? i.e. source=(git@@dirname::http://projects.archlinux.org/git/pacman.git)
If you want to allow multiple sources of the same project, please don't clone them into multiple directories. You'd just duplicate all objects they share (which could be many). Better cd into the one you already have and simply add a new remote. I don't like the @@ and :: syntax. Maybe "git://remotename//http://projects.archlinux.org/git/pacman.git"? That way we can simply look for "git://" and also easily figure out if there is a remote name or not. "//" should also be a safe delimiter because in the URL it would be collapsed to "/" anyway.
2) Specifying commit to work with: I think that this is the difficult bit... the syntax with the source array is already convoluted enough, so I do not think they should be added there. So that suggests we go with assigning them to variables like _git_branch, _git_commit, _git_tag... etc.
But what if we have two git sources? For example, say pacman allowed building against an internal copy of libarchive if a folder named libarchive was found in its root directory. So:
source=(git://projects.archlinux.org/pacman.git git://github.com/libarchive/libarchive)
source=("git://foo <refspec>" "git://2ndfoo/bar.git <refspec>") I'll just assume git allows urlencoded URLs so even if the git URL contained a space you could make it "%20". This is simple, clear and doesn't introduce any forbidden characters in the URL. If <refspec> is ommited, we should just clone/add the remote and leave HEAD alone. If it is there we checkout. This also means if there are multiple git URLs with the same name the last refspec wins. -- Florian Pritz