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

Re: [PATCH v2] bisect: don't use invalid oid as rev when starting

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 24, 2020, 11:08 UTC
Message-ID
<CAP8UFD3HtiAj2yiHBZOeqm-=VxVeV7mpwvFRV_mV8y-vsxgQUQ@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.2009240947080.5061@tvgsbejvaqbjf.bet>
Hi Dscho,

On Thu, Sep 24, 2020 at 11:59 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> On Thu, 24 Sep 2020, Christian Couder wrote:
Show 15 quoted lines
> > -                       rev=$(git rev-parse -q --verify "$arg^{commit}") || {
> > -                               test $has_double_dash -eq 1 &&
> > -                               die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
> > -                               break
> > -                       }
> > -                       revs="$revs $rev"
>
> These are awfully long lines. The reason is that you kept the indentation
> of the diff. But that's actually not necessary, because we do not need to
> apply a diff here; This code snippet is intended purely for human
> consumption.
>
> What I suggested in my adaptation of your patch was to lose the diff
> markers and to decrease the insane amount of indentation to just one (and
> two) horizontal tabs.
Yeah, I didn't realize that.
When I am sent some code or patch like this, I often hesitate between:
- using it verbatim, which can create issues as it makes me more
likely to overlook something in the case the sender didn't fully check
everything
- looking at the differences with the existing code/patch and applying
them one by one, which has the risk of missing or forgetting a
difference

I guess the best would be to do both and then check the differences between the 2 results, but it feels like twice the amount of work for this step.

Show 13 quoted lines
> > diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> > index b886529e59..70c39a9459 100755
> > --- a/t/t6030-bisect-porcelain.sh
> > +++ b/t/t6030-bisect-porcelain.sh
> > @@ -82,6 +82,13 @@ test_expect_success 'bisect fails if given any junk instead of revs' '
> >       git bisect bad $HASH4
> >  '
> >
> > +test_expect_success 'bisect start without -- uses unknown arg as path restriction' '
>
> To avoid the overly long line (and also to re-use existing naming
> conventions), I replaced "path restrictions" by "pathspecs" here. What do
> you think?

It's not a huge issue, but I tend to prefer using "restrictions" because the tests that check that these arguments are used properly are called "restricting bisection on one dir" and "restricting bisection on one dir and a file". So I feel that it keeps test names more coherent.

Best, Christian.

Previous: Johannes SchindelinNext: Junio C Hamano
Message 16 of 23 in “bisect: don't use invalid oid as rev when starting”
  1. bisect: don't use invalid oid as rev when startingChristian Couder, Sep 23, 2020
  2. Junio C HamanoSep 23, 2020
  3. Johannes SchindelinSep 23, 2020
  4. Johannes SchindelinSep 23, 2020
  5. Junio C HamanoSep 23, 2020
  6. Christian CouderSep 24, 2020
  7. Junio C HamanoSep 24, 2020
  8. Johannes SchindelinSep 24, 2020
  9. Junio C HamanoSep 24, 2020
  10. Junio C HamanoSep 24, 2020
  11. Johannes SchindelinSep 25, 2020
  12. Johannes SchindelinSep 25, 2020
  13. Junio C HamanoSep 25, 2020
  14. bisect: don't use invalid oid as rev when startingChristian Couder, Sep 24, 2020
  15. Johannes SchindelinSep 24, 2020
  16. Christian CouderSep 24, 2020
  17. Junio C HamanoSep 24, 2020
  18. Junio C HamanoSep 24, 2020
  19. Junio C HamanoSep 24, 2020
  20. Junio C HamanoSep 24, 2020
  21. Junio C HamanoSep 24, 2020
  22. Christian CouderSep 25, 2020
  23. bisect: don't use invalid oid as rev when startingChristian Couder, Sep 25, 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.