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

Re: [PATCH][OUTREACHY] bisect: allow `git bisect` to run from subdirectory

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 23, 2020, 15:43 UTC
Message-ID
<xmqqeelphrsp.fsf@gitster.c.googlers.com>
In-Reply-To
<CAHjREB7+3QtPw6X33GEB8SiDjSfvNhb15+_rpy=McmqBdcMebQ@mail.gmail.com>
Sangeeta NB <sangunb09@gmail.com> writes:
> Yes, I agree. We need to make some changes in `git rebase` to make it
> work from the subdirectory, but that doesn't mean that we should
> completely restrict it from running in the subdirectory, and the same
> follows for `git bisect`.
You actually don't have to make "bisect" work from the subdirectory.

You instead can detect the case where your $cwd may be made to disappear, and allow "git bisect" to continue if you are certain that you are not in the funny situation. You need to protect the user from funny situation by refusing to run from a subdirectory only when needed.

Besides, as Phillip mentioned, there is a big difference between two commands, isn't it?

"git rebase" would ask for help to the end-user by returning the control when anything goes wrong (e.g. it may not be able to replay a commit while the user is sitting in a directory that has already gone), but "git bisect run" would just interpret any failure, not just the ones that are caused by genuine test failure but caused by $cwd going away, as "we saw a bad revision". It would cause a lot of wasted cycles, instead of immediately stopping when there is trouble. So the first thing that has to happen if we want to allow "bisect" to run from anywhere is to teach it to detect when the $cwd went away, and stop to give control back to the user to deal with the situation (it might be the matter of "cd /path/to/top" at that point), instead of blindly continuing. Only after that is in place, we can safely allow it to start from a subdirectory.

Thanks.
Previous: Sangeeta NBNext: Phillip Wood
Message 9 of 14 in “bisect: allow `git bisect` to run from subdirectory”
  1. bisect: allow `git bisect` to run from subdirectorySangeeta via GitGitGadget, Oct 21, 2020
  2. Phillip WoodOct 21, 2020
  3. Taylor BlauOct 21, 2020
  4. Junio C HamanoOct 21, 2020
  5. Johannes SchindelinOct 22, 2020
  6. Phillip WoodOct 22, 2020
  7. Junio C HamanoOct 22, 2020
  8. Sangeeta NBOct 23, 2020
  9. Junio C HamanoOct 23, 2020
  10. Phillip WoodOct 23, 2020
  11. Johannes SchindelinOct 22, 2020
  12. Phillip WoodOct 22, 2020
  13. Junio C HamanoOct 22, 2020
  14. Johannes SchindelinOct 23, 2020

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.