In Firefox, the hashes in the blame UI are out of step with the line
number and content leading to ever increasing vertical misalignment.
This is caused by the .oid class setting font-size to 90%, so override
this back to 100% for the blame case, bringing the height of lines in
all three columns
suspect->commit->parents) {
+ struct commit *parent = suspect->commit->parents->item;
+
+ html(" ");
+ cgit_blame_link("^", "Blame the previous revision", NULL,
+ ctx.qry.head, o
Hi,
I'd like to propose a feature (maybe it has already been proposed)
regarding the blame.
Github has a very nice feature (IMHO), that allows you to easily jump
from the current blame, to a blame of a previous version of the file.
It's a link called "View blame prior to this change".
("blob: %s (", oid_to_hex(oid));
cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
rev, path);
- if (ctx.repo->enable_blame) {
+ if (ctx.repo->enable_blame && !is_binary) {
html(") (");
From: Christian Hesse
The blame operation can cause high cost in terms of CPU load for huge
repositories. Let's add a per repository override for enable-blame.
Signed-off-by: Christian Hesse
---
cgit.c | 4
cgit.h | 1 +
cgitrc.5.txt | 4
cmd.c| 2 +-
shared.c
This allows it to work on /blame/ URLs.
Blame has an extra layer of parent elements which
has to be taken into account by the JS when finding
the highlight width, hence the 1 arg to the emit
function.
Signed-off-by: Andy Green
---
ui-blame.c |1 +
1 file changed, 1 insertion(+)
diff --git
This allows it to work on /blame/ URLs.
Blame has an extra layer of parent elements which
has to be taken into account by the JS when finding
the highlight width, hence the 1 arg to the emit
function.
Signed-off-by: Andy Green
---
ui-blame.c |1 +
1 file changed, 1 insertion(+)
diff --git
On 06/20/2018 03:59 AM, John Keeping wrote:
On Tue, Jun 19, 2018 at 03:11:52AM +0800, Andy Green wrote:
On June 19, 2018 2:57:47 AM GMT+08:00, John Keeping wrote:
On Mon, Jun 18, 2018 at 02:02:54PM +0800, Andy Green wrote:
Normal operation of blame view requires div.highlight to
have
On Tue, Jun 19, 2018 at 05:02:07PM +0800, Andy Green wrote:
> Signed-off-by: Andy Green
Pushed to jk/for-jason (after rebasing onto master).
> ---
> ui-blame.c |5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/ui-blame.c b/ui-blame.c
> index 8b56554..37e2c68
On Tue, Jun 19, 2018 at 03:11:52AM +0800, Andy Green wrote:
> On June 19, 2018 2:57:47 AM GMT+08:00, John Keeping
> wrote:
> >On Mon, Jun 18, 2018 at 02:02:54PM +0800, Andy Green wrote:
> >> Normal operation of blame view requires div.highlight to
> >> have ab
Signed-off-by: Andy Green
---
ui-blame.c |5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui-blame.c b/ui-blame.c
index 8b56554..37e2c68 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -154,7 +154,7 @@ static void print_object(const struct object_id *oid, const
char *path,
Normal operation of blame view requires div.highlight to
have absolute position and set to its parent's top for me.
Otherwise the grey background boxes indicating the extent of
the patch in the lines td displace the highlit sources, they
start at the bottom of the td.
This patch makes the blame
On Mon, Jun 18, 2018 at 02:02:54PM +0800, Andy Green wrote:
> Normal operation of blame view requires div.highlight to
> have absolute position and set to its parent's top left
> for me.
>
> Otherwise the grey background boxes indicating the extent of
> the patch in the
Normal operation of blame view requires div.highlight to
have absolute position and set to its parent's top left
for me.
Otherwise the grey background boxes indicating the extent of
the patch in the lines td displace the highlit sources, they
start at the bottom of the td.
This patch makes
Signed-off-by: Andy Green
---
ui-blame.c |6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui-blame.c b/ui-blame.c
index daa7e2b..6e23f0b 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -154,7 +154,7 @@ static void print_object(const struct object_id *oid, const
char
On 06/16/2018 10:23 PM, John Keeping wrote:
On Wed, Jun 13, 2018 at 10:02:05AM +0800, Andy Green wrote:
Signed-off-by: Andy Green
---
ui-blame.c |3 +++
1 file changed, 3 insertions(+)
diff --git a/ui-blame.c b/ui-blame.c
index 17e2d60..a5c7d69 100644
--- a/ui-blame.c
+++
On Wed, Jun 13, 2018 at 10:02:05AM +0800, Andy Green wrote:
> Signed-off-by: Andy Green
> ---
> ui-blame.c |3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/ui-blame.c b/ui-blame.c
> index 17e2d60..a5c7d69 100644
> --- a/ui-blame.c
> +++ b/ui-blame.c
> @@ -206,6 +206,9 @@ static
Signed-off-by: Andy Green
---
ui-blame.c |3 +++
1 file changed, 3 insertions(+)
diff --git a/ui-blame.c b/ui-blame.c
index 17e2d60..a5c7d69 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -206,6 +206,9 @@ static void print_object(const unsigned char *sha1, const
char *path,
} else {
This patchset has been merged to master. Thanks for your contribution!
Jason
___
CGit mailing list
CGit@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/cgit
On Sun, Oct 29, 2017 at 11:23:38PM +0100, Jason A. Donenfeld wrote:
> Works remarkably well. Excellent work. Example, for others on the list:
>
> https://git.zx2c4.com/WireGuard/blame/src/noise.c
>
> Pending objections from others, I'll merge this from jd/color-blame to
> ma
Works remarkably well. Excellent work. Example, for others on the list:
https://git.zx2c4.com/WireGuard/blame/src/noise.c
Pending objections from others, I'll merge this from jd/color-blame to
master in a few days.
Thanks for this series!
Jason
) {
+ cgit_print_error_page(500, "Internal server error",
+ "Error reading object %s", sha1_to_hex(sha1));
+ return;
+ }
+
argv_array_push(_argv, "blame");
argv_array_push(_argv, rev);
init_revisions(,
ev_argv = ARGV_ARRAY_INIT;
> struct rev_info revs;
> @@ -102,6 +117,13 @@ static void print_object(const unsigned char *sha1,
> const char *path,
> return;
> }
>
> + buf = read_sha1_file(sha1, , );
> + if (!buf) {
>
rror",
+ "Error reading object %s", sha1_to_hex(sha1));
+ return;
+ }
+
argv_array_push(_argv, "blame");
argv_array_push(_argv, rev);
init_revisions(, NULL);
@@ -157,20 +179,37 @@ static void print_object(con
Just waiting on resubmission of this 4/4, then. I'll put 1-3 in a branch.
Jason
___
CGit mailing list
CGit@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/cgit
On Sat, Oct 21, 2017 at 9:43 AM, John Keeping wrote:
>
> This doesn't account for tabs, which is noticable in long lines (I
> happened to test with cgit.c where line 615 is quite a bit longer than
> average).
>
> It is fixed by using:
>
> const char *start =
char *path,
>const char *basename, const char *rev)
> {
> enum object_type type;
> + char *buf;
> unsigned long size;
> struct argv_array rev_argv = ARGV_ARRAY_INIT;
> struct rev_info revs;
> @@ -102,6 +109,13 @@ static void print_object
On Tue, Oct 17, 2017 at 11:17:34PM -0500, Jeff Smith wrote:
> Signed-off-by: Jeff Smith
Reviewed-by: John Keeping
> ---
> cgit.css | 19 +--
> ui-blame.c | 58 +-
> 2 files
On Tue, Oct 17, 2017 at 11:17:33PM -0500, Jeff Smith wrote:
> Signed-off-by: Jeff Smith
Reviewed-by: John Keeping
> ---
> ui-blame.c | 44 ++--
> 1 file changed, 30 insertions(+), 14 deletions(-)
>
> diff --git
Signed-off-by: Jeff Smith
---
cgit.css | 1 +
ui-blame.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/cgit.css b/cgit.css
index 836f8ae..893ebeb 100644
--- a/cgit.css
+++ b/cgit.css
@@ -300,6 +300,7 @@ div#cgit table.blob {
border-top: solid
ternal server error",
+ "Error reading object %s", sha1_to_hex(sha1));
+ return;
+ }
+
argv_array_push(_argv, "blame");
argv_array_push(_argv, rev);
init_revisions(, NULL);
@@ -157,20 +171,37 @@ sta
Signed-off-by: Jeff Smith
---
cgit.css | 19 +--
ui-blame.c | 58 +-
2 files changed, 54 insertions(+), 23 deletions(-)
diff --git a/cgit.css b/cgit.css
index 893ebeb..20b7e86 100644
--- a/cgit.css
+++
I reorganized the ordering of the table so that the lines of the file
are contained within a single cell, and the base layer of that cell
contains the alternating colors. I then pass the full contents of the
file through the source filter.
Jeff Smith (4):
ui-blame: Distinguish hashes column
Signed-off-by: Jeff Smith
---
ui-blame.c | 44 ++--
1 file changed, 30 insertions(+), 14 deletions(-)
diff --git a/ui-blame.c b/ui-blame.c
index a5ac590..9b84147 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -41,36 +41,52 @@ static char
Hi Jeff,
Oh, cool. What's your idea for accomplishing that? Planning on putting
it through the filter, buffering it, and then spitting it back out in
equal sized chunks, hoping the filter doesn't add extra new lines?
Jason
___
CGit mailing list
That seems like it could be valuable work, but FWIW I have been working on
a different solution to adding syntax highlighting to the blame page. I
hope to have it ready (at least a prototype) in the next day or two.
On Oct 15, 2017 11:47 AM, "Jason A. Donenfeld" <ja...@zx2c4.com>
Right, we may very well need a more capable model.
One approach would be to get rid of all the exec stuff, and instead
have plugins, that can register themselves in all sorts of places. A
plugin would define a series of hooks and filters, which would be
directly called at the right time. We'd
On Sat, Oct 14, 2017 at 04:17:46PM +0200, Jason A. Donenfeld wrote:
> This patch set is currently broken, because in the exec filter,
> processes like to buffer their output. The result is that the text winds
> up at the bottom:
>
> https://git.zx2c4.com/cgit/blame/cache.c
This patch set is currently broken, because in the exec filter,
processes like to buffer their output. The result is that the text winds
up at the bottom:
https://git.zx2c4.com/cgit/blame/cache.c
If anybody has some ideas on how we might enact a flush operation, please
pipe up (hah
We toggle the filter on and off so that the control table can avoid
going through the filter.
Signed-off-by: Jason A. Donenfeld
---
ui-blame.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/ui-blame.c b/ui-blame.c
index 62cf431..71aec65
, Oct 3, 2017 at 1:36 PM, Jason A. Donenfeld <ja...@zx2c4.com> wrote:
> Merged to master. Working quite nicely:
>
> https://git.zx2c4.com/cgit/blame/ui-shared.c
>
> Jeff -- do we want to be passing this through the source code filter
>
Merged to master. Working quite nicely:
https://git.zx2c4.com/cgit/blame/ui-shared.c
Jeff -- do we want to be passing this through the source code filter
to get highlighted lines?
___
CGit mailing list
CGit@lists.zx2c4.com
https://lists.zx2c4.com
On Tue, Oct 03, 2017 at 01:29:59AM +0200, Christian Hesse wrote:
> Jeffrey Smith on Mon, 2017/10/02 17:35:
> > From what I can see, it appears that it is in ch/for-jason.
> >
> > Also, I noticed a typo in my html_ntxt patch:
> > ssize_t slen = (size_t) len;
> >should be
>
Jeffrey Smith on Mon, 2017/10/02 17:35:
> From what I can see, it appears that it is in ch/for-jason.
>
> Also, I noticed a typo in my html_ntxt patch:
> ssize_t slen = (size_t) len;
>should be
> ssize_t slen = (ssize_t) len;
>
> Do I need to resend, or can someone fix
eview.
>
>> If you'd like to put this in a
>> for-jason branch, I'll get to merging it soon.
>
> I pushed the latest version to ch/ui-blame.
> --
> main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
> "CX:;",b;for(a/*
l get to merging it soon.
I pushed the latest version to ch/ui-blame.
--
main(a){char*c=/*Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/*Best regards my address:*/=0;b=c[a++];)
putchar(b-1/(/*Chriscc -ox -xc -
Implement a page which provides the blame view of a specified file.
This feature is controlled by a new config variable, "enable-blame",
which is disabled by default.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
cgit.c | 2 +
cgit.css | 8 +++
cgit.h
Create links to the blame page.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
ui-shared.c | 20 +---
ui-shared.h | 3 +++
ui-tree.c | 10 +-
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/ui-shared.c b/ui-shared.c
index 315dedb..07c78a5
I split git blame functionality into libgit, and the changes were
accepted upstream and are a part of git 2.14. Now that the git
infrastructure is in place, here is what is needed for cgit to make use
of it.
Since previous set:
. Updated html_ntxt signature
. set_title_from_path
On Wed, Sep 27, 2017 at 05:43:31PM -0500, Jeff Smith wrote:
> Create links to the blame page.
>
> Signed-off-by: Jeff Smith <whydo...@gmail.com>
Reviewed-by: John Keeping <j...@keeping.me.uk>
> ---
> ui-shared.c | 20 +---
> ui-shared.
Create links to the blame page.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
ui-shared.c | 20 +---
ui-shared.h | 3 +++
ui-tree.c | 10 +-
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/ui-shared.c b/ui-shared.c
index ee96755..f75338a
eff Smith wrote:
>> Use the blame interface added in libgit to output the blame information
>> of a file in the repository.
>>
>> Signed-off-by: Jeff Smith <whydo...@gmail.com>
>> ---
>> diff --git a/ui-blame.c b/ui-blame.c
>> index 901ca89..cc4457a 1
Yes, it is identical.
I will look at extracting to ui-shared.c as you suggest.
On Sat, Sep 23, 2017 at 10:47 AM, John Keeping <j...@keeping.me.uk> wrote:
> On Fri, Sep 22, 2017 at 10:38:43PM -0500, Jeff Smith wrote:
>> Create framework for a page that will contain the 'bl
I will start re-arranging the patches to follow your suggestion.
On Sat, Sep 23, 2017 at 10:53 AM, John Keeping <j...@keeping.me.uk> wrote:
> On Fri, Sep 22, 2017 at 10:38:41PM -0500, Jeff Smith wrote:
>> I split git blame functionality into libgit, and the changes were
>&
On Fri, Sep 22, 2017 at 10:38:46PM -0500, Jeff Smith wrote:
> Use the blame interface added in libgit to output the blame information
> of a file in the repository.
>
> Signed-off-by: Jeff Smith <whydo...@gmail.com>
> ---
> diff --git a/ui-blame.c b/ui-blame.c
> in
On Fri, Sep 22, 2017 at 10:38:45PM -0500, Jeff Smith wrote:
> For implementing a ui-blame page, there is need for a function that
> outputs a selection from a block of text, transformed for HTML output,
> but with no further modifications or additions.
>
> Signed-off-by: Je
On Fri, Sep 22, 2017 at 10:38:43PM -0500, Jeff Smith wrote:
> Create framework for a page that will contain the 'blame' for a file
> in the repository.
>
> Signed-off-by: Jeff Smith <whydo...@gmail.com>
> --
Signed-off-by: Jeff Smith
---
cgit.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/cgit.mk b/cgit.mk
index 90a2346..3fcc1ca 100644
--- a/cgit.mk
+++ b/cgit.mk
@@ -77,6 +77,7 @@ CGIT_OBJ_NAMES += parsing.o
CGIT_OBJ_NAMES += scan-tree.o
CGIT_OBJ_NAMES += shared.o
d)
+{
+ if (ctx.cfg.enable_blame)
+ cgit_print_blame();
+ else
+ cgit_print_error_page(403, "Forbidden", "Blame is disabled");
+}
+
static void blob_fn(void)
{
cgit_print_blob(ctx.qry.sha1, ctx.qry.path, ctx.qry.head, 0);
@@ -164,6 +173,7
Use the blame interface added in libgit to output the blame information
of a file in the repository.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
cgit.css | 8 +++
ui-blame.c | 210 -
2 files changed, 216 insertions
Create links to the blame page.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
ui-shared.c | 20 +---
ui-shared.h | 3 +++
ui-tree.c | 10 +-
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/ui-shared.c b/ui-shared.c
index e5c9a02..faa0d6a
For implementing a ui-blame page, there is need for a function that
outputs a selection from a block of text, transformed for HTML output,
but with no further modifications or additions.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
html.c
Create framework for a page that will contain the 'blame' for a file
in the repository.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
ui-blame.c | 160 +
ui-blame.h | 7 +++
2 files changed, 167 insertions(+)
create mode
*name, const char *value)
ctx.cfg.enable_tree_linenumbers = atoi(value);
else if (!strcmp(name, "enable-git-config"))
ctx.cfg.enable_git_config = atoi(value);
+ else if (!strcmp(name, "enable-blame"))
+ ctx.cfg
and integrating some
>> of the suggestions made thus far. Blame is certainly a more expensive
>> operation, and adding a flag for it makes a lot of sense. I will look into
>> it further.
>
> I rebased the original code on current master.
>
> Any news on an updated set of
Jeffrey Smith <whydo...@gmail.com> on Fri, 2017/08/04 19:57:
> I am working at rebasing my changes onto git 2.14-rc1 and integrating some
> of the suggestions made thus far. Blame is certainly a more expensive
> operation, and adding a flag for it makes a lot of sen
I am working at rebasing my changes onto git 2.14-rc1 and integrating some
of the suggestions made thus far. Blame is certainly a more expensive
operation, and adding a flag for it makes a lot of sense. I will look into
it further.
- Jeff
On Aug 4, 2017 7:23 PM, "Daniel Campbell"
On Wed, Jun 07, 2017 at 09:18:06PM -0500, Jeff Smith wrote:
> I split git blame functionality into libgit, and the changes were
> accepted upstream a few days ago. Now that the git infrastructure is in
> place, it is time to get back to the cgit part.
>
> The first patch advances
On Wed, Jun 07, 2017 at 09:18:10PM -0500, Jeff Smith wrote:
> Use the blame interface added in libgit to output the blame information
> of a file in the repository.
>
> Signed-off-by: Jeff Smith <whydo...@gmail.com>
> ---
> cgit.css | 8
On Wed, Jun 07, 2017 at 09:18:09PM -0500, Jeff Smith wrote:
> For implementing a ui-blame page, there is need for a function that
> outputs a selection from a block of text, transformed for HTML output,
> but with no further modifications or additions.
>
> Signed-off-by: Je
On Wed, Jun 07, 2017 at 09:18:08PM -0500, Jeff Smith wrote:
> Create a placeholder for and links to a page that will contain the
> 'blame' for a file in the repository.
>
> Signed-off-by: Jeff Smith <whydo...@gmail.com>
> ---
> cgit.mk | 1 +
> cmd.c |
Jeff Smith on Wed, 2017/06/07 21:18:
> +div#cgit table.blame tr:nth-child(even) {
> + background: #f7f0e7;
> +}
We do not use this color for anything, no? Any reason not to use a color that
is used elsewhere, for example #f7f7f7?
--
main(a){char*c=/*Schoene Gruesse
Jeff Smith <whydo...@gmail.com> on Wed, 2017/06/07 21:18:
> I split git blame functionality into libgit, and the changes were
> accepted upstream a few days ago. Now that the git infrastructure is in
> place, it is time to get back to the cgit part.
>
> The first patch ad
Use the blame interface added in libgit to output the blame information
of a file in the repository.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
cgit.css | 8 +++
ui-blame.c | 214 -
2 files changed, 220 insertions
For implementing a ui-blame page, there is need for a function that
outputs a selection from a block of text, transformed for HTML output,
but with no further modifications or additions.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
html.c | 37 -
Create a placeholder for and links to a page that will contain the
'blame' for a file in the repository.
Signed-off-by: Jeff Smith <whydo...@gmail.com>
---
cgit.mk | 1 +
cmd.c | 8 ++-
ui-blame.c | 160
ui-b
I split git blame functionality into libgit, and the changes were
accepted upstream a few days ago. Now that the git infrastructure is in
place, it is time to get back to the cgit part.
The first patch advances git to current master (which should be future
v2.14), and makes changes made
Hey Jeff,
If option 1 can be done cleanly enough, that'd be fine with me.
Jason
___
CGit mailing list
CGit@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/cgit
Relying on an installed git does impose an additional deployment
requirement we didn't have before. Previously git was just required
for running the tests (developers), but not for deployment.
I'll wait to receive some other opinions on the topic of relying on
having the executables around.
On Wed, Aug 12, 2015 at 3:03 PM, John Keeping j...@keeping.me.uk wrote:
This is an attempt at adding blame support to CGit. Because git.git
doesn't include the blame implementation in libgit.a, I decided to
simply invoke git-blame(1) and parse its porcelain output.
Could you possibly just do
This is disabled by default and needs to be turned on in the config
file.
Because libgit.a does not include the blame implementation (which lives
in git/builtin/blame.c), this is implemented by executing a git-blame
subprocess and parsing its output. Given how expensive the blame
operation
This is an attempt at adding blame support to CGit. Because git.git
doesn't include the blame implementation in libgit.a, I decided to
simply invoke git-blame(1) and parse its porcelain output. I don't
think the result is too hideous (although I do perhaps need to extract
some helper functions
(, sha1_to_hex(sha1));
cgit_plain_link(plain, NULL, NULL, ctx.qry.head,
rev, path);
+ if (ctx.cfg.enable_blame) {
+ html( | );
+ cgit_blame_link(blame, NULL, NULL, ctx.qry.head,
+ rev, path, -1
On Wed, Jan 21, 2015 at 11:02:32AM -0500, Elijah Lynn wrote:
I am not sure if there is an issue tracker being used for the project. I
asked the list a while back but haven't heard back. At any rate, is there a
way I can see if there is git blame support being built? I am part of the
Drupal
84 matches
Mail list logo