[-] duckduckduck@programming.dev 5 points 8 hours ago

Beauty beyond compare

[-] duckduckduck@programming.dev 5 points 8 hours ago

Yeah, we say bone not bany, what gives...

[-] duckduckduck@programming.dev 1 points 2 weeks ago* (last edited 2 weeks ago)

Neat, but I don't like how it highlight the entire like if I change just one character on that line.

Maybe there's a setting I'm missing, but I really like diff-so-fancy for legibility of changed lines.

For example if I've got like these changes:

***
a	2026-06-01 14:36:20.699016620 -0400
+++ b	2026-06-01 14:36:21.842027381 -0400
@@ -1,11 +1,10 @@
 foo
 bar
-baz
+bazz
 
 foo
-bar
 baz
 
-foo
+bar
 bar
 baz

difft shows me:

size by side diff with entire lines highlighted in red or green

but diff-so-fancy shows me:

unified diff with word highlighting

Imho it's easier to read the pertinent info in the latter, where you've got that attractive word diffing on changed lines.

I do like the conditional side-by-side and unified diffing, though. That's huge.

[-] duckduckduck@programming.dev 2 points 3 weeks ago

Updated OP with what I came up with. I wasn't able to make use of $GIT_REFLOG_ACTION -- for some reason it was blank in every case, but reading the first line of the existing commit message, if it exists, does the trick.

I do foresee a potential problem if you're doing like an interactive rebase for example, and you go to edit a commit message that starts like the default "Revert " style--that could be surprising... Maybe some other cases I haven't thought of too, but yeah, works for me. Thanks for pointing me in the right direction!

[-] duckduckduck@programming.dev 2 points 3 weeks ago* (last edited 3 weeks ago)

Thanks that is a great start, and even better gives me an excuse to faff about with scripting. I'll share what I come up with!

EDIT Oh interesting, in my debugging I found out that if you revert a revert now (git version 2.43.0) that the subject line reads "Reapply" instead of "Revert "Revert "..."""

[-] duckduckduck@programming.dev 3 points 3 weeks ago

Do you... like it?

[-] duckduckduck@programming.dev 8 points 3 weeks ago

And yeah I made an account just to ask this question. Hello! Nice looking server you've got here. ๐Ÿ–

13
submitted 3 weeks ago* (last edited 3 weeks ago) by duckduckduck@programming.dev to c/git@programming.dev

Whenever I do a git revert I go into an edit session with the following pre-filled.

Revert "wip: does this work?"

This reverts commit ad21a2ae23166b3f3cddoooooooom94821e3cdb4.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
...

...and so on.

I like to use conventional commits, so I change this to revert: "wip: does this work?".

Is there a way to get the initial template for the revert commit message to appear this way by default? Lowercase, and with a colon.


UPDATE This is what I came up with

#!/bin/bash

COMMIT_MSG_FILE=$1

old_subject_line=$(head -1 $COMMIT_MSG_FILE)

# Not a revert
if [[ ! "$old_subject_line" =~ ^Revert\ \" ]]
then
    exit 0
fi

new_subject_line=$(echo $old_subject_line|sed 's/^Revert/revert:/')

sed -i "1s/.*/$new_subject_line/" $COMMIT_MSG_FILE

Curiously, the case where two "Reverts" in a row become a "Reapply" doesn't come up like I thought it would. Maybe it only happens if you use the default Revert "yada yada yada" subject line.

duckduckduck

0 post score
0 comment score
joined 3 weeks ago