From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks Date: Mon, 29 Aug 2022 02:34:46 +0300 Message-ID: <310d5a9d-fbe4-4fd1-dcd0-34cf08388771@yandex.ru> References: <268cee0d-465d-b862-d1d6-f5da4d69e737@inventati.org> <9106387a-98cf-396f-bf45-ccb04581787b@yandex.ru> <864k7kfd56.fsf@mail.linkov.net> <86fsr3uen2.fsf@mail.linkov.net> <95d2d999-49ad-13c4-9f25-0935650a1e42@yandex.ru> <8635ktjfll.fsf@mail.linkov.net> <36b963e4-5af7-dd9e-af92-4404541b9f4d@yandex.ru> <86v8xjx45h.fsf@mail.linkov.net> <861qt9h1hh.fsf@mail.linkov.net> <864jy1mrk8.fsf@mail.linkov.net> <86ler9labz.fsf@mail.linkov.net> <8635dgkv80.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: 52349@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 29 01:35:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSRo9-0005Tk-Ub for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Aug 2022 01:35:14 +0200 Original-Received: from localhost ([::1]:41622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSRo8-0006vO-3k for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Aug 2022 19:35:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSRny-0006vG-UA for bug-gnu-emacs@gnu.org; Sun, 28 Aug 2022 19:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSRny-0003qz-Is for bug-gnu-emacs@gnu.org; Sun, 28 Aug 2022 19:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSRny-0001br-7N for bug-gnu-emacs@gnu.org; Sun, 28 Aug 2022 19:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Aug 2022 23:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52349 X-GNU-PR-Package: emacs Original-Received: via spool by 52349-submit@debbugs.gnu.org id=B52349.16617296986175 (code B ref 52349); Sun, 28 Aug 2022 23:35:02 +0000 Original-Received: (at 52349) by debbugs.gnu.org; 28 Aug 2022 23:34:58 +0000 Original-Received: from localhost ([127.0.0.1]:59736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSRnu-0001bX-IZ for submit@debbugs.gnu.org; Sun, 28 Aug 2022 19:34:58 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:53804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSRns-0001bI-7b for 52349@debbugs.gnu.org; Sun, 28 Aug 2022 19:34:56 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id h1so3483077wmd.3 for <52349@debbugs.gnu.org>; Sun, 28 Aug 2022 16:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc; bh=kGsNp0/hv6rLx/crt859qOouKGkmGzpUFxCpaVg7S60=; b=ZCDObY+7jBWVb4LWv9uxShPXhuhc12JMTh61ye/3zYH7eZNTUC2+uQhK6IdHCXYsxa iUbaY5JpFACGCXvOU/snbdIj3KoL2C32lhjz5NC7W5HdiGk+DERVtqPiI0WeQ/71vqkk vtWy5GCL1tFCd8bUEyIIwo3m0VaI1Xy50g5z36JbbdPNrYAJ7dUTMDIJPN7dNY5WDt3P 7w0XymFSKgKBqo/L1k3SCYaDAde8hULlXETSBes1BKDBS4sz3TLKXJXP8mHEgdEuMgYd HUMZqEKbpdS9nJEXn6a7Zhy4vIdAuCbeINTFvIwIc/2I1Vxw5uUJFFAfqkdofQpuWhz9 Y++A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc; bh=kGsNp0/hv6rLx/crt859qOouKGkmGzpUFxCpaVg7S60=; b=oaSilxEtAqRsKSAqH9pzuumFKnilTAUS5NOnO2oXD7aArb1kWUJu0y5s02IwXqobBe Fqm9hg2kktyGpiB4vdTXS/SPbolA83go4A3qnKn+AJxZEXkcblKYhCdmKYt8u1s+N+Ih R2i5YcKwdQqy7CbVYBDkuXBu/Y7B+mQhpzV8/ip5vIUFptaMcJR+OVcavu/jIQgDofN+ 7vh2PBLq4TglPtGsd+i3ZaU8llOXgRKqN6W1Eb3tAd5dpjaFp20DQ4YiLfxGs5Xgl5Id BxYWLVI1Ys7DNuIF03ETNtQeMlwjetNY/GBRMfi5TO1UfkRhldPqlIbwRk5/mug+byDi qaVA== X-Gm-Message-State: ACgBeo2dIHSop48sroE/L9tsvs2pZ3ZgbVfsk/IHOTtZfQc5kX/9GOG4 KC/Ep9IOIFvt7qiMR51CLxs= X-Google-Smtp-Source: AA6agR42uRWnLx35fUIam+gDvVlofKvqx7pBasP7SILtDeKFqYzxluvSFnAVQVYDUEqiFcIjBYGxdQ== X-Received: by 2002:a05:600c:1c8d:b0:3a6:8ef:f6c0 with SMTP id k13-20020a05600c1c8d00b003a608eff6c0mr5230362wms.23.1661729690232; Sun, 28 Aug 2022 16:34:50 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id c191-20020a1c35c8000000b003a608d69a64sm7067646wma.21.2022.08.28.16.34.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Aug 2022 16:34:49 -0700 (PDT) Content-Language: en-US In-Reply-To: <8635dgkv80.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240997 Archived-At: On 28.08.2022 22:45, Juri Linkov wrote: > close 52349 29.0.50 > thanks > >>> The problem is that currently using 'C-c C-d' (log-edit-show-diff) >>> in the *vc-log* buffer doesn't show the same diff that will be really >>> committed when different files were marked in *vc-dir* parent buffer >>> before typing 'C-c C-c' in *vc-log*. >>> This is because currently log-edit-diff-function is set to vc-diff >>> that is not suitable here since it tries to deduce fileset again >>> from *vc-dir*, but files to commit are set in the buffer-local >>> 'vc-log-fileset' in *vc-log*. So I added a new function >>> 'log-edit-diff-fileset' that shows the diff from 'vc-log-fileset'. >>> Using the same naming scheme, I renamed 'vc-diff-patch' to >>> 'log-edit-diff-patch'. >>> This shows the difference from the previous patch, >>> but later these changes could be committed separately: >> >> Makes perfect sense, thanks. > > So now pushed and closed. If more changes are needed, > this could be reopened or a new bug report opened. Seems to be working well. Thank you! >> Honestly, I think it's a long-requested advanced feature which we'd be >> happy to have even if there were rough edges remaining (as long as it >> doesn't corrupt users' files or otherwise loses changes, of course). But >> this seems to be coming along nicely. > > 'vc-finish-logentry' has such FIXME: > > (let ((logbuf (current-buffer)) > (log-operation vc-log-operation) > ;; FIXME: When coming from VC-Dir, we should check that the > ;; set of selected files is still equal to vc-log-fileset, > ;; to avoid surprises. > (log-fileset vc-log-fileset) > (pop-to-buffer vc-parent-buffer) > > I tried to fix this, but it requires duplicating too much code > from vc-next-action, including code that prepares 'ready-for-commit' > list of files. I'm afraid that such check often will raise > a false alarm. > > OTOH, maybe this check is not needed since I fixed 'C-c C-d' above > to show the same diff that will be committed using vc-log-fileset, > and 'C-c C-c' uses the same vc-log-fileset as well. Hopefully, yes.