Commit Graph

14628 Commits

Author SHA1 Message Date
Simon Michael
e15edcff69 ;examples: how to get debconf's ledger files 2026-01-09 11:11:50 -10:00
Simon Michael
f2ec9d58bc ;doc:issue template: improve 2026-01-09 09:48:48 -10:00
Simon Michael
8295e521a7 ;doc:issue template: improve 2026-01-09 09:32:33 -10:00
Simon Michael
9307c178c9 ;doc:issue template: improve 2026-01-09 09:29:31 -10:00
Simon Michael
932de54aa9 ;doc:issue template: edit 2026-01-09 09:09:27 -10:00
Simon Michael
b96a8bf01d ;doc:issue template: encourage a modern version 2026-01-09 09:08:13 -10:00
g. nicholas d'andrea
e678e09704 feat: accounts: add Gain (G) account type as subtype of Revenue [#2522]
Add a new account type Gain with single-letter code G as a subtype of
Revenue, similar to how Cash is a subtype of Asset and Conversion is a
subtype of Equity. This enables tracking capital gains/losses separately
while still including them in income statements and close --retain.

Usage: account revenues:capital  ; type: G

- type:G matches only Gain accounts
- type:R matches both Revenue and Gain (subtype matching)
- Auto-detection from account names matching:
  ^(income|revenue)s?:(capital[- ]?)?(gains?|loss(es)?)(:|$)
  e.g. income:gains, revenue:capital-gains, income:losses
2026-01-08 19:18:13 -10:00
Simon Michael
c7732c7600 ;workflows:binaries:linux: ensure the linux binary uses a fixed haskeline [#2410] 2026-01-08 18:23:43 -10:00
Simon Michael
e36f55c98a ;add: allow older haskeline again, it's needed for stackage (reopens [#2410])
For now, `hledger add` with the stackage build of hledger 1.51.2+ will once again show ANSI junk.
Dev builds, the github release binaries, stackage builds of hledger-1.50..1.51.1,
and stackage hledger builds in future snapshots with a GHC that provides the fixed haskeline,
will remain free of that bug.
2026-01-08 18:15:35 -10:00
Simon Michael
7ab155de67 ;pkg:stack: revert to ghc 9.12.2, 9.12.3 is buggy and not yet available with ghcup 2026-01-08 13:51:27 -10:00
Simon Michael
9e79fe7182 ;doc: REGRESSIONS 2026-01-08 02:28:21 -10:00
Simon Michael
81547f371c ;pkg:stack: nightly-2026-01-08 / ghc 9.12.3 2026-01-08 02:15:02 -10:00
Simon Michael
4a79b29f42 ;doc:gh relnotes 2026-01-08 02:14:55 -10:00
Simon Michael
95dc030005 ;doc:relnotes 2026-01-08 02:14:03 -10:00
Simon Michael
cc7cbed4d9 ;doc:ANNOUNCE 2026-01-08 02:12:24 -10:00
Simon Michael
1eaf37ca0f ;doc:changelogs: 1.51.2 2026-01-08 02:10:53 -10:00
Simon Michael
62a104c42c fix:web:register: prevent line wrapping in dates [#2520] 2026-01-08 00:57:28 -10:00
Simon Michael
1d596c494b ;bin:bashrc: fix LEDGER_FILE typo 2026-01-08 00:44:05 -10:00
Simon Michael
3c0a02a34a Revert "fix:lib:Hledger.Query: words'': Parse escaped quotes in quoted patterns" [#2513]
This reverts commit de900e5b24, it's not
as safe as we thought.
2026-01-06 21:55:35 -10:00
Simon Michael
98fdffd516 ;doc: hledger's regular expressions: no lazy quantifiers 2026-01-06 21:42:32 -10:00
Simon Michael
dd6061ed65 ;bin:bashrc: cleanup 2026-01-06 21:42:32 -10:00
Simon Michael
3b656ff372 imp:add,import: also create directories when autocreating journal file
When autocreating a journal file specified by -f or LEDGER_FILE,
required parent directories will now also be autocreated if needed.
2026-01-06 21:39:59 -10:00
Simon Michael
e7d7c49562 imp: -f now errors if given a glob matching no files, like LEDGER_FILE
Previously LEDGER_FILE=foo hledger add did, but hledger -f foo add didn't.
Now they both consistently will error if given a glob
(a path contining [, {, *, or ?) that matches nothing,
rather than auto-creating a file with a glob-like name.

Hledger.Utils.IO:
expandPathOrGlob
2026-01-06 21:39:59 -10:00
Simon Michael
88f6c16dd5 fix:add,import: autocreate missing journal files again (but later) [#2514]
This restores the pre-1.50.3 behaviour of add and import, which once
again auto-create a missing file (specified by -f or LEDGER_FILE or
the builtin default path) rather than giving an error.
This fixes #2514 and refines the fix for [#2485].

There's also an improvement: they no longer create it unconditionally at the start;
they create lazily, when they have data to write.

Hledger.Read:
defaultExistingJournalPath
defaultExistingJournalPathSafely
readPossibleJournalFile

Hledger.Cli.Utils:
withPossibleJournal
2026-01-06 21:39:59 -10:00
Oleg Bulatov
abd7d60884 imp:lib:valuation: optimize price lookup with pre-built indexes [#2511]
Replace O(n log n) re-sorting of all prices on every valuation date
with O(log n) indexed lookups. By pre-building sorted price indexes
once at startup using O(n log n) time, we avoid redundant work
during reports.

This significantly improves performance for --value=end,COMM with daily
reports over long periods and large price databases.

Implementation:
- PriceIndex maps commodity pairs to a Map from date to effective
  price, enabling O(log n) temporal lookups via M.lookupLE.
- DefaultValuationIndex provides efficient resolution of destination
  commodities using the same temporal logic.
- makePriceGraph is updated to consume these indexes.

Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
2026-01-02 17:05:24 -10:00
Simon Michael
1a5f10f928 ;doc:ghtestbinnotes: bump version for diffing 2025-12-31 13:38:43 -10:00
Simon Michael
6e0ef6b88e ;doc:ghtestbinnotes: fix urls 2025-12-31 13:37:05 -10:00
Simon Michael
20389ad844 ;workflows:binaries-linux-x64: add more caching 2025-12-31 13:16:54 -10:00
Simon Michael
656c779c6f ;workflows: rename nightly -> testbin
The nightly tag is no longer usable, having been used in a test of
immutable releases on Github. The branch/tag/workflow/release is
now "testbin", intended for publishing unreleased binaries for testing.
2025-12-31 12:49:44 -10:00
Simon Michael
01c79b357e readme: heading 2025-12-31 09:34:27 -10:00
Simon Michael
dbdf199e42 ;dev: gitignore 2025-12-31 09:30:31 -10:00
Simon Michael
3d85549e79 dev:Hledger.Utils.IO: clarify expandPath, expandHomePath 2025-12-31 00:28:05 -10:00
Simon Michael
6a9c5d41d9 ;cabal: update cabal files 2025-12-31 00:28:05 -10:00
Jens Petersen
ada160db3a hledger-ui: allow vty-crossplatform 0.5 2025-12-30 23:35:46 -10:00
Simon Michael
ea043df56e ;examples:csv: opencollective: update 2025-12-30 12:54:21 -10:00
Simon Michael
6aaeddfcf0 ;examples:csv: opencollective: update 2025-12-30 12:43:04 -10:00
Simon Michael
2dd2ad5cf9 ;examples:csv: Open Collective 2025-12-30 11:26:18 -10:00
Simon Michael
3d5704fe22 ;doc:README: badges updates 2025-12-30 05:55:36 -10:00
Simon Michael
9b0555e657 ;doc:COMMON TASKS:Setting LEDGER_FILE: updates 2025-12-29 09:30:40 -10:00
Simon Michael
327ff6ef0c ;doc:REGRESSIONS 2025-12-29 08:46:30 -10:00
Simon Michael
d505c98910 ;doc:REGRESSIONS 2025-12-29 01:15:36 -10:00
Dmitry Astapov
edfea86656 ;roi: rephrase IRR solver errors a bit 2025-12-27 09:43:53 -10:00
Dmitry Astapov
1c37dc44a7 ;roi: more input sanity checks (fixes #2505) 2025-12-27 09:43:53 -10:00
Simon Michael
2fb09f0d1e cabal: update cabal files 2025-12-26 17:10:47 -10:00
Simon Michael
1a0a81d9e7 fix: add, ui: better fix for add's [#2410], also fixes ui's [#2512]
By using newer haskeline fixing https://github.com/haskell/haskeline/issues/130.
2025-12-26 17:09:26 -10:00
Simon Michael
91d019741e ;pkg: allow base 4.22 / ghc 9.14 2025-12-26 15:17:16 -10:00
Simon Michael
262e6d2c2e ;examples:cctax: wording 2025-12-26 15:05:34 -10:00
Simon Michael
ff018bf482 ;doc:README: new badges provided by gitscope.dev 2025-12-26 15:05:34 -10:00
Simon Michael
60293349bb ;imp:lib:Hledger.Utils.IO.expandHomePath: handle a bare ~ 2025-12-26 15:05:34 -10:00
Tuong Nguyen Manh
de900e5b24 fix:lib:Hledger.Query: words'': Parse escaped quotes in quoted patterns 2025-12-26 12:09:49 -10:00