git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] interpret-trailers: add option for in-place editing

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jan 11, 2016, 17:24 UTC
Message-ID
<vpqpox82fna.fsf@anie.imag.fr>
In-Reply-To
<20160111171345.GA26950@distanz.ch>
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.
Show 8 quoted lines
>> 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/
Previous: Tobias Klauser
Message 6 of 6 in “Add in-place editing support to git interpret-trailers”
  1. 0/2 Add in-place editing support to git interpret-trailersTobias Klauser, Jan 11, 2016
  2. 1/2 trailer: use fprintf instead of printfTobias Klauser, Jan 11, 2016
  3. 2/2 interpret-trailers: add option for in-place editingTobias Klauser, Jan 11, 2016
  4. Matthieu MoyJan 11, 2016
  5. Tobias KlauserJan 11, 2016
  6. Matthieu MoyJan 11, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.