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 4/6] Don't display graph page if enable-commit-graph is not set to "separate"
Date: Thu,  4 Aug 2022 21:59:37 -0700	[thread overview]
Message-ID: <20220805045939.57987-5-kian@kasad.com> (raw)
In-Reply-To: <20220805045939.57987-1-kian@kasad.com>

If the graph page is not supposed to be enabled, it returns a "404 Not
Found" error page.
---
 cmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd.c b/cmd.c
index c780895..6940b60 100644
--- a/cmd.c
+++ b/cmd.c
@@ -107,6 +107,8 @@ static void log_fn(void)
 
 static void graph_fn(void)
 {
+	if (ctx.repo->enable_commit_graph != 2)
+		return cgit_print_error_page(404, "Not found", "Not found");
 	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) ? 2 : 0,
-- 
2.37.1


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

Thread overview: 10+ 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       ` [PATCH 2/6] Add graph page Kian Kasad
2022-08-05  4:59       ` [PATCH 3/6] Don't display commit age on " Kian Kasad
2022-08-05  4:59       ` Kian Kasad [this message]
2022-08-05  4:59       ` [PATCH 5/6] Add graph page tab if enable-commit-graph is set to "separate" Kian Kasad
2022-08-05  4:59       ` [PATCH 6/6] Document new enable-commit-graph option Kian Kasad

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-5-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).