Hi,

While prepping the website for the PG18 GA, I stumbled on the inability to access parts of commits through the gitweb links, specifically hitting 429 status code errors (this seems to be intermittent). After some briefing on why it's disabled and how this isn't an issue with cgit, I prepped a patch for postgresql.org (the main website) that would update the git.postgresql.org reference to use cgit instead of gitweb.

However, as this could impact some hacker workflows (e.g. the commit search page), I wanted to run this patch by -hackers before committing. Basically, the patch:

* Moves any web links to git.postgresql.org repos to use the cgit interface instead of gitweb (e.g. [1])
* Update the commit search[2] to use cgit instead of gitweb

Please note that this doesn't impact the availability of gitweb, rather the main parts of the postgresql.org website will link to cgit first, and people will have a more consistent experience overall (e.g. no 429 errors).

Thoughts?

Thanks,

Jonathan

[1] https://www.postgresql.org/developer/related-projects/
[2] https://www.postgresql.org/developer/coding/
From c3d8523951c6736e55da870ab622cc0c34d57011 Mon Sep 17 00:00:00 2001
From: "Jonathan S. Katz" <[email protected]>
Date: Thu, 18 Sep 2025 21:02:40 -0400
Subject: [PATCH] Move gitweb links to cgit

Parts of the gitweb functionality are no longer accessible,
specifically viewing individual commits. cgit doesn't have this
issue, thus move the website links to use the cgit interface.
---
 pgweb/core/templatetags/pgfilters.py          |  2 +-
 templates/docs/docspage.html                  |  2 +-
 templates/pages/about/governance.html         |  2 +-
 .../pages/about/governance/sysadmin.html      |  2 +-
 .../pages/about/policies/conferences.html     |  2 +-
 templates/pages/about/policies/npos.html      |  2 +-
 templates/pages/developer/backend.html        | 24 +++++++++----------
 templates/pages/developer/coding.html         |  8 +++----
 templates/pages/developer/committers.html     |  2 +-
 .../corereports/january2022_december2022.html |  2 +-
 .../pages/developer/related-projects.html     | 18 +++++++-------
 templates/pages/download.html                 |  2 +-
 12 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/pgweb/core/templatetags/pgfilters.py 
b/pgweb/core/templatetags/pgfilters.py
index d66630d..8e038e0 100644
--- a/pgweb/core/templatetags/pgfilters.py
+++ b/pgweb/core/templatetags/pgfilters.py
@@ -151,7 +151,7 @@ def languagename(lang):
 
 @register.simple_tag(takes_context=True)
 def git_changes_link(context):
-    return mark_safe('<a 
href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=history;f=templates/{}";>View</a>
 change history.'.format(context.template_name))
+    return mark_safe('<a 
href="https://git.postgresql.org/cgit/pgweb.git/log/templates/{}";>View</a> 
change history.'.format(context.template_name))
 
 
 # CSS inlining (used for HTML email)
diff --git a/templates/docs/docspage.html b/templates/docs/docspage.html
index f19cb0c..bad2e87 100644
--- a/templates/docs/docspage.html
+++ b/templates/docs/docspage.html
@@ -18,7 +18,7 @@
               <div class="row">
                 <div class="col">
                   <div>
-                    <a href="/docs/" title="Documentation">Documentation</a> 
&rarr; <a 
href="/docs/{{page.display_version}}/{{doc_index_filename}}">PostgreSQL 
{{page.display_version}}</a>{%if loaddate%} ({{loaddate|date:"Y-m-d 
H:i:s"}}{%if loadgit%} - git commit <a 
href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h={{loadgit}}";>{{loadgit}}</a>{%endif%}){%endif%}
+                    <a href="/docs/" title="Documentation">Documentation</a> 
&rarr; <a 
href="/docs/{{page.display_version}}/{{doc_index_filename}}">PostgreSQL 
{{page.display_version}}</a>{%if loaddate%} ({{loaddate|date:"Y-m-d 
H:i:s"}}{%if loadgit%} - git commit <a 
href="https://git.postgresql.org/cgit/postgresql.git/commit/?id={{loadgit}}";>{{loadgit}}</a>{%endif%}){%endif%}
                   </div>
                 </div>
               </div>
diff --git a/templates/pages/about/governance.html 
b/templates/pages/about/governance.html
index b838a3c..c49620d 100644
--- a/templates/pages/about/governance.html
+++ b/templates/pages/about/governance.html
@@ -28,7 +28,7 @@ and charter.
 <p>
   The <a href="/developer/committers/">PostgreSQL Committers</a>
   are the people with access to push to the
-  <a href="https://git.postgresql.org/gitweb/?p=postgresql.git";>git 
repository</a>.
+  <a href="https://git.postgresql.org/cgit/postgresql.git/";>git repository</a>.
 </p>
 
 <h2>Security Team</h2>
diff --git a/templates/pages/about/governance/sysadmin.html 
b/templates/pages/about/governance/sysadmin.html
index 0e48f20..5fde2c2 100644
--- a/templates/pages/about/governance/sysadmin.html
+++ b/templates/pages/about/governance/sysadmin.html
@@ -11,7 +11,7 @@
   is discussed on the
   <a href="http://archives.postgresql.org/pgsql-www/";>pgsql-www mailing 
list</a>.
   Source code for the postgresql.org web site is stored in a public
-  <a href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=summary";>GIT 
repository</a>.
+  <a href="https://git.postgresql.org/cgit/pgweb.git/";>GIT repository</a>.
 </p>
 
 <h2>Infrastructure Team Members</h2>
diff --git a/templates/pages/about/policies/conferences.html 
b/templates/pages/about/policies/conferences.html
index ca5a8b4..a440805 100644
--- a/templates/pages/about/policies/conferences.html
+++ b/templates/pages/about/policies/conferences.html
@@ -5,7 +5,7 @@
 
 <h1>Community Conference Recognition <i class="fas fa-gavel"></i></h1>
 
-<p><em>Last updated: September 21, 2023. {%git_changes_link%} <a 
href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=history;f=templates/pages/community/recognition.html";>View</a>
 history before December 8, 2020.</em></p>
+<p><em>Last updated: September 21, 2023. {%git_changes_link%} <a 
href="https://git.postgresql.org/cgit/pgweb.git/log/templates/pages/community/recognition.html";>View</a>
 history before December 8, 2020.</em></p>
 
 <p>The Community Conference Recognition programme is a voluntary scheme under 
which submitters of events to the <a href="/about/events/">PostgreSQL Website 
listings</a> may self-assess their entry against the criteria below, and if 
they comply may market their event as a PostgreSQL Community event.</p>
 
diff --git a/templates/pages/about/policies/npos.html 
b/templates/pages/about/policies/npos.html
index cc8ac37..303dba1 100644
--- a/templates/pages/about/policies/npos.html
+++ b/templates/pages/about/policies/npos.html
@@ -5,7 +5,7 @@
 
 <h1>Recognised PostgreSQL Nonprofit Organisations <i class="fas 
fa-gavel"></i></h1>
 
-<p><em>Last updated: January 7, 2025. {%git_changes_link%} <a 
href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=history;f=templates/pages/community/recognition.html";>View</a>
 history before December 8, 2020.</em></p>
+<p><em>Last updated: January 7, 2025. {%git_changes_link%} <a 
href="https://git.postgresql.org/cgit/pgweb.git/log/templates/pages/community/recognition.html";>View</a>
 history before December 8, 2020.</em></p>
 
 <p>Recognised PostgreSQL Nonprofit Organisations (NPOs) will be listed on the 
<a href="/community/recognised-npos/">PostgreSQL Website</a> as such. To become 
recognised as an NPO, the organisation must self-certify that they meet the 
criteria below, aimed at ensuring they meet the standards of openness expected 
in the PostgreSQL Community.
 </p>
diff --git a/templates/pages/developer/backend.html 
b/templates/pages/developer/backend.html
index a556644..38ff210 100644
--- a/templates/pages/developer/backend.html
+++ b/templates/pages/developer/backend.html
@@ -46,14 +46,14 @@ echo "0, 0," | awk -F, '{printf "%d, %d\n", $1 + 145, $2 + 
45}'
 or Unix Domain sockets. It is loaded into a string, and passed to the <a
 href="https://wiki.postgresql.org/wiki/Backend_flowchart#parser";>parser,</a>
 where the lexical scanner, <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/scan.l";>scan.l,</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/scan.l";>scan.l,</a>
 breaks the query up into tokens(words). The parser uses <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/gram.y";>gram.y</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/gram.y";>gram.y</a>
 and the tokens to identify the query type, and load the proper
 query-specific structure, like <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/parsenodes.h";>CreateStmt</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/parsenodes.h";>CreateStmt</a>
 or <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/parsenodes.h";>SelectStmt.</a></p>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/parsenodes.h";>SelectStmt.</a></p>
 
 <p>The statement is then identified as complex (<em>SELECT / INSERT /
 UPDATE / DELETE</em>) or simple, e.g <em>CREATE ROLE, ANALYZE,</em>
@@ -62,27 +62,27 @@ functions in the <a 
href="https://wiki.postgresql.org/wiki/Backend_flowchart#com
 Complex statements require more handling.</p>
 
 <p>The parser takes a complex query, and creates a <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/parsenodes.h";>Query</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/parsenodes.h";>Query</a>
 structure that contains all the elements used by complex queries.
 Query.jointree holds the <em>FROM</em> and <em>WHERE</em> clauses, which is 
filled
 in by <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/parse_clause.c";>transformFromClause()</a>
 and
-<a 
href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/parse_clause.c";>transformWhereClause().</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/parse_clause.c";>transformFromClause()</a>
 and
+<a 
href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/parse_clause.c";>transformWhereClause().</a>
 Each table referenced in the query is represented by a <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/parsenodes.h";>RangeTblEntry,</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/parsenodes.h";>RangeTblEntry,</a>
 and they are linked together to form the <em>range table</em> of the
 query, which is generated by <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/parse_clause.c";>transformFromClause().</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/parse_clause.c";>transformFromClause().</a>
 Query.rtable holds the query's range table.</p>
 
 <p>Certain queries, like <em>SELECT,</em> return columns of data. Other
 queries, like <em>INSERT</em> and <em>UPDATE,</em> specify the columns
 modified by the query. These column references are converted to <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/primnodes.h";>TargetEntry</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/primnodes.h";>TargetEntry</a>
 entries, which are linked together to make up the <em>target list</em> of
 the query. The target list is stored in Query.targetList, which is
 generated by <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/parser/parse_target.c";>transformTargetList().</a></p>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/parser/parse_target.c";>transformTargetList().</a></p>
 
 <p>Other query elements, like aggregates(<em>SUM()</em>), <em>GROUP
 BY,</em> and <em>ORDER BY</em> are also stored in their own Query
@@ -100,7 +100,7 @@ type of each table in the RangeTable, using 
Query.jointree(<em>FROM</em>
 and <em>WHERE</em> clauses) to consider optimal index usage.</p>  The <a
 
href="https://wiki.postgresql.org/wiki/Backend_flowchart#optimizer_path";>path</a>
 module  then generates an optimal <a
-href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/plannodes.h";>Plan,</a>
+href="https://git.postgresql.org/cgit/postgresql.git/tree/src/include/nodes/plannodes.h";>Plan,</a>
 which contains the operations to be performed to execute the query.</p>
 
 <p>The Plan is then passed to the <a
diff --git a/templates/pages/developer/coding.html 
b/templates/pages/developer/coding.html
index 594abbf..0cce4d6 100644
--- a/templates/pages/developer/coding.html
+++ b/templates/pages/developer/coding.html
@@ -8,7 +8,7 @@
 
 <h2>Code access and information</h2>
 <ul>
-    <li><a href="https://git.postgresql.org/gitweb?p=postgresql.git";>Web 
interface to the Source Code Repository</a></li>
+    <li><a href="https://git.postgresql.org/cgit/postgresql.git/";>Web 
interface to the Source Code Repository</a></li>
     <li><a href="/docs/current/git.html">Information about the Source Code 
Repository</a></li>
     <li><a href="https://doxygen.postgresql.org/";>Source Code Browser</a> 
(Doxygen)</li>
     <li><a href="/developer/backend/">Backend Flowchart</a></li>
@@ -19,11 +19,9 @@
 <h2>Search Code By Git Commit Hash</h2>
 <div class="row">
   <div class="col-6">
-  <form action="https://git.postgresql.org/gitweb"; method="get">
-    <input type="hidden" name="p" value="postgresql.git" />
-    <input type="hidden" name="a" value="commitdiff" />
+  <form action="https://git.postgresql.org/cgit/postgresql.git/commit/"; 
method="get">
     <div class="input-group">
-      <input class="form-control" type="text" name="h" type="text" size="40" 
placeholder="e.g. &quot;861861edcc04a6e3ebdfe363311f122e2b226196&quot;">
+      <input class="form-control" type="text" name="id" size="40" 
placeholder="e.g. &quot;861861edcc04a6e3ebdfe363311f122e2b226196&quot;">
       <span class="input-group-btn">
         <button class="btn btn-default" type="submit"><i class="fas 
fa-search"></i></button>
       </span>
diff --git a/templates/pages/developer/committers.html 
b/templates/pages/developer/committers.html
index f9dad20..f11814b 100644
--- a/templates/pages/developer/committers.html
+++ b/templates/pages/developer/committers.html
@@ -6,7 +6,7 @@
 
 <p>
   This is the current list of people with access to push to the
-  <a href="https://git.postgresql.org/gitweb/?p=postgresql.git";>git 
repository</a>.
+  <a href="https://git.postgresql.org/cgit/postgresql.git/";>git repository</a>.
   For technical details on how committing works, see
   <a href="https://wiki.postgresql.org/wiki/Committing_with_Git";>Committing 
with Git</a>.
   This is just a list of people who currently have access to push to git; for
diff --git 
a/templates/pages/developer/corereports/january2022_december2022.html 
b/templates/pages/developer/corereports/january2022_december2022.html
index fca8251..e7412c2 100644
--- a/templates/pages/developer/corereports/january2022_december2022.html
+++ b/templates/pages/developer/corereports/january2022_december2022.html
@@ -17,7 +17,7 @@
     <p>
       The PostgreSQL Core Team accepted changes to the Code of Conduct to
       clarify
-      <a 
href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=commitdiff;h=76ea6e51d7e74e93f82b93630e10da51906e1a4d;hp=de0364bf011eae2eecf74075ab8e3be6c6a7e608";>
+      <a 
href="https://git.postgresql.org/cgit/pgweb.git/commit/?id=76ea6e51d7e74e93f82b93630e10da51906e1a4d";>
         term limits</a>.
     </p>
   </li>
diff --git a/templates/pages/developer/related-projects.html 
b/templates/pages/developer/related-projects.html
index 2131354..83579b1 100644
--- a/templates/pages/developer/related-projects.html
+++ b/templates/pages/developer/related-projects.html
@@ -37,8 +37,8 @@
       The PostgreSQL website is split into a dynamic and static part:
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pgweb.git;a=summary";>Dynamic content 
repository</a></li>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pgweb-static.git;a=summary";>Static 
files repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/pgweb.git/";>Dynamic content 
repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/pgweb-static.git/";>Static 
files repository</a></li>
     </ul>
     <p>
       The site itself runs on the  <a 
href="https://www.djangoproject.com/";>Django</a>
@@ -56,7 +56,7 @@
       with moderation.
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=hamn.git;a=summary";>Planet 
PostgreSQL repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/hamn.git/";>Planet 
PostgreSQL repository</a></li>
       <li><a href="https://planet.postgresql.org";>Planet PostgreSQL</a></li>
     </ul>
     <p>
@@ -72,7 +72,7 @@
       The PostgreSQL mailing list system is powered by "pglister":
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pglister.git;a=summary";>pglister 
main repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/pglister.git/";>pglister 
main repository</a></li>
       <li><a href="https://lists.postgresql.org/";>Mailing lists</a></li>
     </ul>
 
@@ -83,7 +83,7 @@
       the PostgreSQL project.
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pgarchives.git;a=summary";>pgarchives 
main repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/pgarchives.git/";>pgarchives 
main repository</a></li>
       <li><a href="https://www.postgresql.org/list/";>Mailing list 
archives</a></li>
     </ul>
     <p>
@@ -115,7 +115,7 @@
     </p>
     <ul>
       <li><a href="https://commitfest.postgresql.org/";>Commitfest 
website</a></li>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pgcommitfest2.git;a=summary";>pgcommitfest
 main repository</a></li>
+      <li><a 
href="https://git.postgresql.org/cgit/pgcommitfest2.git/";>pgcommitfest main 
repository</a></li>
     </ul>
     <p>
       You can get involved in this project by communicating on
@@ -195,13 +195,13 @@
       <li><a href="https://www.bsdcan.org/";>BSDCan - The BSD 
Conference</a></li>
     </ul>
     <p>
-      The conference system runs on the  <a 
href="https://www.djangoproject.com/";>django web framework</a>, and is Open 
Source with a <a 
href="https://git.postgresql.org/gitweb/?p=pgeu-system.git;a=blob_plain;f=LICENSE;hb=HEAD";>MIT
 License</a>.
+      The conference system runs on the  <a 
href="https://www.djangoproject.com/";>django web framework</a>, and is Open 
Source with a <a 
href="https://git.postgresql.org/cgit/pgeu-system.git/plain/LICENSE";>MIT 
License</a>.
     </p>
     <p>
       The code is hosted on git.postgresql.org, and mirrored to GitHub:
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=pgeu-system.git;a=summary";>pgeu-system
 main repository</a></li>
+      <li><a 
href="https://git.postgresql.org/cgit/pgeu-system.git/";>pgeu-system main 
repository</a></li>
       <li><a href="https://github.com/pgeu/pgeu-system";>GitHub mirror</a></li>
     </ul>
     <p>
@@ -221,7 +221,7 @@
       minor updates.
     </p>
     <ul>
-      <li><a 
href="https://git.postgresql.org/gitweb/?p=press.git;a=summary";>Press Kit 
repository</a></li>
+      <li><a href="https://git.postgresql.org/cgit/press.git/";>Press Kit 
repository</a></li>
     </ul>
     <p>
       If you are interested in becoming a press release translator, you can get
diff --git a/templates/pages/download.html b/templates/pages/download.html
index 0e29e0a..6905a42 100644
--- a/templates/pages/download.html
+++ b/templates/pages/download.html
@@ -78,7 +78,7 @@ yourself.
 <p>
 The source code can be found in the main <a href="/ftp/source/">file 
browser</a>
 or you can access the source control repository directly
-at <a href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=summary"; 
target="_blank" rel="noopener">git.postgresql.org</a>.
+at <a href="https://git.postgresql.org/cgit/postgresql.git/"; target="_blank" 
rel="noopener">git.postgresql.org</a>.
 Instructions for building from source can be found in the
 <a href="/docs/current/installation.html">documentation</a>.
 </p>
-- 
2.39.5 (Apple Git-154)

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to