commit 7a6b6eeeda8091da897a1e5b68e132e655969c66794ba0416f34932d80575508 from: Stefan Sperling date: Fri Feb 6 16:35:29 2026 UTC make 'tog diff' indent log messages above patches for safety Lack of log message indentation can be problematic when a patch is saved from 'tog diff' with the 'p' key and then sent elsewhere to be applied. Without indentation, diff text which happens to appear in a log message might be interpreted as part of the commit's patch. (Some patch programs will even strip leading indentation, but that is on them.) See https://github.com/i3/i3/pull/6564 for an example where a call to sleep() was added accidentally via a patch pasted into the log message. commit - 65b128a66b78d72623c8f79efa1d8f6ce858c7f3af262825d0e6a577c9e25e86 commit + 7a6b6eeeda8091da897a1e5b68e132e655969c66794ba0416f34932d80575508 blob - 4144fde9045d9277b8820ad9321d398d0b89bea574bcdbb123fb6ac6de2b65a7 blob + 120d8d2794b05b3ef22152c1f63e2240e436f1fef0cac89adae160f515597d50 --- tog/tog.c +++ tog/tog.c @@ -6039,7 +6039,7 @@ write_commit_info(struct got_diff_line **lines, size_t goto done; s = logmsg; while ((line = strsep(&s, "\n")) != NULL) { - n = fprintf(outfile, "%s\n", line); + n = fprintf(outfile, " %s\n", line); if (n < 0) { err = got_error_from_errno("fprintf"); goto done;