Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Storing a build number in Git repository

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

On 5 Aug 2014, at 00:50, Jason van Zyl <jason@xxxxxxxxx> wrote:

I'll take a look at notes. Thanks Jonathan and Chris.

On Aug 4, 2014, at 4:43 PM, Jonathan Nieder <jrn@xxxxxxxxxx> wrote:

Have you looked into tags or 'git notes' (see http://jk.gs/git-notes.html)?


Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/takari_io
---------------------------------------------------------

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


Back to the top