Re: [RFC/PATCH] merge: Add '--continue' option as a synonym for 'git commit'
- From
Jeff King <peff@peff.net>
- Date
- Dec 12, 2016, 09:40 UTC
- Message-ID
- <20161212094009.wfejbdullac37oi3@sigill.intra.peff.net>
- In-Reply-To
- <20161212083413.7334-1-judge.packham@gmail.com>
On Mon, Dec 12, 2016 at 09:34:13PM +1300, Chris Packham wrote:
Show 10 quoted lines
> Teach 'git merge' the --continue option which allows 'continuing' a > merge by completing it. The traditional way of completing a merge after > resolving conflicts is to use 'git commit'. Now with commands like 'git > rebase' and 'git cherry-pick' having a '--continue' option adding such > an option to 'git merge' presents a consistent UI. > > Signed-off-by: Chris Packham <judge.packham@gmail.com> > --- > So here is a quick patch that adds the --continue option. I need to add > some tests (suggestions for where to start are welcome).
I'm not sure if there's much to test besides concluding a successful merge, and possibly some error cases where --continue should complain. Probably that could go at the end of t7600.
Show 16 quoted lines
> @@ -1166,6 +1169,18 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
> goto done;
> }
>
> + if (continue_current_merge) {
> + int nargc = 1;
> + const char *nargv[] = {"commit", NULL};
> +
> + if (!file_exists(git_path_merge_head()))
> + die(_("There is no merge in progress (MERGE_HEAD missing)."));
> +
> + /* Invoke 'git commit' */
> + ret = cmd_commit(nargc, nargv, prefix);
> + goto done;
> + }
> +I know this block is just adapted from the "--abort" one above, but should both of these complain when other arguments are given? I can't imagine what the user might mean with "git merge --no-commit --continue", but probably it should be an error. :)
-Peff