Am 13.03.2012 12:33, schrieb Allan McRae:
The three cases I see as needing covered are:
1) build from master HEAD 2) build from a branch HEAD 3) build from a given commit/tag
What we need to find is the simplest way of allowing these (and other reasonable suggestion that arises...).
My point was that from git's perspective, those are not different cases. The only annoying thing is the origin/<ref> for branch names which we need to get around somehow. I will throw in another suggestion which should solve some of those problems: To get the source: cd $vcsdir git clone --mirror $url or cd $vcsdir/$reponame git fetch cd $srcdir GIT_DIR=$vcsdir/$reponame git archive --format=tar --prefix=$reponame/ $refspec | bsdtar -xf - To get the version: GIT_DIR=$vcsdir/$reponame git describe $refspec Disadvantage: - The "checkout" itself is not a git tree, so build() cannot use any git commands (some projects use git commands internally in their Makefiles, so this might be bad) Advantage: - Due to clone --mirror, we have all remote branch names as local branch names, so we don't need to care whether $refspec is a branch name or not. As we don't clone again, we don't lose those names. That disadvantage is big (breaks kernel and syslinux git snapshot versioning), so I am still not convinced. My main point is: We must find a way to make sure we (==makepkg) don't need to care about whether $refspec is a branch, tag or commit.