Could a --dry-run option be added to the git annex commands? Or, at least, to the most common ones like git annex add
.
Given that there is no undo command, it would be nice to have the ability to simulate what git annex will do.
wontfix, see comments. Instead, options like --want-get and --want-drop can be used to simulate things. --Joey
This would add a lot of complexity; it's not like I could switch off running all external commands, since many external commands are run to query state to decide what to do. And then there's large chunks of code that actually do stuff and would have to all be guarded to not run.
I don't see the benefit to justify this work.
git annex add
is entirely predictable; it's very similar togit add
. Which itself lacks a dry-run option. And likegit add
, you can certianly undo the effects ofgit annex add
.Matching options can make commands like
git annex find
list the same set of files that are acted on by commands likegit annex drop
(git annex find --in here
) andgit annex get
(git annex find --not --in here
).You can find out what would be done by a get (ish), but running something like this:
..which will show files which are known about but aren't in this annexed copy. I've been using this to see what needs to be 'got' to a location.
It does, however, need an annex repo to have a remote set up if you wish to check against it, as they aren't automatically bi-directional (which makes sense as firewalls and similar may not make this possible).
git annex find --want-get --not --in here
should simulate get --auto/sync wellgit annex find --want-drop --in here
will simulate what drop --auto/sync would try to dropWhat would be nice to have is a way to simulate
copy --auto --to foo
anddrop --auto --from foo
which are of course also things sync does. That could be something like:Hi Joey,
A million thanks for a fantastic tool.
I came across the need today for the aforementioned --want-get-by/ --want-drop-by REMOTE options. Is this something that has since been developed/worked around, or is it still in the infinite TODO?
In the mean time, some more explicit documentation that --want-get/want-drop only ever applies to . would be good. I'll see if I can make a PR for this since I can write docs (but alas Haskell not so much).
best, Kevin