[josm-dev] Open offer to convert JOSM to Git

Ævar Arnfjörð Bjarmason avarab at gmail.com
Thu Apr 29 21:25:11 BST 2010


On Thu, Apr 29, 2010 at 19:27, Sebastian Klein <bastikln at googlemail.com> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>> In case it eluded anyone I'm pretty fond of Git [1][2]. The rails_port
>> has now switched over (with some help of mine), as well as Merkaartor
>> (with no help of mine). I've also set up Git mirror of JOSM on
>> GitHub[3] which I plan to keep up to date.
>>
>> If the JOSM project is ever interested, I'd be willing to do all the
>> work of doing a full and proper conversion of the master
>> repository. This would mean:
>>
>>   * Rewriting the history so that patches by other authors (through
>>     Trac) that have been applied by commiters get correct
>>     Author/Commiter metadata.
>>
>>   * Adding tags to the repository to mark all previous rXXXX releases
>>     of JOSM to the correct Git commit.
>>
>>   * Generally helping with any conversion issues.
>>
>> There was some discussion of switching over the official repo last
>> year[2], but Dirk Stöcker didn't seem very impressed. That's fine, but
>> if that ever changes conversion won't be an issue, because I'll do it.
>>
>> That's all.
>>
>> 1. http://lists.openstreetmap.org/pipermail/josm-dev/2010-April/004310.html
>> 2. http://lists.openstreetmap.org/pipermail/josm-dev/2009-November/thread.html#3694
>> 3. http://github.com/avar/josm
>
> How would we deal with the plugins on openstreetmap.org? It should stay
> open for developers with access to the main subversion repository.

The JOSM Plugin directory in OSM works now, and is not dependant
(aside from myabe a script or two) on the VCS used by JOSM itself. Even if
JOSM moves to Git the plugins don't have to.

There's actually very little that ties down plugins to
svn.openstreetmap.org. It's the default plugin provider, but there are
actually already 4 plugins that are part of the plugin list that
aren't hosted there.

If you put your plugin in any Git repository capable of offering a
.jar download (like GitHub, Gitorious and most do), you should be able
to move plugins to Git one-by-one. Or you could not move, it would be
up to the individual developer.

You'd just have to start a Git repository *somewhere* and add links to
the .jar on the Plugins page on the wiki, actually there seems to be
no reason for why you couldn't do this today.

> And what about automatic update of the subversion externals?

Git itself has svn externals-like support in the form of
submodules. Unlike SVN you can only check out whole repositories, not
paths of a repository (since Git is tree based, there's no such thing
as a subset of the repository).

There are currently 4 externals:

  * apache/bzip2
  * apache/codec

These aren't going to move since Apache maintains them. But they don't
change a lot either. I could either set up our own Git mirror of
these, or just copy/paste the relevant code regularly to the JOSM Git.

  * openstreetmap/gui

Could either be moved to Git + used as a submodule (the main
contributor, stotz, would have to agree). Or the approach with Apache
could be used.

  * map-icons/classic.small

Same as the above.

> In principle would be quite cool to switch to git. However subversion
> works reasonably well for us and there should be real advantages (other
> than being hip) to make up the work and potential problems of the change.

Indeed. Ultimately it's up to you guys. I'm not going to parrot all
the advantages of doing so, that's been covered before. I just wanted
to indicate that I'd like to help if JOSM chooses to go this way.

> Thanks for setting up the github anyway, it made me start learning git
> and i feel a little enlightened now. :)

It was very nice to see h4ck3rm1k3 use it right away, good that it's
interesting for other people as well.

You can use that checkout b.t.w. to do local development and commit
back to SVN. I use this approach with some SVN projects I contribute
to.

What you'd do is:

  1. check out the repository on the mirror branch (default)
  2. Add git-svn metadata: http://trac.parrot.org/parrot/wiki/git-svn-tutorial
  3. branch from the mirror branch: git checkout mirror && git
checkout -b some/silly-branch-name
  3. *hack on the train*
  4. Use git-rebase to apply only your commits (none of the mirror
stuff) to master
  5. git svn dcommit

With Git that would just be:

  1. git clone some/project
  3. *hack*
  4. git push

So git-svn makes things a lot harder, since you're always speaking in
a foreign language and translating between two fundamentally
incompatible systems.

But stuff like this comes in handy when I'm hacking on 8 hour
network-less train rides across Germany.

1. http://josm.openstreetmap.de/wiki/Styles and
http://josm.openstreetmap.de/styles
2. http://josm.openstreetmap.de/wiki/Plugins and
http://josm.openstreetmap.de/plugin

    $ lwp-request http://josm.openstreetmap.de/plugin | ack
'^\S.*http://([^/]+)' --output='$1' | sort | uniq -c | sort -nr
         42 svn.openstreetmap.org
          2 web.me.com
          1 topo.geofabrik.de
          1 mappin.hp2.jp

3. http://josm.openstreetmap.de/ticket/4967
4. http://trac.parrot.org/parrot/wiki/git-svn-tutorial




More information about the josm-dev mailing list