Skip to content
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

Merged
merged 7 commits into from
Jul 29, 2015
Merged

Conversation

whyrusleeping
Copy link
Member

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

@whyrusleeping whyrusleeping added the status/in-progress In progress label Jul 21, 2015
@@ -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"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@whyrusleeping
Copy link
Member Author

dont merge quite yet, i might want to tweak something

@whyrusleeping whyrusleeping force-pushed the feat/patch-create branch 2 times, most recently from 95041f5 to f1d8b2f Compare July 22, 2015 21:20
@jbenet
Copy link
Member

jbenet commented Jul 22, 2015

lmk when ready

@whyrusleeping
Copy link
Member Author

@jbenet RFM

@whyrusleeping whyrusleeping added this to the IPFS 0.3.6 milestone Jul 23, 2015
return nil, err
}

_, err = ds.Add(root)
Copy link
Member

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?

Copy link
Member

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!

Copy link
Member

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])

@jbenet
Copy link
Member

jbenet commented Jul 24, 2015

@whyrusleeping comments above

@whyrusleeping
Copy link
Member Author

@jbenet RFM

}

ctx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
Copy link
Member

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

Copy link
Member Author

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.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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>
return ErrNotFound
}

return nil
Copy link
Member

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

@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

@whyrusleeping LGTM -- one minor thing: test the Remove Link func in node. other than that, RFM

@whyrusleeping
Copy link
Member Author

@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>
jbenet added a commit that referenced this pull request Jul 29, 2015
allow patch to optionally create intermediate dirs
@jbenet jbenet merged commit e517b65 into master Jul 29, 2015
@jbenet jbenet removed the status/in-progress In progress label Jul 29, 2015
@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

thanks @whyrusleeping ❤️ 👏 ❤️ 👏 ❤️ 👏 ❤️ 👏 ❤️ 👏

@jbenet jbenet deleted the feat/patch-create branch July 29, 2015 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants