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

Re: [PATCH v2] bisect: Honor log.date

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 20, 2024, 17:13 UTC
Message-ID
<xmqqjzks3qjt.fsf@gitster.g>
In-Reply-To
<4f0456c0-e926-ee60-4e14-6b8ed80d2ace@softwolves.pp.se>
Peter Krefting <peter@softwolves.pp.se> writes:
> In this particular case, calling "git show" is really the last thing
> we want to do; so if we can move the cleanup that happens after it
> (that ends the bisect), it should be able to just take over the
> current process with a call to show, without needing to re-exec.

The cmd_foo() functions are also expected to either return to their callers or call exit() themselves, and it is true that as the very last step before giving the control back to the end-user in the current "bisect" process, we could make an internal call to cmd_foo() and let it exit with its own exit status.

But that is only the latter half of a story.

The cmd_show() (or any cmd_foo() in general) function expects to start from within a pristine environment. Calling them _after_ somebody else (in this case everything called from cmd_bisect()) clobbered the global state may or may not work (and in general we should assume it would not work) correctly.

The outline of the envisioned end state of libification I gave was about an arrangement to ensure that we can give such an pristine state when we make a call to such "top level" entry point of "foo" command (in this case, "show"), from a different command (in this case, "bisect"). It is very much orthogonal to what you are talking about, I think. We need both.

> And calling back to the libification question, I would see this part
> of the bisect command to be something that would run *on top of* the
> library (with possibly an API to poke bad/good states into it), so I
> don't think that objection holds for this particular case.

There was no objection. I was just pointing out that the infrastructure is not ready to do so.

Previous: Peter Krefting
Message 13 of 13 in “bisect: Honor log.date”
  1. bisect: Honor log.datePeter Krefting, Mar 30, 2024
  2. Junio C HamanoMar 31, 2024
  3. Peter KreftingMar 31, 2024
  4. Junio C HamanoMar 31, 2024
  5. Jeff KingApr 1, 2024
  6. Peter KreftingApr 1, 2024
  7. Jeff KingApr 1, 2024
  8. Junio C HamanoApr 1, 2024
  9. Jeff KingApr 3, 2024
  10. Christian CouderApr 16, 2024
  11. Junio C HamanoApr 16, 2024
  12. Peter KreftingApr 16, 2024
  13. Junio C HamanoApr 20, 2024

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.