vcstool
vcstool copied to clipboard
Add `remove` command
I see vcstool
as a good alternative to git modules in case one needs to have multiple available YAML configurations in the same git repository and branch.
For example a project may have two YAML files, one for the dependencies that need to be installed e.g. for ROS melodic, and a second slightly different set of dependencies for Noetic. In such cases, if one wants to alternate between the two, it would be convenient to offer a subcommand like vcs remove
, which would remove the cloned submodules of a previous run, so that the next vcs import ...
is done with a cleaner slate.
Would such a functionality make sense? Is there something like this already implemented that I'm missing?
I am not sure I understand the use case. If you have to different sets of repositories why don't you clone them into two different locations in the first place? And if you want to use the same location why can't you simply delete the existing working copies before import the other set?
Also it is a unclear what an import
verb should do - maybe you can describe that with a list of commands you would intend to invoke and their desired behavior.
And if you want to use the same location why can't you simply delete the existing working copies before import the other set?
You could remove them by hand, yes. But if there are numerous repositories handled by vcs
then the user would have to form a lengthy command of the form rm -rf src/... ...
. Also if some of the items / repositories under src
were not managed by vcs
in the first place, the user would need to take extra care not to remove them.
Definitely all these are doable, but an rm-all
verb would be convenient to remove all the vcs-managed repositories automatically and avoid the above issues
Also it is a unclear what an import verb should do - maybe you can describe that with a list of commands you would intend to invoke and their desired behavior.
I'd add a single verb rm-all
which would remove all vcs-managed repositories under the given path. The user would call it given the path as well as the YAML
file from which to read the list of repositories to remove vcs rm-all src < <path/to/repos.yaml>
I don't plan to modify the existing import
verb
I'd add a single verb
rm-all
which would remove all vcs-managed repositories under the given path. The user would call it given the path as well as theYAML
file from which to read the list of repositories to removevcs rm-all src < <path/to/repos.yaml>
Sounds good to me. It would be good to also allow an option --input
to match the import
arguments.
I would suggest to ask for confirmation after listing the to-be-deleted directories by default. An option like --yes
could then be used to skip the interactive confirmation.
@bergercookie Just checking if you are still interested in this feature and considering to contribute a pull request?
Hi @dirk-thomas ,
Yeah, I think this would be an interesting feature to have. Let me see If I can squeeze some time to work on it in the next few weeks otherwise feel free to either pick it up or close it.