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

Re: [RFC PATCH] http: use --stdin and --keep when downloading pack

From
Jeff King <peff@peff.net>
Date
Feb 22, 2019, 05:04 UTC
Message-ID
<20190222050406.GA6050@sigill.intra.peff.net>
In-Reply-To
<20190221184948.100083-1-jonathantanmy@google.com>
On Thu, Feb 21, 2019 at 10:49:48AM -0800, Jonathan Tan wrote:
Show 15 quoted lines
> > > -	if (finalize_object_file(preq->tmpfile.buf, sha1_pack_name(p->sha1))
> > > -	 || finalize_object_file(tmp_idx, sha1_pack_index_name(p->sha1))) {
> > > -		free(tmp_idx);
> > > -		return -1;
> > > +	if (finish_command(&ip)) {
> > > +		ret = -1;
> > > +		goto cleanup;
> > >  	}
> > 
> > If the command fails but we got something in *lockfile, should we clean
> > it up? Likewise, do we need to be installing a signal handler to clean
> > it up in case we die in other code paths (or by a signal)?
> 
> My inclination is not to do it - as far as I can tell, we don't have
> cleanup or signal handlers in fetch-pack.c either.

Hmm, yeah, you're right. Nor do we do it on fetch. At first I was surprised that this doesn't cause more problems (we'd leave it in place after seeing a pre-receive hook fail, for instance), but in practice it gets cleaned up along with the rest of the quarantine area.

There's still a window where we may leave it around, though (and we don't quarantine fetches at all), so it might be worth addressing at some point. But I agree it is totally out of scope for this patch.

-Peff
Previous: Jonathan TanNext: Junio C Hamano
Message 4 of 5 in “http: use --stdin and --keep when downloading pack”
  1. http: use --stdin and --keep when downloading packJonathan Tan, Feb 21, 2019
  2. Jeff KingFeb 21, 2019
  3. Jonathan TanFeb 21, 2019
  4. Jeff KingFeb 22, 2019
  5. Junio C HamanoFeb 21, 2019

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.