Re: [PATCH v4] pretty-formats: add hard truncation, without ellipsis, options
- From
Philip Oakley <philipoakley@iee.email>
- Date
- Nov 26, 2022, 22:44 UTC
- Message-ID
- <18530e26-3b36-9bc4-924c-f90084aabc9c@iee.email>
- In-Reply-To
- <f0923db4-7bfe-86d2-7539-c9ebed62fa4f@iee.email>
On 26/11/2022 14:32, Philip Oakley wrote:
> A careful read (and testing) of the existing 'mtrunc' does show a > rounding error bug though. Its a confusion between the computed start > and end points of the cut that loses one display column (the string > displayed is short by one when the count is odd, IIUC).
I had confused myself.
My test case `git log --graph --format="%<(19,mtrunc)%d=2" -6` had a 2-char step in the graph that I confused with the effects between repeated runs with the 'N' value adjusted by +1 and -1.
I then jumped to conclusions about the integer division in the mid string position of the mtrunc case win the code.
Sorry for that.