From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: About commit style Date: Sat, 06 Apr 2013 11:52:44 +0300 Message-ID: <83d2u8dorn.fsf@gnu.org> References: <20130406161308.f195518200567a56f123ac05@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1365278476 27693 80.91.229.3 (6 Apr 2013 20:01:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 20:01:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Xue Fuqiao Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 06 22:01:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UOZIS-0007UX-PE for ged-emacs-devel@m.gmane.org; Sat, 06 Apr 2013 22:01:08 +0200 Original-Received: from localhost ([::1]:54454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOOrk-00047t-QQ for ged-emacs-devel@m.gmane.org; Sat, 06 Apr 2013 04:52:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOOre-00047m-Tb for emacs-devel@gnu.org; Sat, 06 Apr 2013 04:52:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOOrc-0008UK-1K for emacs-devel@gnu.org; Sat, 06 Apr 2013 04:52:46 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:51439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOOrb-0008U9-Pu for emacs-devel@gnu.org; Sat, 06 Apr 2013 04:52:43 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MKT00M00SHWA500@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Sat, 06 Apr 2013 11:52:40 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MKT00LKISNST890@a-mtaout22.012.net.il>; Sat, 06 Apr 2013 11:52:40 +0300 (IDT) In-reply-to: <20130406161308.f195518200567a56f123ac05@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158699 Archived-At: > Date: Sat, 6 Apr 2013 16:13:08 +0800 > From: Xue Fuqiao > > In admin/notes/commits: > > Each commit should correspond to a single change (whether spread over > multiple files or not). Do not mix different changes in the same > commit (eg adding a feature in one file, fixing a bug in another > should be two commits, not one). > > Can I mix changes in _one_ file? (E.g., adding a feature in one file, > fixing a bug in the same file) No, you cannot. > When I want to add a feature in a file, I often find bugs in the > same file. Then fix the bugs (one by one, if they are different) in separate commits, and then finally add the feature in one more commit. You can use separate branches for that, to reduce inconvenience if you find the bugs when you are already half way into adding the feature. The only fixes that can be mixed with other changes are whitespace changes, incorrect formatting, etc. The point to take here is that reverting a single revision does not inadvertently introduces changes unrelated to the issue that is the subject of that revision. E.g., suppose your feature changes were found to be incorrect or undesirable, and are reverted -- you don't want that to re-introduce the unrelated bugs you fixed while working on the feature, do you?