From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1276 invoked from network); 5 Aug 2022 05:00:13 -0000 Received: from lists.zx2c4.com (165.227.139.114) by inbox.vuxu.org with ESMTPUTF8; 5 Aug 2022 05:00:13 -0000 Received: by lists.zx2c4.com (OpenSMTPD) with ESMTP id b18e7c00; Fri, 5 Aug 2022 04:59:55 +0000 (UTC) Return-Path: Received: from mail.kasad.com (mail.kasad.com [140.82.7.10]) by lists.zx2c4.com (OpenSMTPD) with ESMTPS id 5f2485d4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 5 Aug 2022 04:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kasad.com; i=@kasad.com; q=dns/txt; s=mail; t=1659675591; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=A+49/sZ+NxUEZKeUWCUSNm8vyiU/pFkPtyQyZRVqZ8Y=; b=lbDf7dETGNqPKXdpqpe+Od4QsXGwY/fYY10122UITc6RCwVPuA07cZYHtTfhhv2hIIEzZ UJPLwa5h246kmiQ350PEHSXbINM9SrBnZxu+AV8PhO/wnF4iEikyBqqaa6ucaBWfb5d0hY1 Fr9hHbjHpUUX8T1gY1slCpcehFMYP2Tye2D/yI95aK7ItrCjh0lCK96VwyrcXu/SouRiZsp Eo5wLEwm5mzwlEtxrYeSUUKjBMEnD5ibQ1ad3fea8EYetUVsx+irOdAGnbczO4wqt2+uR4p v4qwGkfKtrOY3I0Eo/w4i4FyxhPWzIfEL7BrLPiXlEz4/5LXvCIKmq9Hk6ZQ== Received: from localhost (c-98-35-26-36.hsd1.ca.comcast.net [98.35.26.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail.kasad.com (Postfix) with ESMTPSA id AD31F27371; Thu, 4 Aug 2022 21:59:50 -0700 (PDT) From: Kian Kasad To: cgit@lists.zx2c4.com Cc: Kian Kasad Subject: [PATCH 2/6] Add graph page Date: Thu, 4 Aug 2022 21:59:35 -0700 Message-Id: <20220805045939.57987-3-kian@kasad.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220805045939.57987-1-kian@kasad.com> References: <20211230210820.3ncgngexbbhlpbdq@frisbee.local> <20220805045939.57987-1-kian@kasad.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: cgit@lists.zx2c4.com X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: List for cgit developers and users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cgit-bounces@lists.zx2c4.com Sender: "CGit" 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