Re: Patching bad commits

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

 



On Mon, Jun 28, 2010 at 6:03 PM, Michael Witten <mfwitten@xxxxxxxxx> wrote:
> Sometimes bisecting is less than useful because a number of commits
> fail to build.
>
> How about implementing something SIMILAR to "git notes" (perhaps
> even using "git notes") to store and apply patches for such bad
> commits?

You could probably use the (relatively new) 'git replace' feature for
this.  Just replace the broken tree object with a new one that doesn't
have the bug.  I've never tried it, but it does seem like it should
work.

That said, this idea would require you to manually patch every single
commit that ever had a problem.  I'm not sure there's much benefit to
that compared to the overwhelming cost.  I think it might be more
useful - and much easier -to just have a permanent "always skip these
commits when bisecting" list.  (I don't think such a feature exists
yet though.)

Btw, in recent versions of git, 'git bisect skip' is pretty smart and
seeks around in the tree in such a way that it doesn't hurt so much
when you have a batch of bad commits somewhere in the middle.  So you
may find that it's really not that bad to just use 'git bisect skip'
occasionally if your version of git is relatively new and your history
isn't absolutely littered with crap.

Speaking of littering your history with crap, the an ounce of
prevention is worth a pound of cure: make sure all your commits pass
unit tests before committing, and you'll rarely have this problem
anyway :)  That's obviously easier said than done however.

Have fun,

Avery
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]