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

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 7, 2011, 18:15 UTC
Message-ID
<20110107181501.GA28980@burratino>
In-Reply-To
<20110107172432.GA6040@onerussian.com>
(+cc: Elijah Newren, who has worked on some of this code)
Yaroslav Halchenko wrote:
Show 9 quoted lines
> In our repository we had some submodules, then there was a branch off
> (call new branch todonotloose) with a single commit.  In the master we
> had some other commits and moved one of the subdirectories into a
> submodule.
> 
> Later on we decided to cherry pick todonotloose into master but
> cherry-pick fails despite the fact that 'git show todonotloose | patch
> -p1' applies just fine, ie there were no changes touching any of the
> submodules.
[...]
Show 14 quoted lines
> $> git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #	new file:   poster-hbm2011_neurodebian/abstract.txt
> #	modified:   poster-hbm2011_neurodebian/jb.txt
> #
> # Unmerged paths:
> #   (use "git reset HEAD <file>..." to unstage)
> #   (use "git add/rm <file>..." as appropriate to mark resolution)
> #
> #	added by us:        frontiers/code
> #

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.
Previous: Yaroslav HalchenkoNext: Yaroslav Halchenko
Message 2 of 10 in “problem with cherry-picking a commit which comes before introducing a new submodule”
  1. Yaroslav HalchenkoJan 7, 2011
  2. Jonathan NiederJan 7, 2011
  3. Yaroslav HalchenkoJan 7, 2011
  4. Jonathan NiederJan 7, 2011
  5. Yaroslav HalchenkoJan 7, 2011
  6. Yaroslav HalchenkoJan 8, 2011
  7. Jonathan NiederJan 11, 2011
  8. Yaroslav HalchenkoJan 18, 2011
  9. Andreas EricssonJan 18, 2011
  10. Yaroslav HalchenkoJan 18, 2011

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.