Ticket UUID: | 74782e5f7cf9c3b3430c1b6debbc57c20fe7f3f8 | ||
Title: | auto-discovery of a repository from a webpage | ||
Status: | Closed | Type: | Feature_Request |
Severity: | Cosmetic | Priority: | |
Subsystem: | Resolution: | Rejected | |
Last Modified: | 2013-01-25 18:52:55 | ||
Version Found In: | |||
Description & Comments: | |||
It would be a nice addition if there was a way for a webpage to specify where its source repository was, for example by including a html link element in a webpage -
<link rel="fossil-repository" href="http://www.fossil-scm.org">
This way, one could easily get to the source repository even if the site url is not being served by fossil directly.
It wouldn't make sense for this to be built into "clone"; a separate "autoclone" command that fetched the given url and looked for the link reference and then called "clone". This functionality can be achieved with an external 2-line shell script, but that goes against fossil's all-in-one philosophy. drh added on 2010-03-19 01:06:30: anonymous added on 2010-03-19 02:47:35: The inspiration comes from setting up a self-hosted project on sourceforge. The project homepage is http://myproject.sourceforge.net/ which can be redirected (with php) to some other page. As it stands, I don't think fossil will follow a 301/302 http redirect, so it would do no good to instruct people to "fossil clone http://lilypad.sourceforge.net". They need to find the explicit url of the repository and use "fossil clone http://lilypad.sourceforge.net/cgi-bin/lilypad.fsl" But wouldn't it be nice if they could just use the home page? Just following redirects is helpful but not enough - what if the home page is still some plain html page? So instead, if the home page had some indicator on it to allow a program to discover where the source is (similar to rss autodiscovery) then an interested user/developer could clone the repository right from the home page, without needing to track down the link to the actual repository. (I don't know if any other systems have a similar convention, but if such a thing became widespread the search engines could make use of it) The effect would be roughly the same as the shell command: $ fossil clone `curl http://app-landing-page | grep '<link rel="fossil-source" '| sed 's/.*href="[^"]"/\1/'` anonymous added on 2010-03-19 06:48:33: # You don't need this part: <FilesMatch "\.repo$"> Options +ExecCGI AddHandler cgi-script .repo RewriteEngine Off </FilesMatch> # But you need this (you might want to replace foo.repo with /cgi-bin/foo.cgi): RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^Fossil/\[[a-z0-9]{10}\] RewriteRule ^(.*) /foo.repo/$1 [L] |