From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Thu, 26 Mar 2015 00:37:06 +0600 Message-ID: References: <86egoeusg2.fsf@example.com> <83pp7yp5po.fsf@gnu.org> <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: quoted-printable X-Trace: ger.gmane.org 1427308679 12794 80.91.229.3 (25 Mar 2015 18:37:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 18:37:59 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 19:37:59 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 1YaqBc-0001UM-4O for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 19:37:52 +0100 Original-Received: from localhost ([::1]:40796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaqBW-0008NM-DC for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 14:37:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaqBI-0008NG-MH for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:37:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaqBE-0000Yh-QX for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:37:32 -0400 Original-Received: from mail-ig0-x229.google.com ([2607:f8b0:4001:c05::229]:36175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaqBD-0000YV-Gd; Wed, 25 Mar 2015 14:37:27 -0400 Original-Received: by igbud6 with SMTP id ud6so109592411igb.1; Wed, 25 Mar 2015 11:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=KIntxIaX/YIe/2Oawx+xyR1zfex3XbaxxPO2A3Uu4kk=; b=JZZKpWf472BQJKXxRZqaF0DYePaN0AD69OWsCjAXd60CrPgZskFkMY58Zx4Cz4aD+j IJ6snhrZzQX3Y04kWZtv6zSaPw1p8oFyGd5CNqbFSH0KKqDUOv+Z3PZVoMSJ7dE2R6l9 g0Xgw6ylro3PQHP7niyoHvO6BeJdubfgD8/j8DO+EroaL7Cb19Gz5Vd0juiG4MVFZN+O B5GOcPswhZ61ZXcYu/CwN2XzLo1Fsgnx/i6lkasElRkFIazqH4bwcIzUrh4hUss9P7pB KHmbG3azJc2E+Ybvqh0EW3gDbKHDLFX7pqxsrNXXiX24VSFVb2KCsKloMxl8Dpug6Hy2 ALRA== X-Received: by 10.50.79.229 with SMTP id m5mr31184701igx.23.1427308647033; Wed, 25 Mar 2015 11:37:27 -0700 (PDT) Original-Received: by 10.107.3.132 with HTTP; Wed, 25 Mar 2015 11:37:06 -0700 (PDT) In-Reply-To: <20150325181959.GC3833@acm.fritz.box> X-Google-Sender-Auth: 7KJfLRvXq6BtG9joNhDBKsWa28w X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::229 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:184254 Archived-At: 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=E2=80=99d have to make a conscious effort to avo= id 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. 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.