git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Complex gitweb URL

From
CDCLOSE Dave <dave.close@us.thalesgroup.com>
Date
Jul 20, 2016, 19:24 UTC
Message-ID
<225e6ff4-178c-cd2a-6a05-b621f0ad4a84@us.thalesgroup.com>

I'm trying to create a URL that will always refer to the latest version of a file stored under Gerrit. gitweb access is available. The man page specification doesn't seem to work for me. Instead, I seem to need to put most of the information into arguments (after the '?').

For example, the repo name includes several directories, so it doesn't work to put it into the ".../gitweb.cgi/<repo>/<action>/<revision>:/<path>?<arguments>" format. Or, at least, I don't see how.

Instead I'm trying to use a URL in the format, "http://site/gitweb/?args". If I use gitweb itself to navigate to my target file, I see a URL in this format that contains several arguments, "p=repo;a=blob;f=file;h=SHA;hb=SHA". If I use that URL directly, I get my file. But those SHA values are not something I know how to determine in advance. And I suspect they are unique to the specific version of the file accessed, not always the latest as I want.

If I replace the hb=SHA argument with hb=HEAD, the URL still works. But I have no idea what I can use to replace the h=SHA argument.

A complication is that the target file is not in the master branch. Somehow I need to be able to specify the branch. I've tried putting it as the h= argument but that results in "Reading blob failed". If I leave out the h= argument entirely, gitweb responds, "404 cannot find file".

Are these arguments documented somewhere? What is the recommended way to construct a URL like I need?

-- 
	Dave Close
Next: Jakub Narębski
Message 1 of 7 in “Complex gitweb URL”
  1. CLOSE DaveJul 20, 2016
  2. Jakub NarębskiJul 20, 2016
  3. CLOSE DaveJul 20, 2016
  4. Jakub NarębskiJul 20, 2016
  5. CLOSE DaveJul 20, 2016
  6. Jakub NarębskiJul 23, 2016
  7. Junio C HamanoJul 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.