]> Lady’s Gitweb - Gitweb/commitdiff
Add "raw" output option to blobs in "tree" view format
authorLuben Tuikov <redacted>
Fri, 7 Jul 2006 06:39:30 +0000 (23:39 -0700)
committerLady <redacted>
Sat, 4 Apr 2026 18:43:37 +0000 (14:43 -0400)
Add a "raw" output option to blobs in "tree" view format, so that the
user doesn't have to click on "blob", wait for the (binary) file to be
uploaded and shown in "blob" mode, and then click on "plain" to
download the (binary) file.

This is useful when the file is clearly binary and we don't want the
browser to upload and display it in "blob" mode, but we just want to
download it.  Case in point: pdf files, wlg.

Note: the "raw" format is equivalent to the blob->plain view, not
blob->head view. I.e. the view has the hash of the file as listed
by git-ls-tree, not just "HEAD".

Signed-off-by: Luben Tuikov <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.cgi

index c790ca6850cbc6e84e4a5a6adb3fee872d157d566df34b4aa12f25c13dc66ccd..dab419f28b74b6ddc658772a2a718e9fedc252c03aac983060f243ea79046061 100755 (executable)
@@ -1668,6 +1668,7 @@ sub git_tree {
                              $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob") .
 #                            " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame") .
                              " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$hash_base;f=$base$t_name")}, "history") .
+                             " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
                              "</td>\n";
                } elsif ($t_type eq "tree") {
                        print "<td class=\"list\">" .
This page took 0.3162 seconds and 4 git commands to generate.