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: Thu, 28 Nov 2019 21:48:57 +0100 Message-ID: References: <18f1bbf5-46ad-99e5-51dc-1bd9ddfece33@yandex.ru> <85bba360-2a57-63b8-d82f-3ed7bcd8bee1@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000aa8ff805986e3e17" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="156564"; 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 Thu Nov 28 23:31:23 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 1iaSJm-000eZZ-TE for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Nov 2019 23:31:23 +0100 Original-Received: from localhost ([::1]:53722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaSJj-0004O3-Nc for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Nov 2019 17:31:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54849) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaQjs-0006hJ-Fz for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 15:50:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaQjl-00007i-Q6 for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 15:50:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iaQjk-0008SB-El for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 15:50:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iaQji-0005Vo-8R for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Fredrik Nyqvist Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Nov 2019 20:50:02 +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.157497416121128 (code B ref 38343); Thu, 28 Nov 2019 20:50:02 +0000 Original-Received: (at 38343) by debbugs.gnu.org; 28 Nov 2019 20:49:21 +0000 Original-Received: from localhost ([127.0.0.1]:59177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaQj2-0005Ue-Dn for submit@debbugs.gnu.org; Thu, 28 Nov 2019 15:49:20 -0500 Original-Received: from mail-qk1-f181.google.com ([209.85.222.181]:40736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaQix-0005UM-Is for 38343@debbugs.gnu.org; Thu, 28 Nov 2019 15:49:17 -0500 Original-Received: by mail-qk1-f181.google.com with SMTP id a137so21967240qkc.7 for <38343@debbugs.gnu.org>; Thu, 28 Nov 2019 12:49:15 -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=Z0LcrFXlOpZVcNNEpPc2oBE9t9pw8DF3keE9I0lDX1Q=; b=kcwIjJth1lJbaS4cH6uI1Kg6HbRkFlGXv/4X2BsRg2LPSm+mYhcT8wGekJqANhMtea fSR4suQDpQxECMVONGH5t9+clFNbUg5l/7bMwQM3bSoXXdvJ7n7CTlIFgdyvDjsZYCUN bndQcPKcXuhJDTZSSFfrl697T3+17ny8sRetw8WtDdnKw2g3iY2b64OE8uBPfWjKiXCz RLuAjcXu1QYfJQCVlL4W4m7tUWJi2fih9khdsMZj3mMOecX7oaSucHetiztAShzLPuy7 b8fxHafPXRsud+xwIVIC4uQmWX25h0Tyrrq6nvyeopOXXzwuTCQYyQojtXh7jKUbilhI v8wg== 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=Z0LcrFXlOpZVcNNEpPc2oBE9t9pw8DF3keE9I0lDX1Q=; b=HMV9vQAdXbHdbN03O3Xa85T7ZU5/h6ATZekneBiYbGPlKc85FsCjjiGKi9u0SzdIvW pQc2Nyb4aPkVuLo1d98swYNaSTransqZiHJNEgBT4DXnXyipHiV5QuMgNc/opTfNtxK9 H/dPsCUCMWhEPfLaQClPsEJqsb63kY2/Evkh77Sceb4zGfXmp/c+uxX4T4AD070vRzzM 5DRxPT92ZcvL2mQG2j2RujrNFmE/n9gB9ifHH2yPECJXJZY24bbe5AjEvoPgxPbAgmtb Bo3XVHXw9uLQa2QJKOMNmZHPtprsjIFifZxxWZj0KVndeadgozZ5pXzzvOxAf5dTfZc4 T6nw== X-Gm-Message-State: APjAAAUANK6a4e2KuDriioiPtif//S9T3aTZT4rxBP9bGpZFH3+Q3tl8 doZuF6t03PKltpfOQKKZW5pwx2P2qXBJ6AltrFY= X-Google-Smtp-Source: APXvYqzIDqLdBBNv8XSGdRs2M35M+ubfwgsijWvP+IZWQSRDrtUeJy8HYrIKUxhLqsPFyOAhn2kGI9X8XHUbHwKDiSY= X-Received: by 2002:a37:514:: with SMTP id 20mr10108799qkf.321.1574974148741; Thu, 28 Nov 2019 12:49:08 -0800 (PST) In-Reply-To: <85bba360-2a57-63b8-d82f-3ed7bcd8bee1@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:172625 Archived-At: --000000000000aa8ff805986e3e17 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Den ons 27 nov. 2019 kl 23:08 skrev Dmitry Gutov : > 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=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 anywa= y > > (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 optio= n > 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 revisio= n > > ##"). 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. > > OK I understand. > > 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 commit= s > > 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= . > That sounds good to me. At least so that log-view-modify-change-comment works the same way as 'C-x C-e'. --000000000000aa8ff805986e3e17 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Den ons 27 nov. 2019 kl 23:08 skrev Dmitry Gutov <dgutov@yandex.ru>:
On 27.11.2019 22:11, Fredrik Nyqvist wro= te:
>
>
> Den ons 27 nov. 2019 kl 01:10 skrev Dmitry Gutov <dgutov@yandex.ru
> <mailto:dguto= v@yandex.ru>>:
>
>=C2=A0 =C2=A0 =C2=A0On 26.11.2019 22:43, Fredrik Nyqvist wrote:
>=C2=A0 =C2=A0 =C2=A0 > Den m=C3=A5n 25 nov. 2019 kl 23:49 skrev Dmit= ry Gutov
>=C2=A0 =C2=A0 =C2=A0<dgutov@yandex.ru <mailto:dgutov@yandex.ru>
>=C2=A0 =C2=A0 =C2=A0 > <mailto:dgutov@yandex.ru <mailto:dgutov@yandex.ru>>>:
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0On 25.11.2019 22:16, Fredr= ik Nyqvist wrote:
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 > Yes, I have tried th= e option you mention to edit the last
>=C2=A0 =C2=A0 =C2=A0commit
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0with
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 > C-x C-e and it is wo= rking fine.
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 > But It seems that it= only allows amending the last commit
>=C2=A0 =C2=A0 =C2=A0if I have
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0 > edited a file.
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0Yes. Not sure how to chang= e an arbitrary commit in Git anyway
>=C2=A0 =C2=A0 =C2=A0(without
>=C2=A0 =C2=A0 =C2=A0 >=C2=A0 =C2=A0 =C2=A0interactive rebase). The b= est approximation looks like this:
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 > https://stackoverflow.com/a= /48999882/615245
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 > I am not sure how to do it in a good way eith= er. Maybe the option to
>=C2=A0 =C2=A0 =C2=A0 > edit an
>=C2=A0 =C2=A0 =C2=A0 > older commit message could be skipped for vc-= git. And then just
>=C2=A0 =C2=A0 =C2=A0allow amend
>=C2=A0 =C2=A0 =C2=A0 > on the latest one.
>
>=C2=A0 =C2=A0 =C2=A0The question is how to skip. Error in the end, afte= r the user has
>=C2=A0 =C2=A0 =C2=A0already written the new commit message?
>
>=C2=A0 =C2=A0 =C2=A0Or add a backend predicate action, like "can e= dit revision ##". That's
>=C2=A0 =C2=A0 =C2=A0one 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 ed= it 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 discussi= on with
our maintainer, I'm not confident we're allowed to do that.

OK I understand.
=C2=A0
> Also we should think about how to handle a commit that has already bee= n
> 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 commi= ts
> then.

Yeah, it's going to be a choice. Sometimes editing even a commit that&#= 39;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 war= ning
(with yes-no prompt). The aforementioned predicate could do that job, too.<= br>
=C2=A0
That sounds good to me. At least so t= hat log-view-modify-change-comment works the same way as 'C-x C-e'.=
--000000000000aa8ff805986e3e17--