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: Sun, 28 Aug 2022 03:40:13 +0300 Message-ID: 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> 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="1821"; 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 Sun Aug 28 02:41:10 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 1oS6MP-0000Ng-LE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Aug 2022 02:41:09 +0200 Original-Received: from localhost ([::1]:36578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oS6MO-0003Q4-II for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Aug 2022 20:41:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oS6MI-0003Pg-JG for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 20:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oS6MI-0006ud-Aw for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 20:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oS6MI-0002FT-2o for bug-gnu-emacs@gnu.org; Sat, 27 Aug 2022 20:41: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 00:41: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.16616472268592 (code B ref 52349); Sun, 28 Aug 2022 00:41:02 +0000 Original-Received: (at 52349) by debbugs.gnu.org; 28 Aug 2022 00:40:26 +0000 Original-Received: from localhost ([127.0.0.1]:57309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS6Lh-0002EV-RV for submit@debbugs.gnu.org; Sat, 27 Aug 2022 20:40:26 -0400 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:53177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS6Lf-0002E7-3a for 52349@debbugs.gnu.org; Sat, 27 Aug 2022 20:40:25 -0400 Original-Received: by mail-wm1-f48.google.com with SMTP id k17so2606213wmr.2 for <52349@debbugs.gnu.org>; Sat, 27 Aug 2022 17:40:23 -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=ps5B2QUZPUo9p4tr43U49YrW5fVcK5ikiNVhFraJypI=; b=gt9hHffcGK6zMNG/97Umy/qSFc1miB+nHFaokuAqpCgjNZ8aD9mCCPdLVvWdrirR4l iewsYemifoD/+ZJ58PliiHQC7xdnJXBRn4WsksGk6FIjBQ+lCHd0QWcXE9W8ccXQaxH/ jKsdgEc7Zl9y6HhUdHIN4hsorbAN6K4UKu/GxBU+LYyWUfhMEZV0kFU2gltm8mDlMGyD RiXTf96n+UdPt1ReZKUCQSdV1bbJ/iUb1VDOgcW4OWva7h/AvJqyCKA3whw3qNV8L2Yh CY9eEoo1PWd6/Q+uqB6m9KWJnkY7RueVkpKPNAkHGjmY/yHUt+nWXHBQ/bEqBuDZb64R aolg== 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=ps5B2QUZPUo9p4tr43U49YrW5fVcK5ikiNVhFraJypI=; b=rOjPBHpBDCM2ayNH8qeIfbYikG59UmmxCtXYn5zinhzhnPhraHEQVsnmOxd/t7gVXx vFEZKrFM9yygVzgAnnaElPSTQB0CATSGIf4PPcF3lHqeMfErCKfwwTuMtYGDWDZGvUM4 hA0GpheEUPD4GdXlFMmVvnLzAmUTn2yfPe/n0j9Oo21O6SiDhTX/ADh7f0otMsmnKMeE 1Kk2JmwnlVKTjRQEE0zg9M61J85dw05u5jK8Q5t9AUFyWPpZstSr3RbifSMwVdrichzt xcb+Bj7jBXfXAlo4/4LKAyX9XiQewLuPgqjBmMAdpqj4h9uOvvjme7Bd3vr8W1VjyWzS BeiQ== X-Gm-Message-State: ACgBeo3jRjvz832Tsw82t+h6tYnH+QE6Oo2R7tfqyjD6bl4Wkai/NM0j iA7AsuBw7S0k+PKGsBzJlH4= X-Google-Smtp-Source: AA6agR5Jf3dDI+ePjy+bmpanMOzP1fjOkox/u7oK1jmwbnPdlkXldC2dLB7aK065VerdgBlDUDR5kQ== X-Received: by 2002:a05:600c:206:b0:3a5:41f1:aa23 with SMTP id 6-20020a05600c020600b003a541f1aa23mr3371031wmi.31.1661647217130; Sat, 27 Aug 2022 17:40:17 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j18-20020a05600c191200b003a5c1e916c8sm23844102wmq.1.2022.08.27.17.40.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Aug 2022 17:40:15 -0700 (PDT) Content-Language: en-US In-Reply-To: <86ler9labz.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:240967 Archived-At: On 27.08.2022 23:07, Juri Linkov wrote: >>> @@ -944,6 +944,8 @@ vc-git-checkin >>> (let ((default-directory (file-name-directory file1))) >>> (make-nearby-temp-file "git-msg"))))) >>> (when vc-git-patch-string >>> + (unless (eq (vc-git-command nil t nil "diff" "--cached" "--quiet") 0) >>> + (error "Index not empty")) >> >> user-error, maybe? > > Will be fixed. > >>> (let ((patch-file (make-temp-file "git-patch"))) >>> (with-temp-file patch-file >>> (insert vc-git-patch-string)) >> >> Looking great otherwise. Please install whenever you think it's ready. > > Not yet great :) I tried to fix another long-standing problem > because its solution should also define the names of new functions here. > > 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. 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.