Re: [PATCH 78/83] Move libified code from builtin/apply.c to apply.{c,h}

2 messages, 2 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH 78/83] Move libified code from builtin/apply.c to apply.{c,h}

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:14

Christian Couder [off-list ref] writes:
By the way does someone know how such a patch can be applied?
Perhaps this one?

    http://thread.gmane.org/gmane.linux.kernel/1879635

Re: [PATCH 78/83] Move libified code from builtin/apply.c to apply.{c,h}

From: Christian Couder <hidden>
Date: 2016-06-16 02:19:15

On Fri, May 6, 2016 at 11:07 PM, Junio C Hamano [off-list ref] wrote:
Christian Couder [off-list ref] writes:
quoted
By the way does someone know how such a patch can be applied?
I think in mid Feb 2015 I sent out a message that says "'diff -B -M'
gives a broken result, do not use it".
I do not have time to dig the mail archive right now.

Perhaps this one?

    http://thread.gmane.org/gmane.linux.kernel/1879635
I get something strange with only -B:

$ git reset --keep 20f1d27~
$ git format-patch -B -1  -o ../../patches/test-libify-apply-use-in-am/ 20f1d27
../../patches/test-libify-apply-use-in-am/0001-Move-libified-code-from-builtin-apply.c-to-apply.-c-.patch
$ wc ../../patches/test-libify-apply-use-in-am/0001-Move-libified-code-from-builtin-apply.c-to-apply.-c-.patch
  5264  23426 147127
../../patches/test-libify-apply-use-in-am/0001-Move-libified-code-from-builtin-apply.c-to-apply.-c-.patch

I get a conflict with `git am`:

$ git am --3way
../../patches/test-libify-apply-use-in-am/0001-Move-libified-code-from-builtin-apply.c-to-apply.-c-.patch
Applying: Move libified code from builtin/apply.c to apply.{c,h}
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging apply.c
CONFLICT (add/add): Merge conflict in apply.c
error: Failed to merge in the changes.
Patch failed at 0001 Move libified code from builtin/apply.c to apply.{c,h}
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

But it works using `git apply --3way`:

$ git reset --hard HEAD
HEAD is now at 557f659 apply: rename and move opt constants to apply.h
$ git apply --3way
../../patches/test-libify-apply-use-in-am/0001-Move-libified-code-from-builtin-apply.c-to-apply.-c-.patch
Falling back to three-way merge...
Applied patch to 'apply.c' cleanly.
$ git am --continue
Applying: Move libified code from builtin/apply.c to apply.{c,h}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help