Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to remove git-bug data from git repository #676

Closed
wavexx opened this issue May 19, 2021 · 13 comments
Closed

Command to remove git-bug data from git repository #676

wavexx opened this issue May 19, 2021 · 13 comments
Labels
Easy pick Something that should be easy to solve help wanted Extra attention is needed

Comments

@wavexx
Copy link
Contributor

wavexx commented May 19, 2021

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?)

@GlancingMind
Copy link
Contributor

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.

@MichaelMure MichaelMure added help wanted Extra attention is needed Easy pick Something that should be easy to solve labels Nov 20, 2022
@stefnotch
Copy link

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.

@MichaelMure
Copy link
Owner

Arguably, that could be a dedicated CLI subcommand.

@zinderic
Copy link
Contributor

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.

@MichaelMure MichaelMure changed the title Document instructions to remove git-bug data from git repository Command to remove git-bug data from git repository Nov 25, 2022
@MichaelMure
Copy link
Owner

@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

Let me know if that make sense.

@stefnotch
Copy link

I guess I'd be looking for a command named remove or uninstall. cleanup also sounds fine. eject would confuse me.

Uninstall might be misinterpreted as "globally uninstall git bug" though, so it might not be ideal.

@GlancingMind
Copy link
Contributor

purge and wipe might also fit.

@zinderic
Copy link
Contributor

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.

@MichaelMure
Copy link
Owner

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.

@zinderic
Copy link
Contributor

OK, wipe it is then, I'll change it. Thank you for the PR review and the feedback, I'll work on it.

@zarelit
Copy link

zarelit commented Nov 29, 2022

git-annex uses uninit: uninit De-initialize git-annex and clean out repository.

@Kintar
Copy link
Contributor

Kintar commented 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
Copy link
Owner

#933 has been merged, we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy pick Something that should be easy to solve help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants