From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 64DA76DE01F6 for ; Sat, 25 Aug 2018 04:58:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.33 X-Spam-Level: X-Spam-Status: No, score=0.33 tagged_above=-999 required=5 tests=[AWL=-0.112, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.211, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lGANiWJ061sg for ; Sat, 25 Aug 2018 04:58:02 -0700 (PDT) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by arlo.cworth.org (Postfix) with ESMTPS id B42036DE01E4 for ; Sat, 25 Aug 2018 04:58:01 -0700 (PDT) Received: by mail-wr1-f65.google.com with SMTP id o37-v6so9551354wrf.6 for ; Sat, 25 Aug 2018 04:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=5SPYbdCJv7LRl5Nt1PeDiZntZ+VzGa9J6OhkjJVhA1s=; b=mL3uvtjFm+NR7pnoljXf8wMuGgtHj+BbwXLoYy3gV6x4HJ0GdFNH8PceT9hmITTGd/ GJ1OKPpd1jF1FR5r0PGXM+BF7XwHMDWctvMFNS5NpKURdlorKaMASff/ZUJPSabN8h+c r78PlnQNwdIPAush4x+hgPZB37TvIrZV2K7BLtVjtvxkZXUzM9lwqUMZD+zB8+uLhRki YMyPf/KZaeFwPnQlEH7bGPdZUXHjsHgrE62/dcP5bgiOIuVoSBb7qT8TX08laTUqcAAU 84RT9zClR89fHBgMKakKLz0bTJWEbR4muPExBr+y01duZ9mldzl/TKVqKeauy6mdWupt /boA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=5SPYbdCJv7LRl5Nt1PeDiZntZ+VzGa9J6OhkjJVhA1s=; b=C4I4qIeJMQS+64rIPBpchnIOMOG+VL53rJIy/NWjN6icdQiyi8U78KQ/HEng7xNlSs +wi7z7DKu38pZZQp7FYOTGPLs1n9zVZ8tq3GapbNTVRk3q9ONr15xSJ7ode33R+QSL8r VnRakXOmHwSdK68QL7itIJq72tsjIMTSX8l5d462WmU9bjueMRtMkNnn9WxnrciLTBKE ZWK3nHFi3E9O6TtC3dIDOgFp6fqtIUXsp+q4YXNwF28RniNxM8GlAtJzP9bfmeDkRD2/ pSw8WZJEmtU5iBHojQbTEcD0zV0F5542qS46YyPz/jPqSVEgq3qzaVkELQOh+kNV9Gmn FHGw== X-Gm-Message-State: APzg51C/CdfFF1UTojHjeeU6Jw9IvOVhwptMWS4wU2DHaef7at56Qr9d ZucHI5Q0FqHVN+isuBuvSBDjDOoHxv4CCg== X-Google-Smtp-Source: ANB0VdYVVk1iwGi8WncfdFIw76CIVIwVL8bgvANibkKlEzgIjnmAN+tcTpzXa+aoUVvnyrNKNL+N4Q== X-Received: by 2002:adf:e6c2:: with SMTP id y2-v6mr3671042wrm.35.1535198278478; Sat, 25 Aug 2018 04:57:58 -0700 (PDT) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id 144-v6sm5106534wma.19.2018.08.25.04.57.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Aug 2018 04:57:56 -0700 (PDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id a197e583 for ; Sat, 25 Aug 2018 11:57:56 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v1 0/2] Interpret a directory path without a leading slash as relative to $HOME. Date: Sat, 25 Aug 2018 12:57:54 +0100 Message-Id: <20180825115756.24148-1-dme@dme.org> X-Mailer: git-send-email 2.11.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Aug 2018 11:58:03 -0000 Being able to specify a database path that works well on multiple machines, where $HOME is not always the same, seems generally useful. There was a previous attempt to support ~ in the configuration file (id:1462722574-4176-1-git-send-email-bijan@chokoufe.com), but this foundered on concerns about support for ~otheruser. This patch attempts to avoid that problem by asserting that any database lacking a leading / character is interpreted as being relative to $HOME. So in my case, I would set the path to Maildir: [database] path=Maildir This would work in Linux (where my home directory is /home/dme) and on macOS (where it is /Users/dme). David Edmondson (2): test: Absolute and relative directory paths. notmuch: Database paths without a leading / are relative to $HOME notmuch-config.c | 14 +++++++++++++- test/T030-config.sh | 10 ++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) -- 2.11.0