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

2017-08-22 Thread Junio C Hamano
Job Snijders  writes:

> For people that work with very large plain text files it may be easier
> if one can bypass viewing the htmlized blob and instead click directly
> to the raw file (rather then click through 'blob' and then to 'raw').
>
> Reviewed-by: Giuseppe Bilotta 
> Signed-off-by: Job Snijders 
>
> ---

This is much more readable ;-)  Will replace.

Thanks.

>  gitweb/gitweb.perl | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 9208f42ed..959f04b49 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5967,6 +5967,9 @@ sub git_history_body {
> $cgi->a({-href => href(action=>"commitdiff", 
> hash=>$commit)}, "commitdiff");
>  
>   if ($ftype eq 'blob') {
> + print " | " .
> +   $cgi->a({-href => href(action=>"blob_plain", 
> hash_base=>$commit, file_name=>$file_name)}, "raw");
> +
>   my $blob_current = $file_hash;
>   my $blob_parent  = git_get_hash_by_path($commit, 
> $file_name);
>   if (defined $blob_current && defined $blob_parent &&


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

2017-08-22 Thread Job Snijders
For people that work with very large plain text files it may be easier
if one can bypass viewing the htmlized blob and instead click directly
to the raw file (rather then click through 'blob' and then to 'raw').

Reviewed-by: Giuseppe Bilotta 
Signed-off-by: Job Snijders 

---
 gitweb/gitweb.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9208f42ed..959f04b49 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5967,6 +5967,9 @@ sub git_history_body {
  $cgi->a({-href => href(action=>"commitdiff", 
hash=>$commit)}, "commitdiff");
 
if ($ftype eq 'blob') {
+   print " | " .
+ $cgi->a({-href => href(action=>"blob_plain", 
hash_base=>$commit, file_name=>$file_name)}, "raw");
+
my $blob_current = $file_hash;
my $blob_parent  = git_get_hash_by_path($commit, 
$file_name);
if (defined $blob_current && defined $blob_parent &&


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

2017-08-22 Thread Junio C Hamano
Job Snijders  writes:

> On Tue, Aug 22, 2017 at 12:22:43PM -0700, Junio C Hamano wrote:
>> Job Snijders  writes:
>> > Add 'raw' blob_plain link in history overview
>> >
>> > Reviewed-by: Giuseppe Bilotta 
>> > Signed-off-by: Job Snijders 
>> >
>> > ---
>> 
>> Thanks; I somehow thought that your earlier one not just said what
>> it does (twice---that is not needed) but why this change is useful,
>> but that is lost in the patch description?
>
> We often work with very large plain text files...

You do not have to explain it to _me_ ;-) I wanted you to explain it
to our history, instead of me manually tweaking your proposed log
message in your patch with what you sent over e-mail in a follow up
explanation like this one.

> ...
> immediately click to the 'raw' version, saving time and improving
> workflow.

Most of the above, or at least a condensed version of it, should be
in the proposed log message.  That is all I was saying.

Thanks.


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

2017-08-22 Thread Giuseppe Bilotta
On Tue, Aug 22, 2017 at 9:35 PM, 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.

It might be worth it to add this information to the commit message.

-- 
Giuseppe "Oblomov" Bilotta


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

2017-08-22 Thread Job Snijders
On Tue, Aug 22, 2017 at 12:22:43PM -0700, Junio C Hamano wrote:
> Job Snijders  writes:
> > Add 'raw' blob_plain link in history overview
> >
> > Reviewed-by: Giuseppe Bilotta 
> > Signed-off-by: Job Snijders 
> >
> > ---
> 
> Thanks; I somehow thought that your earlier one not just said what
> it does (twice---that is not needed) but why this change is useful,
> but that is lost in the patch description?

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.

Without this patch the workflow is to go to the history of a file, click
the 'blob' link, and then click the 'raw' link. If the file is large
(multiple megabytes) - rendering the html enveloppe to the blob can take
quite some time in the browser DOM rendering. 

This patch adds a 'raw' blob_plain link in history overview so you can
immediately click to the 'raw' version, saving time and improving
workflow.

Here is a screenshot of a gitweb instance with this patch applied:

http://instituut.net/~job/screenshots/b0f30e21eb64d5dda75ddabd.png

Kind regards,

Job


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

2017-08-22 Thread Junio C Hamano
Job Snijders  writes:

> Add 'raw' blob_plain link in history overview
>
> Reviewed-by: Giuseppe Bilotta 
> Signed-off-by: Job Snijders 
>
> ---

Thanks; I somehow thought that your earlier one not just said what
it does (twice---that is not needed) but why this change is useful,
but that is lost in the patch description?

>  gitweb/gitweb.perl | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 9208f42ed..959f04b49 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5967,6 +5967,9 @@ sub git_history_body {
> $cgi->a({-href => href(action=>"commitdiff", 
> hash=>$commit)}, "commitdiff");
>  
>   if ($ftype eq 'blob') {
> + print " | " .
> +   $cgi->a({-href => href(action=>"blob_plain", 
> hash_base=>$commit, file_name=>$file_name)}, "raw");
> +
>   my $blob_current = $file_hash;
>   my $blob_parent  = git_get_hash_by_path($commit, 
> $file_name);
>   if (defined $blob_current && defined $blob_parent &&


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

2017-08-21 Thread Job Snijders
Add 'raw' blob_plain link in history overview

Reviewed-by: Giuseppe Bilotta 
Signed-off-by: Job Snijders 

---
 gitweb/gitweb.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9208f42ed..959f04b49 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5967,6 +5967,9 @@ sub git_history_body {
  $cgi->a({-href => href(action=>"commitdiff", 
hash=>$commit)}, "commitdiff");
 
if ($ftype eq 'blob') {
+   print " | " .
+ $cgi->a({-href => href(action=>"blob_plain", 
hash_base=>$commit, file_name=>$file_name)}, "raw");
+
my $blob_current = $file_hash;
my $blob_parent  = git_get_hash_by_path($commit, 
$file_name);
if (defined $blob_current && defined $blob_parent &&


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

2017-08-21 Thread Giuseppe Bilotta
Hello,

On Mon, Aug 21, 2017 at 12:44 PM, Job Snijders  wrote:
> On Mon, Aug 21, 2017 at 12:19:38PM +0200, Giuseppe Bilotta wrote:
> Thank you for your feedback, good point. Please see below:

This looks fine
> ---
>
> Add a 'raw' blob_plain link in history overview
>
> Signed-off-by: Job Snijders 
> ---
>  gitweb/gitweb.perl | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 9208f42ed..c43bbe331 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5967,6 +5967,9 @@ sub git_history_body {
>   $cgi->a({-href => href(action=>"commitdiff", 
> hash=>$commit)}, "commitdiff");
>
> if ($ftype eq 'blob') {
> +   print " | " .
> +   $cgi->a({-href => href(action=>"blob_plain", 
> hash_base=>$commit, file_name=>$file_name)}, "raw");

Nitpick: gitweb uses tabs for nested indents, but spaces for
alignment. For this line here, the last tab should be replace with
spaces (to align the $ with the quotes above.)

With that fixed, you can add

Reviewed-by: Giuseppe Bilotta 


-- 
Giuseppe "Oblomov" Bilotta


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

2017-08-21 Thread Job Snijders
On Mon, Aug 21, 2017 at 12:19:38PM +0200, Giuseppe Bilotta wrote:
> >> This patch adds a 'raw' blob_plain link in history overview.
> 
> 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)

Thank you for your feedback, good point. Please see below:

---

Add a 'raw' blob_plain link in history overview

Signed-off-by: Job Snijders 
---
 gitweb/gitweb.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9208f42ed..c43bbe331 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5967,6 +5967,9 @@ sub git_history_body {
  $cgi->a({-href => href(action=>"commitdiff", 
hash=>$commit)}, "commitdiff");
 
if ($ftype eq 'blob') {
+   print " | " .
+   $cgi->a({-href => href(action=>"blob_plain", 
hash_base=>$commit, file_name=>$file_name)}, "raw");
+
my $blob_current = $file_hash;
my $blob_parent  = git_get_hash_by_path($commit, 
$file_name);
if (defined $blob_current && defined $blob_parent &&


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

2017-08-21 Thread Giuseppe Bilotta
Hello,

On Sun, Aug 20, 2017 at 8:03 PM, Job Snijders  wrote:
> bump?

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

> 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 
>> ---
>>  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 "\n" .
>> "" .
>> -   $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


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

2017-08-20 Thread Job Snijders
bump? 

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 
> ---
>  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 "\n" .
> "" .
> -   $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;


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

2017-08-02 Thread Job Snijders
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 
---
 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 "\n" .
  "" .
- $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;