Opened 9 years ago

Last modified 2 years ago

#1502 new enhancement

Add redirects for URLs referenced in git-svn-id

Reported by: morganestes's profile morganestes Owned by:
Milestone: Priority: lowest
Component: Trac Keywords:


Looking at older commits in my Git repo shows me a git-svn-id with a URL to the SVN changeset, but those URLs go to a generic Apache 404 page. Can we redirect them instead to the commit page of Trac?

For example, would be redirected to

Change History (3)

#1 @dd32
9 years ago

Worth noting that these are valid SVN urls for use with the SVN client, but you're right, they're kinda awkward in Git commit messages :)

svn checkout will create a checkout of trunk at that exact revision.

#2 follow-up: @obenland
6 years ago

Where are these links shown and what exactly needs changing?

#3 in reply to: ↑ 2 @morganestes
6 years ago

Replying to obenland:

Where are these links shown and what exactly needs changing?

When I first saw them, they were exposed in my IDE as part of the Annotate feature (in PhpStorm). They come from the commit log, so inside the develop repo, running git log src/index.php returns git-svn-id as part of each commit:

$ git log src/index.php
commit 8f95800d52c1736d651ae6e259f90ad4a0db2c3f
Author: Gary Pendergast <>
Date:   Thu Nov 30 23:09:33 2017 +0000

    Code is Poetry.
    WordPress' code just... wasn't.
    This is now dealt with.

    Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
    Fixes #41057.

    git-svn-id: 602fd350-edb4-49c9-b593-d223f7449a82

commit 8d72ad52ff6a37f235ac585abef1131183d0e548
Author: Andrew Nacin <>
Date:   Wed Sep 25 00:17:40 2013 +0000

    Don't rely on include_path to include files.

    Always use dirname() or, once available, ABSPATH.

    props ketwaroo, hakre.
    fixes #17092.

    git-svn-id: 602fd350-edb4-49c9-b593-d223f7449a82

commit b43712e0f79a9f5bea52217e06155e2f471c490c
Author: Andrew Nacin <>
Date:   Wed Aug 7 05:25:25 2013 +0000

    New repository based on the old core.svn repository.

     * All WordPress files move to a src/ directory.
     * New task runner (Grunt), configured to copy a built WordPress to build/.
     * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
     * Remove Akismet external from develop.svn. Still exists in core.svn.
     * Drop minified files from src/. The build process will now generate these.

    props koop.
    see #24976.

    and see

    git-svn-id: 602fd350-edb4-49c9-b593-d223f7449a82

Since they represent links to actual changesets, I'd like to see them redirected instead of just die on the vine. My guess is an .htaccess rewrite rule on the Subversion server could do the trick, but should it go to the SVN revision or the Git one?

If you want to redirect to the SVN revision viewer, then this could work:

RewriteRule ^trunk@([0-9]{1,6})$ /!svn/bc/$1/trunk/

Which would redirect to!svn/bc/25001/trunk/

Rewriting to Git/Trac would be:

RewriteRule ^trunk@([0-9]{1,6})$$1
Last edited 6 years ago by morganestes (previous) (diff)
Note: See TracTickets for help on using tickets.