From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Amending commits Date: Sun, 25 Sep 2022 20:17:40 +0000 Message-ID: References: <87h70vbw2f.fsf@gnus.org> <877d1ru3rd.fsf@posteo.net> <87zgenr812.fsf@gmail.com> <7a1185d7c76d3e55bc78@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14153"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , Visuwesh , Philip Kaludercic , Lars Ingebrigtsen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 25 22:20:10 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ocY6j-0003a1-RT for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Sep 2022 22:20:09 +0200 Original-Received: from localhost ([::1]:49636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocY6i-0000D7-EQ for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Sep 2022 16:20:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocY4b-0007IN-Jm for emacs-devel@gnu.org; Sun, 25 Sep 2022 16:17:57 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:24201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocY4Z-0005Zx-2s for emacs-devel@gnu.org; Sun, 25 Sep 2022 16:17:57 -0400 Original-Received: (qmail 73798 invoked by uid 3782); 25 Sep 2022 22:17:41 +0200 Original-Received: from acm.muc.de (p2e5d53a5.dip0.t-ipconnect.de [46.93.83.165]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 25 Sep 2022 22:17:41 +0200 Original-Received: (qmail 11285 invoked by uid 1000); 25 Sep 2022 20:17:40 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296233 Archived-At: Hello, Stefan. On Sun, Sep 25, 2022 at 15:26:39 -0400, Stefan Monnier wrote: > >> As someone who does not really understand Git, does this mean we are > >> rewriting the log message without also committing a change? I thought > >> that was not allowed by Git. > > git commit --amend is mainly used to change a commit before pushing > > it. Rewriting history (i.e. changing an already public commit) is (by > > default) not possible. > When people say that in Git you cannot rewrite history, what it means is > that you can't change anything about a given *commit id* (aka > "revision"). > Of course, you can create a new revision (i.e. a different commit id) > with any content you like. Things like `rebase` and `filter-repo` are > more general version of `commit --amend` and work in the same way, by > writing a whole new history. At the risk of drifting off topic, this is a misfeature of git (and other VCSs). When people commit software changes, and get it wrong, this can be fixed by another commit. When people commit software changes and get the commit message wrong, this cannot be fixed. Whether it be misspelling somebody's name, missing out the bug number, or whatever, mistakes can't be corrected. This seems to have been caused by a misunderstanding by the authors of git (and other VCSs), who thought that the commit message was a fundamental part of the commit. It's not, any more than the label on a bottle of beer is part of the beer. You don't drink labels, just as you don't ship commit messages to the users of (binary) software. Those authors thought that nobody makes mistakes in their commit messages. Or at least, nobody that matters. They, of course, never make such mistakes themselves. ;-) It would have been a simple enough matter, in a VCS, for the commit message for a specific commit itself to have had revisions. Instead, we have repositories filled with unfixable errors. Rant over. > Stefan -- Alan Mackenzie (Nuremberg, Germany).