> here is an initial implementation:
> https://github.com/divinity76/git-php-net-redirector/blob/main/src/redirector.php
> it is just a minimum-effort implementation, anyone feel free to make
> something better (also i have no idea how the "p" argument is supposed to
> be parsed, so i just guessed)
>
> it passes "Stanislav Malyshev"'s initial sample url, but it probably fails
> on any other formats, if anyone has test urls, share em
>
>
>
> On Mon, 4 Oct 2021 at 08:38, Hans Henrik Bergan <divinit...@gmail.com>
> wrote:
>
> > >So who's going to work on it? Doesn't make sense to have 5 people work
> > > on it independently from each other ;-)
> >
> > if nobody else wants to do it, i can make an initial implementation on
> > october 9th (6 days from now),
> >
> > but wouldn't surprise me at all if someone else wants to do it ^^
> >
> >
> > On Mon, 4 Oct 2021 at 08:01, Andreas Heigl <andr...@heigl.org> wrote:
> >
> >> Hey all.
> >>
> >> On 04.10.21 07:52, Hans Henrik Bergan wrote:
> >> > there's also plenty of broken links on reddit to git.php.net , ref
> >> > https://www.google.com/search?q=git.php.net+site%3Areddit.com
> >> >
> >> > it wouldn't be hard to set up a redirector parsing commit ids out of the
> >> > url and redirecting to github,
> >> > +1 from me.
> >>
> >> So who's going to work on it? Doesn't make sense to have 5 people work
> >> on it independently from each other ;-)
> >>
> >> Cheers
> >>
> >> Andreas
> >> --
> >>                                                                ,,,
> >>                                                               (o o)
> >> +---------------------------------------------------------ooO-(_)-Ooo-+
> >> | Andreas Heigl                                                       |
> >> | mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
> >> | https://andreas.heigl.org                                           |
> >> +---------------------------------------------------------------------+
> >> | https://hei.gl/appointmentwithandreas                               |
> >> +---------------------------------------------------------------------+
> >>
> >


Hi Stanislav/Hans,
Thanks for opening this conversation and the initial implementation.

Having worked with a few cgit repositories before, I happen to recall
some of the other URL patterns. I worked on a similar implementation
to Hans's at https://github.com/Ayesh/git-php-redirect

> something better (also i have no idea how the "p" argument is supposed to
> be parsed, so i just guessed)

It is the name of the git repository on git.php.net. There were
several other repos for PECL, bug tracker, docs in multiple languages,
etc. I have added support for a static list that maps git.php.net
names to GitHub repo under `php` organization namespace.

In addition to the URL patterns Hans have covered
(p=php-src;h=HEX{40}), I thought to add a few more patterns:

- FROM: http://git.php.net/?p=php-src.git;a=commit;h=5af586be (
`/[a-z0-9]{7,}$/` )
  TO:       https://github.com/php/php-src/commit/5af586be

- FROM: https://git.php.net/?p=php-src.git;a=shortlog;h=refs/tags/php-8.0.0RC2
  TO:       https://github.com/php/php-src/releases/tag/php-8.1.0RC3

- FROM: 
https://git.php.net/?p=php-src.git;a={tree,log,shortlog};h=refs/heads/master;hb=refs/heads/master
  TO:       https://github.com/php/php-src/{tree,commits,commits}/master

- FROM: http://git.php.net/?p=php-src.git;a=log
  TO:       https://github.com/php/php-src

Cheers,
Ayesh.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to