List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 0/2] ui-log: Don't print out unknown decoration types
@ 2016-02-26 20:57 tim.nordell
  2016-02-26 20:57 ` [PATCH 1/2] ui-log: Do not always emit decoration span tim.nordell
  0 siblings, 1 reply; 4+ messages in thread
From: tim.nordell @ 2016-02-26 20:57 UTC (permalink / raw)


On our server we have some ref spaces that shouldn't be displayed in
the main log.  The command line tool "git log" does not display these
either.  Add some additional smarts to ui-log so that it uses the
enumeration types returned by the internals of git to determine
whether or not to display a tag, as well as converting the logic
in the log to use these enumerations rather than reinventing the
wheel for these.

Tim Nordell (2):
  ui-log: Do not always emit decoration span
  ui-log: Simplify decoration code

 ui-log.c | 58 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 29 insertions(+), 29 deletions(-)
-- 
2.4.9



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ui-log: Do not always emit decoration span
  2016-02-26 20:57 [PATCH 0/2] ui-log: Don't print out unknown decoration types tim.nordell
@ 2016-02-26 20:57 ` tim.nordell
  2016-02-28 12:40   ` john
  2016-05-12 15:16   ` Jason
  0 siblings, 2 replies; 4+ messages in thread
From: tim.nordell @ 2016-02-26 20:57 UTC (permalink / raw)


The decoration span does not need to be emited if there aren't
any decorations to show.  This modification saves slightly
on bandwidth.

Signed-off-by: Tim Nordell <tim.nordell at logicpd.com>

diff --git a/ui-log.c b/ui-log.c
index 0a3938b..62881ce 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -61,6 +61,8 @@ void show_commit_decorations(struct commit *commit)
 
 	buf[sizeof(buf) - 1] = 0;
 	deco = get_name_decoration(&commit->object);
+	if(!deco)
+		return;
 	html("<span class='decoration'>");
 	while (deco) {
 		if (starts_with(deco->name, "refs/heads/")) {
-- 
2.4.9



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ui-log: Do not always emit decoration span
  2016-02-26 20:57 ` [PATCH 1/2] ui-log: Do not always emit decoration span tim.nordell
@ 2016-02-28 12:40   ` john
  2016-05-12 15:16   ` Jason
  1 sibling, 0 replies; 4+ messages in thread
From: john @ 2016-02-28 12:40 UTC (permalink / raw)


On Fri, Feb 26, 2016 at 02:57:30PM -0600, Tim Nordell wrote:
> The decoration span does not need to be emited if there aren't
> any decorations to show.  This modification saves slightly
> on bandwidth.
> 
> Signed-off-by: Tim Nordell <tim.nordell at logicpd.com>
> 
> diff --git a/ui-log.c b/ui-log.c
> index 0a3938b..62881ce 100644
> --- a/ui-log.c
> +++ b/ui-log.c
> @@ -61,6 +61,8 @@ void show_commit_decorations(struct commit *commit)
>  
>  	buf[sizeof(buf) - 1] = 0;
>  	deco = get_name_decoration(&commit->object);
> +	if(!deco)

style nit: if (!deco)

otherwise:

Reviewed-by: John Keeping <john at keeping.me.uk>

> +		return;
>  	html("<span class='decoration'>");
>  	while (deco) {
>  		if (starts_with(deco->name, "refs/heads/")) {
> -- 
> 2.4.9
> 
> _______________________________________________
> CGit mailing list
> CGit at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/cgit


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ui-log: Do not always emit decoration span
  2016-02-26 20:57 ` [PATCH 1/2] ui-log: Do not always emit decoration span tim.nordell
  2016-02-28 12:40   ` john
@ 2016-05-12 15:16   ` Jason
  1 sibling, 0 replies; 4+ messages in thread
From: Jason @ 2016-05-12 15:16 UTC (permalink / raw)


Merged, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20160512/92da2b83/attachment.html>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-12 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-26 20:57 [PATCH 0/2] ui-log: Don't print out unknown decoration types tim.nordell
2016-02-26 20:57 ` [PATCH 1/2] ui-log: Do not always emit decoration span tim.nordell
2016-02-28 12:40   ` john
2016-05-12 15:16   ` Jason

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 NNTP newsgroup(s).