From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 4A9041F910 for ; Sat, 26 Nov 2022 22:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbiKZWom (ORCPT ); Sat, 26 Nov 2022 17:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiKZWol (ORCPT ); Sat, 26 Nov 2022 17:44:41 -0500 Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0781414010 for ; Sat, 26 Nov 2022 14:44:39 -0800 (PST) Received: from 88-110-102-84.dynamic.dsl.as9105.com ([88.110.102.84] helo=[192.168.1.57]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1oz3uW-0002dP-Fk; Sat, 26 Nov 2022 22:44:37 +0000 Message-ID: <18530e26-3b36-9bc4-924c-f90084aabc9c@iee.email> Date: Sat, 26 Nov 2022 22:44:36 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v4] pretty-formats: add hard truncation, without ellipsis, options Content-Language: en-GB From: Philip Oakley To: Junio C Hamano Cc: GitList , Taylor Blau , NSENGIYUMVA WILBERFORCE References: <20221102120853.2013-1-philipoakley@iee.email> <20221112143616.1429-1-philipoakley@iee.email> <7a6c3d32-4494-e209-9877-e8784f0c3502@iee.email> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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.