unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH v2] nmbug: write tags out to a temporary file, not 'nmbug.index'
Date: Sun, 13 Feb 2022 12:17:09 -0500	[thread overview]
Message-ID: <87y22ebsa2.fsf@kyleam.com> (raw)
In-Reply-To: <20220213165408.972859-1-spwhitton@spwhitton.name>

[ drive-by comment based on a past mistake :/ ]

Sean Whitton writes:

> -def _index_tags():
> -    "Write notmuch tags to the nmbug.index."
> -    path = _os.path.join(NMBGIT, 'nmbug.index')
> +    (_, index) = _tempfile.mkstemp()
[...]
>      _git(
>          args=['read-tree', '--empty'],
> -        additional_env={'GIT_INDEX_FILE': path}, wait=True)
> +        additional_env={'GIT_INDEX_FILE': index}, wait=True)

It's better to put the temporary index in $GIT_DIR due to this bit noted
in git-read-tree(1):

      The file must allow to be rename(2)ed into from a temporary file
      that is created next to the usual index file; typically this means
      it needs to be on the same filesystem as the index file itself, and
      you need write permission to the directories the index file and
      index output file are located in.

So, assuming NMBGIT matches $GIT_DIR, perhaps change the above mkstemp
call to something like

  _tempfile.mkstemp(dir=NMBGIT, prefix="nmbug", suffix=".index")

  reply	other threads:[~2022-02-13 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <id:m2pmnr2o2f.fsf@guru.guru-group.fi>
2022-02-13 16:54 ` [PATCH v2] nmbug: write tags out to a temporary file, not 'nmbug.index' Sean Whitton
2022-02-13 17:17   ` Kyle Meyer [this message]
2022-02-13 17:18   ` Sean Whitton
2022-02-13 18:08     ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y22ebsa2.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=notmuch@notmuchmail.org \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).