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 pin lock in AddallPin function #5506

Merged
merged 2 commits into from
Oct 2, 2018
Merged

add pin lock in AddallPin function #5506

merged 2 commits into from
Oct 2, 2018

Conversation

kjzz
Copy link
Contributor

@kjzz kjzz commented Sep 21, 2018

fix #4561

License: MIT
Signed-off-by: Kejie Zhang 601172892@qq.com

@kjzz kjzz requested a review from Kubuxu as a code owner September 21, 2018 07:01
@kjzz kjzz force-pushed the fix/lock branch 2 times, most recently from a068b19 to ac7506d Compare September 21, 2018 07:24
@@ -10,19 +10,19 @@ import (
"path/filepath"
"strconv"

core "github.com/ipfs/go-ipfs/core"
"github.com/ipfs/go-ipfs/core"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for these changes? They are adding a lot of noise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah,actually,it need not to rename the package name.The default name is also core,and renamed maybe redundant.

Copy link
Member

Choose a reason for hiding this comment

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

There was a (short) discussion on this somewhere, the conclusion IIRC was that for consistency in some places we may actually prefer to have those labels. (some IDEs such as Goland do this by default, you can disable this in Settings > Go > Imports > Optimize imports on the fly)

Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Other than the import thing, looks good.

@kjzz
Copy link
Contributor Author

kjzz commented Sep 22, 2018

@kevina @magik6k Thx for advice. I have already update my pr.Please help me review again

@@ -276,6 +276,7 @@ You can now check what blocks have been created by:
fileAdder.NoCopy = nocopy
fileAdder.Name = pathName
fileAdder.CidBuilder = prefix
fileAdder.Hash = hash
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this just set fileAdder.Pin to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why should put fileAdder.Pin to false? The reason i add fileAdder.Hash is that i want to get this param in coreunix/add.go.

Copy link
Member

Choose a reason for hiding this comment

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

I know, but we don't really need this param there as all it does in disable pinning. See https://github.com/ipfs/go-ipfs/blob/b789295580d2ede0df6e248d73a1a7fb60b253ba/core/coreunix/add.go#L171-L178

We should just do fileAdder.Pin = dopin && hash

Copy link
Contributor Author

@kjzz kjzz Sep 23, 2018

Choose a reason for hiding this comment

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

And maybe we should do fileAdder.Pin = dopin && !hash,because hash is mean not to pin file.

@kjzz
Copy link
Contributor Author

kjzz commented Sep 23, 2018

@magik6k Thx for advice, i have update my pr as you suggested.Please help review again.

@kjzz kjzz force-pushed the fix/lock branch 2 times, most recently from d146722 to 47566ec Compare September 23, 2018 14:44
@kjzz
Copy link
Contributor Author

kjzz commented Sep 27, 2018

@magik6k there are some problem about ci.Can u help me restart it and reviwe my pr again?Thx a lot

magik6k
magik6k previously approved these changes Sep 27, 2018
@magik6k
Copy link
Member

magik6k commented Sep 27, 2018

(Note that you should be able to re-trigger the ci with git commit --amend --no-edit; git push --force)

@kjzz
Copy link
Contributor Author

kjzz commented Sep 29, 2018

Hey @magik6k @Stebalien ,

(Note that you should be able to re-trigger the ci with git commit --amend --no-edit; git push --force)

Because the ci has some error, i did the command git commit --amend --no-edit; git push --force.But the new commit has dismissed your stale review.Please help me review again.very sorry .

@kjzz
Copy link
Contributor Author

kjzz commented Oct 1, 2018

hey @magik6k , if you have anytime. please help me review it again . I have performed a misoperation to dimiss your approved.Very sorry.

@magik6k
Copy link
Member

magik6k commented Oct 2, 2018

the new commit has dismissed your stale review

It used to work fine some time ago. Ah well.

magik6k
magik6k previously approved these changes Oct 2, 2018
@ghost ghost assigned Stebalien Oct 2, 2018
@ghost ghost added the status/in-progress In progress label Oct 2, 2018
License: MIT
Signed-off-by: Kejie Zhang <601172892@qq.com>
License: MIT
Signed-off-by: Kejie Zhang <601172892@qq.com>
@Stebalien
Copy link
Member

It used to work fine some time ago. Ah well.

I enabled that feature but yeah, it's too annoying (now disabled again). I wish there were a less pedantic version (compares the actual diff, not just the commits).

@Stebalien Stebalien merged commit 5c8580d into ipfs:master Oct 2, 2018
@ghost ghost removed the status/in-progress In progress label Oct 2, 2018
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.

The add command's addAllAndPin function doesn't hold the pin lock
4 participants