jjcommit.sh
· 318 B · Bash
Orginalformat
#!/bin/sh
set -e
# Run jj diff and prefix each line with "JJ: "
diff_output="$(jj diff | 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
| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | # Run jj diff and prefix each line with "JJ: " |
| 6 | diff_output="$(jj diff | sed 's/^/JJ: /')" |
| 7 | |
| 8 | # Add two newlines at the top (without the prefix) |
| 9 | final_output="\n\n$diff_output" |
| 10 | |
| 11 | # Feed the string to jj desc --stdin |
| 12 | # Use printf to preserve newlines |
| 13 | printf "%b" "$final_output" | jj desc --stdin --edit |
| 14 |