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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 0D97D1F8C6 for ; Wed, 8 Sep 2021 17:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350206AbhIHRZJ (ORCPT ); Wed, 8 Sep 2021 13:25:09 -0400 Received: from bsmtp1.bon.at ([213.33.87.15]:35319 "EHLO bsmtp1.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231723AbhIHRZE (ORCPT ); Wed, 8 Sep 2021 13:25:04 -0400 Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp1.bon.at (Postfix) with ESMTPSA id 4H4TWX2hgrz5tl9; Wed, 8 Sep 2021 19:23:52 +0200 (CEST) Subject: Re: diff-index --cc no longer permitted, gitk is now broken (slightly) To: Sergey Organov Cc: Junio C Hamano , Jeff King , Paul Mackerras , Git Mailing List References: <87h7f4tf0b.fsf@osv.gnss.ru> <87pmtjkwsj.fsf@osv.gnss.ru> From: Johannes Sixt Message-ID: Date: Wed, 8 Sep 2021 19:23:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87pmtjkwsj.fsf@osv.gnss.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 08.09.21 um 15:43 schrieb Sergey Organov: > Besides, nobody yet told us why gitk uses --cc option in invocation of > 'diff-index' in the first place. Does it actually *rely* on particular > undocumented behavior of "diff-index --cc", or is it just a copy-paste > *leftover*? No, it is not a left-over. The thing is, - there is one point in the code where gitk adds options -p -C --cc (and more) to the command line (around line 8034), - and there is a totally different point in the code where it is decided whether diff-index, diff-tree, or diff-files is invoked (proc diffcmd around line 7871). IOW, Gitk expects that these option combinations can always be passed to all three commands. Gitk does not want to look at a commit and then decide which incarnation of the command it wants to use (--cc vs. -p) depending on whether it is a merge commit or not. This decision is delegated to command that is invoked. Therefore, silent fall-back from --cc to -p in case of non-merge commits or non-conflicted index is absolutely necessary. -- Hannes