From: greened@obbligato•org (David A. Greene)
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org
Subject: Re: Detecting redundant commits
Date: Thu, 07 Jan 2016 21:14:22 -0600 [thread overview]
Message-ID: <87d1tcyd81.fsf@waller.obbligato.org> (raw)
In-Reply-To: <49661552-EBD9-4F45-9F31-54B217AE3350@obbligato.org> (David Greene's message of "Tue, 05 Jan 2016 10:31:04 -0600")
David Greene <greened@obbligato•org> writes:
> On January 4, 2016 10:00:26 PM CST, Jeff King <peff@peff•net> 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
prev parent reply other threads:[~2016-01-08 3:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 15:59 Detecting redundant commits greened
2016-01-05 4:00 ` Jeff King
2016-01-05 16:31 ` David Greene
2016-01-08 3:14 ` David A. Greene [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1tcyd81.fsf@waller.obbligato.org \
--to=greened@obbligato$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox