From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Fredrik Nyqvist Newsgroups: gmane.emacs.bugs Subject: bug#38343: 27.0.50; vc git: Cannot edit outgoing log (like git commit --amend) Date: Wed, 27 Nov 2019 21:11:36 +0100 Message-ID: References: <18f1bbf5-46ad-99e5-51dc-1bd9ddfece33@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000037e7040598599b47" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="39043"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38343@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 27 21:12:12 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 1ia3fY-000A3H-9Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Nov 2019 21:12:12 +0100 Original-Received: from localhost ([::1]:42970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia3fW-0000uM-Ku for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Nov 2019 15:12:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38765) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia3fP-0000sL-Im for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:12:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ia3fO-0001kH-7a for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ia3fO-0001jk-1C for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ia3fN-0005Y1-RP for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Fredrik Nyqvist Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Nov 2019 20:12: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.157488551421309 (code B ref 38343); Wed, 27 Nov 2019 20:12:01 +0000 Original-Received: (at 38343) by debbugs.gnu.org; 27 Nov 2019 20:11:54 +0000 Original-Received: from localhost ([127.0.0.1]:56248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia3fG-0005Xd-87 for submit@debbugs.gnu.org; Wed, 27 Nov 2019 15:11:54 -0500 Original-Received: from mail-qk1-f176.google.com ([209.85.222.176]:47037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia3fE-0005XR-OK for 38343@debbugs.gnu.org; Wed, 27 Nov 2019 15:11:53 -0500 Original-Received: by mail-qk1-f176.google.com with SMTP id f5so2325789qkm.13 for <38343@debbugs.gnu.org>; Wed, 27 Nov 2019 12:11:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fWcDHoqogPJ68SqfOKJt/rM3GYk6fJzU9WrAeUFV5eM=; b=aseYK9lebYHoC2p+lL3S6NeD5m2wKkFSlr6kbBLNv73Oq5XBzjpCVoPz3pA1YBfBPS 2uCcRLC34PdwPtfPINLOqDScWKD3UZdMT3A5V357sFgf4mSEIXDKdC7bgYfUnGRKjY/J 8Z9UyIF5Q7OZfsfduSs5GccRP9WCd3HHcu7POakFVFMe9BMrpczAv173CzqwCSkvs9SF dR5v5/0Z1/Sc3DTa6OEeIKJ9m3ql7DWUKMy9MQzR7v5L5p2hAOqbjX2geCpJOWRWbh0F pDpqc0XrM/iiRYZVxmP2eKGXp4N1TiM9xaiFSooZ2t3Zz7qwrBil01ICpyvc0UBDMkyW Xofw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fWcDHoqogPJ68SqfOKJt/rM3GYk6fJzU9WrAeUFV5eM=; b=S4ZtR01ZjcCzHEEL+5BmECMJthb8GtbQK+QTOHKU1akTZnpvFxj2Jj7qKf3DG/FgtX rKdqAdqKEQiSL9G1gT8XyCVlDwKyWsjQwdBGmSGv57MgvFALy1Kbij6Jt/E1bLHRNcZF bTxF0dUhmlJiio67y5Pv2HEA1V9cTaJ+xBPcaJiJUeXu4x8hRlZ38mT7AzuDTZOWF7Uy Ym+fzsl/nPDUFxc6NV14vmGiJrPLwez2pdCD/O1mgF/7HS3X5UY5P+du1A5IHpIrPkx1 DAylheDBob96ZxV8XlTtPlS4VAzEH7KVrfPHUucgNFZnLT+51ofsoskqbUtbf+J+uG06 4hKQ== X-Gm-Message-State: APjAAAUt1/Te0tZzDJYM2QuQ8dJCymxwhG9gCqru8+Cmjflalqatmkl8 af9sjKx+70woXSg7RCl9qCvyKle/cWpx396GC/c= X-Google-Smtp-Source: APXvYqwTKuuRLhZVjAO0Auk6amNzGr5kEx/nA88oIrWZFDhdmLxdaoE/raWFzjM/DeQmi0/TYyGeR56xFUQcVsQ08BM= X-Received: by 2002:a05:620a:12cb:: with SMTP id e11mr6457480qkl.247.1574885507195; Wed, 27 Nov 2019 12:11:47 -0800 (PST) In-Reply-To: <18f1bbf5-46ad-99e5-51dc-1bd9ddfece33@yandex.ru> 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:172556 Archived-At: --00000000000037e7040598599b47 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Den ons 27 nov. 2019 kl 01:10 skrev Dmitry Gutov : > On 26.11.2019 22:43, Fredrik Nyqvist wrote: > > Den m=C3=A5n 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. 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. --00000000000037e7040598599b47 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
Den ons 27 nov. 2019 kl 01:10 skrev D= mitry Gutov <dgutov@yandex.ru>= ;:
On 26.11.2019= 22:43, Fredrik Nyqvist wrote:
> Den m=C3=A5n 25 nov. 2019 kl 23:49 skrev Dmitry Gutov <dgutov@yandex.ru
> <mailto:dguto= v@yandex.ru>>:
>
>=C2=A0 =C2=A0 =C2=A0On 25.11.2019 22:16, Fredrik Nyqvist wrote:
>=C2=A0 =C2=A0 =C2=A0 > Yes, I have tried the option you mention to e= dit the last commit
>=C2=A0 =C2=A0 =C2=A0with
>=C2=A0 =C2=A0 =C2=A0 > C-x C-e and it is working fine.
>=C2=A0 =C2=A0 =C2=A0 > But It seems that it only allows amending the= last commit if I have
>=C2=A0 =C2=A0 =C2=A0 > edited a file.
>
>=C2=A0 =C2=A0 =C2=A0Yes. Not sure how to change an arbitrary commit in = Git anyway (without
>=C2=A0 =C2=A0 =C2=A0interactive rebase). The best approximation looks l= ike this:
>
>=C2=A0 =C2=A0 =C2=A0https://stackoverflow.com/a/48999= 882/615245
>
>
> I am not sure how to do it in a good way either. Maybe the option to <= br> > 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 ##". T= hat'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 wi= ll be more clear at least.

Also we should think ab= out how to handle a commit that has already been pushed. In this case I gue= ss 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.
--00000000000037e7040598599b47--