-
Notifications
You must be signed in to change notification settings - Fork 5
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
holo-files: Support patch files (#5) #42
base: master
Are you sure you want to change the base?
Commits on Feb 4, 2018
-
holo-files/impl.Resource: Pre-compute the disambiguator and entityPath.
This simplifies the code; as most of the code from the old separate Disambiguator() and EntityPath() was identical.
Configuration menu - View commit details
-
Copy full SHA for dc0aebd - Browse repository at this point
Copy the full SHA dc0aebdView commit details
Commits on Feb 5, 2018
-
holo-files: Turn Resource into an interface, split the implementation.
This makes the minimal textual changes to accomplish this (don't move things between files, add a bogus `if true {` to avoid indentation change, ...), to make rebasing it easier. The next commit will clean that up.
Configuration menu - View commit details
-
Copy full SHA for cf1d60b - Browse repository at this point
Copy the full SHA cf1d60bView commit details -
holo-files: Split resource.go into multiple files, tidy.
- shorten rawResource's methods - remove the bogus 'if true' from StaticResource.ApplyTo()
Configuration menu - View commit details
-
Copy full SHA for aa26621 - Browse repository at this point
Copy the full SHA aa26621View commit details -
util/dump-to-tree.sh: Correctly handle backslashes in file contents.
This affects patch files with the "\ No newline at end of file" footer.
Configuration menu - View commit details
-
Copy full SHA for 610d23e - Browse repository at this point
Copy the full SHA 610d23eView commit details -
doc/holo-files: Refactor wording in anticipation of what is coming.
Alone, this is probably a bad change. But, this structure is amenable to adding other resource types; which a subsequent commit will do. I wanted these wording changes to be review-able separately from wording for new behavior.
Configuration menu - View commit details
-
Copy full SHA for 52364c3 - Browse repository at this point
Copy the full SHA 52364c3View commit details -
holo-files: Implement .patch files.
This ended up being a lot more work than I thought it would be... though a good chunk of that was slowly realizing all of the ways that I could mess up writing patch files (in the tests) by hand. Apparently, when applying `--git` style patches, GNU patch is pretty finicky about the "index" line, which I had expected it to basically ignore. BusyBox patch doesn't implement the `-d` flag, despite it being in POSIX for as long as `patch` has (2001; before that patch was standardized in XDG/SUS, before that merged with POSIX; but I don't have pre-merge copies handy to see if they had the `-d` flag). So use `cmd.Dir` instead of `-d`. That doesn't mean that BusyBox patch will pass the tests, just that it will work. It will still fail the tests: - The tests check for `--git` style changing of symlinks. BusyBox patch does not support patching symlinks - The tests check for `--git` style changing of and file permissions. BusyBox patch does not support that - The tests expect it to say "patching file FILENAME" when creating a file (GNU patch behavior); BusyBox patch says "creating FILENAME". - The BusyBox fuzz detector seems to be less forgiving than the GNU one; it rejects my with-fuzz test. That said, BusyBox patch will still work for users writing ordinary patch files. I will 100% not be surprised of the tests don't pass with BSD patch for similar reasons. This breaks backward compatibility in a very minor way: previously, a resource file with the ".patch" suffix was understood to be a verbatim file; this changes that, obviously. The target file is operated on in a temporary directory, and without specifying the `-p` flag or the target filename. This gives the patch the freedom to do directory-type operations (change file type). If the patch creates other files, they will be ignored.
Configuration menu - View commit details
-
Copy full SHA for d3c9cba - Browse repository at this point
Copy the full SHA d3c9cbaView commit details