git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sangeeta NB <sangunb09@gmail.com>
Cc: Phillip Wood <phillip.wood123@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Taylor Blau <me@ttaylorr.com>,
	phillip.wood@dunelm.org.uk,
	Sangeeta via GitGitGadget <gitgitgadget@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH][OUTREACHY] bisect: allow `git bisect` to run from subdirectory
Date: Fri, 23 Oct 2020 08:43:02 -0700	[thread overview]
Message-ID: <xmqqeelphrsp.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAHjREB7+3QtPw6X33GEB8SiDjSfvNhb15+_rpy=McmqBdcMebQ@mail.gmail.com> (Sangeeta NB's message of "Fri, 23 Oct 2020 16:29:52 +0530")

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.

  reply	other threads:[~2020-10-23 15:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  9:09 [PATCH] bisect: allow `git bisect` to run from subdirectory Sangeeta via GitGitGadget
2020-10-21 13:41 ` [PATCH][OUTREACHY] " Phillip Wood
2020-10-21 16:20   ` Taylor Blau
2020-10-21 19:53     ` Junio C Hamano
2020-10-22  8:52       ` Johannes Schindelin
2020-10-22  9:46         ` Phillip Wood
2020-10-22 16:52           ` Junio C Hamano
2020-10-23 10:59             ` Sangeeta NB
2020-10-23 15:43               ` Junio C Hamano [this message]
2020-10-23 15:18             ` Phillip Wood
2020-10-22  8:47   ` Johannes Schindelin
2020-10-22  9:52     ` Phillip Wood
2020-10-22 17:04       ` Junio C Hamano
2020-10-23  8:37         ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqeelphrsp.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=phillip.wood123@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sangunb09@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).