Apply a patch file that was produced with "git format-patch" using the patch command, and commit it using the message from the original commit.

Unlike "git am", "patch" supports fuzzy matches. If "git am" fails, try running this command as:

$ ./apply-patch.sh 0037-Fix-broken-foo.patch -F3

to increase the fuzz factor to 3. Arguments after the patch filename are passed verbatim to patch.

Also, "patch" is not all-or-nothing; so if 1 of 7 hunks fail then this script will commit the 6 successful hunks, and you can inspect the rejected hunk in the foo.rej file then amend the commit.