[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / a3 / ead7f167660df478f22f3d183712f8e3a614f5
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 51607431FD0\r
6         for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 12:21:37 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id mlO482GXKpw3 for <notmuch@notmuchmail.org>;\r
16         Wed, 21 Dec 2011 12:21:36 -0800 (PST)\r
17 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
18  [74.125.83.53])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  88B8D431FB6    for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 12:21:36 -0800\r
21  (PST)\r
22 Received: by eekd41 with SMTP id d41so9359248eek.26\r
23         for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 12:21:33 -0800 (PST)\r
24 Received: by 10.213.15.139 with SMTP id k11mr81354eba.69.1324498892337;\r
25         Wed, 21 Dec 2011 12:21:32 -0800 (PST)\r
26 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
27         [80.220.92.23])\r
28         by mx.google.com with ESMTPS id 13sm24640216eeu.1.2011.12.21.12.21.29\r
29         (version=SSLv3 cipher=OTHER); Wed, 21 Dec 2011 12:21:30 -0800 (PST)\r
30 From: Jani Nikula <jani@nikula.org>\r
31 To: Austin Clements <amdragon@MIT.EDU>, David Edmondson <dme@dme.org>\r
32 Subject: Re: [PATCH] emacs: create patch filename from subject for inline\r
33         patch fake parts\r
34 In-Reply-To: <20111221144008.GG10376@mit.edu>\r
35 References: <1321657368-13872-1-git-send-email-jani@nikula.org>\r
36         <87aa6nxb3o.fsf@nikula.org> <20111220215229.GF10376@mit.edu>\r
37         <cun4nwuxota.fsf@hotblack-desiato.hh.sledj.net>\r
38         <20111221144008.GG10376@mit.edu>\r
39 User-Agent: Notmuch/0.10.2+120~ga2d869a (http://notmuchmail.org) Emacs/23.3.1\r
40         (i686-pc-linux-gnu)\r
41 Date: Wed, 21 Dec 2011 22:21:27 +0200\r
42 Message-ID: <877h1py8u0.fsf@nikula.org>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 Cc: notmuch@notmuchmail.org\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Wed, 21 Dec 2011 20:21:37 -0000\r
59 \r
60 On Wed, 21 Dec 2011 09:40:08 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
61 > I would definitely go with the latter.\r
62\r
63 > It might feel less unwieldy with a shorter variable name than\r
64 > "filename", since that has to be repeated so many times.  (It's also\r
65 > not really a filename in the middle of the replace process.)\r
66\r
67 > This is splitting hairs, but in my original suggestion, I was thinking\r
68 > something like\r
69\r
70 >   (let* ((s subject)\r
71 >          (s (replace-regexp-in-string "^ *\\(\\[[^]]*\\]\\)? *" "" s))\r
72 >          (s (replace-regexp-in-string "[. ]*$" "" s))\r
73 >          (s (replace-regexp-in-string "[^A-Za-z0-9._-]+" "-" s))\r
74 >          (s (replace-regexp-in-string "\\.+" "." s))\r
75 >          (s (substring s 0 (min (length s) 50))))\r
76 >      (concat s ".patch"))\r
77\r
78 > Out of curiosity, where'd the regexps come from?  They all seem\r
79 > reasonable, but some of them seem somewhat arbitrary.\r
80 \r
81 The regexps should definitely have some explanation. I tried to mimic\r
82 the 'git format-patch' behaviour [1] using as simple and straightforward\r
83 regexps as possible. For simplicity, there's no creation of patch\r
84 sequence numbers. The max length is the same as in git, excluding the\r
85 sequence number.\r
86 \r
87 If the patch was sent using git format-patch/send-email, this should\r
88 result in re-creation of the same filename as the sender had (apart from\r
89 the sequence number, obviously).\r
90 \r
91 I seem to be missing the trimming of any trailing '.' and '-' after\r
92 truncating the string to max length, though.\r
93 \r
94 \r
95 BR,\r
96 Jani.\r
97 \r
98 [1] https://github.com/gitster/git/blob/master/pretty.c#L712\r
99 \r