Re: [PATCH] create .mailmap file (for git shortlog/blame)
[notmuch-archives.git] / 74 / ed4334fe74b3e3085b0d5e67f1ba1730533396
1 Return-Path: <tomi.ollila@iki.fi>\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 4B53C431FDC\r
6         for <notmuch@notmuchmail.org>; Sun,  8 Dec 2013 10:59:55 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 FC-jYlAHNmzS for <notmuch@notmuchmail.org>;\r
16         Sun,  8 Dec 2013 10:59:47 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id C957A431FD4\r
19         for <notmuch@notmuchmail.org>; Sun,  8 Dec 2013 10:59:46 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 69ABC10005D;\r
22         Sun,  8 Dec 2013 20:59:42 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH 2/4] test: sanitize Date and timestamp fields in json\r
26 In-Reply-To: <1386517946-22054-3-git-send-email-david@tethera.net>\r
27 References: <1386517946-22054-1-git-send-email-david@tethera.net>\r
28         <1386517946-22054-3-git-send-email-david@tethera.net>\r
29 User-Agent: Notmuch/0.17~rc1+17~ga2e1a2f (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Sun, 08 Dec 2013 20:59:42 +0200\r
35 Message-ID: <m2bo0rnp7l.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Sun, 08 Dec 2013 18:59:55 -0000\r
51 \r
52 On Sun, Dec 08 2013, David Bremner <david@tethera.net> wrote:\r
53 \r
54 > Eventually we want test messages to have distinct dates to avoid\r
55 > reproducability problems. This sanitization will prevent some test\r
56 > failures when that change is made.\r
57 >\r
58 > Replace the use of a local function in maildir-sync with\r
59 > notmuch_json_show_sanitize\r
60 > ---\r
61 >  test/maildir-sync | 15 +++++----------\r
62 >  test/test-lib.sh  |  4 +++-\r
63 >  2 files changed, 8 insertions(+), 11 deletions(-)\r
64 >\r
65 > diff --git a/test/maildir-sync b/test/maildir-sync\r
66 > index 33d2c58..3186e70 100755\r
67 > --- a/test/maildir-sync\r
68 > +++ b/test/maildir-sync\r
69 > @@ -4,11 +4,6 @@ test_description="maildir synchronization"\r
70 >  \r
71 >  . ./test-lib.sh\r
72 >  \r
73 > -# Avoid including the local value of MAIL_DIR in the result.\r
74 > -filter_show_json() {\r
75 > -    sed -e "s|${MAIL_DIR}/|MAIL_DIR/|"\r
76 > -}\r
77 > -\r
78 >  # Create the expected maildir structure\r
79 >  mkdir $MAIL_DIR/cur\r
80 >  mkdir $MAIL_DIR/new\r
81 > @@ -40,18 +35,18 @@ output=$(cd ${MAIL_DIR}/cur; ls -1 adding-replied*)\r
82 >  test_expect_equal "$output" "adding-replied-tag:2,RS"\r
83 >  \r
84 >  test_begin_subtest "notmuch show works with renamed file (without notmuch new)"\r
85 > -output=$(notmuch show --format=json id:${gen_msg_id} | filter_show_json)\r
86 > -test_expect_equal_json "$output" '[[[{"id": "adding-replied-tag@notmuch-test-suite",\r
87 > +output=$(notmuch show --format=json id:${gen_msg_id} | notmuch_json_show_sanitize)\r
88 > +test_expect_equal_json "$output" '[[[{"id": "XXXXX",\r
89 >  "match": true,\r
90 >  "excluded": false,\r
91 > -"filename": "MAIL_DIR/cur/adding-replied-tag:2,RS",\r
92 > -"timestamp": 978709437,\r
93 > +"filename": "YYYYY",\r
94 > +"timestamp": 42,\r
95 >  "date_relative": "2001-01-05",\r
96 >  "tags": ["inbox","replied"],\r
97 >  "headers": {"Subject": "Adding replied tag",\r
98 >  "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
99 >  "To": "Notmuch Test Suite <test_suite@notmuchmail.org>",\r
100 > -"Date": "Fri, 05 Jan 2001 15:43:57 +0000"},\r
101 > +"Date": "GENERATED_DATE"},\r
102 >  "body": [{"id": 1,\r
103 >  "content-type": "text/plain",\r
104 >  "content": "This is just a test message (#3)\n"}]},\r
105 > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
106 > index 8611ba5..9d2f805 100644\r
107 > --- a/test/test-lib.sh\r
108 > +++ b/test/test-lib.sh\r
109 > @@ -625,7 +625,9 @@ notmuch_json_show_sanitize ()\r
110 >  {\r
111 >      sed \\r
112 >       -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \\r
113 > -     -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'\r
114 > +     -e 's|"Date": "Fri[^"]*0000"|"Date": "GENERATED_DATE"|g' \\r
115 \r
116 Minor nit: The RE for changing to GENERATED_DATE is more different than\r
117 required here and elsewhere in this patch series. Both could use \r
118 'Fri, 05 Jan 2001' and '0000' parts...\r
119 \r
120 > +     -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' \\r
121 > +     -e 's|"timestamp": 97.......|"timestamp": 42|g'\r
122 >  }\r
123 >  \r
124 >  notmuch_emacs_error_sanitize ()\r
125 > -- \r
126 > 1.8.4.3\r
127 >\r
128 > _______________________________________________\r
129 > notmuch mailing list\r
130 > notmuch@notmuchmail.org\r
131 > http://notmuchmail.org/mailman/listinfo/notmuch\r