From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#38343: 27.0.50; vc git: Cannot edit outgoing log (like git commit --amend) Date: Thu, 28 Nov 2019 00:08:40 +0200 Message-ID: <85bba360-2a57-63b8-d82f-3ed7bcd8bee1@yandex.ru> References: <18f1bbf5-46ad-99e5-51dc-1bd9ddfece33@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="33179"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: 38343@debbugs.gnu.org To: Fredrik Nyqvist Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 27 23:09:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ia5Ur-0008Wm-21 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Nov 2019 23:09:17 +0100 Original-Received: from localhost ([::1]:43658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia5Up-0007i4-Hw for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Nov 2019 17:09:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37441) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia5Uf-0007cy-8m for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 17:09:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ia5Uc-0004px-UE for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 17:09:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ia5Ub-0004p5-U8 for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 17:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ia5Ub-00021R-QF for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 17:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Nov 2019 22:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38343 X-GNU-PR-Package: emacs Original-Received: via spool by 38343-submit@debbugs.gnu.org id=B38343.15748925307754 (code B ref 38343); Wed, 27 Nov 2019 22:09:01 +0000 Original-Received: (at 38343) by debbugs.gnu.org; 27 Nov 2019 22:08:50 +0000 Original-Received: from localhost ([127.0.0.1]:56339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia5UQ-000210-9X for submit@debbugs.gnu.org; Wed, 27 Nov 2019 17:08:50 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:55835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia5UO-00020j-Jj for 38343@debbugs.gnu.org; Wed, 27 Nov 2019 17:08:49 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id a131so4511167wme.5 for <38343@debbugs.gnu.org>; Wed, 27 Nov 2019 14:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9CrFllfYrBjGIMtMPhuKEAKkX6jpJ82KxyUlGt1ltzU=; b=owSU0UkjhccH644dfYyhcVP+qdzWdhd8WhWv0fo5PzwjdjTlJ6NBgNczhySJ/P6IRV sFnnBoblh0EAlx3VlT/RNwAv4+HFAqUFH3LUMBJVkJ+eqcfRjYZ/qZF+7vytOEBcUbQN 8a8qCUL+mTN0crMGXjKcnpBcXyq/3FBB6scIpfKhzzdzaCAUJmsE+1S7mdJEiux+N5VS cquRSh/bBqFfrNk2gqHvHjIgCGCTZcpFWU9QqmO+2SIVKREmDerWO2CCTa6qAQE1SSbI 9B3UdN1fFPtvfGD9jsKYX9ODfOoWk52ys6iRq1sQ+0MxNKDkr6TTZndQHSwoaWxRYJJF RtFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9CrFllfYrBjGIMtMPhuKEAKkX6jpJ82KxyUlGt1ltzU=; b=q/f/7Z8XNd6hoNxYBo8zVZxt+9ZEjMHXpIoQ9zWIUw1cV9SovbP5TDD8SN8fKL1azL JgqVMMlSctTWsOapFjG7f0sb/S8jFImIn7sSqYZmc8oO7pexZzBTctRv1RrYm1WK4tXF pTZxe/6kwXKGRmnbW8G9bY0yEDPfueSXE7gEee/GZfenjQR5bJg3EK3FbhakZQsxdOhs zV/uV32dDkcCB0/5no4QKjoO8Zy1sl+70PYb2Ntyf1DGX26GIrnqlyhlJtDbWvH+u6u3 oVb/SK5XgLHW2M+jwk8lYF6hlAMT7loU2J2TwSOTUH/NtP83+Z/XkubwKOboWGgtNI5G Yq4A== X-Gm-Message-State: APjAAAWaBQ4VEKHn2ZeGjNotNOlehj30WVLB0eneS/vg2aQwrbPVE+VK bUzjwzcJZYo57XtbY3xo7iA= X-Google-Smtp-Source: APXvYqyMhJfYeiSaOig4sS5LyL5nb1J2afJOZ3AfC7rGI2XqgWPzTV3pOP6jx63mXc/VfM2nNZs1qA== X-Received: by 2002:a1c:6144:: with SMTP id v65mr6612032wmb.53.1574892522782; Wed, 27 Nov 2019 14:08:42 -0800 (PST) Original-Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id u16sm20780578wrr.65.2019.11.27.14.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2019 14:08:42 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172568 Archived-At: On 27.11.2019 22:11, Fredrik Nyqvist wrote: > > > Den ons 27 nov. 2019 kl 01:10 skrev Dmitry Gutov >: > > On 26.11.2019 22:43, Fredrik Nyqvist wrote: > > Den mån 25 nov. 2019 kl 23:49 skrev Dmitry Gutov > > > >>: > > > >     On 25.11.2019 22:16, Fredrik Nyqvist wrote: > >      > Yes, I have tried the option you mention to edit the last > commit > >     with > >      > C-x C-e and it is working fine. > >      > But It seems that it only allows amending the last commit > if I have > >      > edited a file. > > > >     Yes. Not sure how to change an arbitrary commit in Git anyway > (without > >     interactive rebase). The best approximation looks like this: > > > > https://stackoverflow.com/a/48999882/615245 > > > > > > I am not sure how to do it in a good way either. Maybe the option to > > edit an > > older commit message could be skipped for vc-git. And then just > allow amend > > on the latest one. > > The question is how to skip. Error in the end, after the user has > already written the new commit message? > > Or add a backend predicate action, like "can edit revision ##". That's > one more action, though. > > > If the user is trying to edit an older commit message from the > log-buffer (with log-view-modify-change-comment) I think an error > message is good, before writing the commit message ("can't edit revision > ##"). I feel that it will be more clear at least. Then it seems like we'd also have to introduce a new predicate backend action (like "can I edit this revision"). Given a recent discussion with our maintainer, I'm not confident we're allowed to do that. > Also we should think about how to handle a commit that has already been > pushed. In this case I guess a force push is needed, but maybe that is > not good to hide. Maybe it is better to just allow edit on local commits > then. Yeah, it's going to be a choice. Sometimes editing even a commit that's been pushed is okay (if it's on a personal branch). We already allow doing that with 'C-x C-e', so I'd rather we only gave out a warning (with yes-no prompt). The aforementioned predicate could do that job, too.