From: Philip Oakley Date: Sat, 26 Nov 2022 22:44:36 GMT Subject: Re: [PATCH v4] pretty-formats: add hard truncation, without ellipsis, options Message-ID: <18530e26-3b36-9bc4-924c-f90084aabc9c@iee.email> In-Reply-To: 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.