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

Consolidate RCS support #5

Merged
merged 11 commits into from
Sep 27, 2022
Merged

Consolidate RCS support #5

merged 11 commits into from
Sep 27, 2022

Conversation

kpitt
Copy link
Owner

@kpitt kpitt commented Sep 27, 2022

Drop support for Fossil revision control, and focus only on Git. Consolidate revision control commands under gopass git and remove gopass rcs.

The "fs" backend was filtered out of the list of valid values for the
`--storage` option on these commands.  The only remaining option would
be "gitfs", so there is no need for an option.
If a store does not exist, then it should be initialized with the `init`
command.  The purpose of the `rcs init` command is to initialize a Git
repository in an existing "fs" store that has no revision control, so
we won't get the desired result if we fail the init, or if we just do
nothing, when the store is using the "fs" backend.  It also makes no
sense to check the backend for the context because that is initialized
from the root store only, and the actual storage could be different if
the "--store" option was used.
Now that Git is the only RCS provider, `gopass git` is the only extra
command introduced by the storage backends.  We can eliminate the extra
complexity of the extension commands interface by moving it to the
regular commands array, and there's even a leftover `Git` command func
that we can reuse.
- `rcs status` duplicates the functionality of `git status`.
- `RCSRemoveRemote` is never used.
- `RCSPull`, `RCSPush`, and `RCSAddRemote` are used as store functions
  from other actions, but the action functions are unused.
The "init" subcommand was the only subcommand left under the old "rcs"
command.  Since it runs a `git init` command, but with important
additional configuration, we can make it a subcommand of "gopass git"
so that it will be used instead of just forwarding the "init" command
directly to `git`.  This allows the "git" command to completely replace
the "rcs" command.
The `Storage` interface embeds the `rcs` interface.  This increases the
total method count in the interface, but doesn't actually affect the
number of methods that must be implemented compared to treating `rcs`
and `Storage` as independent interfaces.
@kpitt kpitt merged commit 00cf3c1 into master Sep 27, 2022
@kpitt kpitt deleted the consolidate-rcs-support branch September 27, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant