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

Re: [PATCH 2/4] bisect: replace hardcoded "bad|good" by variables

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 9, 2015, 08:12 UTC
Message-ID
<CAP8UFD1mWaXwJwFLcw2f4Qj1v_Ves1UHEH7qkk8yq6WhjLeZGQ@mail.gmail.com>
In-Reply-To
<vpqtwuhl6s0.fsf@anie.imag.fr>

On Tue, Jun 9, 2015 at 8:45 AM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 18 quoted lines
> Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr> writes:
>
>> --- a/git-bisect.sh
>> +++ b/git-bisect.sh
>> @@ -32,6 +32,8 @@ OPTIONS_SPEC=
>>
>>  _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
>>  _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
>> +NAME_BAD="bad"
>> +NAME_GOOD="good"
>
> I would have written
>
> NAME_NEW=bad
> NAME_OLD=good
>
> "old/new" are the generic wording, so I think it would make more sense
> for the codebase to use it when we don't hardcode old/new.

I don't agree with NAME_NEW and NAME_OLD instead of NAME_BAD and NAME_OLD, for me it is easier when reasonning about the code to always think as if we want to find a bug. This is especially true when thinking about cases when we are given a "good" commit that is not an ancestor of the "bad" commit (and we have to find the merge base and so on), because in this case the "good" commit might be newer than the "bad" commit.

"old/new" is not more generic than "good/bad". It just has a different kind of drawbacks, and as "good/bad" is older and is the default we should keep that in the names.

Previous: Matthieu MoyNext: Matthieu Moy
Message 5 of 24 in “bisect : correction of typo”
  1. 1/4 bisect : correction of typoAntoine Delaite, Jun 8, 2015
  2. 2/4 bisect: replace hardcoded "bad|good" by variablesAntoine Delaite, Jun 8, 2015
  3. Junio C HamanoJun 8, 2015
  4. Matthieu MoyJun 9, 2015
  5. Christian CouderJun 9, 2015
  6. Matthieu MoyJun 9, 2015
  7. Junio C HamanoJun 9, 2015
  8. 3/4 bisect: simplify the add of new bisect termsAntoine Delaite, Jun 8, 2015
  9. Junio C HamanoJun 8, 2015
  10. Antoine DelaiteJun 9, 2015
  11. Matthieu MoyJun 10, 2015
  12. Matthieu MoyJun 9, 2015
  13. Christian CouderJun 9, 2015
  14. Louis-Alexandre StuberJun 9, 2015
  15. Junio C HamanoJun 10, 2015
  16. Louis-Alexandre StuberJun 10, 2015
  17. Matthieu MoyJun 10, 2015
  18. Louis-Alexandre StuberJun 10, 2015
  19. Matthieu MoyJun 10, 2015
  20. Junio C HamanoJun 10, 2015
  21. Matthieu MoyJun 10, 2015
  22. Junio C HamanoJun 10, 2015
  23. 4/4 bisect: add the terms old/newAntoine Delaite, Jun 8, 2015
  24. Junio C HamanoJun 8, 2015

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.