Re: [josm-dev] Request for review of plugins

2014-02-27 Thread Paul Hartmann

On 02/26/2014 10:08 PM, Simon Legner wrote:

On 26/02/14 21:58, Marián Kyral wrote:

Thanks Simon. It fixes the first case (when there is a local git
repository inside the plugin folder). But it still fails when there is
no .git folder at all.


Right, but what should be the outcome? How to determine the last change
timestamp?

I won't look into this issue since I do not consider building a plugin
from a non-repository very important.


I've added another fall-back ([o30309]). When the plugin is not under 
version control, it should now set the revision to UNKOWN and the date 
to the current date.


This is mainly for testing purpose, until you decide to commit the code 
to some repository.


Paul

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-26 Thread Marián Kyral

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



___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-26 Thread Simon Legner

Hi,

On 25/02/14 12:55, Dirk Stöcker wrote:

... or fix the build-common.xml. When reading the text it tells me, that
svn should fail and git be used instead. Seems your svn does not fail
enough? It probably delivers something. Maybe a check is needed to
detect that invalid output?


Done: https://trac.openstreetmap.org/changeset/30306/subversion/

Marián, please give it a try. :-)

Cheers,
Simon

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-26 Thread Simon Legner

On 26/02/14 21:58, Marián Kyral wrote:

Thanks Simon. It fixes the first case (when there is a local git
repository inside the plugin folder). But it still fails when there is
no .git folder at all.


Right, but what should be the outcome? How to determine the last change 
timestamp?


I won't look into this issue since I do not consider building a plugin 
from a non-repository very important.


Cheers,
Simon

___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-25 Thread Dirk Stöcker

On Tue, 25 Feb 2014, Marián Kyral wrote:

Both plugins were discussed and tested by Czech OSM community (talk-cz@) and 
are regularly used by several users. I think that now are both plugins stable 
enough to include them in JOSM repository (and fix the annoying missing 
version issue).


See
https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins

Some notes:
a) You aren't required to have plugins in OSM-SVN. External plugins are 
also supported, see https://josm.openstreetmap.de/wiki/Plugins , but SVN 
has some advantages (like translations).


b) If your code is an extension of Tracer plugin without breaking existing 
functionality, I'd vote for updating the existing plugin instead of a new 
one. If Tracer and Tracer2 can be joined I'd also would welcome that. It's 
confusing for users to have multiple plugins with the same goal.


c) Regarding shortcuts, have a look at
https://josm.openstreetmap.de/wiki/DevelopersGuide/ShortcutsList :-)

As I'm not a java programmer, I'm asking for code review and for help with 
commiting to JOSM tree.


I also was no Java programmer before starting with JOSM. We wont cut your 
head if you make errors. Testing with multiple users sounds already like a 
very good approach.


Ciao
--
http://www.dstoecker.eu/ (PGP key available)___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-25 Thread Marián Kyral

Dne 25.2.2014 10:34, Dirk Stöcker napsal:

On Tue, 25 Feb 2014, Marián Kyral wrote:

Both plugins were discussed and tested by Czech OSM community 
(talk-cz@) and
are regularly used by several users. I think that now are both plugins 
stable
enough to include them in JOSM repository (and fix the annoying 
missing

version issue).


See
https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins



Yes, I read this page, several times ;-)
I think, it needs some improvements. E.g.: how to handle version in 
manifest for new plugin without commit to svn (se below).



Some notes:
a) You aren't required to have plugins in OSM-SVN. External plugins are
also supported, see https://josm.openstreetmap.de/wiki/Plugins , but 
SVN

has some advantages (like translations).


No I aren't, but in case of Tracer plugin it is much better to update 
the source. It will avoid all possible future issues.
I would like to keep git and sync it with the JOSM svn (via git-svn or 
by applying patches)


Teoretically, I could manage PoinInfo externally, but I have an issue 
with versions in Manifest file. I tried git mirror - but I was not able 
to compile plugins. Now I'm using svn tree, but ant requires at least 
one commit of the new plugin, otherwise ant dist fails in target 
init-svn-revision-xml
I have no idea how to fix it without commit to JOSM svn. As an 
workaround, I've changed arg value=./ to arg value=../tracer/.




b) If your code is an extension of Tracer plugin without breaking 
existing
functionality, I'd vote for updating the existing plugin instead of a 
new
one. If Tracer and Tracer2 can be joined I'd also would welcome that. 
It's

confusing for users to have multiple plugins with the same goal.


Tracer2 plugin uses rewritten .Net server. Allows user to define more 
sources of bitmaps. I did not tested deeply, but one user on talk-cz 
told me, that he prefers original Tracer as the results are better. 
Maybe it is just an issue with configuration, or it is a bug. I could 
ask him for some examples if needed.


Initially I planned to do a third Tracer plugin ;-), then I decided to 
merge it with original Tracer and later on I've found that there is 
Tracer2 also.
In theory Tracer and Tracer2 plugins could be merged in future, but 
currently Tracer plugin is focused mainly to Czech specific cases 
(Especially the RUIAN mode - server is sending not only geometry, but 
also additional attributes.) and Tracer2 is much more universal.





c) Regarding shortcuts, have a look at
https://josm.openstreetmap.de/wiki/DevelopersGuide/ShortcutsList :-)



Yes, shortcuts. My nightmare :-( For Tracer, I wanted to stay close to 
T, for pointInfo I wanted something that could be easily pressed by 
left hand. The only good news is, that user could change shortcut when 
needed (even they don't know about this possibility).


As I'm not a java programmer, I'm asking for code review and for help 
with

commiting to JOSM tree.


I also was no Java programmer before starting with JOSM. We wont cut 
your
head if you make errors. Testing with multiple users sounds already 
like a

very good approach.


Good to hear :-D

Marián



___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-25 Thread Dirk Stöcker

On Tue, 25 Feb 2014, Marián Kyral wrote:


 https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins


Yes, I read this page, several times ;-)
I think, it needs some improvements. E.g.: how to handle version in manifest 
for new plugin without commit to svn (se below).


Feel free to improve it...


 a) You aren't required to have plugins in OSM-SVN. External plugins are
 also supported, see https://josm.openstreetmap.de/wiki/Plugins , but SVN
 has some advantages (like translations).


No I aren't, but in case of Tracer plugin it is much better to update the 
source. It will avoid all possible future issues.
I would like to keep git and sync it with the JOSM svn (via git-svn or by 
applying patches)


Teoretically, I could manage PoinInfo externally, but I have an issue with 
versions in Manifest file. I tried git mirror - but I was not able to compile 
plugins. Now I'm using svn tree, but ant requires at least one commit of the 
new plugin, otherwise ant dist fails in target init-svn-revision-xml
I have no idea how to fix it without commit to JOSM svn. As an workaround, 
I've changed arg value=./ to arg value=../tracer/.


... or fix the build-common.xml. When reading the text it tells me, that 
svn should fail and git be used instead. Seems your svn does not fail 
enough? It probably delivers something. Maybe a check is needed to detect 
that invalid output?


Still we encourage using the SVN for several reasons, I18n and 
installation history for old JOSM versions are the two most important 
ones.


Ciao
--
http://www.dstoecker.eu/ (PGP key available)___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-25 Thread Marián Kyral

Dne 25.2.2014 12:55, Dirk Stöcker napsal:

On Tue, 25 Feb 2014, Marián Kyral wrote:


 https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins


Yes, I read this page, several times ;-)
I think, it needs some improvements. E.g.: how to handle version in 
manifest

for new plugin without commit to svn (se below).


Feel free to improve it...


But I don't know how :-(



 a) You aren't required to have plugins in OSM-SVN. External plugins 
are
 also supported, see https://josm.openstreetmap.de/wiki/Plugins , but 
SVN

 has some advantages (like translations).


No I aren't, but in case of Tracer plugin it is much better to update 
the

source. It will avoid all possible future issues.
I would like to keep git and sync it with the JOSM svn (via git-svn or 
by

applying patches)

Teoretically, I could manage PoinInfo externally, but I have an issue 
with
versions in Manifest file. I tried git mirror - but I was not able to 
compile
plugins. Now I'm using svn tree, but ant requires at least one commit 
of the

new plugin, otherwise ant dist fails in target init-svn-revision-xml
I have no idea how to fix it without commit to JOSM svn. As an 
workaround,

I've changed arg value=./ to arg value=../tracer/.


... or fix the build-common.xml. When reading the text it tells me, 
that

svn should fail and git be used instead. Seems your svn does not fail
enough? It probably delivers something. Maybe a check is needed to 
detect

that invalid output?


I have official svn copy and I've created a new plugin folder. Git is 
used only inside pointInfo folder.


What I get:

[pointInfo (master)]$ ant dist
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
Buildfile: 
/home/marian/data/josm/josm_plugins/plugins/pointInfo/build.xml


init:

compile:
 [echo] compiling sources for ../../dist/pointInfo.jar ...

init-svn-revision-xml:
 [exec] Result: 1

init-git-revision-xml:

revision:
[xmlproperty] [Fatal Error] :-1:-1: Premature end of file.

BUILD FAILED
/home/marian/data/josm/josm_plugins/plugins/build-common.xml:193: Failed 
to load 
/home/marian/data/josm/josm_plugins/plugins/pointInfo/REVISION.XML


Total time: 1 second

When I rename .git to .git_ it changes a little:

[pointInfo]$ ant dist
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on
Buildfile: 
/home/marian/data/josm/josm_plugins/plugins/pointInfo/build.xml


init:

compile:
 [echo] compiling sources for ../../dist/pointInfo.jar ...

init-svn-revision-xml:
 [exec] Result: 1

init-git-revision-xml:
 [exec] Result: 128

revision:
[xmlproperty] [Fatal Error] REVISION.XML:1:1: Content is not allowed in 
prolog.


BUILD FAILED
/home/marian/data/josm/josm_plugins/plugins/build-common.xml:193: Failed 
to load 
/home/marian/data/josm/josm_plugins/plugins/pointInfo/REVISION.XML


Total time: 1 second

What I want - plugin compiles. Maybe use some default value in MANIFEST.



Still we encourage using the SVN for several reasons, I18n and
installation history for old JOSM versions are the two most important
ones.



I18n - do you mean lauchpad integration? - I don't like launchpad. I 
want to download .po file without registration (but this is a different 
story)


Regards,
Marián



___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Request for review of plugins

2014-02-25 Thread Dirk Stöcker

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).


Ciao
--
http://www.dstoecker.eu/ (PGP key available)___
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev