From 46e247439b4a658e311a0aa81233b7f8241c1481 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 20 Mar 2024 16:09:17 +0100 Subject: git.cgi: show command in title for log --- bonus/git.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bonus/git.cgi') diff --git a/bonus/git.cgi b/bonus/git.cgi index 824874a3..9038f332 100755 --- a/bonus/git.cgi +++ b/bonus/git.cgi @@ -52,6 +52,9 @@ if (params[0] == "log") { os.close(write_fd2); const f = std.fdopen(read_fd2, "r"); const cgi = `${query.prefix}git.cgi?prefix=${query.prefix}&path=${query.path}¶ms=show`; + const titleParams = params.join(' ').replace(/[&<>]/g, + x => ({'&': '&', '<': '<', '>': '>'}[x])); + console.log(`git ${titleParams}`); while ((l = f.getline()) !== null) { console.log(l.replace(/[a-f0-9]{40}/g, x => `${x}`)); -- cgit 1.4.1-2-gfad0