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 24, 2007, 10:45 UTC
Message-ID
<B1169070-341A-444A-ACCE-872C5E00A05A@zib.de>
In-Reply-To
<Pine.LNX.4.64.0706241123170.4059@racer.site>
On Jun 24, 2007, at 12:26 PM, Johannes Schindelin wrote:
Show 18 quoted lines
>
> Oh! But the commit messages do no longer correspond to their  
> patches, do
> they?
>
> Example:
>
> In "onto", you have a sorely needed bugfix in main.c. In "from",  
> you have
> not. Then you do your transplant, and all of a sudden, the
> first transplanted commit _undoes_ that bugfix (because you take the
> contents at face value), but the commit message _cannot_ say so, or  
> even
> why.
>
> IMHO this makes no sense (and that is why I misunderstood it as  
> being a
> rebase).
It doesn't make sense on a sane repository.

I need the script to fix an insane, broken repository that was generated by git-cvsimport [1]. cvsimport created commits attached to the wrong parent in the first place. So the patches derived from this history are wrong. They are different from the patches that you'd expect from the cvs repository. The commit messages and the patches did never correspond. My script fixes this relationship. Only after I transplanted the branch the commits and their messages match.

The following is a different illustration of the same problem. Suppose you copy a file and modify its contents somewhere else. Now you checkout the _wrong_ branch, but do not recognize, copy the file back and commit it. You'd be writing a message as if the right branch would have been checked out. This message describes what you believe you did. But because of the wrong branch you may have done something completely different to the repository. You may for example have reverted earlier changes. Your commit doesn't make any sense before you transplanted it to the right branch. You don't want to apply a patch to the right branch but transplant the content of your file.

	Steffen
[1] http://article.gmane.org/gmane.comp.version-control.git/50736
Previous: Johannes SchindelinNext: Johannes Sixt
Message 10 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.