Allow git bisect to auto-skip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux