I’m trying to set the subject of a patch I’m sending manually, but for some reason it always picks the subject of the patch commit instead of the one I supply to it.
I’m running it as
git send-email --compose --subject="blah" file.patch
and even though I can see the subject “blah” in the editor window that opens, after I save it and attempt to email the patch the subject that is mailed is still the same as the patch commit message.
What am I doing wrong?
You’re not doing anything wrong:
--composetellsgit send-emailthat you want to write a “cover letter” with the subject you gave with--subject. The actual commit will then be sent as a reply to this “cover letter”, with the first line of the commit message as a subject.This is the “standard format” that is understood by
git amso that the recipient can apply the patch and get the same result. This means that changing the subject of the patch email will change the commit message: your recipient would get a different commit, which is probably not what you want.If you really want to send a commit by email with a custom subject, you can prepare your patch with
git format-patchand then attach it to an email written with your usual MUA. This way the recipient cangit amthe attachment.