WordPress.org

Making WordPress.org

Opened 4 years ago

Last modified 12 months ago

#1502 new enhancement

Add redirects for URLs referenced in git-svn-id

Reported by: morganestes Owned by:
Milestone: Priority: lowest
Component: Trac Keywords:
Cc:

Description

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, https://develop.svn.wordpress.org/trunk@14248 would be redirected to https://core.trac.wordpress.org/changeset/14248.

Change History (3)

#1 @dd32
4 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 https://develop.svn.wordpress.org/trunk@14248 will create a checkout of trunk at that exact revision.

#2 follow-up: @obenland
12 months ago

Where are these links shown and what exactly needs changing?

#3 in reply to: ↑ 2 @morganestes
12 months 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 <pento@git.wordpress.org>
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: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82

commit 8d72ad52ff6a37f235ac585abef1131183d0e548
Author: Andrew Nacin <nacin@git.wordpress.org>
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: https://develop.svn.wordpress.org/trunk@25616 602fd350-edb4-49c9-b593-d223f7449a82

commit b43712e0f79a9f5bea52217e06155e2f471c490c
Author: Andrew Nacin <nacin@git.wordpress.org>
Date:   Wed Aug 7 05:25:25 2013 +0000

    New develop.svn.wordpress.org 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 http://wp.me/p2AvED-1AI.



    git-svn-id: https://develop.svn.wordpress.org/trunk@25001 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/

Which would redirect https://develop.svn.wordpress.org/trunk@25001 to https://develop.svn.wordpress.org/!svn/bc/25001/

Rewriting to Git/Trac https://core.trac.wordpress.org/changeset/25001 would be:

RewriteRule ^trunk@([0-9]{1,6})$ https://core.trac.wordpress.org/changeset/$1
Version 1, edited 12 months ago by morganestes (previous) (next) (diff)
Note: See TracTickets for help on using tickets.