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

Re: [PATCH] transplant: move a series of commits to a different parent

From
Steffen Prohaska <prohaska@zib.de>
Date
Jun 25, 2007, 07:49 UTC
Message-ID
<21FC6948-6969-47A4-9D6E-EFD9D98FC361@zib.de>
In-Reply-To
<467F6BB0.4C7F041E@eudaptics.com>
On Jun 25, 2007, at 9:16 AM, Johannes Sixt wrote:
Show 23 quoted lines
> Steffen Prohaska wrote:
>>
>> On Jun 23, 2007, at 11:04 PM, Alex Riesen wrote:
>>
>>>> git-transplant.sh <onto> <from> <to>
>>>>
>>>> transplant starts with the contents of <onto> and puts on top of
>>>> it the contents of files if they are touched by the series of
>>>> commits <from>..<to>.  If a commit touches a file the content of
>>>> this file is taken as it is in the commit. No merging is
>>>> performed. Original authors, commiters, and commit messages are
>>>> preserved.
>>>>
>>> [...]
>>> # detached head
>>> git checkout $(git rev-parse onto) && git format-patch --stdout
>>> --full-index from..to|git am -3
>>
>> No. This one tries to apply the _changes_ between from..to. What I
>> need is the resulting _content_ of files modified between from..to.
>
> Install a graft that points the parent of "from" to "onto", then run
> git-filter-branch. Like so:

I stumbled over the grafts yesterday and thought that this may be a way...

>  $ echo "$(git-rev-parse from^0) $(git-rev-parse onto^0)" \
>     > .git/info/grafts
>  $ git-filter-branch new-to onto..to

... ok this is interesting: git-filter-branch will take the info from grafts to create its new commits. The new commits will contain all information independent of the grafts file, right?

... but, I'm not convinced that this is what I need. I need to mix the tree of onto with the files _modified_ between from..to. Taking _all_ files from the commits between from..to is _wrong_. And I think that is what the command you proposed would do.

My feeling is that repairing a repository resulting from a broken cvsimport is a bit more complex than what the existing tools provide out-of-the box.

	Steffen
Previous: Johannes SixtNext: Johannes Sixt
Message 12 of 20 in “cvsimport: test case for severe branch import problem”
  1. cvsimport: test case for severe branch import problemSteffen Prohaska, Jun 23, 2007
  2. Steffen ProhaskaJun 23, 2007
  3. transplant: move a series of commits to a different parentSteffen Prohaska, Jun 23, 2007
  4. Johannes SchindelinJun 23, 2007
  5. Steffen ProhaskaJun 24, 2007
  6. Alex RiesenJun 23, 2007
  7. Steffen ProhaskaJun 24, 2007
  8. Alex RiesenJun 24, 2007
  9. Johannes SchindelinJun 24, 2007
  10. Steffen ProhaskaJun 24, 2007
  11. Johannes SixtJun 25, 2007
  12. Steffen ProhaskaJun 25, 2007
  13. Johannes SixtJun 25, 2007
  14. Alex RiesenJun 24, 2007
  15. Steffen ProhaskaJun 24, 2007
  16. Alex RiesenJun 24, 2007
  17. Steffen ProhaskaJun 24, 2007
  18. Alex RiesenJun 24, 2007
  19. Steffen ProhaskaJun 24, 2007
  20. Alex RiesenJun 24, 2007

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.