All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: git@vger.kernel.org
Subject: git apply -3 doesn't work
Date: Fri, 8 May 2020 13:35:42 +0300	[thread overview]
Message-ID: <d9d549eb-e888-c930-1aeb-38cd3aad1b3b@yandex.ru> (raw)

As description says. To check that the 3-way merge should actually work subsitute `git apply -3` with `git am -3` in the following steps. This way it works.

# Steps to reproduce

     $ git init
     Initialized empty Git repository in /tmp/foo/.git/
     $ echo hello > file1 && git add file1 && git commit -m "initial commit"
     [master (root-commit) 8334093] initial commit
      1 file changed, 1 insertion(+)
      create mode 100644 file1
     $ git checkout -b mybranch
     Switched to a new branch 'mybranch'
     $ echo bye > file1 && git add file1 && git commit -m "change file1 text"
     [mybranch 1807900] change file1 text
      1 file changed, 1 insertion(+), 1 deletion(-)
     $ git format-patch -1 --stdout > 1.patch
     $ git checkout master
     Switched to branch 'master'
     $ mv file1 file2
     $ git add -u && git add file2 && git commit -m "renamed file1 to file2"
     $ git apply -3 1.patch
     error: file1: does not exist in index

## Expected

Git apply successfully returns

## Actual

It prints

	error: file1: does not exist in index

# Versions

git 2.26.2

             reply	other threads:[~2020-05-08 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 10:35 Konstantin Kharlamov [this message]
2020-05-08 13:47 ` git apply -3 doesn't work Phillip Wood
2020-05-08 13:52   ` Konstantin Kharlamov

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=d9d549eb-e888-c930-1aeb-38cd3aad1b3b@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.