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

drive md5sum --depth level must be incremented by 1 to have the desired effect #783

Closed
jean-christophe-manciot opened this issue Nov 6, 2016 · 7 comments

Comments

@jean-christophe-manciot
Copy link

Google Drive/Missions/Innovations# drive list
/Missions/Innovations/Proposal for a DNS Secured BGP.pdf
/Missions/Innovations/Proposal for a DNS Secured BGP.docx
/Missions/Innovations/Proposal to Change the EIGRP Feasibility Condition to allow faster convergence.docx
/Missions/Innovations/Proposal to Change the EIGRP Feasibility Condition to allow faster convergence.pdf

Google Drive/Missions/Innovations# drive md5sum
Google Drive/Missions/Innovations# 
@odeke-em
Copy link
Owner

odeke-em commented Nov 6, 2016

Hello there @jean-christophe-manciot, thanks for the report.

Yes in deed, this is an annoying bug that results from an off-by one error in the Md5sum code.
For now you can control the depth by setting it to +1 the value you expect. By default it is 1 as with drive list. Please use -depth 2 to mirror drive list -depth 1.

@jean-christophe-manciot
Copy link
Author

jean-christophe-manciot commented Nov 6, 2016

Hey @odeke-em , I've just discovered 2 other issues:

  • the documentation talks about the -r flag, but it does not work as expected:
drive md5sum -r
flag provided but not defined: -r
Usage of md5sum:
  -depth int
        max traversal depth (default 1)
  -h    
  -hidden
        discover hidden paths
  -id
        stat by id instead of path
  -quiet
        if set, do not log anything but errors
  -recursive
        recursively discover folders
  • the -recursive flag has an effect but does not start from where the call is made:
Google Drive/Missions# drive md5sum -recursive
f83efad87af0af2ac45e619f7024cf54  Certifications/Cisco/CCDA/Certificate/9927656_certificate.pdf
483360399fd61dac7fc55e84404bd275  Certifications/Cisco/CCDA/Certificate/CCDA Score Report.jpg
...

@odeke-em
Copy link
Owner

odeke-em commented Nov 6, 2016

Thank you thank you @jean-christophe-manciot, let me mark this as a bug and for the next release.

@jean-christophe-manciot
Copy link
Author

jean-christophe-manciot commented Nov 6, 2016

My mistake about the second point of my second post which is not an issue.
Actually, it can be used as another workaround to first post:

Google Drive/Missions/Innovations# drive md5sum -recursive
a3ec8d8644b63a9cfff50fd8f102dffa  Proposal for a DNS Secured BGP.docx
36215eb1940f422d6d289c8ec042f86f  Proposal for a DNS Secured BGP.pdf
6b5be4ad070dbe3f7c0085013743bb75  Proposal to Change the EIGRP Feasibility Condition to allow faster convergence.docx
8c78373e08b590ef0dcaa5ac8a38f270  Proposal to Change the EIGRP Feasibility Condition to allow faster convergence.pdf

@odeke-em
Copy link
Owner

odeke-em commented Nov 6, 2016

No worries, thing though is -recursive will traverse as deep as it can so if there were levels in that directory, it would hit the last point

@jean-christophe-manciot
Copy link
Author

jean-christophe-manciot commented Nov 6, 2016

Yes indeed, we cannot control the recursive depth with --depth n, that's another issue or potential for improvement. As a summary on this point:

  • drive md5sum has no result/effect
  • drive md5sum --depth n: n must be incremented by 1 to have the desired effect
  • drive md5sum -r has no result/effect
  • drive md5sum -recursive works fine but its depth cannot be controlled

@odeke-em odeke-em changed the title Drive md5sum does not return any result md5sum does not return any result for depth=1 Nov 19, 2016
@jean-christophe-manciot jean-christophe-manciot changed the title md5sum does not return any result for depth=1 drive md5sum --depth level must be incremented by 1 to have the desired effect Dec 28, 2016
odeke-em added a commit that referenced this issue Jan 7, 2017
Fixes #783.

Ensures that for a directory, after decrementing the depth
by 1 in the parent's first pass that we at least operate on
passed in files instead of erraneously ending on that depth.
Traversal depth is meant for traversing directories/folders
and less on actual files.

This change leads us to conform to the proper behavior exhibited
by  `drive list`.
@odeke-em
Copy link
Owner

odeke-em commented Jan 7, 2017

@jean-christophe-manciot, please get the latest from master. Fixed by #832. Thank you for reporting it and for the patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants