git-annex/doc/todo/add_--dry-run.mdwn
Joey Hess 3a513cfe73
add --dry-run: New option
This is intended for users who want to see what it would output in order to
eg, check if a file would be added to git or the annex. It is not intended
as a way for scripts to get information.

Sponsored-by: Dartmouth College's Datalad project
2022-08-03 11:16:04 -04:00

25 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Previous discussion which touched upon it was [7 years ago](https://git-annex.branchable.com/todo/wishlist__58___--dry-run_option_for_all_commands/) (unless I missed some) where part of the response was
> I don't see the benefit to justify this work. git annex add is entirely predictable; it's very similar to git add. Which itself lacks a dry-run option.
Oh well:
```
$> git add --help | grep -e '-n, --dry' -A1
-n, --dry-run
Dont actually add the file(s), just show if they exist and/or will be ignored.
```
and users [submit requests against DataLad](https://github.com/datalad/datalad/issues/6909) to be able to discover what file would go to git and which to git-annex. Also would be useful to know if to git-annex -- would it be locked or unlocked? Someone else might even want to discover what would be the annex key if it would go into annex, but so far I do not think it is within our desired use-case and it might be too lengthy to compute the key checksum etc.
As for
> And like git add, you can certianly undo the effects of git annex add.
well -- unless there was a version staged already you don't want to loose etc.
[[!meta author=yoh]]
[[!tag projects/datalad]]
> [[done]] joey