From: Avery Pennarun Date: Sun, 13 Jul 2008 21:44:16 GMT Subject: Re: [PATCH] Added --export option to git-send-email. Message-ID: <32541b130807131444s5e9ea0d6v9610dd5871467fc9@mail.gmail.com> In-Reply-To: <7vbq11qxfb.fsf@gitster.siamese.dyndns.org> On 7/13/08, Junio C Hamano wrote: > >> Sorry, but I am scratching my head here. Shouldn't this "bare From > >> munging" be like this instead? > >> > >> $message =~ s/^From />From /m; > > > > That wouldn't be a reversible operation. > > So what? Adding Cc: and stuff send-email does are already irreversible > anyway. At one point the people who write mailers realized that just munging "From" to ">From" when putting things into an mbox was irreversible, ie, there was no way to later display the contents of the mbox without showing ">From" where "From" was intended. However, if you always insert _another_ ">" whenever "^>*From" is detected, then you can also always do the opposite upon displaying to the user, and the message is effectively not munged. It becomes simply a part of the mbox file encoding. So by encoding it this way, someone with a modern mailer could view the resulting mbox with all the munged text de-mungled. Someone without a modern mailer would see munging anyhow, so they're no worse off. Have fun, Avery