[fpc-pascal] Re: [Semi-OT] How to get remote Git revision number (or last update date) using FPC+git executable
Graeme
graemeglists at gmail.com
Thu Aug 4 13:39:12 CEST 2011
On 4 August 2011 12:58, Reinier Olislagers wrote:
>
> 1. The program checks for the current git revision "number" (a hex
> string in fact) of the local copy.
I believe you are referring to the SHA1 value.
> How do I find out, using FreePascal and a git executable:
> 1. (Preferably - so I can match behaviour between the git and svn parts
> of the program) the remote git revision
> 2. If the local copy needs updating, i.e. the remote copy is newer.
Why check for it first, why not just do a 'git pull origin' and be done with it.
But, if you really want to inspect the HEAD revision's SHA1 value of a
remote repository, you can use the following command:
$ git ls-remote origin HEAD
If you wanted to know every HEAD of every branch/tag on the remote
repository, then just do:
$ git ls-remote origin
For more information see the following help for the 'git ls-remote' command:
http://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html
> However, having git support in LazUpdater does make downloading updates
> an awful lot quicker, so...
+1
Graeme.
More information about the fpc-pascal
mailing list