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

Add Defaults to ipfs add #2657

Merged
merged 2 commits into from
May 29, 2016
Merged

Add Defaults to ipfs add #2657

merged 2 commits into from
May 29, 2016

Conversation

RichardLitt
Copy link
Member

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.

@RichardLitt RichardLitt added the topic/docs-ipfs Topic docs-ipfs label May 10, 2016
@whyrusleeping
Copy link
Member

doesnt build

@RichardLitt
Copy link
Member Author

What is the command I should use to build?

@whyrusleeping
Copy link
Member

make build, make install, make test, go test ./... Depending on what youre looking to do. Generally the go test one is the best bet

@Kubuxu
Copy link
Member

Kubuxu commented May 12, 2016

@Kubuxu Kubuxu force-pushed the feature/add-defaults-to-add branch from 9b06067 to 87ec9d5 Compare May 17, 2016 19:08
@Kubuxu
Copy link
Member

Kubuxu commented May 17, 2016

@Kubuxu Kubuxu added the need/author-input Needs input from the original author label May 17, 2016
@RichardLitt RichardLitt removed the need/author-input Needs input from the original author label May 18, 2016
@Kubuxu Kubuxu force-pushed the feature/add-defaults-to-add branch 2 times, most recently from 3d6ead0 to 9183b5e Compare May 19, 2016 19:15
@Kubuxu
Copy link
Member

Kubuxu commented May 19, 2016

I squashed it as previously commits in a middle were failing.

@Kubuxu
Copy link
Member

Kubuxu commented May 20, 2016

LGTM

@Kubuxu Kubuxu added the RFM label May 20, 2016
if prgFound {
showProgressBar = progress
} else if !quiet && !silent {
if !progress && !quiet && !silent {
Copy link
Member

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.

@whyrusleeping whyrusleeping added need/author-input Needs input from the original author and removed RFM labels May 20, 2016
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 <richard.littauer@gmail.com>
@RichardLitt
Copy link
Member Author

I think I fixed that issue.

@RichardLitt RichardLitt added need/review Needs a review and removed need/author-input Needs input from the original author labels May 21, 2016
@RichardLitt RichardLitt force-pushed the feature/add-defaults-to-add branch 2 times, most recently from 8d9820a to 84176a6 Compare May 21, 2016 13:17
License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
@Kubuxu
Copy link
Member

Kubuxu commented May 25, 2016

LGTM

@Kubuxu Kubuxu added RFM and removed need/review Needs a review labels May 25, 2016
@whyrusleeping whyrusleeping merged commit da4a4ac into master May 29, 2016
@whyrusleeping whyrusleeping deleted the feature/add-defaults-to-add branch May 29, 2016 06:27
@@ -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.",
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

RichardLitt added a commit to ipfs-inactive/http-api-spec that referenced this pull request May 30, 2016
@whyrusleeping
Copy link
Member

this broke gx, previously the http api wouldnt receive progress information, now it does (since the default gets set differently)

@whyrusleeping
Copy link
Member

Ah, its actually because now we can't actually specify --progress=false

@RichardLitt
Copy link
Member Author

Adding back in 235-239 and showProgressBar should fix this; but that seems inelegant. Is there a better way, @whyrusleeping?

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.
Copy link
Member

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>.

Copy link
Member Author

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 ?

@jbenet
Copy link
Member

jbenet commented Aug 26, 2016

  • I think this PR's language changes should be fixed.
  • And i think the progress bar changes should be either undone or fixed. the changelog looks like it has a bunch of other progress bar fixes. i'll update here if it's fixed.

I don't think it is, because:

> ipfs add /tmp/random
added QmRh7AkukqpqVuGYcH4rSj1rHYUZvQK6hjmbB9Z7NgiNNR random

> ipfs add /tmp/random --progress=false
added QmRh7AkukqpqVuGYcH4rSj1rHYUZvQK6hjmbB9Z7NgiNNR random
 0 B / 95.37 MB [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]   0.00%
  • The first one (no --progress=false) works fine. shows the progress bar moving, then clear is out to write the last line.
  • The second one had no bar until it was done, then it output this empty progress bar crap.
  • I think this is not coming from this PR but from another. i will investigate.

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),
Copy link
Member Author

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

@jbenet jbenet mentioned this pull request Aug 28, 2016
58 tasks
RichardLitt added a commit that referenced this pull request Sep 1, 2016
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 <richard.littauer@gmail.com>
RichardLitt added a commit that referenced this pull request Sep 19, 2016
This reverts commit da4a4ac, reversing
changes made to 518f7e0.

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
RichardLitt added a commit that referenced this pull request Sep 19, 2016
This reverts commit da4a4ac, reversing
changes made to 518f7e0.

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
RichardLitt added a commit that referenced this pull request Sep 19, 2016
This reverts commit da4a4ac, reversing
changes made to 518f7e0.

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
RichardLitt added a commit that referenced this pull request Sep 19, 2016
This reverts commit da4a4ac, reversing
changes made to 518f7e0.

License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
kevina added a commit that referenced this pull request Dec 4, 2016
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 <k@kevina.org>
liliuhai added a commit to peersafe/go-ipfs that referenced this pull request Dec 26, 2016
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFM topic/docs-ipfs Topic docs-ipfs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants