This fixes the issue in https://github.com/simonmichael/hledger/issues/1942.
Instead of relying on a `git record` alias being present `hledger git record`
uses only vanilla git.
The expected alias for record is:
```
record = ! sh -c '(git add -p -- $@ && git commit) || git reset' --
```
The removed `git record` is in the script is implemented using:
- `git commit` with the given messages (and additional arguments if given)
- `git reset` if the commit fails
`git add -p` isn't needed because the files are added already above. Also
this would be interactive which isn't the goal for this call.
The message still defaults to the date if not given, however I had to add
a check to only shift if arguments were passed in, otherwise shift fails.
May also fix#1154, #1033, #708, #536, #73: testing is needed.
This aims to solve all problems where misconfigured locales lead to
parsers failing on utf8-encoded data. This should hopefully avoid
encoding issues, but since it fundamentally alters how encoding is dealt
with it may lead to unexpected outcomes. Widespread testing on a number
of different platforms would be useful.
This increases composability and avoids some ugly case handling. We
re-export runExceptT in Hledger.Read.
The final return types of the following functions has been changed from
IO (Either String a) to ExceptT String IO a. If this causes a problem,
you can get the old behaviour by calling runExceptT on the output:
readJournal, readJournalFiles, readJournalFile
Or, you can use the easy functions readJournal', readJournalFiles', and
readJournalFile', which assume default options and return in the IO
monad.
Note that this is semantically different, and will produce different
results. In particular, the sort is now stable, i.e. account names with
the same balance will not have their order reversed relative to each
other. In this context there doesn't seem to be a reason to prefer one
order to the other, so I'm making this change.