add jjcommit script

$diff_output"
This commit is contained in:
Travis Shears 2025-12-08 08:57:49 +01:00
parent 995ad5193c
commit db8573c469
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469

13
bin/jjcommit.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
set -e
# Run jj diff and prefix each line with "JJ: "
diff_output="$(jj diff --git | sed 's/^/JJ: /')"
# Add two newlines at the top (without the prefix)
final_output="\n\n$diff_output"
# Feed the string to jj desc --stdin
# Use printf to preserve newlines
printf "%b" "$final_output" | jj desc --stdin --edit