On 23 December 2013 03:51, James E Keenan <jk...@verizon.net> wrote:
> Is it possible to preserve the commit history of a tree of files as it moves
> out of one repository and into another


I believe what you want to do is as follows:

1. Clone the Perl repository
2. Perform a branch filter on all branches to move ext/Pod-Html/* to /
( See git filter-branch --subdirectory-filter )
3. Possibly perform a branch filter to remove empty commits

At this point, you've got a mirror or perl.git, but its only the Pod-Html path.

Getting that working _and_ having it respect move history will be the
problem if ext/Pod-Html has ever been somewhere else.

Though, after doing this, once you've got your workflow targeted at
Pod-Html being independent, its reasonably straight forward to
dynamically graft that on to the perl repo with git subtree

`git subtree` is similar to git submodule, except it doesn't work with
repository references, and instead simply rewrites commits before
merging them against the branch.

For example, I have this repository:
https://github.com/kentfredric/travis-scripts

It shares all the stuff I need to make travis work, and its a right
pain to make it work as a submodule.

So all my repositories that I use with travis testing share that code
via git subtree

For example:

https://github.com/kentfredric/Dist-Zilla-PluginBundle-Author-KENTNL/tree/master/maint-travis-ci

And you'll see the automated merge points here:
https://github.com/kentfredric/Dist-Zilla-PluginBundle-Author-KENTNL/commits/master

Here, you'll see the separate history of my travis-ci repo being
merged into master on a regular basis, thats the bottom blue line.

https://github.com/kentfredric/Dist-Zilla-PluginBundle-Author-KENTNL/network

Though I note, this is not yet showing the effect of my changes to use
commit squashing prior to merges, because it proves not very useful to
have the whole history of the source repository visible on the
repository its being merged into, just causes useless clutter ( at
least, thats what I've found ).

Just not sure if the subtree workflow is something perl core are happy
with doing yet.
-- 
Kent

Reply via email to