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 25, 2020, 13:09 UTC
Message-ID
<CAP8UFD1zLeeWsmPvwrs-ypZkwirxcEmasqW5mSxbFeqF6-Fntw@mail.gmail.com>
In-Reply-To
<xmqqsgb7m2bq.fsf@gitster.c.googlers.com>
On Thu, Sep 24, 2020 at 8:55 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
>
> Christian Couder <christian.couder@gmail.com> writes:
>
> > -             } else {
> > -                     char *commit_id = xstrfmt("%s^{commit}", arg);
> > -                     if (get_oid(commit_id, &oid) && has_double_dash)
> > -                             die(_("'%s' does not appear to be a valid "
> > -                                   "revision"), arg);
> > -
> > +             } else if (!get_oid_committish(arg, &oid))
>
> This is wrong, I think.  The "_committish" only applies to the fact
> that the disambiguation includes only the objects that are
> committishes, and the result are not peeled---you'll get an
> annotated tag back in oid, if you give it an annotated tag that
> points at a commit.
>
> This is not what ^{commit} does.
Thanks for finding this.
Show 7 quoted lines
> It may happen to work if the downstream consumers peel objects
> (which are appended to the 'revs' here) down to commit when they are
> used, and if somebody verified that is indeed the case, it would be
> OK, but if this patch is presented as "unlike the previous broken
> one, this is the faithful conversion of the original in shell, so
> there is no need to verify anything outside of the patch context",
> that is a problem.

I agree that it's better if there is no need to verify anything outside of the patch context. So I agree with your fix.

I am also ok with using "pathspec" in the test description of the new test.

Thanks, Christian.

Previous: Junio C HamanoNext: Christian Couder
Message 22 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.