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
Alex Riesen <raa.lkml@gmail.com>
Date
Jun 24, 2007, 18:35 UTC
Message-ID
<20070624183552.GA2374@steel.home>
In-Reply-To
<EA80EB51-97F9-4C5F-BEF7-C8C1BF39B8D2@zib.de>
Steffen Prohaska, Sun, Jun 24, 2007 19:13:42 +0200:
Show 7 quoted lines
> >>I am changing the repository.
> >
> >No, you don't.
> 
> Magically, the script solved my problem by creating a new, corrected
> branch that is different from the original one. I didn't run any
> other script. I promise, I ran the script that I sent in the patch.

I meant: "it does not change the working directory". It is irrelevant, was a bit of confusion on my part.

Your script works, just it can be made simplier: no need for diff, it'll only hurt perfomance and complicates things. And you don't have to care about additions/deletions, and it is trivially extensible to support merges, and the current index is untouched - your user can continue working in predictable environment.

As to perfomance: read-tree doesn't actually _read_ the blobs to populate index, just the trees. And diff-tree has do do the same, but also _compare_ two trees recursively: more work, more memory needed.

BTW, Johannes moved that ident code you copied from git-filter-branch into its own shell file, so it can be sourced and trivially reused.

Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 18 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.