Another approach would be to create a ref that pointed to the build number, and then you can explicitly cross-reference the has that the build occurred on. The build number would then be the highest such number that exists.
For example, you could create refs/builds/1 with a commit hash of the build performed against build 1, then refs/builds/2 for build 2. You can then use git ls-remote to find out the list of the builds, and a quick cut/sort -n would give you the last known build number. It would perhaps be less efficient to gain this each time but given that the build server is likely to keep in step then it would only need to repopulate the current build number if the server lost its state.
Perhaps you could use both approaches; create refs for each build id and then use a git note to store the current buildid.
Alex I'll take a look at notes. Thanks Jonathan and Chris.
Thanks,
Jason
---------------------------------------------------------- Jason van Zyl Founder, Apache Maven
I never make the mistake of arguing with people for whose opinions I have no respect.
-- Edward Gibbon
_______________________________________________ jgit-dev mailing list jgit-dev@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jgit-dev
|