git-hammer icon indicating copy to clipboard operation
git-hammer copied to clipboard

remove a repo from the project

Open dezren39 opened this issue 5 years ago • 2 comments

Hi,

I accidentally added a repo with hundreds of binary/verbose backup file commits in it, it all added very well and kudos to your project for handling it, but now a lot of my stats are.. bad.

Can I set an exclude */ glob and update project? Is update only for future commits since last update or does it check the history to make sure all lines up?

Is there a way I can remove the one repo without corrupting the other, like 50, repos I added to the same project? If not as a module parser then possibly is there a delete query I could run if I conn up to the sqlite db?

Thanks and sorry for the trouble, this project is great and I'm glad it exists.

dezren39 avatar Dec 23 '19 03:12 dezren39

Hi,

Currently update project processes only new commits, it doesn't redo existing commits even if the configuration has changed. Being able to reprocess the existing commits is a feature I'd like to have, so it'll eventually happen.

There is also no ready functionality for removing a repository from a project, but that also seems useful to have. I think you have two options to edit the database to remove a repository from a project:

  1. Find the id of the repository you want to remove from the repositories table and delete, from the projectrepository table, the row with that repository id and your project name. This will detach the repository from the project, but all the data collected from that repository will still be in the database.
  2. If you also want to delete the repository, not just remove it from the project, you will need to delete it from the repositories table as well. I'm not sure what will happen to the commits. I think the repository deletion should cascade to delete the commits as well, but to be sure, you might want to delete manually from the commits table the commits with the appropriate repository_id. And actually, you probably need to delete the rows referring to those commits from the authorcommit table too. So it's quite a bit of manual work if the deletion cascade doesn't work.

asharov avatar Dec 23 '19 19:12 asharov

thank you!! this was super helpful for when i update this again if i need to make changes. I ended up moving the .sqlite db starting a new script and letting it run through all the repos again. Next time I might try modifying the database using this info. 😅

dezren39 avatar Jan 02 '20 11:01 dezren39