From: Stephen Morton <stephen.c.morton@gmail.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: git cherry-pick conflict error message is deceptive when cherry-picking multiple commits
Date: Tue, 26 Jul 2016 15:40:51 -0400 [thread overview]
Message-ID: <CAH8BJxGZW8eNQogksZ416sVaBkpQ78uYkV7FtN6wxGafzNwjAg@mail.gmail.com> (raw)
When I cherry-pick n commits and one of the first (n-1), fails, what I
should do is resolve the conflict, 'git add' it, and then run 'git
cherry-pick --continue'. However git advises me to
error: could not apply d0fb756... Commit message for test commit
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
I suspect this is not just a little bit deceptive but actually a bit
destructive, as doing a 'git commit' removes some of the sequencing
information. If I do a 'git commit', while there is .git/sequencer
information and 'git cherry-pick --continue' will work, there is no
indication in 'git status' that a cherry-pick is in progress.
It would be extremely easy for somebody to follow cherry-pick's hints
by running 'git commit' and think that they were done, not realizing
that there were m more commits remaining to be cherry-picked.
Would it be possible to expand the hint message to tell users to run
'git cherry-pick --continue'
This patch is *not* meant as a serious patch for submission --I'm sure
it's all wrong-- it's just a proof of concept and showing some
goodwill on my part that I'm trying to help and I'm willing to put in
some work if I can be pointed more in the right direction.
Regards,
Stephen
diff --git a/sequencer.c b/sequencer.c
index cdfac82..b8fa534 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -171,14 +171,21 @@ static void print_advice(int show_hint, struct
replay_opts *opts)
if (show_hint) {
if (opts->no_commit)
advise(_("after resolving the conflicts, mark
the corrected paths\n"
"with 'git add <paths>' or 'git rm <paths>'"));
- else
- advise(_("after resolving the conflicts, mark
the corrected paths\n"
- "with 'git add <paths>' or 'git rm <paths>'\n"
- "and commit the result with 'git commit'"));
+ else if (! file_exists(git_path_seq_dir())) {
+ advise(_("SCM: after resolving the conflicts,
mark the corrected paths\n"
+ "with 'git add <paths>' or 'git rm <paths>'\n"
+ "and commit the result with 'git commit'"));
+ }
+ else
+ {
+ advise(_("SCM: after resolving the conflicts, mark the
corrected paths\n"
+ "with 'git add <paths>' or 'git rm <paths>'\n"
+ "and continue the %s with 'git %s --continue'"),
action_name(opts), action_name(opts));
+ }
}
}
next reply other threads:[~2016-07-26 19:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 19:40 Stephen Morton [this message]
2016-07-26 20:18 ` git cherry-pick conflict error message is deceptive when cherry-picking multiple commits Stefan Beller
2016-07-26 20:30 ` Jeff King
2016-07-26 20:44 ` Stephen Morton
2016-07-27 14:15 ` Stephen Morton
2016-07-27 15:03 ` Johannes Schindelin
2016-07-27 15:30 ` Stephen Morton
2016-08-01 9:12 ` Johannes Schindelin
2016-08-10 19:14 ` Stephen Morton
-- strict thread matches above, loose matches on Subject: below --
2016-08-10 19:21 Stephen Morton
2016-08-14 11:44 ` Christian Couder
2016-08-17 13:42 ` Stephen Morton
2016-08-17 14:24 ` Remi Galan Alfonso
2016-08-17 15:31 ` Junio C Hamano
2016-08-18 14:15 ` Johannes Schindelin
2016-08-16 8:44 ` Remi Galan Alfonso
2016-08-17 9:13 ` Johannes Schindelin
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=CAH8BJxGZW8eNQogksZ416sVaBkpQ78uYkV7FtN6wxGafzNwjAg@mail.gmail.com \
--to=stephen.c.morton@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).