From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Wed, 25 Mar 2015 19:23:49 +0000 Message-ID: <20150325192349.GE3833@acm.fritz.box> References: <86sicte9j3.fsf@example.com> <83y4mlnee2.fsf@gnu.org> <20150325181959.GC3833@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1427311471 28884 80.91.229.3 (25 Mar 2015 19:24:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 19:24:31 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 20:24:24 2015 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 1YaquY-00022x-IS for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 20:24:18 +0100 Original-Received: from localhost ([::1]:41074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaquS-0002w6-QU for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 15:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaquP-0002vq-A4 for emacs-devel@gnu.org; Wed, 25 Mar 2015 15:24:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaquM-0007sh-35 for emacs-devel@gnu.org; Wed, 25 Mar 2015 15:24:09 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:51495 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaquL-0007sY-P3 for emacs-devel@gnu.org; Wed, 25 Mar 2015 15:24:06 -0400 Original-Received: (qmail 82684 invoked by uid 3782); 25 Mar 2015 19:24:05 -0000 Original-Received: from acm.muc.de (pD9519387.dip0.t-ipconnect.de [217.81.147.135]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 25 Mar 2015 20:24:03 +0100 Original-Received: (qmail 6105 invoked by uid 1000); 25 Mar 2015 19:23:49 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.1 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:184261 Archived-At: Hello, Yuri. On Thu, Mar 26, 2015 at 12:37:06AM +0600, Yuri Khan wrote: > On Thu, Mar 26, 2015 at 12:19 AM, Alan Mackenzie wrote: > > I'm mystified as to what the git index is for. What's its motivation, > > what's it used for, what does it gain me in exchange for the extra > > complexity? Does anybody have a link to a justification? I'm genuinely > > curious about this. > I view the index as a convenience. > The use case goes like this. I work on a feature. At the same time, I > notice some coding style violations, or bad spelling/grammar, or > possible enhancements unrelated to the feature. > Without using the index, I’d have to make a conscious effort to avoid > mixing feature-related work with all those other good and useful > modifications. Make notes on a piece of paper. Finish the feature > work, commit, then go over the notes, do a few more commits. > However, with the index, I can do all of these things as soon as I > feel the need. Then I call up the Magit status buffer which shows me > all unstaged changes. I go over them and stage only those that I want > to put in a single commit, e.g. all the spelling fixes. I make a > commit, then repeat with the reduced set of changes. With a single > key, I can stage all changes, or all changes to a single file, or an > individual hunk, or a selected region. Isn't this what branches are meant to be for? > Occasionally, a line will be changed in two or more unrelated ways. At > this point, I have to go to the file buffer and temporarily edit the > line to have the form I want to commit. After staging, I undo the > change so the file in the working copy remains in its final form. > Bottom line: The index allows me to do several unrelated changes in > the working copy, then separate them in two or more commits. OK. Thanks for the elucidation. -- Alan Mackenzie (Nuremberg, Germany).