From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#64055: [WIP Patch] Enable editing commit messages - vc-git-modify-change-comment Date: Tue, 01 Oct 2024 10:37:07 +0800 Message-ID: <87v7yco8fg.fsf@melete.silentflame.com> References: <0e2fda3f-7952-66d3-1b13-19ee31dbad7a@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10964"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: Dmitry Gutov , Morgan Smith , 64055@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 01 17:25:24 2024 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 1svekd-0002ik-Sl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Oct 2024 17:25:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svekV-0001zp-Mb; Tue, 01 Oct 2024 11:25:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svekJ-0001wB-OW for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2024 11:25:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svekI-0004ey-QN for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2024 11:25:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Dc2W2rYna/AeaIqmQiX7cvir9TC7iSNSzAjxkpCArk8=; b=schi28sO6Y5mtN4U7o1HMdUcYtclF5SnZcCB7fAPd19CuSAshl2Wk2Xm2x8+In3tXe3jFJFgBCH8nOgy7sDxQOjPKn3uzKt6Aqd+JP7ihFGLLGuaTCnVu3vEUZ76tO2pz9iZvL2/uQv9QOgpeDEjyQQd0cdlYyNRiz/PYWRB3sOdtPRwefkLkP/3SHSQtDewUip8lBwqmAvFmifenuwzxkJZsjz7mZde2O2XL26wISQqVCvl9u39tfFEdz+Qjr2ow47aFhtol4Vu+nWqPVpbhy7+yxdsgJBAXUzmAmp7IFDi/Gv9uZ+5Cy2vBUjYNvitob7JAXmvojOu8N6nk9xsJw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svekH-00054M-Ue for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2024 11:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Oct 2024 15:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64055 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64055-submit@debbugs.gnu.org id=B64055.172779626419461 (code B ref 64055); Tue, 01 Oct 2024 15:25:01 +0000 Original-Received: (at 64055) by debbugs.gnu.org; 1 Oct 2024 15:24:24 +0000 Original-Received: from localhost ([127.0.0.1]:52057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svejf-00053p-If for submit@debbugs.gnu.org; Tue, 01 Oct 2024 11:24:23 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:41760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svejd-00053j-9X for 64055@debbugs.gnu.org; Tue, 01 Oct 2024 11:24:21 -0400 DKIM-Signature: a=rsa-sha256; b=BxfqB8Wq9AgLilqOD+P2hf7EoA3H9xEZhpl95yl0s1bnRlBCK1sFkTiyCGTnT7EPDznTqr0UmZA4D7q0MX5qK4AazLs8P3QpEreE6//TDtr/xg5tLjuN0IbSMb3jEESvrsp5q2IT8jby53lf16JyxPcsLWJFYhE9xkJKvNf330Qd5k5JTYgygN6eplAj440JG8GdYfQB7a9t5jXUHpjMGlVpxWcYr7C2jfIzRL4AD+1mFWgmMIfP7L6H4zMYCjiBA6HiZsT6WfFBXn8sJ+ag/U8QrlnhiLNrcNub7WpKB06J8B2lpGzuLO5omUUAP7jKOKqHyaaBGwTaDTViKmA+hw==; s=purelymail2; d=spwhitton.name; v=1; bh=/5YghpOWhCljhRghKiZaFLj4sXQUccJ4M8mNE6bo8Fs=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=iPqo1I6UYkdGREm1gtHB+MCjlFzR2bokjEgDTUoVVlpJInkeidsSN/+M6/vwYBUPCffaS1zVx4qGvWrMfY4uZIWRNmAlBPlOAdBZjCPlKoK/6Ri+YZvc3Wz3Nywty8ewd2tfrrXE5LfIGDMr/tOB71/Pk0RG8JKVbTVSEVjprcy3dajgBpozuTRZGDV+Rsiup484h2dB3yKhowaUqK6kTJUK/IZEC0JHNdhn9SE/p6/jzTCPZJQygi4oR9/VudDZztSCk1Wr7h/P+TtBlSkL/GMQleSO2056e5JnPZv6tiHnzu8L/E0ilIMc/1VLXIhyfNa+awjohfCUdcv1N/cp4w==; s=purelymail2; d=purelymail.com; v=1; bh=/5YghpOWhCljhRghKiZaFLj4sXQUccJ4M8mNE6bo8Fs=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 64055@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 791778498; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 01 Oct 2024 15:24:16 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 9BE987E38CF; Tue, 1 Oct 2024 16:24:13 +0100 (BST) Resent-To: Morgan Smith , 64055@debbugs.gnu.org Resent-From: Sean Whitton Resent-Date: Tue, 01 Oct 2024 23:24:13 +0800 Resent-Message-ID: <874j5vn8wy.fsf@melete.silentflame.com> In-Reply-To: <0e2fda3f-7952-66d3-1b13-19ee31dbad7a@gutov.dev> (Dmitry Gutov's message of "Sat, 17 Jun 2023 05:40:09 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292766 Archived-At: Hello, On Sat 17 Jun 2023 at 05:40am +03, Dmitry Gutov wrote: > We could do something like this: take the remote branch associated with the > current branch, and its top commit. And then, somehow, see if the commit to be > edited is reachable by traversing up history. > > There likely are some known Git snippets out there on SO or general Internet > that do these steps, but I haven't looked yet. > > Anyway, we could do this check first thing inside vc-git-modify-change-comment > and, when the operation is dangerous, doubly prompt the user whether they want > to proceed. I think that we refuse to proceed, or at least ask for confirmation, in the case that the commit the user wants to edit does not appear in *vc-outgoing* (C-x v O). The difficulty of prompting is that the prompt has to be short to fit in the echo area. But something like This commit is published; are you sure you want to rewrite history? is only explanatory to someone who already has a lot of git-specific knowledge. So, by default, we I think we should refuse to rewrite any commit that does not appear in *vc-outgoing*. Then there could be a defcustom to enable a yes/no prompt (or to enable unconditionally rewriting). In the docstring for the defcustom we could provide a reference to the relevant git documentation, so the user can find out what this notion of "rewriting history" is all about. -- Sean Whitton