enforce some commit prerequisites#24
Conversation
|
hmm, the README.md didn't seem like a good place to write about commit semantics since its more of a crash course to using Pond. I'll probably hold off on writing about this until after the locking changes. |
| ) && self.fds.len() == 1; | ||
| if !self.fds.is_empty() && !is_commit_only_fd { | ||
| return Err(Error::new( | ||
| ErrorKind::InvalidData, |
There was a problem hiding this comment.
EINVAL feels weird. EBUSY? EINPROGRESS?
| return Err(Error::new( | ||
| ErrorKind::InvalidData, | ||
| format!( | ||
| "all open files must be closed before committing, with the exception of the commit file. num open files: {}", |
There was a problem hiding this comment.
I wouldn't mention the commit file or the number of open fds here. I think either you don't care and will be confused, or you'll be frustrated that you don't know which fds are still open.
Do we need an api to see which files are open?
There was a problem hiding this comment.
Do we need an api to see which files are open?
maybe? it kinda sounds like it would be something we'd do if we decide to make this more git-like with versions -> commits, then we'd want to see a lot more state (like staged files, revert staged files if they were previously committed files, etc.)
c5edd95 to
0efdd69
Compare
0efdd69 to
9ac749f
Compare
|
fyi the tests were failing because apparently the kernel wasn't sending out the release fast enough -- i thought the release was synchronous in the File's drop, but apparently not. |
enforce that there should be no file descriptors open before trying to commit