[josm-dev] Request for review of plugins
Marián Kyral
mkyral at email.cz
Wed Feb 26 08:10:12 UTC 2014
Dne 25.2.2014 16:13, Dirk Stöcker napsal:
> On Tue, 25 Feb 2014, Marián Kyral wrote:
>
>>> Feel free to improve it...
>>
>> But I don't know how :-(
>
> You can do so, when you know it :-)
>
>> I have official svn copy and I've created a new plugin folder. Git is
>> used
>> only inside pointInfo folder.
>>
>> What I get:
>
> [...snip...]
>
> This looks much like a error in init-git-revision-xml. I never used
> that.
> It seems the code is designed to extract the value "git-svn-id". Your
> copy
> is git-only, so it has no git id.
>
> A check needs to be added, which does something useful in this case
> (e.g. using the date as version [2010-02-25 or 20100225], as git has no
> real version field).
In folder with local .git repository (without git-svn-id), the command:
git log -1 --grep=git-svn-id --pretty=format:%B%n%ai HEAD
creates a blank REVISION.XML file. This then cause an error:
revision:
[xmlproperty] Loading
/home/marian/data/josm/josm_plugins/plugins/pointInfo/REVISION.XML
[xmlproperty] [Fatal Error] :-1:-1: Premature end of file.
-------------------------------------------
In plain folder (without .git folder inside), the same command generates
following REVISION.XML file:
$ cat /home/marian/data/josm/josm_plugins/plugins/pointInfo/REVISION.XML
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not
set).
This then causes an error:
revision:
[xmlproperty] Loading
/home/marian/data/josm/josm_plugins/plugins/pointInfo/REVISION.XML
[xmlproperty] [Fatal Error] REVISION.XML:1:1: Content is not allowed in
prolog.
Ant should handle correctly both situations:
1) init-git-revision-xml finished correctly, but REVISION.XML file is
blank
2) init-git-revision-xml finished with error code 128 and REVISION.XML
contains bad content (git error message)
I don't know ant, but looks to me that the init-git-revision-xml target
is called only when init-svn-revision-xml fails, but there is no check
for result of init-git-revision-xml. The script is expecting that there
always will be svn or git if svn is not available.
So, in first case, there should be some check for zero size REVISON.XML
and init-git-revision-xml should return error code in this case.
In second case, the bad REVISION.XML file should be deleted.
In both cases, the revision target should expect that svn and git call
could fail and use some default value in this case.
Regards,
Marián
More information about the josm-dev
mailing list