Topic on User talk:Krenair

Linking to a raw file on Git

3
Kghbln (talkcontribs)

Heiya Krenair, you seem to know your way around in Git. In case I want to link to a raw file to display on screen which is in the root directory of an extension I do e.g. https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Validator.git;a=blob_plain;f=INSTALL;hb=HEAD This is understood and expected. What do I have to do if a file is in a subdirectory of the extension, e.g. /includes/Parameter.php So far I managed only to trigger a direct download? However most files are in subdirectories, so it would be cool to know how to do it. I currently have no idea how. O_o May you help? Cheers

Krenair (talkcontribs)

Hi. I definitely know my way around Gitweb and Gerrit as well to some extent. Just change "f=INSTALL" to "f=/includes/Parameter.php". Unfortunately because the file type is PHP it'll try to download the file instead of display it. This happens even if the file is in the root directory, and I'm not sure if there's a way to force display on screen.

What you might like to do instead is this: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Validator.git;a=blob;f=includes/Parameter.php;hb=HEAD

Kghbln (talkcontribs)

:) Yeah, forcing php files to display on screen without getting a download was basically what I was trying to achieve. So I guess it is not possible right now. :( Hopefully on day ... I thought about your alternative proposal, too. I figured that it is not very elegant in case you want to link to a file for documentation purposes, since you get to read revision comments etc. Still it is better than nothing, isn't it?!. Thank you very much for your help and for fixing the link on my talk page. :) Cheers

Reply to "Linking to a raw file on Git"