-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
implement patch command #1299
implement patch command #1299
Conversation
|
||
var PatchCmd = &cmds.Command{ | ||
Helptext: cmds.HelpText{ | ||
Tagline: "Mutate a given merkledag object and return the modified node", |
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'd avoid “mutate” for immutable IPFS objects ;). Maybe “Create a new Merkle DAG object based on an existing object”? Or “Create a new Merkle DAG object that's similar to an existing object”? 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.
good point
} | ||
|
||
switch req.Arguments()[1] { | ||
case "add-link": |
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.
As I explain here, I'd also like an add-or-replace-link
action (can you think of a more compact name?) to avoid either (a) adding two links with the same name or (b) requiring separate calls with rm-link
and add-link
. Not that (b) is so bad, but I expect this to be a common activity, so adding some sugar to handle it seems to be worth the cost of a separate action.
this is RFM (unless other CR is wanted) |
|
||
EMPTY_DIR=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn | ||
BAR=$(echo "bar" | ipfs add -q) | ||
ipfs patch $EMPTY_DIR add-link foo $BAR |
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 still has inconsistent tab-vs.-space indenting. I think you should fix that, even if you don't use my object new
suggestion for EMPTY_DIR
;).
#1299 (comment)
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.
+1
- fix inconsistent tab-vs.-space indenting
@whyrusleeping CR above
|
@wking @whyrusleeping i wonder if this command should "bubble" too? |
On Mon, Jun 01, 2015 at 08:12:13PM -0700, Juan Batiz-Benet wrote:
Bubbling is complicated, so I'd rather restrict the ‘ipfs object |
@whyrusleeping oh uh: it this a problem with the import cycle thing we merged? oh maybe just need to rebase? |
WIP: object creator command better docs move patch command into object namespace dont ignore cancel funcs addressing comment from CR add two new subcommands to object patch and clean up main Run func cancel contexts in early returns switch to util.Key
This PR implements a basic DAG object patching utility, and another command to create new objects.