Subject: Re: problem with cherry-picking a commit which comes before introducing a new submodule

From: Yaroslav Halchenko <[email-masked]>
Date: Fri, 7 Jan 2011 13:32:26 -0500

oy -- I thought that cherry-pick is primarily just application of the
patch (without use of the merge clevernesses).

Here is the protocol:
% export GIT_MERGE_VERBOSITY=4
%         base=todonotloose^
%         next=todonotloose
%         head=HEAD
% 
%         git merge-recursive $base -- $head $next
Merging HEAD with todonotloose
Merging:
855981d just placeholders in the abstract
a00c497 Initial draft for HBM abstract.
CONFLICT (file/directory): There is a directory with name frontiers/code in todonotloose. Adding frontiers/code as frontiers/code~HEAD
%         git ls-files -u;        # after the merge
160000 a2b57871d2d79bef06ba6214739d82b9a63772a8 2   frontiers/code
zsh: command not found: #
%         git diff-tree todonotloose
a00c497fa399c00486c97121ed0b8fda72c7ce47
:040000 040000 40427e34a1ff89c458f2a5f262a108d46b4fa004 c7ba91028b1cef63f4f7eef70f0c4054b31e92b6 M  poster-hbm2011_neurodebian
%         git diff-tree todonotloose^ HEAD
:100644 100644 378e1379ec5ebb7abac59fec162b7238b5846525 c39ced763aeb5fd352cecd6fef1bfc40471f2246 M  .gitmodules
:000000 040000 0000000000000000000000000000000000000000 141dbc1bfe1be2eab77f04ca03f6f28feb372cca A  challenge-execpapers
:040000 040000 401fd66867de412b8653dc3a698bbaa45441bec1 ee190f09786f324abdda6e7a36e8278c201a20a0 M  frontiers
:040000 040000 26c884a67efb55bdf96d7453d9acd50cee36ae90 ad3e829d15b302c4342a6b2a9fb5dfede0ed77c9 M  sty

On Fri, 07 Jan 2011, Jonathan Nieder wrote:
> As contrib/examples/git-revert.sh explains, the heart of "git
> cherry-pick" is

> 	base=todonotloose^
> 	next=todonotloose
> 	head=HEAD

> 	git merge-recursive $base -- $head $next

> Could you try that, perhaps with GIT_MERGE_VERBOSITY=4 (or some other
> number from 1 to 5, larger is louder) in the environment?  For context,

> 	git ls-files -u;	# after the merge
> 	git diff-tree todonotloose
> 	git diff-tree todonotloose^ HEAD

> would also be interesting.

-- 
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik