git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Michael Blume <blume.mike@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] rebase: fix preserving commits with --keep-empty
Date: Mon, 14 Dec 2015 16:39:45 +0100	[thread overview]
Message-ID: <20151214153945.GA1414@pks-xps.fritz.box> (raw)
In-Reply-To: <CAO2U3QiFXaOCb114NMgGxDOV3FqHN6HyNDJBWT6ZeqTvQ+i0Zg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2517 bytes --]

On Thu, Dec 10, 2015 at 02:58:06PM -0800, Michael Blume wrote:
> This test does not seem to pass on my mac.
> 
> I've placed the verbose output here:
> https://gist.github.com/MichaelBlume/db7ba222be001d502e57
> 
> On Fri, Nov 20, 2015 at 4:04 AM, Patrick Steinhardt <ps@pks.im> wrote:
> > When rebasing commits where one or several commits are redundant
> > to commits on the branch that is being rebased upon we error out.
> > This is due to the usage of `--allow-empty` for the invoked
> > cherry-pick command, which will only cause _empty_ commits to be
> > picked instead of also allowing redundant commits. As
> > git-rebase(1) mentions, though, we also want to keep commits that
> > do not change anything from its parents, that is also redundant
> > commits.
> >
> > Fix this by invoking `git cherry-pick --keep-redundant-commits`
> > instead, which will cause redundant commits to be rebased
> > correctly.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> >  git-rebase--am.sh | 2 +-
> >  t/t3400-rebase.sh | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/git-rebase--am.sh b/git-rebase--am.sh
> > index 9ae898b..ea7b897 100644
> > --- a/git-rebase--am.sh
> > +++ b/git-rebase--am.sh
> > @@ -44,7 +44,7 @@ then
> >         # empty commits and even if it didn't the format doesn't really lend
> >         # itself well to recording empty patches.  fortunately, cherry-pick
> >         # makes this easy
> > -       git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty \
> > +       git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --keep-redundant-commits \
> >                 --right-only "$revisions" \
> >                 ${restrict_revision+^$restrict_revision}
> >         ret=$?
> > diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
> > index 6cca319..f43b202 100755
> > --- a/t/t3400-rebase.sh
> > +++ b/t/t3400-rebase.sh
> > @@ -255,7 +255,7 @@ test_expect_success 'rebase commit with an ancient timestamp' '
> >         grep "author .* 34567 +0600$" actual
> >  '
> >
> > -test_expect_failure 'rebase duplicated commit with --keep-empty' '
> > +test_expect_success 'rebase duplicated commit with --keep-empty' '
> >         git reset --hard &&
> >         git checkout master &&
> >
> > --
> > 2.6.3

Thanks for letting me know. I'll keep this in mind when there is
some consensus reached wether this option actually makes any
sense. Until then I'll just leave it as is.

Patrick

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-12-14 15:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 12:04 [PATCH 0/2] rebase: broken behavior with --keep-empty Patrick Steinhardt
2015-11-20 12:04 ` [PATCH 1/2] rebase: test " Patrick Steinhardt
2015-11-20 12:04 ` [PATCH 2/2] rebase: fix preserving commits " Patrick Steinhardt
2015-12-10 22:58   ` Michael Blume
2015-12-14 15:39     ` Patrick Steinhardt [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151214153945.GA1414@pks-xps.fritz.box \
    --to=ps@pks.im \
    --cc=blume.mike@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).