quentinsf / icsv2ledger

Interactive importing of CSV files to Ledger
196 stars 70 forks source link

Change MD5 hash construction to avoid false-positives #140

Open antler5 opened 3 years ago

antler5 commented 3 years ago

Re-submission of https://github.com/quentinsf/icsv2ledger/pull/139 because I was naively working on master and, as it happens, Github doesn't let you change your default branch, only rename it.

Cleaned up the commits while I was at it.

Note that this will cause current transactions to become unique. It may catch existing users off-guard. Clean solutions welcome.

(I'd like to write an accompanying helper-script that, when given a Source Account, checks an existing ledger for CSV comments accompanied by a hash matching that of a depreciated approach and updates it in-place, but I only have so much time atm.

The justification for breaking it out into a separate script would be that in taking only one file and preforming in-place modifications to it, it would be breaking the conventions of the existing icsv2ledger command.)

As it stands, such duplicates may still be detected via --depreciated-md5, which is disabled by default so as to minimize the ironic 'duplication' of work entailed by checking for every hash every time. You could have this on by default to minimize the aforementioned potential for disruption to existing users.

All appropriate adjustments have been made to existing tests.

antler5 commented 1 year ago

I'll be coming back 'round to (h)ledger later this year, and while I plan on creating my own solution in the long term, I'd be glad to merge my existing PRs and to triage other issues in the meantime