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

Allow git bisect to auto-skip

From
Olliver Schinagl <oliver@schinagl.nl>
Date
Mar 22, 2024, 22:18 UTC
Message-ID
<3d835c4b-d026-4c6a-b68e-6989a7a2065f@schinagl.nl>

In some cases, we know a commit will always break bisect. This is bad and evil but sometimes needed.

An example, in my particular case, when OpenWRT does a kernel bump, patches and config files get copied to the new version. This is fine, but there is not git copy (one could also see that as an individual feature request which would solve the actual issue for now :p). Since the files are copied, git treats them as new files, without history. This makes tracking history almost impossible (config-4.14 -> config 5.15 -> config 6.6 etc). People have found out, there's some tricks to apply where we can make git not see the copy as such, and we'll have our history of both files [0]. In short, this hack is used to create two commits.

git checkout -b _tmp git mv old new git commit -m 'copy old to new' -m 'GIT_SKIP_BISECT' git checkout HEAD~ old git commit -m 'restore old' git switch _tmp git merge _tmp

and to remove the ugly merge commit
git rebase HEAD~1
which surely is a hack :p
But, it's a `git cp` if you will.

Now this does break git bisect, when the commit with the move comes in, things are broken until the next commit. It would be very nice if we can have a special marker keyword (GIT_SKIP_BISECT) in the commit message for example, to force git bisect to just skip this commit. It will fail, it is designed to fail.

There's probably also other very useful cases, but this is just one example.

And hey, if this leads to two patches, where a second one introduces `git cp` I'd be even more happy :)

Olliver
[0]: https://github.com/openwrt/openwrt/blob/main/scripts/kernel_bump.sh
Next: Junio C Hamano
Message 1 of 14 in “Allow git bisect to auto-skip”
  1. Olliver SchinaglMar 22, 2024
  2. Junio C HamanoMar 22, 2024
  3. Olliver SchinaglMar 23, 2024
  4. Stefan HallerMar 23, 2024
  5. Junio C HamanoMar 23, 2024
  6. Olliver SchinaglMar 23, 2024
  7. Olliver SchinaglMar 24, 2024
  8. Stefan HallerMar 24, 2024
  9. Christian CouderMar 24, 2024
  10. rsbecker@nexbridge.comMar 24, 2024
  11. Junio C HamanoMar 24, 2024
  12. Olliver SchinaglMar 27, 2024
  13. Junio C HamanoMar 27, 2024
  14. Olliver SchinaglMar 28, 2024

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.