* [PATCH] Add 'raw' blob_plain link in history overview
@ 2017-08-02 18:59 Job Snijders
2017-08-20 18:03 ` Job Snijders
0 siblings, 1 reply; 12+ messages in thread
From: Job Snijders @ 2017-08-02 18:59 UTC (permalink / raw)
To: git
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;
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-02 18:59 [PATCH] Add 'raw' blob_plain link in history overview Job Snijders
@ 2017-08-20 18:03 ` Job Snijders
2017-08-21 10:19 ` Giuseppe Bilotta
0 siblings, 1 reply; 12+ messages in thread
From: Job Snijders @ 2017-08-20 18:03 UTC (permalink / raw)
To: git; +Cc: avarab, yashi, giuseppe.bilotta, jnareb
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 <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;
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-20 18:03 ` Job Snijders
@ 2017-08-21 10:19 ` Giuseppe Bilotta
2017-08-21 10:44 ` Job Snijders
0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2017-08-21 10:19 UTC (permalink / raw)
To: Job Snijders
Cc: Git List, Ævar Arnfjörð Bjarmason, yashi,
Jakub Narebski
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)
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-21 10:19 ` Giuseppe Bilotta
@ 2017-08-21 10:44 ` Job Snijders
2017-08-21 14:07 ` Giuseppe Bilotta
0 siblings, 1 reply; 12+ messages in thread
From: Job Snijders @ 2017-08-21 10:44 UTC (permalink / raw)
To: Giuseppe Bilotta
Cc: Git List, Ævar Arnfjörð Bjarmason, yashi,
Jakub Narebski
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 <job@instituut.net>
---
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 &&
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-21 10:44 ` Job Snijders
@ 2017-08-21 14:07 ` Giuseppe Bilotta
2017-08-21 14:13 ` Job Snijders
0 siblings, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2017-08-21 14:07 UTC (permalink / raw)
To: Job Snijders
Cc: Git List, Ævar Arnfjörð Bjarmason, yashi,
Jakub Narebski
Hello,
On Mon, Aug 21, 2017 at 12:44 PM, Job Snijders <job@instituut.net> 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 <job@instituut.net>
> ---
> 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.bilotta@gmail.com>
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-21 14:07 ` Giuseppe Bilotta
@ 2017-08-21 14:13 ` Job Snijders
2017-08-22 19:22 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Job Snijders @ 2017-08-21 14:13 UTC (permalink / raw)
To: Giuseppe Bilotta
Cc: Git List, Ævar Arnfjörð Bjarmason, yashi,
Jakub Narebski
Add 'raw' blob_plain link in history overview
Reviewed-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Job Snijders <job@instituut.net>
---
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 &&
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-21 14:13 ` Job Snijders
@ 2017-08-22 19:22 ` Junio C Hamano
2017-08-22 19:35 ` Job Snijders
0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2017-08-22 19:22 UTC (permalink / raw)
To: Job Snijders
Cc: Giuseppe Bilotta, Git List,
Ævar Arnfjörð Bjarmason, yashi, Jakub Narebski
Job Snijders <job@instituut.net> writes:
> Add 'raw' blob_plain link in history overview
>
> Reviewed-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
> Signed-off-by: Job Snijders <job@instituut.net>
>
> ---
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 &&
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-22 19:22 ` Junio C Hamano
@ 2017-08-22 19:35 ` Job Snijders
2017-08-22 20:00 ` Giuseppe Bilotta
2017-08-22 20:06 ` Junio C Hamano
0 siblings, 2 replies; 12+ messages in thread
From: Job Snijders @ 2017-08-22 19:35 UTC (permalink / raw)
To: Junio C Hamano
Cc: Giuseppe Bilotta, Git List,
Ævar Arnfjörð Bjarmason, yashi, Jakub Narebski
On Tue, Aug 22, 2017 at 12:22:43PM -0700, Junio C Hamano wrote:
> Job Snijders <job@instituut.net> writes:
> > Add 'raw' blob_plain link in history overview
> >
> > Reviewed-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
> > Signed-off-by: Job Snijders <job@instituut.net>
> >
> > ---
>
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-22 19:35 ` Job Snijders
@ 2017-08-22 20:00 ` Giuseppe Bilotta
2017-08-22 20:07 ` Job Snijders
2017-08-22 20:06 ` Junio C Hamano
1 sibling, 1 reply; 12+ messages in thread
From: Giuseppe Bilotta @ 2017-08-22 20:00 UTC (permalink / raw)
To: Job Snijders
Cc: Junio C Hamano, Git List, Ævar Arnfjörð Bjarmason,
yashi, Jakub Narebski
On Tue, Aug 22, 2017 at 9:35 PM, Job Snijders <job@instituut.net> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-22 19:35 ` Job Snijders
2017-08-22 20:00 ` Giuseppe Bilotta
@ 2017-08-22 20:06 ` Junio C Hamano
1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2017-08-22 20:06 UTC (permalink / raw)
To: Job Snijders
Cc: Giuseppe Bilotta, Git List,
Ævar Arnfjörð Bjarmason, yashi, Jakub Narebski
Job Snijders <job@instituut.net> writes:
> On Tue, Aug 22, 2017 at 12:22:43PM -0700, Junio C Hamano wrote:
>> Job Snijders <job@instituut.net> writes:
>> > Add 'raw' blob_plain link in history overview
>> >
>> > Reviewed-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>> > Signed-off-by: Job Snijders <job@instituut.net>
>> >
>> > ---
>>
>> 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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-22 20:00 ` Giuseppe Bilotta
@ 2017-08-22 20:07 ` Job Snijders
2017-08-22 20:09 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Job Snijders @ 2017-08-22 20:07 UTC (permalink / raw)
To: Giuseppe Bilotta
Cc: Junio C Hamano, Git List, Ævar Arnfjörð Bjarmason,
yashi, Jakub Narebski
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 <giuseppe.bilotta@gmail.com>
Signed-off-by: Job Snijders <job@instituut.net>
---
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 &&
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Add 'raw' blob_plain link in history overview
2017-08-22 20:07 ` Job Snijders
@ 2017-08-22 20:09 ` Junio C Hamano
0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2017-08-22 20:09 UTC (permalink / raw)
To: Job Snijders
Cc: Giuseppe Bilotta, Git List,
Ævar Arnfjörð Bjarmason, yashi, Jakub Narebski
Job Snijders <job@instituut.net> 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 <giuseppe.bilotta@gmail.com>
> Signed-off-by: Job Snijders <job@instituut.net>
>
> ---
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 &&
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-08-22 20:09 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 18:59 [PATCH] Add 'raw' blob_plain link in history overview Job Snijders
2017-08-20 18:03 ` Job Snijders
2017-08-21 10:19 ` Giuseppe Bilotta
2017-08-21 10:44 ` Job Snijders
2017-08-21 14:07 ` Giuseppe Bilotta
2017-08-21 14:13 ` Job Snijders
2017-08-22 19:22 ` Junio C Hamano
2017-08-22 19:35 ` Job Snijders
2017-08-22 20:00 ` Giuseppe Bilotta
2017-08-22 20:07 ` Job Snijders
2017-08-22 20:09 ` Junio C Hamano
2017-08-22 20:06 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).