]> Lady’s Gitweb - Gitweb/commit
gitweb: choose appropriate view for file type if a= parameter missing
authorGerrit Pape <redacted>
Thu, 10 May 2007 07:32:07 +0000 (07:32 +0000)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
commit34ad37e62846aad75906720a7c8c2aec8cf4f105ed784fea75bc5a0a6845b798
tree2cf11019ae7c5a8eb3f587428890512e34187390556b2cc8c0d28a9efd252b92
parent82e574fa07166107cd47286cfe54fa27ee52a16c44e9daedcf69f06a9bce69ea
gitweb: choose appropriate view for file type if a= parameter missing

gitweb URLs use the a= parameter for the view to use on the given path, such
as "blob" or "tree".  Currently, if a gitweb URL omits the a= parameter,
gitweb just shows the top-level repository summary, regardless of the path
given.  gitweb could instead choose an appropriate view based on the file
type: blob for blobs (files), tree for trees (directories), and summary if
no path given (the URL included no f= parameter, or an empty f= parameter).

Apart from making gitweb more robust and supporting URL editing more easily,
this change would aid the creation of shortcuts to git repositories using
simple substitution, such as:
http://example.org/git/?p=path/to/repo.git;hb=HEAD;f=%s

With this patch, if given the hash through the h= parameter, or the hash
base (hb=) and a filename (f=), gitweb uses cat-file -t to automatically set
the a= parameter.

This feature was requested by Josh Triplett through
 http://bugs.debian.org/410465

Signed-off-by: Gerrit Pape <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.225132 seconds and 4 git commands to generate.