aboutsummaryrefslogtreecommitdiff
path: root/Utility/Format.hs
Commit message (Collapse)AuthorAge
* fix failing quickcheck propertiesGravatar Joey Hess2017-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QuickCheck 2.10 found a counterexample eg "\929184" broke the property. As far as I can tell, Git.Filename is matching how git handles encoding of strange high unicode characters in filenames for display. Git does not display high unicode characters, and instead displays the C-style escaped form of each byte. This is ambiguous, but since git is not unicode aware, it doesn't need to roundtrip parse it. So, making Git.FileName's roundtrip test only chars < 256 seems fine. Utility.Format.format uses encode_c, in order to mimic git, so that's ok. Utility.Format.gen uses decode_c, but only so that stuff like "\n" in the format string is handled. If the format string contains C-style octal escapes, they will be converted to ascii characters, and not combined into unicode characters, but that should not be a problem. If the user wants unicode characters, they can include them in the format string, without escaping them. Finally, decode_c is used by Utility.Gpg.secretKeys, because gpg --with-colons hex-escapes some characters in particular ':' and '\\'. gpg passes unicode through, so this use of decode_c is not a problem. This commit was sponsored by Henrik Riomar on Patreon.
* better typesGravatar Joey Hess2016-02-14
|
* fix use of hifalutin terminologyGravatar Joey Hess2015-11-16
|
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* relicense general utility library code to BSDGravatar Joey Hess2014-05-10
| | | | | Omitted a couple of files what have had significant contributions from others.
* gpg secret keys list parsingGravatar Joey Hess2013-09-16
| | | | | | Note that Utility.Format.prop_idempotent_deencode does not hold now that hex escaped characters are supported. quickcheck fails to notice this, so I have left it as-is for now.
* finished where indentation changesGravatar Joey Hess2012-12-13
|
* hlintGravatar Joey Hess2012-02-16
|
* rename readMaybe to readishGravatar Joey Hess2012-01-23
| | | | a stricter (but also partial) readMaybe is getting added to base
* treakGravatar Joey Hess2012-01-21
|
* cleanupGravatar Joey Hess2011-12-23
|
* add escape_var hackGravatar Joey Hess2011-12-23
| | | | Makes it easy to find files with duplicate contents, anyway.. :)
* reorgGravatar Joey Hess2011-12-23
|
* handle C-style escapes in FormatGravatar Joey Hess2011-12-23
| | | | | | | | | | | I was happily able to repurpose some code from Git.Filename to handle this. I remember writing that code... a whole afternoon at a coffee shop, after which I felt I'd struggled with Haskell and git, and sorta lost, in needing to write this nasty peice of code. But was also pleased at the use of a pair of functions and quickcheck that allowed me to get it 100% right. So, turns out I not only got it right, but the code wasn't as special-purpose as I'd feared. Yay!
* better data typeGravatar Joey Hess2011-12-22
|
* Format strings can be specified using the new --find option, to control what ↵Gravatar Joey Hess2011-12-22
| | | | is output by git annex find.
* add a text formatterGravatar Joey Hess2011-12-22
This is built for speed; a format string is parsed once, generating a Format, that can be applied repeatedly to different sets of variables to generate output.