Re: [PATCH] gitk: add user-defined custom commands
Tim Wiederhake <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2026-08-05 at 08:59 +0200, Johannes Sixt wrote: > Am 04.08.26 um 23:43 schrieb Tim Wiederhake via GitGitGadget: > > Allow users to define up to three custom commands each for the > > commit > > list and the diff display area. Commands are configured in a new > > "Commands" tab in the preferences dialog, with a name and a command > > template per slot. Non-empty slots appear in the right-click > > context > > menu of the respective area. > > > > Command templates support placeholder substitution (commit id, > > commit > > title, author name, author date, etc.) and are executed via "sh -c" > > to allow for background execution by appending "&", and pipeing. > > If > > a command terminates with exit code 42, its output is displayed; > > otherwise only non-zero exit codes are reported. > > Thanks, but this commit message is a bit lacking: it does not explain > why it is a good idea to have this feature, what purpose it servers. > For > this reason, it is not possible to tell whether the design is sound > and > whether the implementation follows the design. > > > Signed-off-by: Tim Wiederhake <[email protected]> > > Assisted-by: Claude Opus 4.6 > Thank you for being explicit about AI assistance. Note that this code > is > going to be downstreamed to the Git project. Therefore, their AI > rules[*] must be obeyed. > > Equally important is that I want to be sure that you have checked and > carefully reviewed and understood everything the AI produced. I am > not > going to look at the code until there is sufficient insurance that > you > did. (Blatantly put, I don't want to review code produced by someone > else with AI.) > > [*] https://git-scm.com/docs/SubmittingPatches#ai > > -- Hannes Hi Hannes, thanks for the feedback! I agree that the commit message is a bit light on the "why" side of things. Personally, I wrote this patch because i wanted gitk to have the ability to let me select a line in any commit, rebase to that commit, start an editor with that file and line selected, and after quitting the editor amend the commit and continue the rebase. An "edit this line at that point in history" function of sorts, because I tend to spot typos only twenty commits later. If I had proposed a patch to this effect, I am sure it would have been nack'd as too niche, wrong tool, or any other reason. But having the possibility to define custom commands allows users to adapt gitk to their workflow instead of the other way round. I am very open to suggestions on how to put this in the commit message without resorting to (contrieved) examples. Regarding the use about AI: I used Claude to produce the initial implementation. I do not write Tcl, and frankly, this patch has not changed that. I have reworked the code - using Claude - until it was effectively the Tcl version of code I would have written myself in Python or C or any other language that I actually understand. Does that pass the bar? Regards, Tim