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

Re: [PATCH] Add 'raw' blob_plain link in history overview

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Aug 21, 2017, 10:19 UTC
Message-ID
<CAOxFTcxOt878uDYj1Y0QMDNe8mNkfX3ZaZayOH3Njp9RWCJo0Q@mail.gmail.com>
In-Reply-To
<20170820180332.GC39363@Vurt.local>
Hello,
On Sun, Aug 20, 2017 at 8:03 PM, Job Snijders <job@instituut.net> wrote:
> bump?

(As a side note, I have also noticed that gitweb patches tend to go unreviewed for long)

Show 30 quoted lines
> On Wed, Aug 02, 2017 at 08:59:01PM +0200, Job Snijders wrote:
>> We often work with very large plain text files in our repositories and
>> found it friendlier to the users if we can click directly to the raw
>> version of such files.
>>
>> This patch adds a 'raw' blob_plain link in history overview.
>>
>> Signed-off-by: Job Snijders <job@instituut.net>
>> ---
>>  gitweb/gitweb.perl | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index 3d4a8ee27..ad79c518e 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -5961,8 +5961,11 @@ sub git_history_body {
>>                                         href(action=>"commit", hash=>$commit), $ref);
>>               print "</td>\n" .
>>                     "<td class=\"link\">" .
>> -                   $cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype) . " | " .
>> -                   $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff");
>> +                   $cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype) . " | ";
>> +             if ($ftype eq 'blob') {
>> +                     print $cgi->a({-href => href(action=>"blob_plain", hash_base=>$commit, file_name=>$file_name)}, "raw") . " | ";
>> +             }
>> +             print $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff");
>>
>>               if ($ftype eq 'blob') {
>>                       my $blob_current = $file_hash;

Arguably, the addition of the 'raw' link should be done in the same conditional that also adds the 'diff to current' link, before the diff to current link. This would be more consistent with the tree view (which puts the raw link last), while still preserving the alignment of the link position independently of the existence of the 'diff to current' link. (Bonus extra: smaller patch)

-- 
Giuseppe "Oblomov" Bilotta
Previous: Job SnijdersNext: Job Snijders
Message 3 of 12 in “Add 'raw' blob_plain link in history overview”
  1. Add 'raw' blob_plain link in history overviewJob Snijders, Aug 2, 2017
  2. Job SnijdersAug 20, 2017
  3. Giuseppe BilottaAug 21, 2017
  4. Job SnijdersAug 21, 2017
  5. Giuseppe BilottaAug 21, 2017
  6. Job SnijdersAug 21, 2017
  7. Junio C HamanoAug 22, 2017
  8. Job SnijdersAug 22, 2017
  9. Giuseppe BilottaAug 22, 2017
  10. Job SnijdersAug 22, 2017
  11. Junio C HamanoAug 22, 2017
  12. Junio C HamanoAug 22, 2017

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.