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 arlo.cworth.org (Postfix) with ESMTP id 75E5F6DE0022
\r
6 for <notmuch@notmuchmail.org>; Mon, 9 May 2016 00:54:35 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0.593 tagged_above=-999 required=5 tests=[AWL=-0.059,
\r
13 SPF_NEUTRAL=0.652] autolearn=disabled
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id AGIziLZNsACB for <notmuch@notmuchmail.org>;
\r
17 Mon, 9 May 2016 00:54:26 -0700 (PDT)
\r
18 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
19 by arlo.cworth.org (Postfix) with ESMTP id A22BA6DE0005
\r
20 for <notmuch@notmuchmail.org>; Mon, 9 May 2016 00:54:25 -0700 (PDT)
\r
21 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
22 by guru.guru-group.fi (Postfix) with ESMTP id D59A21000B3;
\r
23 Mon, 9 May 2016 10:54:21 +0300 (EEST)
\r
24 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
25 To: Bijan Chokoufe <bijan@chokoufe.com>, notmuch@notmuchmail.org
\r
26 Subject: Re: [PATCH] config: Expand ~ to $HOME
\r
28 <CAOsAL0pp+3b-sf_k5kdrN7r1W8EtkC2vJ44Mg-e+su-8V=H6bQ@mail.gmail.com>
\r
29 References: <1462722574-4176-1-git-send-email-bijan@chokoufe.com>
\r
30 <m2r3dc7azk.fsf@guru.guru-group.fi>
\r
31 <CAOsAL0pp+3b-sf_k5kdrN7r1W8EtkC2vJ44Mg-e+su-8V=H6bQ@mail.gmail.com>
\r
32 References: <1462722574-4176-1-git-send-email-bijan@chokoufe.com>
\r
33 <m2r3dc7azk.fsf@guru.guru-group.fi>
\r
34 <CAOsAL0pp+3b-sf_k5kdrN7r1W8EtkC2vJ44Mg-e+su-8V=H6bQ@mail.gmail.com>
\r
35 User-Agent: Notmuch/0.22+9~gb26b5ad (http://notmuchmail.org) Emacs/24.5.1
\r
36 (x86_64-unknown-linux-gnu)
\r
37 User-Agent: Notmuch/0.22+9~gb26b5ad (http://notmuchmail.org) Emacs/24.5.1
\r
38 (x86_64-unknown-linux-gnu)
\r
39 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
40 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
41 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
42 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
43 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
44 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
45 Date: Mon, 09 May 2016 10:54:21 +0300
\r
46 Message-ID: <m21t5bll8y.fsf@guru.guru-group.fi>
\r
48 Content-Type: text/plain
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.20
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Mon, 09 May 2016 07:54:35 -0000
\r
63 On Sun, May 08 2016, Bijan Chokoufe <bijan@chokoufe.com> wrote:
\r
67 > Thanks for your detailled review. Please see questions below.
\r
72 > Tomi Ollila <tomi.ollila@iki.fi> schrieb am So., 8. Mai 2016 um 18:47 Uhr:
\r
74 >> On Sun, May 08 2016, Bijan Chokoufe Nejad <bijan@chokoufe.com> wrote:
\r
76 >> > Very useful in case you want to keep your .notmuch-config synchronized
\r
78 >> > machines where you have different user names.
\r
80 >> Thank you for your interest in improving notmuch!
\r
82 >> There are a few things that needs to be sorted out for this feature to be
\r
85 >> This implementation does not handle ~user/ prefix: i.e. home directory of
\r
86 >> 'user' (maybe this should not, but it should handle the case).
\r
88 > I don't get it. Is '~user" an alternative to '~'?
\r
90 ~user is ~ in case you're 'user' -- except that now that I think of it
\r
91 ~user could read home directory from /etc/passwd and not using $HOME.
\r
92 If you're 'eve', then ~alice should definitely be different than ~
\r
95 >> Whether or not ~user is handled, it should check that slash (/) follows...
\r
98 > So I guess you aim at the case where someone sets `path=~`? On the other
\r
99 > hand why is this checking not necessary in the "normal" case where no
\r
100 > expanding of `~` is done? Or is it maybe already handled in
\r
101 > `lib/database.cc`. Just to be clear I tested that it works currently with
\r
104 your code checked that path[0] == '~', but nothing else, e.g.
\r
106 ~123randomstuff/... would expand as /home/user23randomstuff/...
\r
108 ... and you have good point path being set as single '~' !
\r
110 >> IIRC there is some ready-made implementations of the above -- but if not,
\r
111 >> one option is to check how (expand-file-name) works in emacs for reference.
\r
114 > Well there is wordexp (http://linux.die.net/man/3/wordexp) but I wasn't
\r
115 > sure if I should use it. The getenv just seemed simpler but maybe it is
\r
118 For the time being we could simply do checking that path[0] == '~' and
\r
119 path[1] == '/' and then do expansion based on getenv ("HOME") -- and
\r
120 comment that ~any_user is just not supported there.
\r
122 >From testing point of view doing one positive test which ensures that when
\r
123 HOME is a string pointing to valid directory (and does not end with
\r
124 trailing slash as it usually is) and path in configuration starts with '~/'
\r
125 (and does not have multiple slashes following) works as expected...
\r
127 (as a special case, from softare functionality point I don't see problem
\r
128 setting path=~/ but from usability point that might not be the best -- but
\r
129 some users may have peculiar preferences... ;D)
\r