Skip to content

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

Closed

Description

@wavexx

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

Activity

  1. GlancingMind commented on May 19, 2021

    @GlancingMind
    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.

  2. stefnotch commented on Nov 20, 2022

    @stefnotch

    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.

  3. MichaelMure commented on Nov 20, 2022

    @MichaelMure
    Contributor

    Arguably, that could be a dedicated CLI subcommand.

  4. kalinstaykov commented on Nov 25, 2022

    @kalinstaykov
    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.

  5. 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
  6. MichaelMure commented on Nov 25, 2022

    @MichaelMure
    Contributor

    @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.

  7. stefnotch commented on Nov 25, 2022

    @stefnotch

    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.

  8. GlancingMind commented on Nov 26, 2022

    @GlancingMind
    Contributor

    purge and wipe might also fit.

  9. kalinstaykov commented on Nov 26, 2022

    @kalinstaykov
    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.

  10. MichaelMure commented on Nov 28, 2022

    @MichaelMure
    Contributor

    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.

  11. kalinstaykov commented on Nov 28, 2022

    @kalinstaykov
    Contributor

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

  12. zarelit commented on Nov 29, 2022

    @zarelit

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

  13. kintar commented on Jan 21, 2023

    @kintar
    Contributor

    @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.

  14. MichaelMure commented on Jan 21, 2023

    @MichaelMure
    Contributor

    #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions