Re: rewriting pathnames in history

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King wrote:
I recently ran into an interesting situation with git. I created a
repository that consisted of several directories (and files in them).
Later, after many commits, I realized I would prefer each directory have
its own git repository. That is, given a repo with the files:
  foo/bar
  baz/bleep
I wanted two repos, "foo" containing the file "bar" and "baz" containing
the file "bleep".

Nice work, but I think you should be able to get it *really* fast, much faster than that.

Instead of replaying a checked out copy, just go through the commit history, and when the treeID for that subdirectory has changed, then that directory has a new revision. So, make a new commit object with that as the treeid. in other words, you'll be constructing a very lightweight branch, but with its tree IDs all corresponding to sub-directory treeids on the combined branch. The history ripple script that was posted the other day probably has most of the pieces you need. Once this is done, you can just clone that branch to "get it out".

Sam.
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]