Open jwaterloo opened 9 years ago
Hi @jwaterloo, there's a fundraiser for that exact functionality here https://www.bountysource.com/teams/bfg-repo-cleaner/fundraiser
On 2/26/2015 10:19 AM, Roberto Tyley wrote:
Hi @jwaterloo https://github.com/jwaterloo, there's a fundraiser for that exact functionality here https://www.bountysource.com/teams/bfg-repo-cleaner/fundraiser
— Reply to this email directly or view it on GitHub https://github.com/rtyley/bfg-repo-cleaner/issues/84#issuecomment-76195695.
Thanks, the link is about path based deleting but it doesn't say anything about moving. Am I the only one who want to be able to move files. I have been googling and haven't found anyone of similar mind.
Yep, it mentions deleting, but the work is specifically to address the BFG not supporting path-based operations (which, of course, is what moving a file between folders requires) - path-based ops are the main blocker to the BFG providing that functionality.
Hi @rtyley, any news on moving files in a repository?
I have to move all files of a repo to a subfolder (about 20k commits) and it takes about an hour and a half using git filter-branch
. Any chance I can do that using BFG?
Thanks!
Moving files is a path operation, and unfortunately the _Support Paths in the _BFG! fundraiser raised only 4% of the goal amount, so I haven't been able to spend any more time on it. If you'd like to sponsor this work, let me know! On 11 Jan 2016 23:25, "Jérémie Astori" notifications@github.com wrote:
Hi @rtyley https://github.com/rtyley, any news on moving files in a repository?
I have to move all files of a repo to a subfolder (about 20k commits) and it takes about an hour and a half using git filter-branch. Any chance I can do that using BFG?
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/rtyley/bfg-repo-cleaner/issues/84#issuecomment-170730728 .
I started taking a look at this - with a simple scope of being able to insert a single-level single-directory entry into the root tree, and then move all the existing root entries to nest under that single directory. That would be accomplished by creating a new root tree, the subtree entry in it, then make that subtree's entries those of the original root tree. Then assign that tree to the commit.
Sounds simple enough, but it's not completely obvious how to achieve this with the current scala-git
library classes. They may need some additional access points, I'm not sure yet. Any tips appreciated :).
I got the feeling that I would be best to do this in ObjectIdCleaner so that replacement of the root tree could be properly memoized. But since cleanTree must be called recursively I need a way to specify that the root-tree replacement should only be made on the initial call. I'd find this easy enough in Java, but with the way these memo functions are built it is less-clear how to create a special case there.
could you provide an option to move files as found in http://stackoverflow.com/questions/2314652/is-it-possible-to-move-rename-files-in-git-and-maintain-their-history, in particular git filter-branch --tree-filter 'if [ -f old ]; then mkdir dir && mv old dir/new; fi' HEAD
The use case is I am migrating a project to maven and I want the files to be in the standard directory layout with all of the individual files history in tact as if it was always structured so.