-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Pin commands default to recursive #1823
Conversation
test("-b", kvs{"b": ""}, words{}) | ||
test("-bs foo", kvs{"b": "", "s": "foo"}, words{}) | ||
test("-b", kvs{"b": true}, words{}) | ||
test("-bs foo", kvs{"b": true, "s": "foo"}, words{}) |
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.
huh, i didnt know we could combine flags like this.
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.
i know, right? @AtnNn made it great :)
test("-sb", kvs{"s": "b"}, words{}) | ||
test("-b foo", kvs{"b": ""}, words{"foo"}) | ||
test("--bool foo", kvs{"bool": ""}, words{"foo"}) | ||
test("-b foo", kvs{"b": true}, words{"foo"}) |
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.
maybe also try:
test("-b true", kvs{"b": true}, words{"true"})
test("-b false", kvs{"b": true}, words{"false"})
(i.e. we don't let bools be separated by space, as we cannot distinguish -b <arg>
from -b true
, right?)
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.
👍
@ForrestWeston great, thanks! having the bool stuff in will be useful for other bool options that currently didn't have this. 👍 @whyrusleeping just to check, happy with this UX ( |
i'm okay with |
@whyrusleeping we could break backwards compat, deprecate |
It makes more sense to think that 'recursive == false' implies direct than to try and figure out that 'direct == false' means recursive. |
@whyrusleeping sounds good to me. |
License: MIT Signed-off-by: ForrestWeston <Forrest.Weston@gmail.com>
pin add, pin rm, and pin ls will be recursive unless specified with '=false' eg. 'ipfs pin add -r=false <file>' tests for pinning have been updated/added License: MIT Signed-off-by: ForrestWeston <Forrest.Weston@gmail.com>
License: MIT Signed-off-by: ForrestWeston <Forrest.Weston@gmail.com>
@whyrusleeping @jbenet added tests as requested and rebased |
only test failure is fixed by: #1837 LGTM. |
ShortDescription: ` | ||
Removes the pin from the given object allowing it to be garbage | ||
Recursively removes the pin from the given object allowing it to be garbage |
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.
the description + tagline should still say:
"Unpin an object...
"Removes the pin...
but can just add:
(by default, recursively. use -r=false for direct pins)
or something
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.
(this is because is should not be able to turn --recursive=false
on a command that "Recursively unpins an object from local storage"
Otherwise LGTM |
License: MIT Signed-off-by: ForrestWeston <Forrest.Weston@gmail.com>
RFM? |
Pin commands default to recursive
Fix for #1801
All pinning commands are by default recursive unless with a flag specified.
Because of these changes, parsing pin commands needed to allow bool opts to be specified as true/false. (Had a little trouble following parse.go, but I think I got things right)
ipfs pin add
ipfs pin add -r=false
ipfs pin add -r
ipfs pin add -r=FALSE
ipfs pin add -r=true
ipfs pin add --recursive=false
ipfs pin add --recursive=true