From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Thu, 26 Mar 2015 00:15:26 +0300 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=us-ascii X-Trace: ger.gmane.org 1427318170 14070 80.91.229.3 (25 Mar 2015 21:16:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 21:16:10 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 22:16:02 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 1Yasee-0006Eg-LH for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 22:16:00 +0100 Original-Received: from localhost ([::1]:41410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yased-0006bP-V2 for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 17:15:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaseZ-0006Yx-HT for emacs-devel@gnu.org; Wed, 25 Mar 2015 17:15:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaseW-0002cg-7O for emacs-devel@gnu.org; Wed, 25 Mar 2015 17:15:55 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:58274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaseW-0002ca-0n for emacs-devel@gnu.org; Wed, 25 Mar 2015 17:15:52 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YaseS-00064t-RY for emacs-devel@gnu.org; Wed, 25 Mar 2015 22:15:49 +0100 Original-Received: from 89.175.180.246 ([89.175.180.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Mar 2015 22:15:48 +0100 Original-Received: from sorganov by 89.175.180.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Mar 2015 22:15:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 89.175.180.246 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:184267 Archived-At: Alan Mackenzie writes: > Hello, Eli. > > On Wed, Mar 25, 2015 at 08:03:17PM +0200, Eli Zaretskii wrote: >> > From: Stefan Monnier >> > Date: Wed, 25 Mar 2015 11:04:51 -0400 > >> > I tend not to use the index very heavily (I'm still a fairly young Git >> > user, evidently), so I don't suffer from it too much, but it's clearly >> > wrong (an obvious problem is when the file is modified in the index and >> > this modification is undone in the actual file > >> That's because you are not radical enough in not-using the index. I >> never get to the situation where a file is modified in the index. One >> problem less. > >> (Of course, now I will be pounced upon by all the people who were >> brainwashed to think the index is a good idea. Please don't bother.) > > The index (stupid name) is an extra layer of complexity. Even the git > maintainers half-admit it's not (always) a good thing by allowing "git > commit -a". > > 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. Did you ever mark a few files to commit from many, in either pcl-cvs or vc-dir? That's one thing that git allows you to do using its command-line interface and index, only better. You mark changes to commit by putting them into the index (that is now officially called "staging area"), and you can even do this per-diff-chunk. Magit supports this, by not trying to hide staging area (it does ask to commit everything when nothing is staged, but anyway.) [Side note]: now comes reasonable question: how about testing exact to-be-committed state before commit? That's what 'git stash --keep-index' provides (see "Testing partial commits" in the git-stash manual.) And yes, magit supports this as well. There are other uses of the staging area, notably to save multiple trees on merges and getting diffs w.r.t both sides of the merge, that helps in not-trivial conflicts resolution, but the use-case above should be rather familiar to many. -- Sergey. P.S. Haters will hate, anyway.