* [PATCH] Allow hand-editing of patches before sending @ 2006-11-01 9:00 Karl Hasselström 2006-11-02 10:32 ` Catalin Marinas 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-01 9:00 UTC (permalink / raw) To: Catalin Marinas; +Cc: git From: Karl Hasselström <kha@treskal.com> This adds a new flag to 'stg mail', allowing the user to hand-edit each patch e-mail before it is sent, just like it is currently possible to edit the cover message. Signed-off-by: Karl Hasselström <kha@treskal.com> --- Intended use is to allow the user to write comments like this, when there is only one patch and a cover mail would be overkill. stgit/commands/mail.py | 59 ++++++++++++++++++++++++++++-------------------- 1 files changed, 35 insertions(+), 24 deletions(-) diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 970ae3e..26c711d 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -108,6 +108,9 @@ options = [make_option('-a', '--all', make_option('-e', '--edit', help = 'edit the cover message before sending', action = 'store_true'), + make_option('-E', '--edit-patches', + help = 'edit each patch before sending', + action = 'store_true'), make_option('-s', '--sleep', type = 'int', metavar = 'SECONDS', help = 'sleep for SECONDS between e-mails sending'), make_option('--refid', @@ -276,6 +279,34 @@ def __build_extra_headers(): return headers +def edit_message(msg): + fname = '.stgitmail.txt' + + # create the initial file + f = file(fname, 'w') + f.write(msg) + f.close() + + # the editor + if config.has_option('stgit', 'editor'): + editor = config.get('stgit', 'editor') + elif 'EDITOR' in os.environ: + editor = os.environ['EDITOR'] + else: + editor = 'vi' + editor += ' %s' % fname + + print 'Invoking the editor: "%s"...' % editor, + sys.stdout.flush() + print 'done (exit code: %d)' % os.system(editor) + + # read the message back + f = file(fname) + msg = f.read() + f.close() + + return msg + def __build_cover(tmpl, total_nr, msg_id, options): """Build the cover message (series description) to be sent via SMTP """ @@ -326,30 +357,7 @@ def __build_cover(tmpl, total_nr, msg_id 'supported in the patch template' if options.edit: - fname = '.stgitmail.txt' - - # create the initial file - f = file(fname, 'w+') - f.write(msg) - f.close() - - # the editor - if config.has_option('stgit', 'editor'): - editor = config.get('stgit', 'editor') - elif 'EDITOR' in os.environ: - editor = os.environ['EDITOR'] - else: - editor = 'vi' - editor += ' %s' % fname - - print 'Invoking the editor: "%s"...' % editor, - sys.stdout.flush() - print 'done (exit code: %d)' % os.system(editor) - - # read the message back - f = file(fname) - msg = f.read() - f.close() + msg = edit_message(msg) return msg.strip('\n') @@ -431,6 +439,9 @@ def __build_message(tmpl, patch, patch_n raise CmdException, 'Only "%(name)s" variables are ' \ 'supported in the patch template' + if options.edit_patches: + msg = edit_message(msg) + return msg.strip('\n') ^ permalink raw reply related [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-01 9:00 [PATCH] Allow hand-editing of patches before sending Karl Hasselström @ 2006-11-02 10:32 ` Catalin Marinas 2006-11-02 11:36 ` Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-02 10:32 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 01/11/06, Karl Hasselström <kha@treskal.com> wrote: > This adds a new flag to 'stg mail', allowing the user to hand-edit > each patch e-mail before it is sent, just like it is currently > possible to edit the cover message. Applied it but with some conflicts since you have some other patches which I haven't merged yet (like QP encoding). I'll try to have a look at this QP encoding this week. The main problem is that Gnus shows plenty of "=20" instead of new lines and 'stg import' cannot cope with them. Thanks. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-02 10:32 ` Catalin Marinas @ 2006-11-02 11:36 ` Karl Hasselström 2006-11-03 9:39 ` Catalin Marinas 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-02 11:36 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-02 10:32:46 +0000, Catalin Marinas wrote: > On 01/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > This adds a new flag to 'stg mail', allowing the user to hand-edit > > each patch e-mail before it is sent, just like it is currently > > possible to edit the cover message. > > Applied it but with some conflicts since you have some other patches > which I haven't merged yet (like QP encoding). I'll try to have a > look at this QP encoding this week. The main problem is that Gnus > shows plenty of "=20" instead of new lines and 'stg import' cannot > cope with them. That Gnus shows =20 suggests that I haven't got the QP encoding 100% right. I haven't had time to look at that yet, and it looks like you may beat me to it. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-02 11:36 ` Karl Hasselström @ 2006-11-03 9:39 ` Catalin Marinas 2006-11-03 9:58 ` Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 9:39 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 02/11/06, Karl Hasselström <kha@treskal.com> wrote: > That Gnus shows =20 suggests that I haven't got the QP encoding 100% > right. I haven't had time to look at that yet, and it looks like you > may beat me to it. Well, it might be just the way I read the list (via the gmane news gateway) but I have to run some tests. However, I'd like the message body to still be 8bit and the QP encoding optional (either command line option or [stgit] config variable). -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 9:39 ` Catalin Marinas @ 2006-11-03 9:58 ` Karl Hasselström 2006-11-03 10:01 ` Karl Hasselström 2006-11-03 12:44 ` [PATCH] Allow hand-editing of patches before sending Catalin Marinas 0 siblings, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 9:58 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 09:39:57 +0000, Catalin Marinas wrote: > On 02/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > That Gnus shows =20 suggests that I haven't got the QP encoding > > 100% right. I haven't had time to look at that yet, and it looks > > like you may beat me to it. > > Well, it might be just the way I read the list (via the gmane news > gateway) but I have to run some tests. I believe all the mails I send with mutt are QP-encoded, and they don't look funny, do they? (You'd see the separator just above my signature as "--=20" if that was the case; it has a trailing whitespace.) > However, I'd like the message body to still be 8bit and the QP > encoding optional (either command line option or [stgit] config > variable). Are you sure? Wouldn't it be better to teach StGIT to eat QP-encoded mails, and use 7bit encoding when the patch is all ascii? (And still have an option to force 8bit instead of QP if desired, of course.) I'm really not comfortable with assuming all mail servers are 8-bit clean, when they're evidently not. :-) -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 9:58 ` Karl Hasselström @ 2006-11-03 10:01 ` Karl Hasselström 2006-11-03 10:21 ` Petr Baudis 2006-11-03 12:07 ` Andy Whitcroft 2006-11-03 12:44 ` [PATCH] Allow hand-editing of patches before sending Catalin Marinas 1 sibling, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 10:01 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: > I believe all the mails I send with mutt are QP-encoded, I just checked, and that one certainly was. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:01 ` Karl Hasselström @ 2006-11-03 10:21 ` Petr Baudis 2006-11-03 10:31 ` Robin Rosenberg 2006-11-03 10:36 ` Andreas Ericsson 2006-11-03 12:07 ` Andy Whitcroft 1 sibling, 2 replies; 45+ messages in thread From: Petr Baudis @ 2006-11-03 10:21 UTC (permalink / raw) To: Karl Hasselström; +Cc: Catalin Marinas, git Dear diary, on Fri, Nov 03, 2006 at 11:01:42AM CET, I got a letter where Karl Hasselström <kha@treskal.com> said that... > On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: > > > I believe all the mails I send with mutt are QP-encoded, > > I just checked, and that one certainly was. Are you sure? As far as I can see, it's 8bit. -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1 ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:21 ` Petr Baudis @ 2006-11-03 10:31 ` Robin Rosenberg 2006-11-03 10:36 ` Andreas Ericsson 1 sibling, 0 replies; 45+ messages in thread From: Robin Rosenberg @ 2006-11-03 10:31 UTC (permalink / raw) To: Petr Baudis; +Cc: Karl Hasselström, Catalin Marinas, git fredag 03 november 2006 11:21 skrev Petr Baudis: > Dear diary, on Fri, Nov 03, 2006 at 11:01:42AM CET, I got a letter > where Karl Hasselström <kha@treskal.com> said that... > > > On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: > > > I believe all the mails I send with mutt are QP-encoded, > > > > I just checked, and that one certainly was. > > Are you sure? As far as I can see, it's 8bit. The patch mail was QP-encoded, not the other messasges in this thread. ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:21 ` Petr Baudis 2006-11-03 10:31 ` Robin Rosenberg @ 2006-11-03 10:36 ` Andreas Ericsson 2006-11-03 10:53 ` Karl Hasselström 1 sibling, 1 reply; 45+ messages in thread From: Andreas Ericsson @ 2006-11-03 10:36 UTC (permalink / raw) To: Petr Baudis; +Cc: Karl Hasselström, Catalin Marinas, git Petr Baudis wrote: > Dear diary, on Fri, Nov 03, 2006 at 11:01:42AM CET, I got a letter > where Karl Hasselström <kha@treskal.com> said that... >> On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: >> >>> I believe all the mails I send with mutt are QP-encoded, >> I just checked, and that one certainly was. > > Are you sure? As far as I can see, it's 8bit. > 8bit here too. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:36 ` Andreas Ericsson @ 2006-11-03 10:53 ` Karl Hasselström 2006-11-03 11:21 ` Junio C Hamano 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 10:53 UTC (permalink / raw) To: Andreas Ericsson; +Cc: Petr Baudis, Catalin Marinas, git On 2006-11-03 11:36:51 +0100, Andreas Ericsson wrote: > Petr Baudis wrote: > > > Dear diary, on Fri, Nov 03, 2006 at 11:01:42AM CET, I got a letter > > where Karl Hasselström <kha@treskal.com> said that... > > > > > On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: > > > > > > > I believe all the mails I send with mutt are QP-encoded, > > > > > > I just checked, and that one certainly was. > > > > Are you sure? As far as I can see, it's 8bit. > > 8bit here too. Spooky. When I get copies of my own mails via the git list, they are QP-encoded; but when I bcc myself directly, I get them in 8bit. But you all say you get them still 8bit-encoded. I'm not sure I even _want_ to know what is happening there. One thing is certain, though: When I sent 8bit-encoded patches from StGIT to this list, the vger mail server added headers saying that it didn't like 8bit, and had re-encoded the mail (to what, I don't recall just now). It warned that in doing so, it had to make assumptions about the charset used. The assumption it had made was that the text was latin1, which is not so good when it is in fact utf8. This all just strengthens my belief that StGIT should go to great legths to avoid stepping on mail servers' toes. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:53 ` Karl Hasselström @ 2006-11-03 11:21 ` Junio C Hamano 2006-11-03 11:35 ` Karl Hasselström 2006-11-03 12:56 ` Catalin Marinas 0 siblings, 2 replies; 45+ messages in thread From: Junio C Hamano @ 2006-11-03 11:21 UTC (permalink / raw) To: Karl Hasselström; +Cc: Petr Baudis, Catalin Marinas, git Karl Hasselström <kha@treskal.com> writes: > One thing is certain, though: When I sent 8bit-encoded patches from > StGIT to this list, the vger mail server added headers saying that it > didn't like 8bit, and had re-encoded the mail (to what, I don't recall > just now). It warned that in doing so, it had to make assumptions > about the charset used. The assumption it had made was that the text > was latin1, which is not so good when it is in fact utf8. > > This all just strengthens my belief that StGIT should go to great > legths to avoid stepping on mail servers' toes. I wonder if this can be solved by simply reusing the machinery format-patch already has. If calling it as a standalone script does more unnecessary things than what StGIT wants, we should certainly be able to separate the only necessary part out to suit StGIT's needs. ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 11:21 ` Junio C Hamano @ 2006-11-03 11:35 ` Karl Hasselström 2006-11-03 12:56 ` Catalin Marinas 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 11:35 UTC (permalink / raw) To: Junio C Hamano; +Cc: Petr Baudis, Catalin Marinas, git On 2006-11-03 03:21:29 -0800, Junio C Hamano wrote: > Karl Hasselström <kha@treskal.com> writes: > > > This all just strengthens my belief that StGIT should go to great > > legths to avoid stepping on mail servers' toes. > > I wonder if this can be solved by simply reusing the machinery > format-patch already has. If calling it as a standalone script does > more unnecessary things than what StGIT wants, we should certainly > be able to separate the only necessary part out to suit StGIT's > needs. Yes, I agree. Mail code tends to not be so beautiful that you want to maintain more copies of it than absolutely necessary. Of course, the same reasoning applies when importing mails into stgit. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 11:21 ` Junio C Hamano 2006-11-03 11:35 ` Karl Hasselström @ 2006-11-03 12:56 ` Catalin Marinas 1 sibling, 0 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 12:56 UTC (permalink / raw) To: Junio C Hamano; +Cc: Karl Hasselström, Petr Baudis, git On 03/11/06, Junio C Hamano <junkio@cox.net> wrote: > I wonder if this can be solved by simply reusing the machinery > format-patch already has. If calling it as a standalone script > does more unnecessary things than what StGIT wants, we should > certainly be able to separate the only necessary part out to > suit StGIT's needs. I would like to keep the e-mail templates feature which is not available via format-patch. The reason is because I also send patches to the ARM Linux maintainer via a patch tracking system which expects the messages formatted in a strict certain way (http://www.arm.linux.org.uk/developer/patches/info.php). It would probably be easier to fix StGIT than modifying format-patch. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 10:01 ` Karl Hasselström 2006-11-03 10:21 ` Petr Baudis @ 2006-11-03 12:07 ` Andy Whitcroft 2006-11-03 12:36 ` Karl Hasselström 2006-11-03 14:03 ` Andy Whitcroft 1 sibling, 2 replies; 45+ messages in thread From: Andy Whitcroft @ 2006-11-03 12:07 UTC (permalink / raw) To: Karl Hasselström; +Cc: Catalin Marinas, git Karl Hasselström wrote: > On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: > >> I believe all the mails I send with mutt are QP-encoded, > > I just checked, and that one certainly was. Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: QUOTED-PRINTABLE It reached me as quoted printable, with =20 on your signature intro. -apw ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 12:07 ` Andy Whitcroft @ 2006-11-03 12:36 ` Karl Hasselström 2006-11-03 14:03 ` Andy Whitcroft 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 12:36 UTC (permalink / raw) To: Andy Whitcroft; +Cc: Catalin Marinas, git On 2006-11-03 12:07:00 +0000, Andy Whitcroft wrote: > It reached me as quoted printable, with =20 on your signature intro. The copy of your mail cc'ed to me reached me as 8bit, but the copy I got through the list reached me as QP. As I said, I don't really want to know why. I just want my patches to pass through smtp hell unmangled. :-) -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 12:07 ` Andy Whitcroft 2006-11-03 12:36 ` Karl Hasselström @ 2006-11-03 14:03 ` Andy Whitcroft 2006-11-03 18:48 ` Linus Torvalds 1 sibling, 1 reply; 45+ messages in thread From: Andy Whitcroft @ 2006-11-03 14:03 UTC (permalink / raw) To: Andy Whitcroft; +Cc: Karl Hasselström, Catalin Marinas, git Andy Whitcroft wrote: > Karl Hasselström wrote: >> On 2006-11-03 10:58:59 +0100, Karl Hasselström wrote: >> >>> I believe all the mails I send with mutt are QP-encoded, >> I just checked, and that one certainly was. > > Mime-Version: 1.0 > Content-Type: text/plain; charset=iso-8859-1 > Content-Disposition: inline > Content-Transfer-Encoding: QUOTED-PRINTABLE > > It reached me as quoted printable, with =20 on your signature intro. Heh, well the copy thunderbird wrote directly to my mailbox is also 8bit. And thinking about it I've seen talk of MTA's not supporting 8bit xfers between themselves, so thats probabally when it gets switched. ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 14:03 ` Andy Whitcroft @ 2006-11-03 18:48 ` Linus Torvalds 2006-11-05 11:43 ` Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Linus Torvalds @ 2006-11-03 18:48 UTC (permalink / raw) To: Andy Whitcroft; +Cc: Karl Hasselström, Catalin Marinas, git On Fri, 3 Nov 2006, Andy Whitcroft wrote: > > Heh, well the copy thunderbird wrote directly to my mailbox is also > 8bit. And thinking about it I've seen talk of MTA's not supporting 8bit > xfers between themselves, so thats probabally when it gets switched. If your ISP mailer doesn't answer with "8BITMIME" to your EHLO, your mail client is supposed to downgrade to a 7-bit format (or the same thing can happen anywhere in between on one of the other hops). Of course, that would be a really old and broken mailer, and if you find one of those at the ISP you use, you should probably switch ISPs. Some other mailers have other issues, and qmail for example is apparently totally broken (it accepts 8-bit input, but cannot forward it properly to somebody who wants it converted to 7-bit). And some of us use "fetchmail" and ask it do do mimedecode for us, so that even if it arrived as 7-bit crud, we don't have to see it. So the fact that some people see it as 8-bit can be because the hops to them didn't involve a broken remailer, but it could also be because something in between (like fetchmail) tries to fix it up after the fact. That said: it tends to be unusual to see true 7-bit mailer setups these days. So the most _likely_ cause of unnecessary 7-bit QP crud is not in fact a 7-bit mailserver, but usually just the mail client that is just lazy and just sends out everything as 7-bit because it's too bothersome to even look at whether the mail server supports 8-bit data. Check your Thunderbird settings - it's quite possible that there's a flag there somewhere to turn on 8-bit mail transfers. ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 18:48 ` Linus Torvalds @ 2006-11-05 11:43 ` Karl Hasselström 2006-11-05 16:44 ` Linus Torvalds 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-05 11:43 UTC (permalink / raw) To: Linus Torvalds; +Cc: Andy Whitcroft, Catalin Marinas, git On 2006-11-03 10:48:49 -0800, Linus Torvalds wrote: > If your ISP mailer doesn't answer with "8BITMIME" to your EHLO, your > mail client is supposed to downgrade to a 7-bit format (or the same > thing can happen anywhere in between on one of the other hops). Of > course, that would be a really old and broken mailer, and if you > find one of those at the ISP you use, you should probably switch > ISPs. > > Some other mailers have other issues, and qmail for example is > apparently totally broken (it accepts 8-bit input, but cannot > forward it properly to somebody who wants it converted to 7-bit). > > And some of us use "fetchmail" and ask it do do mimedecode for us, > so that even if it arrived as 7-bit crud, we don't have to see it. > So the fact that some people see it as 8-bit can be because the hops > to them didn't involve a broken remailer, but it could also be > because something in between (like fetchmail) tries to fix it up > after the fact. > > That said: it tends to be unusual to see true 7-bit mailer setups > these days. > > So the most _likely_ cause of unnecessary 7-bit QP crud is not in > fact a 7-bit mailserver, but usually just the mail client that is > just lazy and just sends out everything as 7-bit because it's too > bothersome to even look at whether the mail server supports 8-bit > data. Check your Thunderbird settings - it's quite possible that > there's a flag there somewhere to turn on 8-bit mail transfers. So the right thing to do would be to teach StGIT to generate 8bit-encoded output, and trust the SMTP transfer path do mangle it correctly? (Hmm. No, since StGIT talks directly with the first SMTP server in the chain, it needs to be able to QP-encode the mail itself if necessary -- but it should seldom be necessary, then.) In that case, the problem with the current implementation (without my patch applied) is likely to be that it fails to provide the headers needed for the SMTP path to be able to transform it losslessly. [ ... digs through old mail ... ] This is the interesting part of such a mail that was sent from my computer, passed through the list, and ended up back at my computer again: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>); Sun, 22 Oct 2006 08:02:21 -0400 X-Warning: Original message contained 8-bit characters, however during the SMTP transport session the receiving system did not announce capability of receiving 8-bit SMTP (RFC 1651-1653), and as this message does not have MIME headers (RFC 2045-2049) to enable encoding change, we had very little choice. X-Warning: We ASSUME it is less harmful to add the MIME headers, and convert the text to Quoted-Printable, than not to do so, and to strip the message to 7-bits.. (RFC 1428 Appendix A) X-Warning: We don't know what character set the user used, thus we had to write these MIME-headers with our local system default value. MIME-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751780AbWJVMCV (ORCPT <rfc822;git-outgoing>); Sun, 22 Oct 2006 08:02:21 -0400 The mail server (vger talking to itself, if the Received: headers were added in order) complained that there were no MIME headers, so it had to guess the charset. As it happened, it guessed wrong, so the non-ascii characters of the mail body was garbled. My stab at fixing this was to make StGIT QP-encode the mail from the outset, but if I've not misunderstood things yet again, the actual problem was that StGIT did not produce the right MIME headers. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-05 11:43 ` Karl Hasselström @ 2006-11-05 16:44 ` Linus Torvalds 2006-11-05 19:04 ` Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Linus Torvalds @ 2006-11-05 16:44 UTC (permalink / raw) To: Karl Hasselström; +Cc: Andy Whitcroft, Catalin Marinas, git [-- Attachment #1: Type: TEXT/PLAIN, Size: 2102 bytes --] On Sun, 5 Nov 2006, Karl Hasselström wrote: > > So the right thing to do would be to teach StGIT to generate > 8bit-encoded output, and trust the SMTP transfer path do mangle it > correctly? (Hmm. No, since StGIT talks directly with the first SMTP > server in the chain, it needs to be able to QP-encode the mail itself > if necessary -- but it should seldom be necessary, then.) Right. You could even just consider it an error if the mailserver doesn't reply to EHLO with 8BITMIME, I really think it's that rare. > In that case, the problem with the current implementation (without my > patch applied) is likely to be that it fails to provide the headers > needed for the SMTP path to be able to transform it losslessly. I _think_ it should be sufficient to just set the Content-Type and Content-Transfer-Encoding to say something like "text/plain; charset=UTF8" and "8bit" respectively. But somebody who know the SMTP rules better should check. HOWEVER: > Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand > id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>); > Sun, 22 Oct 2006 08:02:21 -0400 > X-Warning: Original message contained 8-bit characters, however during > the SMTP transport session the receiving system did not announce > capability of receiving 8-bit SMTP (RFC 1651-1653), and as this > message does not have MIME headers (RFC 2045-2049) to enable > encoding change, we had very little choice. This does seem to say that somebody didn't even announce 8-bit capability in the first place. That's a zmailer error message, and it does imply that somebody was running a bad server. That said, _if_ your message had had the proper mime-type specifiers, then zmailer would happily have QP-converted the message for you, so everything would have been fine. > The mail server (vger talking to itself, if the Received: headers were > added in order) complained that there were no MIME headers, so it had > to guess the charset. vger itself? Strange. Linus ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-05 16:44 ` Linus Torvalds @ 2006-11-05 19:04 ` Karl Hasselström 2006-11-05 19:29 ` Jakub Narebski 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-05 19:04 UTC (permalink / raw) To: Linus Torvalds; +Cc: Andy Whitcroft, Catalin Marinas, git On 2006-11-05 08:44:13 -0800, Linus Torvalds wrote: > On Sun, 5 Nov 2006, Karl Hasselström wrote: > > > So the right thing to do would be to teach StGIT to generate > > 8bit-encoded output, and trust the SMTP transfer path do mangle it > > correctly? (Hmm. No, since StGIT talks directly with the first > > SMTP server in the chain, it needs to be able to QP-encode the > > mail itself if necessary -- but it should seldom be necessary, > > then.) > > Right. You could even just consider it an error if the mailserver > doesn't reply to EHLO with 8BITMIME, I really think it's that rare. Makes sense (unless the Python SMTP library can do this for us -- it would be impolite to refuse then). > > In that case, the problem with the current implementation (without > > my patch applied) is likely to be that it fails to provide the > > headers needed for the SMTP path to be able to transform it > > losslessly. > > I _think_ it should be sufficient to just set the Content-Type and > Content-Transfer-Encoding to say something like "text/plain; > charset=UTF8" and "8bit" respectively. But somebody who know the > SMTP rules better should check. These are the headers that StGIT uses without my patch -- that is, the headers used to get that error message: Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: 8bit Which is obviously not good enough for some picky part of the SMTP chain. > HOWEVER: > > > Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand > > id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>); > > Sun, 22 Oct 2006 08:02:21 -0400 > > X-Warning: Original message contained 8-bit characters, however during > > the SMTP transport session the receiving system did not announce > > capability of receiving 8-bit SMTP (RFC 1651-1653), and as this > > message does not have MIME headers (RFC 2045-2049) to enable > > encoding change, we had very little choice. > > This does seem to say that somebody didn't even announce 8-bit > capability in the first place. That's a zmailer error message, and > it does imply that somebody was running a bad server. > > That said, _if_ your message had had the proper mime-type > specifiers, then zmailer would happily have QP-converted the message > for you, so everything would have been fine. E-mail seems to be like driving. You can't just follow the rules, you also have to be careful to make allowances for those who don't. :-( Well, it added these headers: MIME-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Maybe MIME-Version was the only thing missing? I'll have to try. > > The mail server (vger talking to itself, if the Received: headers > > were added in order) complained that there were no MIME headers, > > so it had to guess the charset. > > vger itself? Strange. It looks that way, but I don't know enough about mail servers to be very certain. The complete header of the message (in my git list mailbox) is this: From git-owner@vger.kernel.org Sun Oct 22 14:02:35 2006 Received: from vger.kernel.org ([209.132.176.167]) by diana.vm.bytemark.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 1Gbc2E-0005lw-00 for <kha-list-git@hemma.treskal.com>; Sun, 22 Oct 2006 13:02:35 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>); Sun, 22 Oct 2006 08:02:21 -0400 X-Warning: Original message contained 8-bit characters, however during the SMTP transport session the receiving system did not announce capability of receiving 8-bit SMTP (RFC 1651-1653), and as this message does not have MIME headers (RFC 2045-2049) to enable encoding change, we had very little choice. X-Warning: We ASSUME it is less harmful to add the MIME headers, and convert the text to Quoted-Printable, than not to do so, and to strip the message to 7-bits.. (RFC 1428 Appendix A) X-Warning: We don't know what character set the user used, thus we had to write these MIME-headers with our local system default value. MIME-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751780AbWJVMCV (ORCPT <rfc822;git-outgoing>); Sun, 22 Oct 2006 08:02:21 -0400 Received: from mxfep01.bredband.com ([195.54.107.70]:50054 "EHLO mxfep01.bredband.com") by vger.kernel.org with ESMTP id S1750700AbWJVMCU (ORCPT <rfc822;git@vger.kernel.org>); Sun, 22 Oct 2006 08:02:20 -0400 Received: from ironport2.bredband.com ([195.54.107.84] [195.54.107.84]) by mxfep01.bredband.com with ESMTP id <20061022120218.PHVT953.mxfep01.bredband.com@ironport2.bredband.com> for <git@vger.kernel.org>; Sun, 22 Oct 2006 14:02:18 +0200 Received: from ua-83-227-180-148.cust.bredbandsbolaget.se (HELO yoghurt.hemma.treskal.com) ([83.227.180.148]) by ironport2.bredband.com with ESMTP; 22 Oct 2006 14:02:18 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by yoghurt.hemma.treskal.com (Postfix) with ESMTP id 1DFDF4C010; Sun, 22 Oct 2006 14:02:18 +0200 (CEST) From: Karl =?utf-8?q?Hasselstr=C3=B6m?= <kha@treskal.com> Subject: [PATCH] RFC2047-encode email headers Date: Sun, 22 Oct 2006 14:02:17 +0200 To: Catalin Marinas <catalin.marinas@gmail.com> Cc: git@vger.kernel.org Message-Id: <20061022120217.7650.23715.stgit@localhost> User-Agent: StGIT/0.11 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org X-Envelope-Username: kha-list-git X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=0.94.4 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on diana.vm.bytemark.co.uk X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,FORGED_RCVD_HELO autolearn=disabled version=3.0.3 X-Already-Filtered-By: kha@treskal.com, 2006-10-22 13:02:44 +0100 Status: RO X-Status: A Content-Length: 4148 -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-05 19:04 ` Karl Hasselström @ 2006-11-05 19:29 ` Jakub Narebski 2006-11-06 7:45 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Jakub Narebski @ 2006-11-05 19:29 UTC (permalink / raw) To: git Karl Hasselström wrote: > These are the headers that StGIT uses without my patch -- that is, the > headers used to get that error message: > > Content-Type: text/plain; charset=utf-8; format=fixed > Content-Transfer-Encoding: 8bit > > Which is obviously not good enough for some picky part of the SMTP > chain. I think you are missing MIME-Version: header. [...] > Well, it added these headers: > > MIME-Version: 1.0 > Content-Transfer-Encoding: QUOTED-PRINTABLE > Content-Type: TEXT/PLAIN; charset=ISO-8859-1 > > Maybe MIME-Version was the only thing missing? I'll have to try. MIME-Version _is_ important. I remember that Outlook Express sent news messages without this header, and those posts were either mangled by news server, or news readers didn't parse MIME headers without MIME-Version: -- Jakub Narebski Warsaw, Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 45+ messages in thread
* [PATCH] Add a MIME-Version header to e-mails 2006-11-05 19:29 ` Jakub Narebski @ 2006-11-06 7:45 ` Karl Hasselström 2006-11-06 7:56 ` Karl Hasselström 2006-11-07 9:53 ` Catalin Marinas 0 siblings, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-06 7:45 UTC (permalink / raw) To: Catalin Marinas; +Cc: git From: Karl Hasselström <kha@treskal.com> This is required by some mail servers that want to change the transfer encoding of the mail. Signed-off-by: Karl Hasselström <kha@treskal.com> --- OK, this is a test to see if adding MIME-Version makes the problem go away. I don't have any other way to test this than sending a patch to the list. :-) stgit/commands/mail.py | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 45f7438..c428d67 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -271,13 +271,11 @@ def __get_signers_list(msg): return addr_list def __build_extra_headers(): - """Build extra headers like content-type etc. - """ - headers = 'Content-Type: text/plain; charset=utf-8; format=fixed\n' - headers += 'Content-Transfer-Encoding: 8bit\n' - headers += 'User-Agent: StGIT/%s\n' % version.version - - return headers + """Build extra headers like content-type etc.""" + return ('MIME-Version: 1.0\n' + 'Content-Type: text/plain; charset=utf-8; format=fixed\n' + 'Content-Transfer-Encoding: 8bit\n' + 'User-Agent: StGIT/%s\n' % version.version) def edit_message(msg): ^ permalink raw reply related [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-06 7:45 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström @ 2006-11-06 7:56 ` Karl Hasselström 2006-11-07 9:53 ` Catalin Marinas 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-06 7:56 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-06 08:45:32 +0100, Karl Hasselström wrote: > OK, this is a test to see if adding MIME-Version makes the problem > go away. I don't have any other way to test this than sending a > patch to the list. :-) All right, it seems to have worked! When I send patches to myself, they arrive still 8bit-encoded, and when I get them through the list, they have been properly QP-encoded by whatever part of the chain didn't like 8bit. Catalin, this should replace the QP-encoding patch. (But not the RFC2047-encoding patch -- the headers are required to always be ascii, if I've not misunderstood something.) Thanks everyone! -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-06 7:45 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 2006-11-06 7:56 ` Karl Hasselström @ 2006-11-07 9:53 ` Catalin Marinas 2006-11-07 19:09 ` Catalin Marinas 1 sibling, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-07 9:53 UTC (permalink / raw) To: Karl Hasselström; +Cc: git Karl, On 06/11/06, Karl Hasselström <kha@treskal.com> wrote: > This is required by some mail servers that want to change the transfer > encoding of the mail. Thanks for digging into this problem and thanks to everyone else (especially Linus) for the detailed explanations. I'll include these patches (maybe modified) and I'll try to fix "import" as well. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-07 9:53 ` Catalin Marinas @ 2006-11-07 19:09 ` Catalin Marinas 2006-11-08 8:40 ` Karl Hasselström 2006-11-11 12:24 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 0 siblings, 2 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-07 19:09 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 07/11/06, Catalin Marinas <catalin.marinas@gmail.com> wrote: > I'll include these patches (maybe modified) and I'll try to fix > "import" as well. I re-implemented parts of the mail and import commands (inspiring from your patches). They now use the email Python package. The mail command encodes the body to 7 or 8bit depending on non-ascii characters. The headers are QP-encoded. The import command can decode messages properly and can also handle multipart e-mails. I still have to write a test script but my simple tests showed that it works. Please let me know if there is anything wrong (especially with the QP-encoding of the mail headers). Thanks. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-07 19:09 ` Catalin Marinas @ 2006-11-08 8:40 ` Karl Hasselström 2006-11-08 9:41 ` Catalin Marinas 2006-11-11 12:24 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 1 sibling, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-08 8:40 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote: > I re-implemented parts of the mail and import commands (inspiring > from your patches). They now use the email Python package. The mail > command encodes the body to 7 or 8bit depending on non-ascii > characters. Even though it turned out to be possible to use 8bit always? > The headers are QP-encoded. Strictly speaking, it's rfc2047-encoded. I think the options are QP and base64. > The import command can decode messages properly and can also handle > multipart e-mails. Goodie. > I still have to write a test script but my simple tests showed that > it works. Please let me know if there is anything wrong (especially > with the QP-encoding of the mail headers). I won't have time to check this out today (in fact, it may have to wait until the weekend). But when I do check it out, I might have time to write that test, so please holler if you start working on that. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-08 8:40 ` Karl Hasselström @ 2006-11-08 9:41 ` Catalin Marinas 2006-11-08 10:01 ` Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-08 9:41 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 08/11/06, Karl Hasselström <kha@treskal.com> wrote: > On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote: > > > I re-implemented parts of the mail and import commands (inspiring > > from your patches). They now use the email Python package. The mail > > command encodes the body to 7 or 8bit depending on non-ascii > > characters. > > Even though it turned out to be possible to use 8bit always? I just let the Python email package to the encoding and it first tries pure ascii and switches to 8bit if this fails. This package automatically adds the proper e-mail headers based on the encoding type. It can also do QP or base64 encodings (if someone complains of an old SMTP server, maybe I'll add a config option to force QP body). > > I still have to write a test script but my simple tests showed that > > it works. Please let me know if there is anything wrong (especially > > with the QP-encoding of the mail headers). > > I won't have time to check this out today (in fact, it may have to > wait until the weekend). But when I do check it out, I might have time > to write that test, so please holler if you start working on that. It would be great if you can run a test script. I've been thinking more of an "import" test that also checks both the "export" and "mail" commands. BTW, I'll try to add support for mbox importing which is pretty easy with the email package. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-08 9:41 ` Catalin Marinas @ 2006-11-08 10:01 ` Karl Hasselström 2006-11-08 10:12 ` Catalin Marinas 0 siblings, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-08 10:01 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-08 09:41:33 +0000, Catalin Marinas wrote: > On 08/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote: > > > > > I re-implemented parts of the mail and import commands > > > (inspiring from your patches). They now use the email Python > > > package. The mail command encodes the body to 7 or 8bit > > > depending on non-ascii characters. > > > > Even though it turned out to be possible to use 8bit always? > > I just let the Python email package to the encoding and it first > tries pure ascii and switches to 8bit if this fails. Ah, OK, I misread you. This is precisely what I wanted. > It can also do QP or base64 encodings (if someone complains of an > old SMTP server, maybe I'll add a config option to force QP body). Yes, but let's hope we don't have to. :-) And if we do have to, we should probably autodetect it from the SMTP dialog as Linus explained (or rather, we should hope that the library can do this for us). > > > I still have to write a test script but my simple tests showed > > > that it works. Please let me know if there is anything wrong > > > (especially with the QP-encoding of the mail headers). > > > > I won't have time to check this out today (in fact, it may have to > > wait until the weekend). But when I do check it out, I might have > > time to write that test, so please holler if you start working on > > that. > > It would be great if you can run a test script. I've been thinking > more of an "import" test that also checks both the "export" and "mail" > commands. I was thinking along these lines too; first make sure the importer works, by feeding it a number of hard-coded patches in different formats, and then make sure that the importer can read what the exporter produces. (With "exporter" meaning both "stg export" and "stg mail".) I didn't originally plan to thest the actual e-mail sending, but now that I think of it, a simple script listening on a random port, pretending to be an SMTP daemon, should be quite simple to set up. > BTW, I'll try to add support for mbox importing which is pretty easy > with the email package. Sounds good. If you do it in time, I'll write a test for that too. ;-) -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-08 10:01 ` Karl Hasselström @ 2006-11-08 10:12 ` Catalin Marinas 2006-11-12 21:14 ` [StGIT PATCH 0/2] mail and import tests Karl Hasselström 0 siblings, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-08 10:12 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 08/11/06, Karl Hasselström <kha@treskal.com> wrote: > On 2006-11-08 09:41:33 +0000, Catalin Marinas wrote: > > It would be great if you can run a test script. I've been thinking > > more of an "import" test that also checks both the "export" and "mail" > > commands. > > I didn't originally plan to thest the actual e-mail sending, but now > that I think of it, a simple script listening on a random port, > pretending to be an SMTP daemon, should be quite simple to set up. I'm not sure it's worth the hassle. You could just generate an mbox file with "mail" and import it with "import --mbox" (it will hopefully be ready this week). Problems with SMTP would be noticed quickly anyway. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* [StGIT PATCH 0/2] mail and import tests 2006-11-08 10:12 ` Catalin Marinas @ 2006-11-12 21:14 ` Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 1/2] Regression test for "stg import" Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 2/2] Regression test for "stg mail" Karl Hasselström 0 siblings, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-12 21:14 UTC (permalink / raw) To: Catalin Marinas; +Cc: git Tests for "stg import" and "stg mail". The later test is not very ambitious, but it can always be extended later. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* [StGIT PATCH 1/2] Regression test for "stg import" 2006-11-12 21:14 ` [StGIT PATCH 0/2] mail and import tests Karl Hasselström @ 2006-11-12 21:15 ` Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 2/2] Regression test for "stg mail" Karl Hasselström 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-12 21:15 UTC (permalink / raw) To: Catalin Marinas; +Cc: git From: Karl Hasselström <kha@treskal.com> Signed-off-by: Karl Hasselström <kha@treskal.com> --- t/t1800-import.sh | 85 ++++++++++++++++++++++++++++++++++++++ t/t1800-import/email-8bit | 37 ++++++++++++++++ t/t1800-import/email-mbox | 102 +++++++++++++++++++++++++++++++++++++++++++++ t/t1800-import/email-qp | 37 ++++++++++++++++ t/t1800-import/git-diff | 20 +++++++++ t/t1800-import/gnu-diff | 19 ++++++++ t/t1800-import/stg-export | 26 +++++++++++ 7 files changed, 326 insertions(+), 0 deletions(-) diff --git a/t/t1800-import.sh b/t/t1800-import.sh new file mode 100755 index 0000000..0c1baa3 --- /dev/null +++ b/t/t1800-import.sh @@ -0,0 +1,85 @@ +#!/bin/sh +# Copyright (c) 2006 Karl Hasselström +test_description='Test the import command' +. ./test-lib.sh + +test_expect_success \ + 'Initialize the StGIT repository' \ + ' + for x in {do,di,da}{be,bi,bo}{dam,dim,dum}; do + echo $x + done > foo.txt && + git add foo.txt && + git commit -a -m "initial version" && + stg init + ' + +test_expect_success \ + 'Apply a patch created with "git diff"' \ + ' + stg import ../t1800-import/git-diff && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch created with GNU diff' \ + ' + stg import ../t1800-import/gnu-diff && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch created with "stg export"' \ + ' + stg import ../t1800-import/stg-export && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") == 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch from an 8bit-encoded e-mail' \ + ' + stg import -m ../t1800-import/email-8bit && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") == 1 ] && + [ $(git cat-file -p $(stg id) \ + | grep -c "author Inge Ström <inge@power.com>") == 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply a patch from a QP-encoded e-mail' \ + ' + stg import -m ../t1800-import/email-qp && + [ $(git cat-file -p $(stg id) \ + | grep -c "tree 030be42660323ff2a1958f9ee79589a4f3fbee2f") == 1 ] && + [ $(git cat-file -p $(stg id) \ + | grep -c "author Inge Ström <inge@power.com>") == 1 ] && + stg delete .. + ' + +test_expect_success \ + 'Apply several patches from an mbox file' \ + ' + stg import -M ../t1800-import/email-mbox && + [ $(git cat-file -p $(stg id change-1) \ + | grep -c "tree 401bef82cd9fb403aba18f480a63844416a2e023") == 1 ] && + [ $(git cat-file -p $(stg id change-1) \ + | grep -c "author Inge Ström <inge@power.com>") == 1 ] && + [ $(git cat-file -p $(stg id change-2) \ + | grep -c "tree e49dbce010ec7f441015a8c64bce0b99108af4cc") == 1 ] && + [ $(git cat-file -p $(stg id change-2) \ + | grep -c "author Inge Ström <inge@power.com>") == 1 ] && + [ $(git cat-file -p $(stg id change-3) \ + | grep -c "tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5") == 1 ] && + [ $(git cat-file -p $(stg id change-3) \ + | grep -c "author Inge Ström <inge@power.com>") == 1 ] && + stg delete .. + ' + +test_done diff --git a/t/t1800-import/email-8bit b/t/t1800-import/email-8bit new file mode 100644 index 0000000..316fe27 --- /dev/null +++ b/t/t1800-import/email-8bit @@ -0,0 +1,37 @@ +From: Inge =?utf-8?q?Str=C3=B6m?= <inge@power.com> +Subject: [PATCH] test patch +To: Upstream <foo@bar.baz> +Date: Sat, 11 Nov 2006 11:58:14 +0100 +Message-ID: <20061111105814.23209.46952.stgit@localhost> +User-Agent: StGIT/0.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Signed-off-by: Inge Ström <inge@power.com> +--- + + foo.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/foo.txt b/foo.txt +index ad01662..d3cd5b6 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -3,6 +3,7 @@ dobedim + dobedum + dobidam + dobidim ++pum-pöddelipåm + dobidum + dobodam + dobodim +@@ -20,6 +21,7 @@ dabedam + dabedim + dabedum + dabidam ++pum-däddelidum + dabidim + dabidum + dabodam + diff --git a/t/t1800-import/email-mbox b/t/t1800-import/email-mbox new file mode 100644 index 0000000..e4103e5 --- /dev/null +++ b/t/t1800-import/email-mbox @@ -0,0 +1,102 @@ +From nobody Sat Nov 11 12:45:27 2006 +From: Inge =?utf-8?q?Str=C3=B6m?= <inge@power.com> +Subject: [PATCH 1/3] Change 1 +To: Upstream <foo@bar.baz> +Date: Sat, 11 Nov 2006 12:45:27 +0100 +Message-ID: <20061111114527.31778.12942.stgit@localhost> +User-Agent: StGIT/0.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit +Status: RO +Content-Length: 304 +Lines: 19 + +Signed-off-by: Inge Ström <inge@power.com> +--- + + foo.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/foo.txt b/foo.txt +index ad01662..91527b1 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -7,7 +7,7 @@ dobidum + dobodam + dobodim + dobodum +-dibedam ++dibedad + dibedim + dibedum + dibidam + +From nobody Sat Nov 11 12:45:27 2006 +From: Inge =?utf-8?q?Str=C3=B6m?= <inge@power.com> +Subject: [PATCH 2/3] Change 2 +To: Upstream <foo@bar.baz> +Date: Sat, 11 Nov 2006 12:45:27 +0100 +Message-ID: <20061111114527.31778.92851.stgit@localhost> +In-Reply-To: <20061111114527.31778.12942.stgit@localhost> +References: <20061111114527.31778.12942.stgit@localhost> +User-Agent: StGIT/0.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit +Status: RO +Content-Length: 296 +Lines: 18 + +Signed-off-by: Inge Ström <inge@power.com> +--- + + foo.txt | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/foo.txt b/foo.txt +index 91527b1..79922d7 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -18,6 +18,7 @@ dibodim + dibodum + dabedam + dabedim ++dibedam + dabedum + dabidam + dabidim + +From nobody Sat Nov 11 12:45:27 2006 +From: Inge =?utf-8?q?Str=C3=B6m?= <inge@power.com> +Subject: [PATCH 3/3] Change 3 +To: Upstream <foo@bar.baz> +Date: Sat, 11 Nov 2006 12:45:27 +0100 +Message-ID: <20061111114527.31778.45876.stgit@localhost> +In-Reply-To: <20061111114527.31778.12942.stgit@localhost> +References: <20061111114527.31778.12942.stgit@localhost> +User-Agent: StGIT/0.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit +Status: RO +Content-Length: 278 +Lines: 16 + +Signed-off-by: Inge Ström <inge@power.com> +--- + + foo.txt | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/foo.txt b/foo.txt +index 79922d7..6f978b4 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -24,5 +24,4 @@ dabidam + dabidim + dabidum + dabodam +-dabodim + dabodum + diff --git a/t/t1800-import/email-qp b/t/t1800-import/email-qp new file mode 100644 index 0000000..1a77c57 --- /dev/null +++ b/t/t1800-import/email-qp @@ -0,0 +1,37 @@ +From: Inge =?utf-8?q?Str=C3=B6m?= <inge@power.com> +Subject: [PATCH] test patch +To: Upstream <foo@bar.baz> +Date: Sat, 11 Nov 2006 11:58:14 +0100 +Message-ID: <20061111105814.23209.46952.stgit@localhost> +User-Agent: StGIT/0.11 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: quoted-printable + +Signed-off-by: Inge Str=C3=B6m <inge@power.com> +--- + + foo.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/foo.txt b/foo.txt +index ad01662..d3cd5b6 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -3,6 +3,7 @@ dobedim + dobedum + dobidam + dobidim ++pum-p=C3=B6ddelip=C3=A5m + dobidum + dobodam + dobodim +@@ -20,6 +21,7 @@ dabedam + dabedim + dabedum + dabidam ++pum-d=C3=A4ddelidum + dabidim + dabidum + dabodam + diff --git a/t/t1800-import/git-diff b/t/t1800-import/git-diff new file mode 100644 index 0000000..642e11d --- /dev/null +++ b/t/t1800-import/git-diff @@ -0,0 +1,20 @@ +diff --git a/foo.txt b/foo.txt +index ad01662..d3cd5b6 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -3,6 +3,7 @@ dobedim + dobedum + dobidam + dobidim ++dabadadash + dobidum + dobodam + dobodim +@@ -20,6 +21,7 @@ dabedam + dabedim + dabedum + dabidam ++dadadadash + dabidim + dabidum + dabodam diff --git a/t/t1800-import/gnu-diff b/t/t1800-import/gnu-diff new file mode 100644 index 0000000..46b338a --- /dev/null +++ b/t/t1800-import/gnu-diff @@ -0,0 +1,19 @@ +diff -Naur old/foo.txt new/foo.txt +--- old/foo.txt 2006-11-11 11:26:18.000000000 +0100 ++++ new/foo.txt 2006-11-11 11:25:18.000000000 +0100 +@@ -3,6 +3,7 @@ + dobedum + dobidam + dobidim ++dabadadash + dobidum + dobodam + dobodim +@@ -20,6 +21,7 @@ + dabedim + dabedum + dabidam ++dadadadash + dabidim + dabidum + dabodam diff --git a/t/t1800-import/stg-export b/t/t1800-import/stg-export new file mode 100644 index 0000000..ddcfc3e --- /dev/null +++ b/t/t1800-import/stg-export @@ -0,0 +1,26 @@ +test patch +--- + + foo.txt | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/foo.txt b/foo.txt +index ad01662..d3cd5b6 100644 +--- a/foo.txt ++++ b/foo.txt +@@ -3,6 +3,7 @@ dobedim + dobedum + dobidam + dobidim ++dabadadash + dobidum + dobodam + dobodim +@@ -20,6 +21,7 @@ dabedam + dabedim + dabedum + dabidam ++dadadadash + dabidim + dabidum ^ permalink raw reply related [flat|nested] 45+ messages in thread
* [StGIT PATCH 2/2] Regression test for "stg mail" 2006-11-12 21:14 ` [StGIT PATCH 0/2] mail and import tests Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 1/2] Regression test for "stg import" Karl Hasselström @ 2006-11-12 21:15 ` Karl Hasselström 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-12 21:15 UTC (permalink / raw) To: Catalin Marinas; +Cc: git From: Karl Hasselström <kha@treskal.com> Signed-off-by: Karl Hasselström <kha@treskal.com> --- t/t1900-mail.sh | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/t/t1900-mail.sh b/t/t1900-mail.sh new file mode 100755 index 0000000..6a950b4 --- /dev/null +++ b/t/t1900-mail.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright (c) 2006 Karl Hasselström +test_description='Test the mail command' +. ./test-lib.sh + +test_expect_success \ + 'Initialize the StGIT repository' \ + ' + for i in 1 2 3 4 5; do + touch foo.txt && + echo "line $i" >> foo.txt && + git add foo.txt && + git commit -a -m "Patch $i" + done && + stg init && + stg uncommit -n 5 foo + ' + +test_expect_success \ + 'Put all the patches in an mbox' \ + 'stg mail --to="Inge Ström <inge@example.com>" -a -m \ + -t ../../templates/patchmail.tmpl > mbox0' + +test_expect_success \ + 'Import the mbox and compare' \ + ' + t1=$(git cat-file -p $(stg id) | grep ^tree) + stg pop -a && + stg import -M mbox0 && + t2=$(git cat-file -p $(stg id) | grep ^tree) && + [ "$t1" == "$t2" ] + ' + ^ permalink raw reply related [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-07 19:09 ` Catalin Marinas 2006-11-08 8:40 ` Karl Hasselström @ 2006-11-11 12:24 ` Karl Hasselström 2006-11-16 17:24 ` Catalin Marinas 1 sibling, 1 reply; 45+ messages in thread From: Karl Hasselström @ 2006-11-11 12:24 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote: > I re-implemented parts of the mail and import commands (inspiring > from your patches). They now use the email Python package. The mail > command encodes the body to 7 or 8bit depending on non-ascii > characters. The headers are QP-encoded. The import command can > decode messages properly and can also handle multipart e-mails. > > I still have to write a test script but my simple tests showed that > it works. Please let me know if there is anything wrong (especially > with the QP-encoding of the mail headers). One potentially hazardous thing: you encode the mail before letting the user edit it (with the -e and -E switches). This means that the user can insert non-ascii characters in the body after you've already decided it's safe to use 7bit encoding. It also means that the user must be careful to rfc2047-encode any changes to the Subject: and From: headers. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Add a MIME-Version header to e-mails 2006-11-11 12:24 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström @ 2006-11-16 17:24 ` Catalin Marinas 0 siblings, 0 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-16 17:24 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 11/11/06, Karl Hasselström <kha@treskal.com> wrote: > One potentially hazardous thing: you encode the mail before letting > the user edit it (with the -e and -E switches). This means that the > user can insert non-ascii characters in the body after you've already > decided it's safe to use 7bit encoding. It also means that the user > must be careful to rfc2047-encode any changes to the Subject: and > From: headers. I changed this to edit the mail before encoding it. You can no longer see the full headers (those added by StGIT) but even in a normal e-mail client you can only see the whole headers after sending it (and if you receive it back). -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 9:58 ` Karl Hasselström 2006-11-03 10:01 ` Karl Hasselström @ 2006-11-03 12:44 ` Catalin Marinas 2006-11-03 13:02 ` Karl Hasselström 1 sibling, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 12:44 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > I believe all the mails I send with mutt are QP-encoded, and they > don't look funny, do they? (You'd see the separator just above my > signature as "--=20" if that was the case; it has a trailing > whitespace.) This e-mail, in gmail: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In Gnus (via gmane, no "=20" displayed though Gnus can handle this encoding correctly): Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE It looks like the mail server re-encodes the message. > > However, I'd like the message body to still be 8bit and the QP > > encoding optional (either command line option or [stgit] config > > variable). > > Are you sure? Wouldn't it be better to teach StGIT to eat QP-encoded > mails, and use 7bit encoding when the patch is all ascii? (And still > have an option to force 8bit instead of QP if desired, of course.) Well, I don't have any strong opinion here, as long as QP is more widely available. My impression with Gnus was that it cannot handle but I think there was an encoding problem. The initial mail command implementation was inspired from sendpatchset but we should probably now use the email Python package and let it handle the encoding and decoding (for import). -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 12:44 ` [PATCH] Allow hand-editing of patches before sending Catalin Marinas @ 2006-11-03 13:02 ` Karl Hasselström 2006-11-03 13:16 ` Catalin Marinas 2006-11-03 13:25 ` Catalin Marinas 0 siblings, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 13:02 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 12:44:48 +0000, Catalin Marinas wrote: > On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > Are you sure? Wouldn't it be better to teach StGIT to eat > > QP-encoded mails, and use 7bit encoding when the patch is all > > ascii? (And still have an option to force 8bit instead of QP if > > desired, of course.) > > Well, I don't have any strong opinion here, as long as QP is more > widely available. My impression with Gnus was that it cannot handle > but I think there was an encoding problem. Most probably, yes. Not supporting QP would count as a serious deficiency in an e-mail client. > The initial mail command implementation was inspired from > sendpatchset but we should probably now use the email Python package > and let it handle the encoding and decoding (for import). Or try to use the git plumbing directly, if reasonable. Mail encoding and decoding isn't my idea of fun -- I just want it to not break. And I don't see much point in StGIT replicating core GIT functionality when there's no reason to. -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:02 ` Karl Hasselström @ 2006-11-03 13:16 ` Catalin Marinas 2006-11-03 13:25 ` Karl Hasselström 2006-11-03 13:25 ` Catalin Marinas 1 sibling, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 13:16 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > Or try to use the git plumbing directly, if reasonable. Mail encoding > and decoding isn't my idea of fun -- I just want it to not break. And > I don't see much point in StGIT replicating core GIT functionality > when there's no reason to. As I said in my reply to Junio, I really like to keep the e-mail templates functionality of StGIT. This is not available in git-format-patch. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:16 ` Catalin Marinas @ 2006-11-03 13:25 ` Karl Hasselström 0 siblings, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 13:25 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 13:16:08 +0000, Catalin Marinas wrote: > On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > Or try to use the git plumbing directly, if reasonable. Mail > > encoding and decoding isn't my idea of fun -- I just want it to > > not break. And I don't see much point in StGIT replicating core > > GIT functionality when there's no reason to. > > As I said in my reply to Junio, I really like to keep the e-mail > templates functionality of StGIT. This is not available in > git-format-patch. Fair enough. How about e-mail importing -- is there a good reason to not use the git plumbing there? -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:02 ` Karl Hasselström 2006-11-03 13:16 ` Catalin Marinas @ 2006-11-03 13:25 ` Catalin Marinas 2006-11-03 13:33 ` Karl Hasselström 2006-11-03 13:39 ` Petr Baudis 1 sibling, 2 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 13:25 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > Mail encoding and decoding isn't my idea of fun -- I just want it to not break. I understand this and I think we should get this fixed. In the meantime, you can always run git-format-patch/git-send-email on the StGIT patches (the id would be "patches/<branch>/<patch>"). On my side I just run git-am and "stg uncommit" or "assimilate". -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:25 ` Catalin Marinas @ 2006-11-03 13:33 ` Karl Hasselström 2006-11-03 13:42 ` Karl Hasselström 2006-11-03 13:56 ` Catalin Marinas 2006-11-03 13:39 ` Petr Baudis 1 sibling, 2 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 13:33 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 13:25:36 +0000, Catalin Marinas wrote: > On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > > > Mail encoding and decoding isn't my idea of fun -- I just want it > > to not break. > > I understand this and I think we should get this fixed. In the > meantime, you can always run git-format-patch/git-send-email on the > StGIT patches (the id would be "patches/<branch>/<patch>"). Does that mean that "stg mail" with my QP patch generates output that even git-am can't read? I had guessed from what you said earlier that git-am _could_ read them. > On my side I just run git-am and "stg uncommit" or "assimilate". Yes, aren't they handy sometimes? :-) -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:33 ` Karl Hasselström @ 2006-11-03 13:42 ` Karl Hasselström 2006-11-03 13:56 ` Catalin Marinas 1 sibling, 0 replies; 45+ messages in thread From: Karl Hasselström @ 2006-11-03 13:42 UTC (permalink / raw) To: Catalin Marinas; +Cc: git On 2006-11-03 14:33:29 +0100, Karl Hasselström wrote: > Does that mean that "stg mail" with my QP patch generates output that > even git-am can't read? I had guessed from what you said earlier that > git-am _could_ read them. (Yes, I'm way too lazy. I tested the "stg mail" output by mailing patches to myself and making sure that they looked good in my mail reader. And by looking at the raw output quite a bit.) -- Karl Hasselström, kha@treskal.com ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:33 ` Karl Hasselström 2006-11-03 13:42 ` Karl Hasselström @ 2006-11-03 13:56 ` Catalin Marinas 2006-11-03 14:37 ` Catalin Marinas 1 sibling, 1 reply; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 13:56 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > On 2006-11-03 13:25:36 +0000, Catalin Marinas wrote: > > I understand this and I think we should get this fixed. In the > > meantime, you can always run git-format-patch/git-send-email on the > > StGIT patches (the id would be "patches/<branch>/<patch>"). > > Does that mean that "stg mail" with my QP patch generates output that > even git-am can't read? I had guessed from what you said earlier that > git-am _could_ read them. Yes, git-am was able to apply them but after using Gnus to write them to an mbox file. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:56 ` Catalin Marinas @ 2006-11-03 14:37 ` Catalin Marinas 0 siblings, 0 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 14:37 UTC (permalink / raw) To: Karl Hasselström; +Cc: git On 03/11/06, Catalin Marinas <catalin.marinas@gmail.com> wrote: > On 03/11/06, Karl Hasselström <kha@treskal.com> wrote: > > On 2006-11-03 13:25:36 +0000, Catalin Marinas wrote: > > > I understand this and I think we should get this fixed. In the > > > meantime, you can always run git-format-patch/git-send-email on the > > > StGIT patches (the id would be "patches/<branch>/<patch>"). > > > > Does that mean that "stg mail" with my QP patch generates output that > > even git-am can't read? I had guessed from what you said earlier that > > git-am _could_ read them. > > Yes, git-am was able to apply them but after using Gnus to write them > to an mbox file. I changed your patch slightly to add "Content-Disposition: inline" and QUOTED-PRINTABLE instead of quoted-printable. It seems that Gnus can show it properly now (but import still fails, of course). -- ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:25 ` Catalin Marinas 2006-11-03 13:33 ` Karl Hasselström @ 2006-11-03 13:39 ` Petr Baudis 2006-11-03 14:01 ` Catalin Marinas 1 sibling, 1 reply; 45+ messages in thread From: Petr Baudis @ 2006-11-03 13:39 UTC (permalink / raw) To: Catalin Marinas; +Cc: Karl Hasselström, git Dear diary, on Fri, Nov 03, 2006 at 02:25:36PM CET, I got a letter where Catalin Marinas <catalin.marinas@gmail.com> said that... > I just run git-am and "stg uncommit" or "assimilate". git-am calls git-mailsplit and git-mailinfo, and those two tools will do most of the work (basically everything except the actual committing) for you, I use them in cg-patch -m and it should be fairly trivial to make a stg command reusing those too. -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1 ^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: [PATCH] Allow hand-editing of patches before sending 2006-11-03 13:39 ` Petr Baudis @ 2006-11-03 14:01 ` Catalin Marinas 0 siblings, 0 replies; 45+ messages in thread From: Catalin Marinas @ 2006-11-03 14:01 UTC (permalink / raw) To: Petr Baudis; +Cc: Karl Hasselström, git On 03/11/06, Petr Baudis <pasky@suse.cz> wrote: > Dear diary, on Fri, Nov 03, 2006 at 02:25:36PM CET, I got a letter > where Catalin Marinas <catalin.marinas@gmail.com> said that... > > I just run git-am and "stg uncommit" or "assimilate". > > git-am calls git-mailsplit and git-mailinfo, and those two tools will do > most of the work (basically everything except the actual committing) for > you, I use them in cg-patch -m and it should be fairly trivial to make a > stg command reusing those too. Yes, indeed, these are the commands I would use. I wouldn't go further in calling git-am or git-applymbox directly as I try not to use too many of the porcelain'ish git scripts. -- ^ permalink raw reply [flat|nested] 45+ messages in thread
end of thread, other threads:[~2006-11-16 17:24 UTC | newest] Thread overview: 45+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-11-01 9:00 [PATCH] Allow hand-editing of patches before sending Karl Hasselström 2006-11-02 10:32 ` Catalin Marinas 2006-11-02 11:36 ` Karl Hasselström 2006-11-03 9:39 ` Catalin Marinas 2006-11-03 9:58 ` Karl Hasselström 2006-11-03 10:01 ` Karl Hasselström 2006-11-03 10:21 ` Petr Baudis 2006-11-03 10:31 ` Robin Rosenberg 2006-11-03 10:36 ` Andreas Ericsson 2006-11-03 10:53 ` Karl Hasselström 2006-11-03 11:21 ` Junio C Hamano 2006-11-03 11:35 ` Karl Hasselström 2006-11-03 12:56 ` Catalin Marinas 2006-11-03 12:07 ` Andy Whitcroft 2006-11-03 12:36 ` Karl Hasselström 2006-11-03 14:03 ` Andy Whitcroft 2006-11-03 18:48 ` Linus Torvalds 2006-11-05 11:43 ` Karl Hasselström 2006-11-05 16:44 ` Linus Torvalds 2006-11-05 19:04 ` Karl Hasselström 2006-11-05 19:29 ` Jakub Narebski 2006-11-06 7:45 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 2006-11-06 7:56 ` Karl Hasselström 2006-11-07 9:53 ` Catalin Marinas 2006-11-07 19:09 ` Catalin Marinas 2006-11-08 8:40 ` Karl Hasselström 2006-11-08 9:41 ` Catalin Marinas 2006-11-08 10:01 ` Karl Hasselström 2006-11-08 10:12 ` Catalin Marinas 2006-11-12 21:14 ` [StGIT PATCH 0/2] mail and import tests Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 1/2] Regression test for "stg import" Karl Hasselström 2006-11-12 21:15 ` [StGIT PATCH 2/2] Regression test for "stg mail" Karl Hasselström 2006-11-11 12:24 ` [PATCH] Add a MIME-Version header to e-mails Karl Hasselström 2006-11-16 17:24 ` Catalin Marinas 2006-11-03 12:44 ` [PATCH] Allow hand-editing of patches before sending Catalin Marinas 2006-11-03 13:02 ` Karl Hasselström 2006-11-03 13:16 ` Catalin Marinas 2006-11-03 13:25 ` Karl Hasselström 2006-11-03 13:25 ` Catalin Marinas 2006-11-03 13:33 ` Karl Hasselström 2006-11-03 13:42 ` Karl Hasselström 2006-11-03 13:56 ` Catalin Marinas 2006-11-03 14:37 ` Catalin Marinas 2006-11-03 13:39 ` Petr Baudis 2006-11-03 14:01 ` Catalin Marinas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).