-
-
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
Add Defaults to ipfs add
#2657
Add Defaults to ipfs add
#2657
Conversation
47bf289
to
42263d8
Compare
doesnt build |
What is the command I should use to build? |
|
42263d8
to
540267d
Compare
You have to reflect changes in sharness tests. |
9b06067
to
87ec9d5
Compare
87ec9d5
to
44fa353
Compare
3d6ead0
to
9183b5e
Compare
I squashed it as previously commits in a middle were failing. |
LGTM |
if prgFound { | ||
showProgressBar = progress | ||
} else if !quiet && !silent { | ||
if !progress && !quiet && !silent { |
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'm not sure this one is correct. If the user actually specifies a choice for the progress option, we want to respect it, otherwise, we assume true unless they pass either quiet or silent.
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother. Part of #2484. License: MIT Signed-off-by: Richard Littauer <[email protected]>
9183b5e
to
74bbb28
Compare
I think I fixed that issue. |
8d9820a
to
84176a6
Compare
License: MIT Signed-off-by: Richard Littauer <[email protected]>
84176a6
to
03dd669
Compare
LGTM |
@@ -30,9 +30,11 @@ const ( | |||
|
|||
var AddCmd = &cmds.Command{ | |||
Helptext: cmds.HelpText{ | |||
Tagline: "Add a file or directory to ipfs.", | |||
Tagline: "Add a file to ipfs.", |
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.
@RichardLitt Out of curiosity, is there a reason for this change. The original text seamed more accurate.
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.
Because with -r
or -w
you're adding more than a file. Seemed to me like that would be pretty common, and that it should be clear that this command also works for dirs.
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 think this is worse than it was before. ipfs add
is for adding both files and directories, and the command summary line should say so. The description can be more clear, that's separate.
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.
We should just make sure that there is a note in the description. I feel that it may have been better before, now that I'm a few months away from where I was when I started this PR.
this broke gx, previously the http api wouldnt receive progress information, now it does (since the default gets set differently) |
Ah, its actually because now we can't actually specify |
Adding back in 235-239 and |
Adds contents of <path> to ipfs. Use -r to add directories (recursively). | ||
Adds contents of <path> to ipfs. Use -r to add directories. | ||
Note that directories are added recursively, to form the ipfs | ||
MerkleDAG. |
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 think this is also a regression. I dont think this language change adds, it only adds more words, while the meaning is still the same.
- Also "to form the ipfs MerkleDAG", "the" is off. "to form an ipfs MerkleDAG" sounds better.
- And, files are also formed as merkledags, so is everything you add to ipfs. I think this clause is more confusing than helpful. I do agree that explaining what's going on is a good idea. This is something for the Long Description.
I would vote for either:
Adds contents of <path> to ipfs. Use -r to add directories, recursively.
or
Adds contents of <path> to ipfs. Use -r to add directories, recursively.
Files and directories will be chunked and imported into ipfs. File chunks
and directory entries will be linked with cryptographic hashes, forming
an ipfs merkledag. For more information about how file importing works
and the merkledag data structures, see <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.
Where do you think we should point to in the ?
I don't think it is, because:
|
cmds.BoolOption(trickleOptionName, "t", "Use trickle-dag format for dag generation.").Default(false), | ||
cmds.BoolOption(onlyHashOptionName, "n", "Only chunk and hash - do not write to disk.").Default(false), | ||
cmds.BoolOption(wrapOptionName, "w", "Wrap files with a directory object.").Default(false), | ||
cmds.BoolOption(hiddenOptionName, "H", "Include files that are hidden. Only takes effect on recursive add.").Default(false), |
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 should mostly be removed, too. No need for Default(false).
This reverts most of the changes in da4a4ac, which were later found to be errorful. See #2657 for details. License: MIT Signed-off-by: Richard Littauer <[email protected]>
This reverts commit da4a4ac, reversing changes made to 518f7e0. License: MIT Signed-off-by: Richard Littauer <[email protected]>
This reverts commit da4a4ac, reversing changes made to 518f7e0. License: MIT Signed-off-by: Richard Littauer <[email protected]>
This reverts commit da4a4ac, reversing changes made to 518f7e0. License: MIT Signed-off-by: Richard Littauer <[email protected]>
This reverts commit da4a4ac, reversing changes made to 518f7e0. License: MIT Signed-off-by: Richard Littauer <[email protected]>
In addition to removing the .Default option in the "add" options this also fixes the --progress option so --progress=false work again. This reverts commit da4a4ac, reversing changes made to 518f7e0. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
* commit 'cdd5285f16af665e5fd5d3592f53b2134281e76a': add cmd: clean up default logic of --progress option add cmd: use .Default(true) for pin option. Revert "Merge pull request ipfs#2657 from ipfs/feature/add-defaults-to-add" bitswap: add wantlist fullness to protobuf messages Enable parallel builds on CircleCI Fix PHONY name in Makefile Run coveralls if COVERALLS_TOKEN is set Switch unixfs.Metadata.MimeType to optional Fix bad formatting introduced by e855047 blockstore.AllKeyChan: fix/cleanup error handling blockstore.AllKeyChan: avoid channels by using the new NextSync method ulimit: handle freebsd ulimit code separately from the rest of the unixes Add test for flags. bitswap: increase wantlist resend delay to one minute ds-help: avoid unnecessary allocs when posssible and make use of RawKey fix formatting on error call "block rm": make channel large enough to avoid blocking # Conflicts: # Makefile # core/commands/add.go
I didn't bother with Chunker, because I think that is a much wider PR. These should all be solid, though. Redid some of the logic to make it smoother.
Part of #2484.