-
Notifications
You must be signed in to change notification settings - Fork 0
Initial spec: delete #61
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
Draft
CGMossa
wants to merge
3
commits into
main
Choose a base branch
from
spec_delete
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # `dvs delete` | ||
|
|
||
| Goal: Provide a controlled way to delete / untrack datafiles from DVS. | ||
|
|
||
| - delete from dvs storage (backend) | ||
| - delete the metadata file | ||
| - delete the data file | ||
| - delete (and commit) the `*.dvs` metafile from `git` if relevant | ||
| - document the reason behind deletion (audit log entry) | ||
|
|
||
| ## CLI | ||
|
|
||
| ```shell | ||
| $ dvs delete [OPTIONS] <PATHS> | ||
|
|
||
| Paths: | ||
| Files to delete from the dvs backend, the current directory, delete metadata file, and also untrack metadata file from `git` | ||
|
|
||
| Options: | ||
| -c, --cached do not delete the files within the project, but delete from backend and the associated metadatafile, plus add audit log entry about the deletion event. | ||
| -m, --message (optional) message explaining why the file was deleted | ||
| -h, --help | ||
|
|
||
| ``` | ||
|
|
||
| Unlike `dvs get`, providing no arguments to `dvs delete` will not delete all the tracked files from the repository. | ||
|
|
||
| ## R package | ||
|
|
||
| ```r | ||
| dvs_delete <- function( | ||
| files = character(), | ||
| glob = character(), | ||
| delete_cached = TRUE | ||
| ) | ||
| ``` | ||
|
|
||
| Aliases: `dvs_delete`, `dvs_remove`, `dvs_rm`. | ||
|
|
||
| - `files`: list of files that are to be deleted. | ||
|
|
||
| ### Non-existing files | ||
|
|
||
| Emit a warning, but still remove the files that do exist and are tracked. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # dvs remove / `dvs remove` / `dvs::dvs_remove` | ||
|
|
||
| Goal: Provide a way to untrack a file without deleting it from the project. | ||
|
|
||
| ## CLI | ||
|
|
||
| ```sh | ||
| dvs -- Remove files from dvs tracking | ||
|
|
||
| Usage: | ||
| dvs remove <FILES> [OPTIONS] | ||
| dvs rm <FILES> [OPTIONS] # alias | ||
|
|
||
| Files: | ||
| Paths to tracked files that must be untracked | ||
|
|
||
| Options: | ||
| --json Command output as a JSON format | ||
| -m, --message (optional) message describing why a file was removed from tracking | ||
| -h, --help | ||
| ``` | ||
|
|
||
| Files that are not tracked, but provided to `dvs remove` must result in an error. Deletion is a sensitive operation. | ||
|
|
||
| ## R | ||
|
|
||
| Functionally an alias to `dvs_delete` by | ||
|
|
||
| ```r | ||
| dvs_remove <- function(...) { | ||
| dvs_delete(delete_cached=FALSE, ...) | ||
| } | ||
| # alias | ||
| dvs_untrack <- dvs_remove | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cached is a confusing git term very few to non will understand the premise of. I generally do not like how overloaded this spec is, and believe it has too many foot guns. Particularly things like deleting the data file the storage backend should be used with a LOT of care.
A set of capabilities around this needs to be provided eventually but with a lot more specificity and detail to consider given the destructive nature of this command.
We will not include this in v1