git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Pelisse <apelisse@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: git <git@vger.kernel.org>, kernel@pengutronix.de
Subject: Re: feature suggestion: optimize common parts for checkout --conflict=diff3
Date: Wed, 6 Mar 2013 19:27:59 +0100	[thread overview]
Message-ID: <CALWbr2zjrKN-op+deOvjT5ZC+6X=we7eoXTPv9W4AkcNst4yMw@mail.gmail.com> (raw)
In-Reply-To: <20130306150548.GC15375@pengutronix.de>

>         git checkout --conflict=diff3 file

That's somehow unrelated, but shouldn't we have a "conflict" option to
git-merge as we have for git-checkout ?

With something like this (pasted into gmail):

diff --git a/builtin/merge.c b/builtin/merge.c
index 7c8922c..edad742 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -65,6 +65,7 @@ static int abort_current_merge;
 static int show_progress = -1;
 static int default_to_upstream;
 static const char *sign_commit;
+static char *conflict_style;

 static struct strategy all_strategy[] = {
  { "recursive",  DEFAULT_TWOHEAD | NO_TRIVIAL },
@@ -213,6 +214,7 @@ static struct option builtin_merge_options[] = {
  { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key id"),
   N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
  OPT_BOOLEAN(0, "overwrite-ignore", &overwrite_ignore, N_("update
ignored files (default)")),
+ OPT_STRING(0, "conflict", &conflict_style, N_("style"), N_("conflict
style (merge or diff3)")),
  OPT_END()
 };

@@ -1102,6 +1104,9 @@ int cmd_merge(int argc, const char **argv, const
char *prefix)
  if (verbosity < 0 && show_progress == -1)
  show_progress = 0;

+ if (conflict_style)
+ git_xmerge_config("merge.conflictstyle", conflict_style, NULL);
+
  if (abort_current_merge) {
  int nargc = 2;
  const char *nargv[] = {"reset", "--merge", NULL};

  reply	other threads:[~2013-03-06 18:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 15:05 feature suggestion: optimize common parts for checkout --conflict=diff3 Uwe Kleine-König
2013-03-06 18:27 ` Antoine Pelisse [this message]
2013-03-06 19:26 ` Antoine Pelisse
2013-03-06 20:03   ` Jeff King
2013-03-06 20:36     ` [PATCH] xdiff: implement a zealous diff3 Uwe Kleine-König
2013-03-06 20:46       ` Jeff King
2013-03-06 20:40     ` feature suggestion: optimize common parts for checkout --conflict=diff3 Junio C Hamano
2013-03-06 20:54       ` Jeff King
2013-03-06 21:09         ` Junio C Hamano
2013-03-06 21:21           ` Jeff King
2013-03-06 21:50             ` Junio C Hamano
2013-03-07  1:02               ` Jeff King
2013-03-06 21:31           ` Uwe Kleine-König
2013-03-06 21:32           ` Junio C Hamano
2013-03-07  8:04             ` Jeff King
2013-03-07 17:26               ` Junio C Hamano
2013-03-07 18:01                 ` Jeff King
2013-03-07 18:40                   ` Junio C Hamano
2013-03-07 18:50                     ` Jeff King
2013-04-04 20:33                       ` Jeff King
2013-04-04 20:49                         ` Uwe Kleine-König
2013-04-04 20:54                           ` Jeff King
2013-04-04 21:19                             ` Junio C Hamano
2013-03-07 18:21                 ` Junio C Hamano

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='CALWbr2zjrKN-op+deOvjT5ZC+6X=we7eoXTPv9W4AkcNst4yMw@mail.gmail.com' \
    --to=apelisse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).