about summary refs log tree commit diff
path: root/overlays/patches/cgit
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-07-29 16:34:40 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-06 14:03:12 +0000
commit8d2731f04e5a0e648311414ee10c380aa98c50a2 (patch)
treeb712412fe5e51262c387ec14888cccabc92028f2 /overlays/patches/cgit
parent8988354026632e4f30914d144c74e69fa2237606 (diff)
downloadnixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar.gz
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar.bz2
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar.lz
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar.xz
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.tar.zst
nixlib-8d2731f04e5a0e648311414ee10c380aa98c50a2.zip
patches/cgit: fetch "this commit" patch from list
No need to keep this in-tree when it's available online.
Diffstat (limited to 'overlays/patches/cgit')
-rw-r--r--overlays/patches/cgit/default.nix5
-rw-r--r--overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch59
2 files changed, 4 insertions, 60 deletions
diff --git a/overlays/patches/cgit/default.nix b/overlays/patches/cgit/default.nix
index c570abe448f0..d1289521922e 100644
--- a/overlays/patches/cgit/default.nix
+++ b/overlays/patches/cgit/default.nix
@@ -3,7 +3,10 @@
 cgit.overrideAttrs ({ patches ? [], ... }: {
   patches = patches ++ [
     ./ui-commit-use-Git-raw-note-format.patch
-    ./ui-shared-add-this-commit-option-to-switch-form.patch
+    (fetchpatch {
+      url = "https://inbox.vuxu.org/cgit/20200723210744.10221-1-hi@alyssa.is/raw";
+      sha256 = "1kxwph84n2la612r8cphy9fkbd851k0cys3mqp5ij3a69qkfdcg9";
+    })
     (fetchpatch {
       url = "https://git.causal.agency/cgit/patch/?id=e65d3eb446294520e2aee50966e5070661d09671";
       sha256 = "0wvckndjmxar3vgqdc3jdnpzy0xgrdlqgfaasixl3x87sdnf4kg7";
diff --git a/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch b/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
deleted file mode 100644
index 7578bd21a8a9..000000000000
--- a/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 5a682008b4b46f762d96725e69e6e1473cd7102e Mon Sep 17 00:00:00 2001
-From: Alyssa Ross <hi@alyssa.is>
-Date: Thu, 23 Jul 2020 19:54:13 +0000
-Subject: [PATCH] ui-shared: add "this commit" option to switch form
-
-Branches are grouped into their own section to make the "this commit"
-option visually distinct.
-
-Adding this option will result in two options being marked as selected
-if a branch has the same name as a commit oid.  But that would cause
-all sorts of other problems anyway (attempting to switch to the branch
-would actually give you the commit, etc.), so let's not worry about
-that.
-
-A "permalink" link on the blob view next to the "plain" link would
-probably be more discoverable, but that would only work for the blob
-view.  The switch UI is visible everywhere.
-
-Co-authored-by: C. McEnroe <june@causal.agency>
----
- ui-shared.c | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/ui-shared.c b/ui-shared.c
-index d2358f2..e1a3603 100644
---- a/ui-shared.c
-+++ b/ui-shared.c
-@@ -893,6 +893,15 @@ void cgit_add_clone_urls(void (*fn)(const char *))
- 		add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
- }
- 
-+static int print_this_commit_option(void)
-+{
-+	struct object_id oid;
-+	if (!ctx.qry.head || get_oid(ctx.qry.head, &oid))
-+		return 1;
-+	html_option(oid_to_hex(&oid), "this commit", ctx.qry.head);
-+	return 0;
-+}
-+
- static int print_branch_option(const char *refname, const struct object_id *oid,
- 			       int flags, void *cb_data)
- {
-@@ -1000,9 +1009,12 @@ static void print_header(void)
- 			html("<form method='get'>\n");
- 			cgit_add_hidden_formfields(0, 1, ctx.qry.page);
- 			html("<select name='h' onchange='this.form.submit();'>\n");
-+			print_this_commit_option();
-+			html("<optgroup label='branches'>");
- 			for_each_branch_ref(print_branch_option, ctx.qry.head);
- 			if (ctx.repo->enable_remote_branches)
- 				for_each_remote_ref(print_branch_option, ctx.qry.head);
-+			html("</optgroup>");
- 			html("</select> ");
- 			html("<input type='submit' value='switch'/>");
- 			html("</form>");
--- 
-2.27.0
-