Re: Detecting redundant commits

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

 



David Greene <greened@xxxxxxxxxxxxx> writes:

> On January 4, 2016 10:00:26 PM CST, Jeff King <peff@xxxxxxxx> wrote:
>
>>Or do you mean commits that, when applied, we find turn out to have
>>empty changes (e.g., because we have a set of commits that have
>>different patch-ids, but do roughly the same thing)? I don't think you
>>can find that with a straight end-to-end diff. You have try to apply
>>and then look at the result. I think we already catch that case (see
>>--allow-empty), though I think the only options are "preserve" or
>>"abort", not "silently skip" (and it sounds like the latter is what
>>you would want).
>
> This.  I see where --allow-empty is handled in prepare_to_commit but
> it is not so easy to skip the commit at that point due to state
> changes.  I was trying to avoid going into commit at all by
> determining ahead of time whether the commit would become empty.  Any
> ideas?

I ended up trying index_differs_from("HEAD", 0) and that actually seems
to work.  Unfortunately, it caused a regression and I'm having trouble
figuring out why.  The code should not even activate without a new
option specified.  If I get it working I'll send a patchset for comment.
Point me another direction if I'm way off track.  :)

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