git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Per Cederqvist <cederp@opera.com>
To: Stefan Beller <sbeller@google.com>
Cc: git <git@vger.kernel.org>
Subject: Re: cherry-picking fails after making a directory a submodule
Date: Mon, 8 Jan 2018 23:15:04 +0100
Message-ID: <CAP=KgsRR1b8t=qBASf+8EnJyCmpLYPaJQMVHy6VfNxHruJ3--A@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79katKiRwXLJscxbO-+JWLedgKmZ7Un-65i4CqefX9Fedqg@mail.gmail.com>

On Mon, Jan 8, 2018 at 10:46 PM, Stefan Beller <sbeller@google.com> wrote:
> On Mon, Jan 8, 2018 at 1:08 PM, Per Cederqvist <cederp@opera.com> wrote:
>> I have a situation where I have switched a directory from being a
>> subdirectory to being a submodule.  I then try to cherry-pick a commit
>> from a taskbranch that was made before the switch to the master
>> branch.  The commit touches a file outside the subdirectory/submodule.
>> Yet "git cherry-pick" fails with this error message:
>>
>>> error: could not apply 78c403e... Add a project feature
>>> hint: after resolving the conflicts, mark the corrected paths
>>> hint: with 'git add <paths>' or 'git rm <paths>'
>>> hint: and commit the result with 'git commit'
>>
>> I can resolve the situation by running "git add libfoo && git
>> cherry-pick --continue".  The generated commit contains no changes to
>> "libfoo".
>>
>> I don't understand why I need to manually add libfoo, as the commit
>> I'm cherry-picking doesn't touch anything in libfoo.
>>
>> The script below can reproduce the issue.  Tested with git 2.15.1,
>> 2.14.0 and 2.8.0, all with the same result.
>>
>> Is this a bug in "git cherry-pick"?
>
> Could you please test with
> github.com/git/git/commit/c641ca67072946f95f87e7b21f13f3d4e73701e3
> included? (See its parent commit, for the test)
>
> From my cursory read that commit is the issue addressed in that commit.

Thanks!  I can confirm that applying the changes to merge-recursive.c from
that commit fixes the issue in 2.15.1.

    /ceder

      reply index

Thread overview: 3+ messages in thread (expand / mbox.gz / Atom feed / [top])
2018-01-08 21:08 Per Cederqvist
2018-01-08 21:46 ` Stefan Beller
2018-01-08 22:15   ` Per Cederqvist [this message]

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAP=KgsRR1b8t=qBASf+8EnJyCmpLYPaJQMVHy6VfNxHruJ3--A@mail.gmail.com' \
    --to=cederp@opera.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox