From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: ChangeLog and commit messages Date: Tue, 20 Jun 2023 01:18:42 +0300 Message-ID: <127bdef7323f0285902a61bbd05f116e042287ec.camel@yandex.ru> References: <87a5wxb5sl.fsf.ref@yahoo.com> <87a5wxb5sl.fsf@yahoo.com> <837cs1p6bf.fsf@gnu.org> <875y7lb4k7.fsf@yahoo.com> <327d575ab075bf4e92ca00c11548a62458fec75b.camel@yandex.ru> <87r0q86zvd.fsf@yahoo.com> <87jzw06j1y.fsf@yahoo.com> <615704a18abdc3880a7e637e1903b81bcc9e50c8.camel@yandex.ru> <87zg4v69v7.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36303"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.3 Cc: Eli Zaretskii , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 20 00:20:00 2023 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 1qBNE7-0009CQ-QB for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Jun 2023 00:19:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBND2-0000zv-Om; Mon, 19 Jun 2023 18:18:52 -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 1qBND1-0000zQ-Mb for emacs-devel@gnu.org; Mon, 19 Jun 2023 18:18:51 -0400 Original-Received: from forward502c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d502]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBNCy-0007UJ-Og; Mon, 19 Jun 2023 18:18:51 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-18.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-18.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:5e29:0:640:6b8b:0]) by forward502c.mail.yandex.net (Yandex) with ESMTP id 1C6B15EA57; Tue, 20 Jun 2023 01:18:43 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-18.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id gIp4fwkDe8c0-wQ6XXb1c; Tue, 20 Jun 2023 01:18:42 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687213122; bh=kDt5o39yDsK+RRZ1wL2bI4UfoSgRPip93eZZHyltX7M=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=bDb6OIgqkaLSpem2FVqWUi02TIgKMgLOip3EdnD7oUzFKgUWYcXUJBZTqGik2wCYx yXqPuGvr4juGq67kONReHSTjPBiTh657e2f1pSLHwuZB1+DwslWeYFltBHV72dASUE fuxXIl8DnE2lnljnsQ6pK6fY+Ad96/OyBzAULJ6g= Authentication-Results: mail-nwsmtp-smtp-production-main-18.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <87zg4v69v7.fsf@yahoo.com> Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d502; envelope-from=hi-angel@yandex.ru; helo=forward502c.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307063 Archived-At: (I apologise in advance, I likely to be slow to answer) On Mon, 2023-06-19 at 18:10 +0800, Po Lu wrote: > Konstantin Kharlamov writes: >=20 > > (actually, it turns out I did work with SVN in my first job. But it was= n't > > the > > only VCS we used, so I remember close to nothing about that =F0=9F=98= =85) >=20 > I'm thinking about RCS and its relatives. >=20 > > Thanks, I see this commit, I'm looking. >=20 > There are many different commits with this title.=C2=A0 The last change w= as > small, but others cannot be split up: look near the start of the branch > point for an example. Okay, so, it might be more efficient if you point me at a specific commit y= ou have in mind. Does this one work, for example? https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=3Dfeature/android&id= =3D5b4dea0fc781fe40548e7b58fe5bd201a05f3913 > BTW, this brings up another problem with Git: it isn't possible to > determine the branch point (or even the branch name) of a revision from > the name of that revision alone. Oh, yeah. I imagine this could come in handy, for example to remove merged = local branches. I have so many at work, but it's often very hard to automatically determine which ones had been merged, because commits ID often change upon = merge through rebase. OTOH, if a project have many thousands of commits, like Linux kernel, this = may become a problem as your name may clash with another one for legitimate reasons.=C2=A0And I also had on a few occasions multiple branches where com= mit with the same title had different content (again, for legitimate reasons: I was experimenting with different approaches, and only one of these commits made= it upstream in the end. Final commit likely had title changed, but I still hav= e other "testing" commits locally). So=E2=80=A6 I would say whether it's better is debatable. > > So=E2=80=A6 From what I can see you have two separate changes in this c= ommit. One is > > "Only access width and height under lock", and another one=E2=80=A6 it = is some > > algorithmic change in the `onLayout()`, which I didn't study too closel= y, > > but > > looking at the commit description I'm assuming it is "Send Expose upon > > layout > > changes if the view has grown". > >=20 > > The problem you have here with making up a title is because you've got = two > > different functional changes inside one commit. Note that you had no tr= ouble > > writing what has changed inside the commit message. So, had you separat= ed > > the > > commit to two different ones, you would've gotten a commit title for fr= ee > > just > > by looking at your commit message =F0=9F=98=8A > >=20 > > When someone mixes up different functional changes, all they can give a= s a > > title > > is just "Refactor foo.c" or "Rework bar" or "Fix buzz". When later look= ing > > at > > the shortlog these are pretty unhelpful titles, because it often says v= ery > > little about what really was done in the code. >=20 > Which is the problem with the ``shortlog'' concept: detailed > descriptions of these changes should be placed in ChangeLog, and the VCS > should concentrate on tracking revisions to each file. Sorry, I may be missing something. You said "this is the problem" which imp= lies the problem should be obvious from the context, but I struggle to see it. S= ome additional details may help. We can discuss a workflow with placing entries to a Changelog file as compa= red to usual git workflow, if you want. I'm just not sure if you're interested = in that. > > It is worth noting that although Emacs does allow mixing up many change= s in > > one, > > a generally accepted good practice is to avoid that. Separating changes > > allows > > for the author to easier figure out what went wrong, it makes review ea= sier, > > and > > when one have to revert an offending commit, it makes sure that unrelat= ed > > good > > changes won't be reverted together with the ones that broke something. = In > > many > > large projects such mixing up is not allowed and in code review the aut= hor > > will > > be asked to separate the changes. >=20 > I don't think so.=C2=A0 At my organization, which uses SVN, each new revi= sion > is required to change only one file, and updates to ChangeLog are > performed separately after all edits are checked in and the > corresponding files are unlocked.=C2=A0 This is also the same policy that= was > used by Emacs development in the CVS days, I think. I am afraid such workflow would break both bisection and the ability to see what's changed by other developers. This is because in many cases a change affects more than one file. For example: when you change a function helper = in C, you may need to edit a header and all C files where it's declared. If you c= reate separate revision for each of these changes, this will =CE=B1) break compil= ation in each of these revisions till the last one, and =CE=B2) will make reading th= e log (either for code review or for other purposes) harder, because the context = of the change is no longer in the same commit. FWIW, at my work after stumbling upon a few situations where some commits couldn't be compiled within same series, we ended up adding a CI check that tests each individual commit for compilation. So people can't commit a revi= sion that does not pass compilation. > I don't know how to do this with Git, since it's not possible to update > ChangeLog separately from file check-ins. I might be missing something here, because I'm not sure what is not possibl= e here. I mean, you can create a separate commit for each individual file. An= d you can edit Changelog there as well, or you can avoid editing it. > > P.S: btw, in the article=C2=B2 by a kernel maintainer that I referred e= lsewhere > > there's also a good quote on your case: > >=20 > > > If it's not possible to describe the high level change in a few words= , it > > > is > > most likely too complex for a single commit > >=20 > > 1: https://gitlab.freedesktop.org/mesa/mesa/-/commits/main > > 2: http://who-t.blogspot.com/2009/12/on-commit-messages.html >=20 > I've read the article, and I don't agree. If you have any specific points, we can discuss them, if you want of course= .