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

[PATCH 0/3] Introduce --first-parent flag for git bisect

From
Aaron Lipman via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 28, 2020, 15:44 UTC
Message-ID
<pull.686.git.1595951056.gitgitgadget@gmail.com>

I've always wished git bisect had a first-parent flag, e.g. "git bisect start --first-parent"

This option would be particularly useful in avoiding false positives when bisecting, if a merged branch contained broken or non-buildable commits, but the merge itself was OK.

There have been a couple attempts/iterations towards this functionality in the past two years or so, and I'd like to get this across the finish line.

The previous iterations have focussed on the preliminary step of editing functions in bisect.c to accept a first_parent_only parameter, enabling the --bisect and --first-parent flags to be used in conjunction with git rev-list. In addition to updating git rev-list, I intend to enable the --first-parent flag on git bisect as well.

I've taken some of the feedback from previous iterations into account, specifically tidying up the code that assigns weights to commits in do_find_bisection(), utilizing existing commit graphs when running tests, and clarifying the test for "git rev-list --bisect-all --first-parent"

Previous two iterations (most recent first): https://lore.kernel.org/git/20191105052141.15913-1-workingjubilee@gmail.com/ https://lore.kernel.org/git/20180828123234.44582-1-tiagonbotelho@hotmail.com/

Related discussion about combining multiple boolean params passed to find_bisection() into a single unsigned integer: https://lore.kernel.org/git/20180415085841.1269-1-haraldnordgren@gmail.com/

Aaron Lipman (3):
  rev-list: allow bisect and first-parent flags
  bisect: introduce first-parent flag
  bisect: combine args passed to find_bisection()
 Documentation/git-bisect.txt       | 13 +++++-
 Documentation/rev-list-options.txt |  7 ++--
 bisect.c                           | 66 +++++++++++++++++++++---------
 bisect.h                           |  7 +++-
 builtin/bisect--helper.c           | 16 ++++++--
 builtin/rev-list.c                 |  9 +++-
 revision.c                         |  3 --
 t/t6000-rev-list-misc.sh           |  4 +-
 t/t6002-rev-list-bisect.sh         | 45 ++++++++++++++++++++
 t/t6030-bisect-porcelain.sh        | 17 ++++++++
 10 files changed, 151 insertions(+), 36 deletions(-)
base-commit: 00a7a21b97a47889cf66de32f8defed023c14c2c
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-686%2Falipman88%2Fbisect_first_parent_final_draft-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-686/alipman88/bisect_first_parent_final_draft-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/686
-- 
gitgitgadget
Next: Aaron Lipman via GitGitGadget
Message 1 of 42 in “Introduce --first-parent flag for git bisect”
  1. 0/3 Introduce --first-parent flag for git bisectAaron Lipman via GitGitGadget, Jul 28, 2020
  2. 1/3 rev-list: allow bisect and first-parent flagsAaron Lipman via GitGitGadget, Jul 28, 2020
  3. Junio C HamanoJul 28, 2020
  4. Junio C HamanoJul 28, 2020
  5. 2/3 bisect: introduce first-parent flagAaron Lipman via GitGitGadget, Jul 28, 2020
  6. 3/3 bisect: combine args passed to find_bisection()Aaron Lipman via GitGitGadget, Jul 28, 2020
  7. 0/3 Introduce --first-parent flag for git bisectAaron Lipman, Jul 30, 2020
  8. 1/3 rev-list: allow bisect and first-parent flagsAaron Lipman, Jul 30, 2020
  9. 2/3 bisect: introduce first-parent flagAaron Lipman, Jul 30, 2020
  10. Junio C HamanoJul 30, 2020
  11. 3/3 bisect: combine args passed to find_bisection()Aaron Lipman, Jul 30, 2020
  12. Junio C HamanoJul 30, 2020
  13. Junio C HamanoJul 30, 2020
  14. 0/4 Introduce --first-parent flag for git bisectAaron Lipman, Aug 1, 2020
  15. 1/4 rev-list: allow bisect and first-parent flagsAaron Lipman, Aug 1, 2020
  16. 3/4 bisect: combine args passed to find_bisection()Aaron Lipman, Aug 1, 2020
  17. Martin ÅgrenAug 1, 2020
  18. 4/4 bisect: consistent style for git bisect run testsAaron Lipman, Aug 1, 2020
  19. Martin ÅgrenAug 1, 2020
  20. 2/4 bisect: introduce first-parent flagAaron Lipman, Aug 1, 2020
  21. Junio C HamanoAug 1, 2020
  22. 0/5 Introduce --first-parent flag for git bisectAaron Lipman, Aug 4, 2020
  23. 1/5 t6030: modernize "git bisect run" testsAaron Lipman, Aug 4, 2020
  24. Christian CouderAug 5, 2020
  25. 2/5 rev-list: allow bisect and first-parent flagsAaron Lipman, Aug 4, 2020
  26. Eric SunshineAug 5, 2020
  27. 3/5 cmd_bisect__helper: defer parsing no-checkout flagAaron Lipman, Aug 4, 2020
  28. 4/5 bisect: introduce first-parent flagAaron Lipman, Aug 4, 2020
  29. 5/5 bisect: combine args passed to find_bisection()Aaron Lipman, Aug 4, 2020
  30. Junio C HamanoAug 4, 2020
  31. Christian CouderAug 5, 2020
  32. Junio C HamanoAug 7, 2020
  33. Eric SunshineAug 7, 2020
  34. Junio C HamanoAug 7, 2020
  35. Eric SunshineAug 7, 2020
  36. Martin ÅgrenAug 5, 2020
  37. 0/5 Introduce --first-parent flag for git bisectAaron Lipman, Aug 7, 2020
  38. 1/5 t6030: modernize "git bisect run" testsAaron Lipman, Aug 7, 2020
  39. 2/5 rev-list: allow bisect and first-parent flagsAaron Lipman, Aug 7, 2020
  40. 3/5 cmd_bisect__helper: defer parsing no-checkout flagAaron Lipman, Aug 7, 2020
  41. 5/5 bisect: combine args passed to find_bisection()Aaron Lipman, Aug 7, 2020
  42. 4/5 bisect: introduce first-parent flagAaron Lipman, Aug 7, 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.