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

Re: [PATCH v2] receive-pack: purge temporary data if no command is ready to run

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 4, 2022, 01:17 UTC
Message-ID
<xmqq5ypvpgzr.fsf@gitster.g>
In-Reply-To
<20220129063538.24038-1-bojun.cbj@gmail.com>
Chen BoJun <bojun.cbj@gmail.com> writes:
Show 12 quoted lines
> +	/*
> +	 * If there is no command ready to run, should return directly to destroy
> +	 * temporary data in the quarantine area.
> +	 */
> +	for (cmd = commands; cmd && cmd->error_string; cmd = cmd->next)
> +		; /* nothing */
> +	if (!cmd)
> +		return;
> +
>  	/*
>  	 * Now we'll start writing out refs, which means the objects need
>  	 * to be in their final positions so that other processes can see them.

One thing I notice is that the first thing we do, after making the new objects available to us, is to check if we are making any conflicting update, e.g.

    git push origin master:master next:master

would try to update the same ref with different objects, and will be rejected.

This check can _almost_ be doable without being able to access the new objects, and as a follow-on work, it might not be a bad little project to see how we can move the call to check_aliased_updates() before this loop we are adding in this patch (#leftoverbits).

Thanks.
Previous: Bojun ChenNext: Bojun Chen
Message 14 of 18 in “receive-pack: purge temporary data if no command is ready to run”
  1. receive-pack: purge temporary data if no command is ready to runBoJun via GitGitGadget, Jan 24, 2022
  2. Ævar Arnfjörð BjarmasonJan 24, 2022
  3. Lertz ChenJan 25, 2022
  4. Junio C HamanoJan 24, 2022
  5. Bojun ChenJan 25, 2022
  6. Jiang XinJan 25, 2022
  7. receive-pack: purge temporary data if no command is ready to runChen BoJun, Jan 29, 2022
  8. Junio C HamanoFeb 1, 2022
  9. Junio C HamanoFeb 1, 2022
  10. Bojun ChenFeb 5, 2022
  11. Junio C HamanoFeb 5, 2022
  12. Jiang XinFeb 7, 2022
  13. Bojun ChenFeb 7, 2022
  14. Junio C HamanoFeb 4, 2022
  15. Bojun ChenFeb 5, 2022
  16. Junio C HamanoFeb 5, 2022
  17. 0/1 purge temporary data if no command is ready to runChen BoJun, Feb 7, 2022
  18. 1/1 receive-pack: purge temporary data if no command is ready to runChen BoJun, Feb 7, 2022

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.