[PATCH v2 (rebased) 0/3] Improve the display of matching/non-matching authors.
[notmuch-archives.git] / 98 / e66ddce66fcb6c05565fee5d65d3a78bdc98e5
1 Return-Path: <sojkam1@fel.cvut.cz>\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 477C1431FBC\r
6         for <notmuch@notmuchmail.org>; Tue, 16 Feb 2010 01:08:54 -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.944\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.944 tagged_above=-999 required=5\r
12         tests=[AWL=-0.945, BAYES_50=0.001] autolearn=ham\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 w5NOrr8kS36E for <notmuch@notmuchmail.org>;\r
16         Tue, 16 Feb 2010 01:08:53 -0800 (PST)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 31177431FAE\r
19         for <notmuch@notmuchmail.org>; Tue, 16 Feb 2010 01:08:53 -0800 (PST)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 2508F19F3305;\r
22         Tue, 16 Feb 2010 10:08:52 +0100 (CET)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id t92phN1g2yHX; Tue, 16 Feb 2010 10:08:48 +0100 (CET)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id E221119F33B8;\r
30         Tue, 16 Feb 2010 10:08:47 +0100 (CET)\r
31 Received: from steelpick.localdomain (k335-30.felk.cvut.cz [147.32.86.30])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id A9F17FA003;\r
34         Tue, 16 Feb 2010 10:08:47 +0100 (CET)\r
35 Received: from wsh by steelpick.localdomain with local (Exim 4.71)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1NhJQE-0000Vu-Im; Tue, 16 Feb 2010 10:08:46 +0100\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: Stewart Smith <stewart@flamingspork.com>, notmuch@notmuchmail.org\r
40 In-Reply-To: <20100215002914.GA22402@flamingspork.com>\r
41 References: <20100215002914.GA22402@flamingspork.com>\r
42 Date: Tue, 16 Feb 2010 10:08:45 +0100\r
43 Message-ID: <87wrydim3m.fsf@steelpick.localdomain>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Subject: Re: [notmuch] Mail in git\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Tue, 16 Feb 2010 09:08:54 -0000\r
60 \r
61 Hi Stewart,\r
62 \r
63 On Mon, 15 Feb 2010 11:29:14 +1100, Stewart Smith <stewart@flamingspork.com> wrote:\r
64 > Which goes from a 15GB Maildir to a 3.7GB git repo.\r
65 \r
66 That's quite interesting ratio. I've tried a plain git add and git gc on\r
67 my mail store and the result was a repo of approximately 50% of mail\r
68 store size. Do you think that this difference might be caused by the way\r
69 you created the packs?\r
70 \r
71\r
72 > The algorithm of evenless.pl is basically:\r
73 > 1 get next directory entry\r
74 > 2 if is directory, recurse into it\r
75 > 3 write item to git (git hash-object -w)\r
76 > 4 add item to tree object\r
77 > 5 if number of items written = 1000\r
78 >   5.1 make pack of last 1000 items\r
79 > 6 goto 1\r
80 \r
81 So it seems that you have all you mails in a single tree. How long it\r
82 takes to caculate difference of two trees (git diff-tree --name-status)?\r
83 This operation will be needed by "notmuch new" to determine which\r
84 files/blobs to index. I suppose it will be better if mail blobs are\r
85 stored in subtrees. If a subtree is not changed git doesn't need to\r
86 descend to it because it has the same sha1.\r
87 \r
88 I think that storing mails in a similar structure as in .git/objects\r
89 (i.e. 256 subdirectories based on the first sha1 byte and file names\r
90 based on the last 39 sha1 bytes) would be reasonable.\r
91 \r
92 > Next step?\r
93\r
94 > Make notmuch be able to read mail out of it and add it to an index\r
95 > (oh, and some kind of verification and error checking about creating\r
96 > the git repo).\r
97 \r
98 Besides using git to compact the size of mail store, another feature that\r
99 cames with git for free is synchronization. For this to work, you only\r
100 need to store tags in the repo. What might work is to store tags in\r
101 files named <mail-name>.tags. The tags would be stored in the files\r
102 alphabetically, one tag per line. I guess, that this way makes it easy\r
103 to merge tags during synchronization even without writing custom git\r
104 merge driver.\r
105 \r
106 Onother point that must be solved if we would like to use git with\r
107 notmuch is the license problem. As it was pointed out by Carl in another\r
108 thread, Git is licensed under GPLv2 only whereas notmuch under GPLv3 and\r
109 these licences are incompatible. So I think we will need some kind of\r
110 hooks in notmuch from which external programs (git) will be called.\r
111 \r
112 Cheers,\r
113  Michal\r