git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Force Confirmation for Dropping Changed Lines

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Jan 26, 2017, 19:19 UTC
Message-ID
<CAE1pOi0foJpZXSpHrbWqvOuG1+VoNKTCMjuLK5TCVcJuGMSOoQ@mail.gmail.com>
In-Reply-To
<xmqqd1fa7dqf.fsf@gitster.mtv.corp.google.com>
On 25 January 2017 at 18:32, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> 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?
Previous: Jacob KellerNext: Junio C Hamano
Message 10 of 11 in “Force Confirmation for Dropping Changed Lines”
  1. Hilco WijbengaJan 25, 2017
  2. Jacob KellerJan 25, 2017
  3. Hilco WijbengaJan 25, 2017
  4. Jacob KellerJan 25, 2017
  5. Junio C HamanoJan 25, 2017
  6. Hilco WijbengaJan 25, 2017
  7. Jacob KellerJan 26, 2017
  8. Junio C HamanoJan 26, 2017
  9. Jacob KellerJan 26, 2017
  10. Hilco WijbengaJan 26, 2017
  11. Junio C HamanoJan 26, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.