18 Commits

Author SHA1 Message Date
Billy Keyes 3772c9eb65 Fix parsing for file names with spaces (#24)
Git does not quote file names containing spaces when generating header
lines. However, I misread the Git implementation and thought it used
spaces as a name terminator by default, implying that names with spaces
would be quoted.

Rewrite the the name parsing code to better match Git. Specifically,
when both names in a header are not quoted, test all splits to see if
any of them produce two equal names. Also account for spaces in file
names when parsing file metadata.

Finally, allow trailing spaces on file names, which seem to be allowed
by Git (although this sounds like a terrible idea to me.)
2021-04-24 15:23:31 -07:00
Billy Keyes 8cd57be485 Update development status in README 2021-02-19 13:09:28 -08:00
Billy Keyes 864dd3fb4f Replace godoc.org badge with pkg.go.dev badge 2020-09-12 21:43:52 -07:00
Billy Keyes 34ea173066 Add apply example to README 2020-02-01 13:30:59 -08:00
Billy Keyes bb5b8f69fd Update README.md 2020-01-27 22:55:33 -08:00
Billy Keyes c979654ba5 Update README with apply status 2020-01-27 22:42:13 -08:00
Billy Keyes d42fb0e93f Fix spelling mistakes, add Go Report Card badge 2019-04-14 19:53:39 -07:00
Billy Keyes 37fcc9a950 Update status and add example in README 2019-04-14 19:35:48 -07:00
Billy Keyes 7b9443bc1c Add tests for ParseTextFragments
Covers that multiple fragments actually works and the unique error
contidions, but otherwise relies on the lower level tests for
correctness. Also update some comments and the README based on
observations from writing/debugging these tests.
2019-04-01 22:55:09 -07:00
Billy Keyes cf2f946a66 Implement traditional file header parsing
While I think this works, this is mostly for completeness. I (and I
expect most other users, if any) intend to use this with git patches.
2019-03-21 22:47:52 -07:00
Billy Keyes aa3e0d357e Clarify behavior when parsing "index" lines
The parsed OIDs are usually prefixes, not full hashes, so rename the
fields appropriately. Also note that values that are too long to be
valid OIDs are still accepted by the library.
2019-03-19 22:35:52 -07:00
Billy Keyes 6daf604b25 Add tests for git header data parsing
Fix parseGitHeaderIndex to allow abbreviated OIDs and add a note about
this to the README. The behavior might change again later, based on some
experimentation with Git.
2019-03-17 21:38:14 -07:00
Billy Keyes bfbc443178 Simplify footnote formatting in README 2019-03-17 15:41:42 -07:00
Billy Keyes ea5b8bceea Finish parsing filenames from Git headers
Adds "default" name handling, error checks for missing names, and prefix
and double-slash stripping.
2019-03-17 15:34:03 -07:00
Billy Keyes ba4db47e68 Add note about stricter checks for invalid input 2019-03-16 15:54:41 -07:00
Billy Keyes f41707bf2a Add status section to README 2019-03-12 22:57:21 -07:00
Billy Keyes 5ddc0cc7e6 Add links to alternatives in README 2019-03-12 22:51:59 -07:00
Billy Keyes a445f1eb6e Initial commit 2019-03-10 17:57:14 -07:00