From 3e40b846456e4efc06ece7180ef152e053114385 Mon Sep 17 00:00:00 2001 From: Saya Andy Date: Tue, 8 Sep 2026 00:11:57 +0700 Subject: diff: allow stepping back N commits from the selected refs The ref pickers can only select the exact ref that is shown. Add an offset input next to each picker (idoff and id2off), whose value is the number of commits to step back, so any ancestor of a branch or tag can be compared without typing a rev into the url by hand. An apply button submits the values typed there, since text inputs cannot be auto-submitted on their own; the flip link swaps the offsets along with the refs, and the file-level links carry them through. By default both offsets are empty, meaning the selected refs themselves. An empty ref submitted from the form is likewise treated as no ref instead of triggering a bad object name error. --- cgit.css | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cgit.css') diff --git a/cgit.css b/cgit.css index 8563462..911cc45 100644 --- a/cgit.css +++ b/cgit.css @@ -674,11 +674,22 @@ div#cgit a.button { padding: 0em 0.5em; } -div#cgit form.diff-ctrls div.cgit-panel a.button { +div#cgit form.diff-ctrls div.cgit-panel a.button, +div#cgit form.diff-ctrls div.cgit-panel input[type=submit] { border: solid 1px var(--border-mid); background-color: var(--bg-hl); } +div#cgit form.diff-ctrls div.cgit-panel input[type=submit] { + font-size: 80%; + padding: 0em 0.5em; +} + +div#cgit span.hint { + color: var(--fg-mute); + font-size: 80%; +} + div#cgit a.primary { font-size: 100%; } -- cgit v1.3.1+16