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

ipfs add -w directories (and FUSE fixes) #1536

Merged
merged 6 commits into from
Jul 29, 2015
Merged

ipfs add -w directories (and FUSE fixes) #1536

merged 6 commits into from
Jul 29, 2015

Conversation

jbenet
Copy link
Member

@jbenet jbenet commented Jul 29, 2015

a8dae30 (Juan Batiz-Benet, 4 minutes ago)
add -w: fix to work correctly with dirs.

this commit changes the behavior of ipfs add -w:

- it makes it able to work with ipfs add -r <dir>
- instead of hacking around the add, we simply just add a wrapper
 directory around the whole result of the add. this means that
 ipfs add -w calls will output _two_ lines, but this is actually
 more correct than outputting one line, as two objects were added.
 this _may_ break scripts out there which expect the output to
 look a certain way. we should consider whether the old output is
 more _useful_ (even if less in-line with the model.)

License: MIT Signed-off-by: Juan Batiz-Benet <[email protected]>

578fd02 (Juan Batiz-Benet, 7 minutes ago)
fuse unmount fixes

unmounting wasn't happening, mostly because of a recent bug in
goprocess.SetTeardown. This commit bumps up some messages to log.Warnings,
as users may want to see them, and makes sure to Unmount when a node shuts
down.

License: MIT Signed-off-by: Juan Batiz-Benet <[email protected]>

7a41dcb (Juan Batiz-Benet, 26 minutes ago)
updated goprocess (SetTeardown fix)

License: MIT Signed-off-by: Juan Batiz-Benet <[email protected]>

License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
unmounting wasn't happening, mostly because of a recent bug in
goprocess.SetTeardown. This commit bumps up some messages to
log.Warnings, as users may want to see them, and makes sure to
Unmount when a node shuts down.

License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
@jbenet jbenet added the status/in-progress In progress label Jul 29, 2015
@jbenet
Copy link
Member Author

jbenet commented Jul 29, 2015

@whyrusleeping @lgierth @wking @cryptix

what do you think about the new ipfs add -w -r behavior (namely the two lines of output).

@jbenet jbenet added this to the IPFS 0.3.6 milestone Jul 29, 2015
@jbenet
Copy link
Member Author

jbenet commented Jul 29, 2015

Fixes #1533

this commit changes the behavior of ipfs add -w:

- it makes it able to work with ipfs add -r <dir>
- instead of hacking around the add, we simply just add a wrapper
  directory around the whole result of the add. this means that
  ipfs add -w calls will output _two_ lines, but this is actually
  more correct than outputting one line, as two objects were added.
  this _may_ break scripts out there which expect the output to
  look a certain way. we should consider whether the old output is
  more _useful_ (even if less in-line with the model.)

License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
@jbenet jbenet changed the title ipfs add -w directories ipfs add -w directories (and FUSE fixes) Jul 29, 2015
@jbenet
Copy link
Member Author

jbenet commented Jul 29, 2015

Sample output:

> ipfs add -r -w Makefile
added QmeGTUVmV3vp78MDEbWazngNm4h6FfnVRB6Vsz6hvbEQZM Makefile
added QmVQcHzPYHiDfvhTxYkP1fCZhuT3qKYgxifzoJ3KuGFCqD

> ipfs add -r -w lib/sharness/test
added QmZpjKjuF8HSnnrrYJKLgmFYYFUZLzAQfVVDzKhb2uM1UT lib/sharness/test/Makefile
added QmPDBWpwh96penZnbcJAt5U1Q9eC7JNpqu43oz2nozBoF1 lib/sharness/test/aggregate-results.sh
added QmZPfASHMA3o4ba4M4EbXeRW8mwHJQLLZCmZrtuWXhrq3L lib/sharness/test/sharness.sh
added Qmbw64Fp3ujbZ8P3H9VZTgRs2jZTFJK8CcxKWi2LJE3n7A lib/sharness/test/sharness.t
added QmSceeTxacJxUuFxtTeeZC7sYjLbNHh6ZwL54fh6n93Cjo lib/sharness/test/simple.t
added QmZW9QSWG1qyRLEjUjbYUwoQ1RgEc2EGR3oeZkWNCAnnpU lib/sharness/test
added QmY6YmWBEh2f39CDJZ9nQiGVyiMMaPQdYQo5N8z5uQf2Vy

@cryptix
Copy link
Contributor

cryptix commented Jul 29, 2015

re add -w:

but this is actually more correct than outputting one line, as two objects were added.

Totally down with this. Maybe we can have -w -q just output the final line for scripts?

Rest LGTM, too. nice cleanup!

  > ipfs add a b c
  added Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 a
  added QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM b
  added QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 c
  added QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3

  > ipfs ls QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3
  Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 10 a
  QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM 10 b
  QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 10 c

License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
made many more tests for ipfs add -w

License: MIT
Signed-off-by: Juan Batiz-Benet <[email protected]>
@jbenet
Copy link
Member Author

jbenet commented Jul 29, 2015

    add -w improvement: wrap multiple files in one dir

      > ipfs add -w a b c
      added Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 a
      added QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM b
      added QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 c
      added QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3

      > ipfs ls QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3
      Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 10 a
      QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM 10 b
      QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 10 c

jbenet added a commit that referenced this pull request Jul 29, 2015
ipfs add -w directories (and FUSE fixes)
@jbenet jbenet merged commit 8ed08ab into master Jul 29, 2015
@jbenet jbenet removed the status/in-progress In progress label Jul 29, 2015
@jbenet jbenet deleted the fix-add-w branch July 29, 2015 11:18
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.

2 participants