-
-
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
allow patch to optionally create intermediate dirs #1506
Conversation
@@ -453,7 +453,9 @@ This removes the link named foo from the hash in $FOO_BAR and returns the | |||
resulting object hash. | |||
`, | |||
}, | |||
Options: []cmds.Option{}, | |||
Options: []cmds.Option{ | |||
cmds.BoolOption("create", "p", "create intermediate directories on 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.
👍
dont merge quite yet, i might want to tweak something |
95041f5
to
f1d8b2f
Compare
lmk when ready |
@jbenet RFM |
f1d8b2f
to
c95c097
Compare
return nil, err | ||
} | ||
|
||
_, err = ds.Add(root) |
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 just making sure the object is in ds
? not sure why it's needed, in which case won't it be?
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.
Oh, i see. if it's been modified!
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.
these mutable nodes really bother me. i'd be so much more comfortable with:
node := dag.RemoveLink(root, path[0])
@whyrusleeping comments above |
@jbenet RFM |
} | ||
|
||
ctx, cancel := context.WithTimeout(ctx, time.Second*30) | ||
defer cancel() |
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.
no timeout here. caller's responsibility.
if you're worried about the "running out of time" problem (e.g. user gives context with timeout T, to do K steps, but we can estimate that if step 1 takes > T/K time, we should fail early and avoid wasting resources on a doomed-to-run-out-of-time operation) use https://godoc.org/github.com/jbenet/go-context/frac
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.
mmm, my bad, thats a holdover from being in the commands lib with no explicit timeout.
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
ea5b8b3
to
b32d0ef
Compare
return ErrNotFound | ||
} | ||
|
||
return nil |
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.
@whyrusleeping pls add test for this o/ else it may get broken again
@whyrusleeping LGTM -- one minor thing: test the Remove Link func in node. other than that, RFM |
@jbenet theres those tests, I'll have more merkledag test coverage on 0.4.0 as i use and test FetchGraph |
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
5bd99f5
to
aa7d946
Compare
allow patch to optionally create intermediate dirs
thanks @whyrusleeping ❤️ 👏 ❤️ 👏 ❤️ 👏 ❤️ 👏 ❤️ 👏 |
Docker stuff is a headache without this option. We can also make it a different sub-command if that makes more sense.
License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com