Migrate a Trac Plugin to a GIT repository?

18 views
Skip to first unread message

Rob Hills

unread,
Jun 28, 2025, 12:30:56 PMJun 28
to Trac Users
I'm planning an upgrade of our Trac 1.4 instance to 1.6

The first step is of course to check the plugins we are using.

I have created a new environment for my trial upgrade using the UV package manager.  So far this has worked well for me.

UV is able to install from GIT repositories but not SVN repositories.  Unfortunately most of the Trac Plugins are in SVN repositories only.

What is involved in migrating a plugin from its SVN repository to a GIT repository (eg the Trac-Hacks repository).  I'm keen to do this for the plugins needed for my project if it's possible.

Rob
Waikiki, Western Australia

Jun Omae

unread,
Jun 28, 2025, 3:32:25 PMJun 28
to trac-...@googlegroups.com
On 2025/06/29 1:30, Rob Hills wrote:
> I'm planning an upgrade of our Trac 1.4 instance to 1.6
>
> The first step is of course to check the plugins we are using.
>
> I have created a new environment for my trial upgrade using the UV package manager <https://docs.astral.sh/uv/>.  So far this has worked well for me.
>
> UV is able to install from GIT repositories but not SVN repositories.  Unfortunately most of the Trac Plugins are in SVN repositories only.
>
> What is involved in migrating a plugin from its SVN repository to a GIT repository (eg the Trac-Hacks repository <https://github.com/orgs/trac-hacks/repositories?type=all>).  I'm keen to do this for the plugins needed for my project if it's possible.
>
> Rob
> Waikiki, Western Australia

No plans, and it would take a lot of time to do so. How about converting the necessary Subversion repositories to Git locally using git-svn?

--
Jun Omae <jun...@gmail.com> (大前 潤)

Rob Hills

unread,
Jun 29, 2025, 4:30:45 AMJun 29
to trac-...@googlegroups.com
Hi Jun Omae,

Thanks for your prompt reply
I'd not used git-svn before so I spent some time with it today, unfortunately without much success.

I started with a simple example: the TicketSidebarProviderPlugin.  I tried the following on my computer:

git svn clone -s https://trac-hacks.org/svn/ticketsidebarproviderplugin ticketsidebarproviderplugin.git

However, after this command completed I don't have a working repository.

git branch -a

shows no branches at all.

git svn rebase

results in the following:

fatal: bad revision 'HEAD'
rev-list --first-parent --pretty=medium HEAD --: command returned error: 128

Any tips on how to create a Git repository from a Trac Hack Plugin in their svn repository?

TIA,


-- 
Rob Hills
Waikiki, Western Australia

Jun Omae

unread,
Jun 29, 2025, 11:24:20 AMJun 29
to trac-...@googlegroups.com
On 2025/06/29 17:30, 'Rob Hills' via Trac Users wrote:
> I started with a simple example: the TicketSidebarProviderPlugin <https://trac-hacks.org/wiki/TicketSidebarProviderPlugin>.  I tried the following on my computer:
>
> git svn clone -s https://trac-hacks.org/svn/ticketsidebarproviderplugin <https://trac-hacks.org/svn/ticketsidebarproviderplugin> ticketsidebarproviderplugin.git
>

The Subversion URL of the plugin doesn't have trunk, branches, tags.
Therefore, -s (--stdlayout) shouldn't be used.

Instead, try the following:
$ git svn clone --prefix=svn/ --trunk=0.11 -r5528:HEAD https://trac-hacks.org/svn/ticketsidebarproviderplugin

$ git branch -a
* master
remotes/svn/trunk
$ $ git log --all --oneline --decorate --graph
* ed7ba266d (HEAD -> master, svn/trunk) TicketSidebarProvider 0.1: Bump version
* 9635b16fc TicketSidebarProviderPlugin: Another non-maintainer commit to fix display issues, refs #7428.
* 844bc6b13 TicketSidebarProviderPlugin: Non-maintainer change applying old patch, refs #7428.
* 9d8043bbd Show plugin's svn revision on webadmin plugin panel.
* 862d272f2 use better CSS rule
* c7d83c9f1 better positioning/formatting
* 0dea6474f resize the ticket box sensibly
* 855aa0164 clear after for vertical alignment
* ed8d93008 try to get all of the files, again
* 9ed918efd try to get all of the files
* cc8341ad9 initial version of TicketSidebarProviderPlugin
* 319abe3dc New hack TicketSidebarProviderPlugin, created by k0s

Rob Hills

unread,
Jun 29, 2025, 1:35:38 PMJun 29
to trac-...@googlegroups.com
Hi Jun Omae,

On Mon, 2025-06-30 at 00:24 +0900, Jun Omae wrote:
On 2025/06/29 17:30, 'Rob Hills' via Trac Users wrote:
I started with a simple example: the TicketSidebarProviderPlugin <https://trac-hacks.org/wiki/TicketSidebarProviderPlugin>.  I tried the following on my computer:



The Subversion URL of the plugin doesn't have trunk, branches, tags.
Therefore, -s (--stdlayout) shouldn't be used.

Instead, try the following:
$ git svn clone --prefix=svn/ --trunk=0.11 -r5528:HEAD https://trac-hacks.org/svn/ticketsidebarproviderplugin


Many thanks again for your prompt and detailed reply.  The "git svn clone" command that you supplied worked perfectly.

I'll now be able to apply this to the other plugins I need to import.
Reply all
Reply to author
Forward
0 new messages