this post was submitted on 06 Feb 2026
53 points (98.2% liked)

Programming

25323 readers
334 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Oinks@lemmy.blahaj.zone 9 points 1 day ago* (last edited 1 day ago)

Hooray to underspecified file formats.

From patch(1):

patch tries to skip any leading garbage, apply the diff, and then skip any trailing garbage. Thus you could feed an email message containing a diff listing to patch, and it should work.

From git-am(1):

The patch is expected to be inline, directly following the message. Any line that is of the form:

  • three-dashes and end-of-line, or
  • a line that begins with "diff -", or
  • a line that begins with "Index: "

is taken as the beginning of a patch, and the commit log message is terminated before the first occurrence of such a line.

Ideally git-am should use a better file format, but I suppose the more realistic lesson now is to never have inline diffs in Commit messages.