List for cgit developers and users
 help / color / mirror / Atom feed
From: Kian Kasad <kian@kasad.com>
To: cgit@lists.zx2c4.com
Cc: Kian Kasad <kian@kasad.com>
Subject: [PATCH 2/6] Add graph page
Date: Thu,  4 Aug 2022 21:59:35 -0700	[thread overview]
Message-ID: <20220805045939.57987-3-kian@kasad.com> (raw)
In-Reply-To: <20220805045939.57987-1-kian@kasad.com>

Adds a basic graph page which is the same as the log page except the
commit graph is enabled when the 'enable-commit-graph' option is set to
"separate". It does not implement the full option behavior yet.
---
 cmd.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/cmd.c b/cmd.c
index 0eb75b1..1f86047 100644
--- a/cmd.c
+++ b/cmd.c
@@ -101,7 +101,15 @@ static void log_fn(void)
 {
 	cgit_print_log(ctx.qry.oid, ctx.qry.ofs, ctx.cfg.max_commit_count,
 		       ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1,
-		       ctx.repo->enable_commit_graph,
+		       (ctx.repo->enable_commit_graph == 1) ? 1 : 0,
+		       ctx.repo->commit_sort);
+}
+
+static void graph_fn(void)
+{
+	cgit_print_log(ctx.qry.oid, ctx.qry.ofs, ctx.cfg.max_commit_count,
+		       ctx.qry.grep, ctx.qry.search, ctx.qry.path, 1,
+		       (ctx.repo->enable_commit_graph == 2) ? 1 : 0,
 		       ctx.repo->commit_sort);
 }
 
@@ -179,6 +187,7 @@ struct cgit_cmd *cgit_get_cmd(void)
 		def_cmd(diff, 1, 1, 0),
 		def_cmd(info, 1, 0, 1),
 		def_cmd(log, 1, 1, 0),
+		def_cmd(graph, 1, 1, 0),
 		def_cmd(ls_cache, 0, 0, 0),
 		def_cmd(objects, 1, 0, 1),
 		def_cmd(patch, 1, 1, 0),
-- 
2.37.1


  parent reply	other threads:[~2022-08-05  5:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 22:31 User-configurable log graph option Kian Kasad
2021-02-19 12:22 ` John Keeping
2021-12-30 21:08   ` Kian Kasad
2022-08-05  4:59     ` [PATCH 0/6] Option for separate 'log' and 'graph' pages Kian Kasad
2022-08-05  4:59       ` [PATCH 1/6] Implement parsing of new enable-commit-graph option Kian Kasad
2022-08-05  4:59       ` Kian Kasad [this message]
2022-08-05  4:59       ` [PATCH 3/6] Don't display commit age on graph page Kian Kasad
2022-08-05  4:59       ` [PATCH 4/6] Don't display graph page if enable-commit-graph is not set to "separate" Kian Kasad
2022-08-05  4:59       ` [PATCH 5/6] Add graph page tab if enable-commit-graph is " Kian Kasad
2022-08-05  4:59       ` [PATCH 6/6] Document new enable-commit-graph option Kian Kasad
2023-01-05 23:14     ` Follow-up: User-configurable log graph option Kian Kasad
2023-07-01  6:28       ` Daniel Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220805045939.57987-3-kian@kasad.com \
    --to=kian@kasad.com \
    --cc=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).