git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Borowitz <dborowitz@google.com>
To: Eugene Sajine <euguess@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Proper way to abort incorrect cherry-picking?
Date: Wed, 28 Apr 2010 12:49:55 -0700	[thread overview]
Message-ID: <r2s302ed1461004281249xd1b65e41l43fa7b639db7c97d@mail.gmail.com> (raw)
In-Reply-To: <s2m76c5b8581004281238jf7179fffna7d757fee6ab4f10@mail.gmail.com>

On Wed, Apr 28, 2010 at 12:38, Eugene Sajine <euguess@gmail.com> wrote:
>
> hi,
>
> we have tried to cherry-pick 2 commits from one branch to another
> branch, but unfortunately the incorrect commit was chosen to be
> applied first.
>
> Thus, the automatic cherry-pick failed and caused conflicts, so in
> order to to cancel the whole operation i had to do the following:
>
> 1. mark the conflicting files as resolved (without even resolving
> them) by doing git add.
> 2. unstage all files staged for commit as a result of incomplete cherry picking
> 3. manually checkout touched files to their correct state (git checkout file)
>
> and then i was able to repeat cherry-picking with correct commits.
>
> Is there a better way?

git reset --hard HEAD@{1}?

> Shouldn't there be a "git cherry-pick --abort"
> for such cases as it exists for rebase?

ISTM the --abort flag to rebase is useful because HEAD may have
changed an arbitrary number of times between the start of the rebase
and now, so you wouldn't know which reflog entry to choose. (The same
holds for "git bisect reset".) But with a cherry-pick it's always
@{1}.

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

  reply	other threads:[~2010-04-28 19:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28 19:38 Proper way to abort incorrect cherry-picking? Eugene Sajine
2010-04-28 19:49 ` David Borowitz [this message]
2010-04-28 19:59   ` Eugene Sajine
2010-04-28 22:39     ` Jon Seymour
2010-04-28 23:37       ` Jonathan Nieder
2010-04-29  0:07         ` Jon Seymour
2010-04-29 19:11         ` git cherry(pick) dumps core Andreas Krey
2010-04-29 19:49           ` Jonathan Nieder
2010-04-29 20:21             ` Andreas Krey
2010-04-30 13:32               ` Jonathan Nieder
2010-05-08 23:17                 ` [PATCH] cherry-pick: do not dump core when iconv fails Jonathan Nieder
2010-05-08 23:55                   ` Junio C Hamano
2010-04-28 19:50 ` Proper way to abort incorrect cherry-picking? Jonathan Nieder
2010-04-28 20:05   ` Eugene Sajine

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=r2s302ed1461004281249xd1b65e41l43fa7b639db7c97d@mail.gmail.com \
    --to=dborowitz@google.com \
    --cc=euguess@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.
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 NNTP newsgroup(s).