You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Command to remove git-bug data from git repository #676
At one point I was using an old version of git-bug on a repository that I stopped updating for a while. Today I wanted to use it again, and git-bug complained about the incompatible metadata format.
However I didn't want to upgrade the existing data, I just wanted to re-create the metadata from scratch.
I actually had an hard time finding out all the places/refs that one needed to remove before git-bug was happy to initialize a new repository.
I don't think a "remove from repository" command is necessary, but it would be nice to have an overview and/or list of commands that can be used to remove all refs, dirs and config entries used by git-bug from an existing repository.
To account for all past versions, so far these seem to be the following refs: refs/bugs/ refs/identities/ refs/remotes/*/bugs/, the "git-bug[.*]" entries from .git/config, the .git/git-bug directory.. (did I miss anything?)
The Makefile does contain two targets (clean local bugs and clean local identities) which seem to remove the "not so obvious" directories. Though, they don't cleanup the .git/config and the .git/git-bug directory and a makefile is not particularly user friendly. So yeah, this is more a workaround then a proper solution.
I don't think a "remove from repository" command is necessary
Today I was searching for this after the migration, since not everything worked as intended. I'd greatly appreciate having such a command that lets me completely remove git-bug from a repository and then I can safely try again.
I see that the make targets are using git commands to clean remote bugs and identities which might be non-trivial to implement without shelling out the commands or printing them for user consideration.
I can give this a shot if I know how that should be handled.
changed the title [-]Document instructions to remove git-bug data from git repository[/-][+]Command to remove git-bug data from git repository[/+]on Nov 25, 2022
@zinderic sure, it seems like there is a consensus that it makes sense. From what I've seen, it's also a very common question/need, especially for newcomers.
I'm not so sure about the naming though, eject? cleanup? It doesn't fully feels right.
Now for the design:
in entity_actions.go there is already a Remove(), we can have a RemoveAll()
bubbling that up in entities/bug/bug_actions.go, the equivalent RemoveAll()
for identities, they don't rely on the "entity framework", so more code need to be added in entities/identity/identity_actions.go
to finish, a new command using LoadRepo() instead of LoadBackend() to bypass the cache and directly run the previous functions
I opened PR #933 for this. I don't have a strong opinion what should be the name of the sub-command, for me personally cleanup, wipe, purge and remove would work just fine so I picked the first one but I can change it if you would prefer a different one.
I like @GlancingMind's suggestion ... let's do ... wipe? According to https://wikidiff.com/wipe/purge it's slightly more correct while also not carrying the political/religious association.
Reacted by stefnotch, Kalin Staykov and davidberglund
Activity
GlancingMind commentedon May 19, 2021
The Makefile does contain two targets (clean local bugs and clean local identities) which seem to remove the "not so obvious" directories. Though, they don't cleanup the
.git/configand the.git/git-bugdirectory and a makefile is not particularly user friendly. So yeah, this is more a workaround then a proper solution.stefnotch commentedon Nov 20, 2022
Today I was searching for this after the migration, since not everything worked as intended. I'd greatly appreciate having such a command that lets me completely remove git-bug from a repository and then I can safely try again.
MichaelMure commentedon Nov 20, 2022
Arguably, that could be a dedicated CLI subcommand.
kalinstaykov commentedon Nov 25, 2022
I see that the make targets are using
gitcommands to clean remote bugs and identities which might be non-trivial to implement without shelling out the commands or printing them for user consideration.I can give this a shot if I know how that should be handled.
[-]Document instructions to remove git-bug data from git repository[/-][+]Command to remove git-bug data from git repository[/+]MichaelMure commentedon Nov 25, 2022
@zinderic sure, it seems like there is a consensus that it makes sense. From what I've seen, it's also a very common question/need, especially for newcomers.
I'm not so sure about the naming though,
eject?cleanup? It doesn't fully feels right.Now for the design:
entity_actions.gothere is already aRemove(), we can have aRemoveAll()entities/bug/bug_actions.go, the equivalentRemoveAll()entities/identity/identity_actions.goLoadRepo()instead ofLoadBackend()to bypass the cache and directly run the previous functionsLet me know if that make sense.
stefnotch commentedon Nov 25, 2022
I guess I'd be looking for a command named
removeoruninstall.cleanupalso sounds fine.ejectwould confuse me.Uninstall might be misinterpreted as "globally uninstall git bug" though, so it might not be ideal.
GlancingMind commentedon Nov 26, 2022
purgeandwipemight also fit.kalinstaykov commentedon Nov 26, 2022
I opened PR #933 for this. I don't have a strong opinion what should be the name of the sub-command, for me personally
cleanup,wipe,purgeandremovewould work just fine so I picked the first one but I can change it if you would prefer a different one.MichaelMure commentedon Nov 28, 2022
I like @GlancingMind's suggestion ... let's do ...
wipe? According to https://wikidiff.com/wipe/purge it's slightly more correct while also not carrying the political/religious association.kalinstaykov commentedon Nov 28, 2022
OK,
wipeit is then, I'll change it. Thank you for the PR review and the feedback, I'll work on it.zarelit commentedon Nov 29, 2022
git-annex uses
uninit: uninit De-initialize git-annex and clean out repository.kintar commentedon Jan 21, 2023
@zinderic : Are you still working on this? If not, I'll pick it up for you, but I don't want to step on your toes if you're just delayed and busy.
MichaelMure commentedon Jan 21, 2023
#933 has been merged, we can close this.