Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Hilco Wijbenga <hilco.wijbenga@gmail.com>
Cc: Jacob Keller <jacob.keller@gmail.com>, Git Users <git@vger.kernel.org>
Subject: Re: Force Confirmation for Dropping Changed Lines
Date: Thu, 26 Jan 2017 12:51:32 -0800	[thread overview]
Message-ID: <xmqqy3xx35pn.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAE1pOi0foJpZXSpHrbWqvOuG1+VoNKTCMjuLK5TCVcJuGMSOoQ@mail.gmail.com> (Hilco Wijbenga's message of "Thu, 26 Jan 2017 11:19:51 -0800")

Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:

> On 25 January 2017 at 18:32, Junio C Hamano <gitster@pobox.com> wrote:
>> I think you should be able to do something like
>>
>>         $ cat >$HOME/bin/fail-3way <<\EOF
>>         #!/bin/sh
>>         git merge-file "$@"
>>         exit 1
>>         EOF
>>         $ chmod +x $HOME/bin/fail-3way
>>         $ cat >>$HOME/.gitconfig <<\EOF
>>         [merge "fail"]
>>                 name = always fail 3-way merge
>>                 driver = $HOME/bin/fail-3way %A %O %B
>>                 recursive = text
>>         EOF
>>         $ echo pom.xml merge=fail >>.gitattributes
>>
>> to define a custom merge driver whose name is "fail", that runs the
>> fail-3way program, which runs the bog standard 3-way merge we use
>> (so that it will do the best-effort textual merge) but always return
>> with a non-zero status to signal that the result is conflicting and
>> needs manual resolution.
>
> Thank you, that's an improvement. :-) Unfortunately, it still
> completes the merge. Is there any way to simply get the
>>>>>>>>>/<<<<<<<< markers?

You can, but you need to write one yourself without relying on "git
merge-file", because the whole point of the 3way merge we implement
(including in that program) is "do not bother the user when both
sides made the same change."


      reply	other threads:[~2017-01-26 20:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 22:16 Force Confirmation for Dropping Changed Lines Hilco Wijbenga
2017-01-25 22:24 ` Jacob Keller
2017-01-25 22:51   ` Hilco Wijbenga
2017-01-25 22:54     ` Jacob Keller
2017-01-25 23:46       ` Junio C Hamano
2017-01-25 23:57         ` Hilco Wijbenga
2017-01-26  0:40           ` Jacob Keller
2017-01-26  2:32             ` Junio C Hamano
2017-01-26  5:05               ` Jacob Keller
2017-01-26 19:19               ` Hilco Wijbenga
2017-01-26 20:51                 ` Junio C Hamano [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

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

  git send-email \
    --in-reply-to=xmqqy3xx35pn.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=hilco.wijbenga@gmail.com \
    --cc=jacob.keller@gmail.com \
    /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