Skip to content
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

hledger 1.29 breaking backwards compatibility #26

Closed
kiteloopdesign opened this issue Mar 31, 2023 · 3 comments
Closed

hledger 1.29 breaking backwards compatibility #26

kiteloopdesign opened this issue Mar 31, 2023 · 3 comments

Comments

@kiteloopdesign
Copy link

Hi, I decided to update hledger from 1.26 version to 1.29 and it looks like they broke backwards compatibility.

Error when running Shake build system:
  at want, called at /home/kitesutra/personal/full-fledged-hledger/06-maintaining-lots-of-csv-rules/export/export.hs:107:24 in main:Main
* Depends on: 2015-opening.journal
  at cmd, called at /home/kitesutra/personal/full-fledged-hledger/06-maintaining-lots-of-csv-rules/export/export.hs:155:5 in main:Main
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: hledger -f ../2014.journal equity assets|liabilities|debts -e 2015 --opening
Exit code: 1
Stderr:
hledger: Error: Unknown flag: --opening (use -h to see usage)

From what I can see error has nothing to do with "--opening" but they removed the "equity" command?

~/.local/hledger/hledger-1.29/hledger -f ./2014.journal equity "assets|liabilities|debts" -e 2015 
hledger: Error: command equity is not recognized, run with no command to see a list
~/.local/hledger/hledger-1.26.1/hledger-linux-x64 -f ./2014.journal equity "assets|liabilities|debts" -e 2015
2014-12-31 closing balances
    assets:Lloyds:current                  £-600.00 = £0.00
    assets:cash                            £-150.00 = £0.00
    assets:pension:aviva                   £-100.00 = £0.00
    equity:opening/closing balances

2015-01-01 opening balances
    assets:Lloyds:current                   £600.00 = £600.00
    assets:cash                             £150.00 = £150.00
    assets:pension:aviva                    £100.00 = £100.00
    equity:opening/closing balances

By the way, this equity command seems to be undocumented/buggy in 1.26 ... Close!?

~/.local/hledger/hledger-1.26.1/hledger-linux-x64 equity -h
close [OPTIONS] [QUERY]
  Prints a sample "closing" transaction bringing specified account
  balances to zero, and an inverse "opening" transaction restoring the
  same account balances.
@simonmichael
Copy link

Sorry about that..

  • https://hledger.org/release-notes.html#2023-03-11-hledger-129 > "close now has three modes, --retain/--migrate/--open, clarifying its uses and providing more useful defaults."

  • Ledger's original "equity" command was long ago renamed to "close" in hledger. I guess at some point (maybe this same release) I dropped the old "equity" alias. (Sometimes I take a chance and remove ancient legacy cruft that I think noone is using.)

It seems I should have been more careful to preserve the previous flags and command alias, or to document the breaking changes in release notes; so this qualifies as a regression, you're welcome to report it and claim the regression bounty.

See hledger close --help or https://hledger.org/hledger.html#close for the new CLI. I think the command you need now might be:

hledger -f ../2014.journal close assets|liabilities|debts -e 2015 --open

@kiteloopdesign
Copy link
Author

Thanks Simon! i've added the issue on hledger git

I leave this issue open for adept to update the command if he wants

@adept
Copy link
Owner

adept commented Apr 1, 2023

I'll push the fix for this shortly. Thank you both!

@adept adept closed this as completed in 85b2828 Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants