-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Feature metadata #144
Feature metadata #144
Conversation
2d3d7f5
to
cba680e
Compare
@erikkemperman it seems that |
At a glance, there is no test for the check in |
91d6e19
to
35cff30
Compare
Several changes, including the guard against calling The last couple of commits are smaller changes I think are improvements, but for the moment I'll leave them unsquashed for easier review. |
35cff30
to
9c80274
Compare
Note, there are of course still those two tests that fail against the version of |
a297ca5
to
61cef07
Compare
@erikkemperman we don't rely on the master branch of vinyl so I don't know why they would be failing |
@erikkemperman can you revert some of the changes that were added to handle the vinyl changes I've now removed. I'd like to get this in but it got a lot more complicated with those workarounds. |
@erikkemperman ah, I had thought the last 4-5 commits were addressing things from the vinyl changes. |
@phated No they're just tweaks on @piranna and my efforts that I kept separate for the moment. I think they are slight improvements, especially the commit that makes the Note however that the other PR, which is now mostly pointless until the I didn't have any time the last week or so, but still think the |
@erikkemperman it definitely needs more thought and discussion. However, can you submit a separate PR with the fix to the failing tests? I'd like to get that merged. |
// Check if mode needs to be updated | ||
var modeDiff = 0; | ||
if (typeof file.stat.mode === 'number') { | ||
modeDiff = (file.stat.mode ^ stat.mode) & MASK_MODE; |
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.
what is the ^
operator? I've never encountered it before
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.
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.
Heh, I guess I betrayed my C origins there. It's a nice operator to get bit-difference.
Sure thing, will do that when I get on campus in an hour or so. As to the commits here, I kept them separate for easier review but should probably squash at some point. |
var writeDir = require('./writeDir'); | ||
var writeStream = require('./writeStream'); | ||
var writeBuffer = require('./writeBuffer'); | ||
var writeSymbolicLink = require('./writeSymbolicLink'); | ||
|
||
// TODO include sticky/setuid/setgid, i.e. 7777? | ||
var MASK_MODE = parseInt('0777', 8); |
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.
@erikkemperman what would happen if this was just '777'
like we did at https://github.com/gulpjs/vinyl-fs/blob/master/test/dest.js#L38
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.
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.
@phated Not sure what you mean... If you meant dropping the zero, so it would leave parseInt('777', 8)
-- that would do the exact same thing, since it is the same number...
I added the leading zero to emphasize we are now actively ignoring any sticky/setuid/setgid bits that users might have set on stat.mode
. Notice that this does not set those bits on extant files on disk to 0 -- all this mask does is ignore any bits on stat.mode
that are not rwx flags in building the argument to fchmod
. And the TODO comment questioned if we wanted to allow users to set those other bits as well.
Either way, it is separate from the issue you linked, although if we were to allow these bits to be set by the user, and reflected on disk by dest
, then there should be a test for it which doesn't use the realMode
function of course (awkward description of what it does, acually).
Let me know if I should remove any commits from this PR, or rebase/squash. EDIT: Sorry @piranna, auto-complete got me. I meant to address @phated. |
@erikkemperman feel free to squash, I am working on some cleanup against this branch currently but can stash and apply after the rebase. |
61cef07
to
90a1189
Compare
@phated Done! Thanks for being patient, this whole thing took a good while. Once merged I will adapt and submit the fix for intermittently failing atime/mtime tests. |
@erikkemperman one more thing, we are writing a lot of functions that take the file descriptor and the vinyl file object - what do you think about attaching the file descriptor to the vinyl object while we are passing it through the vinyl-fs machinery and then removing it when done? This would be very similar to how node's fs.WriteStream works |
@phated I inlined some of those functions, like So you're suggesting to have the various I guess I don't see why not, but then I also don't really mind a separate argument in what is after all an internal contract. |
@phated Would it be a completely ludicrous idea to de-couple the opening/closing of filedescriptors, i.e. have a separate utility which handles this stuff? That might do lazy closing or even predictive opening? I imagine it is pretty common to have intermediate (but persistent) files, and such cases might benefit from subsequent pipes discovering that its file still has a handle. |
Finished by #151 and published as 2.3.2 - Thanks for all your work on this @erikkemperman! |
Squashed as requested.