git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: Junio C Hamano <gitster@pobox.com>,
	Christian Couder <chriscool@tuxfamily.org>,
	Eric Sunshine <sunshine@sunshineco.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 2/2] interpret-trailers: add option for in-place editing
Date: Mon, 11 Jan 2016 18:24:25 +0100	[thread overview]
Message-ID: <vpqpox82fna.fsf@anie.imag.fr> (raw)
In-Reply-To: <20160111171345.GA26950@distanz.ch> (Tobias Klauser's message of "Mon, 11 Jan 2016 18:13:45 +0100")

Tobias Klauser <tklauser@distanz.ch> writes:

> I'm using a static global in order to have it automatically zeroed out
> and according to the documentation in tempfile.h it can be reused. Also,
> all other users of struct tempfile (except for lockfile.h) are using it
> this way.

It seems I hate global variables more than other Git contributors ;-).
Anyway, OK with this.

> According to the comment in tempfile.h an atexit(3) handler is installed
> by prepare_tempfile_object() (which in turn is called by
> x?mks_tempfile_*) which will remove the file in this case. Or did I miss
> something here?

You didn't, I wasn't aware of this atexit handler.

>> It may help the user to get "could not rename temporary file %s to %s"
>> in case this happens.
>
> I think if we keep the current semantics (where the tempfile will be
> deleted by the atexit(3) handler), it doesn't make sense to mention the
> filename in the error message as the file will be gone by the time the
> user has any chance to react. I'd suggest somethin like "could not
> rename temporary file to %s".

Good. The important bit is to tell the user which file.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

      reply	other threads:[~2016-01-11 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 13:33 [PATCH 0/2] Add in-place editing support to git interpret-trailers Tobias Klauser
2016-01-11 13:33 ` [PATCH 1/2] trailer: use fprintf instead of printf Tobias Klauser
2016-01-11 13:33 ` [PATCH 2/2] interpret-trailers: add option for in-place editing Tobias Klauser
2016-01-11 16:33   ` Matthieu Moy
2016-01-11 17:13     ` Tobias Klauser
2016-01-11 17:24       ` Matthieu Moy [this message]

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

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

  git send-email \
    --in-reply-to=vpqpox82fna.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    --cc=tklauser@distanz.ch \
    /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.
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 NNTP newsgroup(s).