Opened 12 years ago

Last modified 21 months ago

#1514 new enhancement

Automatically update official 0ad Git repos after SVN commits

Reported by: historic_bruno Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Non-game systems Keywords:
Cc: Kieran P, Philip Taylor Patch:

Description (last modified by Stan)

We still want to continue using SVN for 0ad's source code, but there's an increasing number of people (mostly programmers) using forks/clones of the 0ad repo on github or gitorious for their local work due to its numerous advantages. Currently some manual work is required to synchronize the Git repos with our SVN trunk, involving pestering k776 to do whatever he does on his system :)

It would be nicer if an SVN commit triggered an automatic update of these Git repos.

Change History (14)

comment:1 by historic_bruno, 12 years ago

It might work like this:

  • Both git and SVN would be setup on the server, with a local git repo cloned from SVN trunk and used only for git svn
  • An SVN post-commit hook could be used to run a script on the SVN server
  • The script uses some git svn magic to pull updates from the "remote" SVN repo to the local git repo
  • Updates are merged (should be trivial since there are no local changes)
  • The local repo gets pushed to the remote 0ad repo on github (requiring an account there and an SSH key configured to authorize the push? I don't know which way is best)

k776 can probably fill in some more details based on what he is currently doing.

comment:2 by Kieran P, 12 years ago

Alternatively, just a quick script we can run that'll start the sync, or a cron to do it every 5 minutes. Whatever is simplest.

We need a server where I can setup the latest Git, and then rsync my local Git copy to it, which has the sync information needed for it to run smoothly.

Also, we need to setup a user which can commit to Git. I don't want to pop my private SSH keys on the server ;-)

Last edited 12 years ago by Kieran P (previous) (diff)

comment:3 by Kieran P, 12 years ago

Milestone: BacklogAlpha 12

in reply to:  2 comment:4 by historic_bruno, 12 years ago

Replying to k776:

Alternatively, just a quick script we can run that'll start the sync, or a cron to do it every 5 minutes. Whatever is simplest.

It would be a simple script once the server was setup with git and a local repo, only a few commands. Or what did you have in mind?

Last edited 12 years ago by historic_bruno (previous) (diff)

comment:5 by Kieran P, 12 years ago

This is all I do (mapped to an alias '0ad_mirror').

git svn fetch && git merge remotes/trunk --no-edit && git reflog expire --expire=now --all && git gc --auto --prune=now && git push github master && git push gitorious master

in reply to:  5 comment:6 by leper, 12 years ago

Replying to k776:

git svn fetch && git merge remotes/trunk

Just that you don't miss it:

21:10 <@vtsj> k776 -- I'm curious; is it possible to update git's master branch by rebasing rather than merging?
21:12 <@vtsj> would make for a nice way to do auto-syncs with the svn repo and avoid tons of useless "merge remote-tracking branch" commits

so the quoted part would be replaced by git svn rebase.

comment:7 by Kieran P, 12 years ago

The short answer is no. The longer answer is yes, but it'll rewrite Git history, causing everyones git clone to be out of sync and have massive merge issues unless they themselves know how to and do a rebase when pulling the 0ad git repo. So probably best to stick to the current method.

comment:8 by historic_bruno, 12 years ago

Description: modified (diff)
Summary: Automatically update 0ad repo on github on SVN commitsAutomatically update official 0ad Git repos after SVN commits

comment:9 by Kieran P, 12 years ago

Milestone: Alpha 12Backlog

comment:10 by Stan, 10 years ago

Could that be merged with the git transition ?

comment:11 by Erik Johansson, 10 years ago

I wouldn't say this should be merged with the Git transition, but rather that once we have started using Git this will be fixed as invalid.

comment:12 by Stan, 10 years ago

Want me to do it ? ^^

comment:13 by Stan, 4 years ago

Description: modified (diff)
Milestone: BacklogWork In Progress
Owner: set to Itms

comment:14 by Stan, 21 months ago

Milestone: Work In ProgressBacklog
Owner: Itms removed

Backlogging due to lack of progress and the user retiring.

Note: See TracTickets for help on using tickets.