Skip to content

1.41

Latest
Compare
Choose a tag to compare
@simonmichael simonmichael released this 10 Dec 01:23
· 51 commits to master since this release
1.41

Release notes

Valuation fix, improved HTML and FODS output, multiple depths, terminal pagination, robust export to Beancount, ...

hledger 1.41

Breaking changes

  • Accounts named "equity:conversion", "equity:trading", or "equity:trade(s)", which are detected as type V/Conversion, will now revert to type E/Equity instead if any other account has been declared as type V/Conversion.

  • When built with ghc 9.10.1, hledger shows two extra newlines after any error message.

Fixes

  • A somewhat severe, though hopefully rare, valuation bug has been fixed. In certain circumstances, values could be calculated inaccurately, because of display-rounding occurring inappropriately during calculations. #2254

    Specifically: when there was no direct P price for the target commodity, so that hledger had to convert via a chain of prices, and if all of those price amounts had too few decimal places, then the result could be inaccurate. An example:

    P 2000-01-01 A   10.5 B
    P 2000-01-01 B  100.5 C
    
    2000-01-01
        (a)    100 A
    
    $ hledger-1.40 print -X C
    2000-01-01
        (a)        105520 C   ; wrong
    
    $ hledger-1.41 print -X C
    2000-01-01
        (a)        105525 C   ; right
    
  • bs/bse/cf/is's HTML output no longer includes excess heading cells, and bs/bse's HTML output no longer shows an inappropriate Total heading with -T. (balancesheet does not support -T.)
    (Henning Thielemann)

  • Balance commands' HTML, CSV and FODS output now show tree mode properly indented (using no-break spaces).
    (Henning Thielemann)

  • In the HTML output of bs/bse/cf/is reports, Net amounts in the Net row are now formatted like the others.
    (Bas van Dijk)

  • In bs/bse/cf/is HTML output, some unnecessary TH cells have been fixed.
    #2225 (Henning Thielemann)

  • The print command now ignores a depth limit entirely.
    Previously, a depth limit caused it to show only transactions referencing accounts as deep or deeper than that.

  • In the roi command, a division by zero error (when all assets were sold) has been fixed.
    #2281 (Dmitry Astapov)

  • In a multi-line comment generated by CSV rules, tags on all lines now work (ie, can be matched). Posting dates in comments generated from CSV also now work.
    #2241

  • hledger's bash shell completions are now up to date with the latest CLI.
    #986

  • When showing output with a pager, if $PAGER is set to something not found in PATH, we now ignore it instead of raising an error.

  • hledger --color=yes | less -R now shows bold headings as you'd expect.

Features

  • The print, register and aregister commands now support HTML and FODS output, and the bs/bse/cf/is commands now support FODS output. This means all of the "STANDARD REPORTS" commands, and the balance command, now support text, HTML, CSV, TSV, or FODS output.
    (Henning Thielemann)

  • When generating HTML output with the register or balance commands, the --base-url option will add hyperlinks to hledger-web, allowing you to view the detailed transactions if you have hledger-web running.
    (Henning Thielemann)

  • Reports can now specify different display depths for certain accounts, rather than showing all accounts with the same depth limit. Multiple --depth=ACCTREGEX=DEPTH options (or depth:ACCTREGEX=DEPTH arguments can be used. For example, this will clip all accounts matching "assets" to depth 3, all accounts matching "expenses" to depth 2, and all other accounts to depth 1: --depth assets=3 --depth expenses=2 --depth 1
    (Stephen Morgan, #2292)

  • In unix-like environments, hledger now uses a pager ($PAGER, less, or more) for all large terminal output, not just for help. You can override this with the new --pager option. The pager is expected to handle hledger's ANSI colour output (unless you disable that). If less is used, it will be configured automatically, or you can override this by setting options in a HLEDGER_LESS environment variable.

  • The print command's beancount output is now much more Beancount-compatible #2295. Other than using --alias to provide the top-level account names Beancount requires, you should rarely have to do anything special to produce a journal that bean-check accepts. hledger will automatically adjust problematic names, encode unsupported characters, and so on. See hledger: Beancount output for the full details.

    This supersedes the ledger2beancount tool, and makes using Beancount tools, especially Fava, practical for hledger users. In many cases this should just work:

    hledger [ALIASES] print -o tmp.beancount; fava tmp.beancount
    

Improvements

  • if blocks in CSV rules now allow & ! (AND NOT) on the same line.

  • When reading .latest files, whitespace is now ignored, and any date parse failure is reported with the file and line number.

  • In journal format, P directives now require a space after the first symbol, preventing surprises like P 2024-10-31 a0 1 parsed as P 2024-10-31 a 01.
    #2280

  • aregister has a new --heading=YN option, for disabling the report heading. (Henning Thielemann)

  • aregister now supports the --invert and --cumulative flags, like the register command. (Henning Thielemann)

  • The balance commands' HTML and FODS output now shows table borders consistently.
    (Henning Thielemann)

  • In the balance commands' HTML output, row headings now span multiple rows when appropriate, rather than being repeated.
    (Henning Thielemann)

  • Balance commands now support --transpose when generating HTML output.
    (Henning Thielemann)

  • The balance command's --layout=tidy now affects HTML and FODS output at least to some extent (not just CSV output). And it always disables the totals row. (Henning Thielemann)

  • The balance command's FODS output now picks a report title based on the report mode: "Balance Report", "Multi-period Balance Report", or "Budget Report". (Henning Thielemann)

  • balance and aregister's HTML output will now use a hledger.css file if present, like bs/bse/cf/is.

  • bs/bse/cf/is now support the --count (postings count) report type, like balance.

  • The balance commands' options help has had some cleanup.

  • The error messages from check accounts and check recentassertions are now clearer.

  • The check commodities command now also checks commodities used in P directives. #2280

  • The commodities command now also list commodities mentioned in P directives. #2280

  • All of hledger's internal hidden (but searchable) tags can now be made visible by print --verbose-tags, which is useful for troubleshooting --infer-equity,
    --infer-costs, and the detection of redundant costs and conversion postings. Also,

    • Some hidden tags have been renamed for clarity:
      _modified is now _modified-transaction,
      _cost-matched is now _cost-posting,
      _conversion-matched is now _conversion-posting.
    • The generated-posting: tag added by --infer-equity is now valueless.
    • The modified-transaction: tag added by --auto now appears on its own line.
  • Using the -NUM shortcut (for --depth NUM) in a config file now works.

  • Setting the --color option in a config file now works (except it does not affect --debug output, currently).

  • The --color option's suggested values are now yes/y, no/n, or auto/a. always and never are no longer documented, though still supported.

  • More compact and informative --debug=2 output during valuation. Market prices are now shown using one line each, the known prices are listed, and the status of --infer-market-prices is shown.
    #2287

  • More informative --debug=7 output from CSV rules.

  • The hledger packages have a new debug build flag. Builds made with ghc 9.10+ and this flag will show some kind of stack trace if the program exits with an error. (These will improve in future ghc versions.)

  • Disabled the unused ghcdebug build flag and ghc-debug support, for now.

  • Allow megaparsec 9.7.

  • ghc 9.10 / base 4.20 are now supported.

Docs

  • Windows: added tips for setting LEDGER_FILE (Amadeusz Wieczorek, hledger_site#119)
  • csv: if blocks: explain matchers and field names better #2289
  • import: rewrite; rename "date skipping" to "overlap detection"
  • import: added tips for first import
  • assertions: mention their behaviour with posting status
  • journal: rewrite the Tags section
  • pager: note that help -p TOPIC uses less; link to less FAQ
  • query types: updates, add headings, mention tag:'s infix matching
  • Regular expressions: note possible RTL/bidi limitation (?)
  • Special characters: rewrite, more precision, mention some Windows differences
  • Output formats: expand, document beancount and FODS output
  • Text output: expand/consolidate terminal topics
  • FODS output: describe the advantages over CSV (Henning Thielemann)
  • Debug output: note that the --debug option doesn't work in config files.
  • bal: improve --layout doc
  • bal: also mention hledger.css and text encoding in balance doc
  • html: note safari text encoding issue
  • timedot: mention the common journal+timedot file setup #2238
  • Install, manual: new shell completions doc. #986
  • Config files: rewrite #2231
  • examples/csv: an example of YNAB 4 data, and RTL text, with a workaround
  • examples: hledger2beancount.conf

Scripts/addons

  • bin/*: remove obsolete _FLAGS markers from --help
  • examples/csv/csv-hledger-1.py: a python-based CSV converter script

API

  • Hledger.Utils.IO's ansi color helpers now respect the --color option.
  • Hledger.Utils.IO.rgb' now takes Float arguments instead of Word8.
  • Hledger.Cli.Commands.Balance: export budgetReportAs* functions, for use in scripts.
    (Dmitry Astapov)

hledger-ui 1.41

Breaking changes

  • When built with ghc 9.10.1, error messages are displayed with two extra trailing newlines.

Fixes

  • V (value) and C (cost) toggle keys once again reset each other as they should
    (broken since 1.21).
    (Gal Lakovnik Gorenec, #2284)

  • Bash shell completions are now up to date. #986

Features

Improvements

  • Allow clipping depth to be configured per account (until adjusted in app, at least).
    (Stephen Morgan, #2292)

  • Added helix as a supported editor for the e key. (amano.kenji)

  • Added --pager and --color options as in hledger, affecting command line help. Also --color=no forces use of the "terminal" theme.

  • Added a new debug build flag. Builds made with ghc 9.10+ and this flag will show some kind of partial stack trace if the program exits with an error. These will improve in future ghc versions.

  • Disabled the unused ghcdebug build flag and ghc-debug support, for now.

  • Allow megaparsec 9.7.

  • Allow brick 2.5, 2.6.

  • Avoid brick 2.3.2, which doesn't build on windows.

  • ghc 9.10 / base 4.20 are now supported.

Docs

  • Mention that period navigation uses standard periods #2293
  • Install, manual: new shell completions doc. #986

hledger-web 1.41

Breaking changes

  • When built with ghc 9.10.1, error messages are displayed with two extra trailing newlines.

Fixes

  • Autocompletions now work in newly created account fields. #2215

  • Bash shell completions are now up to date. #986

Features

Improvements

  • Added --pager and --color options as in hledger, affecting command line help.

  • Added a new debug build flag. Builds made with ghc 9.10+ and this flag will show some kind of partial stack trace if the program exits with an error. These will improve in future ghc versions.

  • Disabled the unused ghcdebug build flag and ghc-debug support, for now.

  • allow megaparsec 9.7

  • ghc 9.10 / base 4.20 are now supported.

Docs

  • Install, manual: new shell completions doc. #986

project changes 1.41

Docs

  • REGRESSIONS: new table format; updates.
  • CODE: notes on the use of haddock #2222
  • Simplify github bug report template
  • Add man pages and info manuals to the release bindists on github

Scripts/addons

  • Fixed build errors in all bin/ scripts. (Dmitry Astapov)
  • hledger-install: fix installation of hledger-ui

Infrastructure/Misc

  • GHC 9.10 is now the default for dev builds and most github workflows.
  • Add consistent greppable summaries to all workflows; various other improvements
  • Add bash shell completion script to the release bindists (#2223, gesh/hseg, Simon Michael)
  • tools/gtree: -u shows untracked files, -I adds ignored files.
  • just doctest: pass through doctest arg(s).

credits 1.41

Simon Michael (@simonmichael),
Henning Thielemann (@thielema),
Dmitry Astapov (@adept),
Stephen Morgan (@Xitian9),
Bas van Dijk (@basvandijk),
Gal Lakovnik Gorenec,
amano.kenji,
gesh.

How to install

For all install options, see hledger.org: Install.
You can install hledger from most package managers (but check for a green badge indicating it's up to date).
Or you can build it from source yourself.

Or you can install up to date binaries from this page, by following the appropriate instructions below.
If you find problems with these instructions, please let us know.

GNU/Linux, 64-bit Intel

At the command line:

cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.41/hledger-linux-x64.zip
(unzip -p hledger-linux-x64.zip | tar xf -) && rm hledger-linux-x64.zip
cd
hledger --version; hledger-ui --version; hledger-web --version    # should show 1.41

Mac, 64-bit ARM or Intel

In a terminal window (don't use your web browser to download, it won't authorise the binaries):

  • For ARM macs:

    cd /usr/local/bin
    curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.41/hledger-mac-arm64.zip
    (unzip -p hledger-mac-arm64.zip | tar xf -) && rm hledger-mac-arm64.zip
    cd
    hledger --version; hledger-ui --version; hledger-web --version    # should show 1.41
    
  • For Intel macs:

    cd /usr/local/bin
    curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.41/hledger-mac-x64.tar.gz
    (unzip -p hledger-mac-x64.tar.gz | tar xf -) && rm -f hledger-mac-x64.zip
    cd
    hledger --version; hledger-ui --version; hledger-web --version    # should show 1.41
    

Windows, 64-bit ARM or Intel

In a powershell window (press WINDOWS-R, powershell, ENTER):

  1. Make a place to keep installed binaries. You only need to do this once, not for every release:

    mkdir -force $HOME\bin >$null
    $ENV:PATH += ";"+$HOME+"\bin"
    [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)
    
  2. Download and install the release binaries:

    cd $HOME\bin
    curl https://github.com/simonmichael/hledger/releases/download/1.41/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip
    Expand-Archive hledger-windows-x64.zip -DestinationPath . -Force
    cd $HOME
    hledger --version; hledger-ui --version; hledger-web --version    # should show 1.41
    
  3. Ensure a default journal file exists, and without a problematic encoding.
    This will allow you to start hledger-web by double-clicking on its icon if you wish.

    out-file -append -encoding ascii $HOME/.hledger.journal
    

    (I'm not sure why "ascii" is needed here - hledger likes utf8 and understands utf8 BOM headers,
    but the state of our unicode support on Windows
    is really unknown, your feedback is welcome.)

Windows 7, 64-bit Intel

These instructions have not been tested recently, please let us know if they work for you:

  • click hledger-windows-x64.zip below
  • choose Open with Windows Explorer, OK
  • click Extract all files
  • choose a destination folder - ideally one that appears in echo %PATH%, like C:\Windows (though that one will require administrator permission); otherwise, your home directory (C:\Users\YOURNAME)
  • check "Show extracted files when complete"
  • click Extract, wait for the destination folder to open
  • find the hledger, hledger-web icons (if you extracted to \Windows, you'll need to scroll down)
  • for each icon: double-click, uncheck "Always ask before opening this file", click Run
  • close those Explorer windows
  • open a command window (press Windows-r, type CMD, press enter)
  • hledger --version; hledger-ui --version; hledger-web --version should show 1.41
  • echo # >> .hledger.journal to ensure a default journal file exists. (Important: the doubled >> is needed to avoid overwriting existing data.)

Problems:

  • Starting hledger by double-clicking its icon won't work because it needs arguments; run it from the command window instead.
  • Starting hledger-web by double-clicking its icon may fail eg because Explorer's command window is too small;
    configure that to be larger, or run hledger-web from a command window instead.
  • hledger or hledger-web may fail to run if there is not enough memory available.

Next steps

Once installed, run hledger, and perhaps read hledger.org: Quick start.