From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Wed, 25 Mar 2015 17:16:16 -0400 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 X-Trace: ger.gmane.org 1427318239 15088 80.91.229.3 (25 Mar 2015 21:17:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 21:17:19 +0000 (UTC) Cc: Alan Mackenzie , Eli Zaretskii , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 22:17:04 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 1Yasfb-0006yG-T3 for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 22:17:00 +0100 Original-Received: from localhost ([::1]:41414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yasfb-0007qW-AD for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 17:16:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YasfX-0007qO-VR for emacs-devel@gnu.org; Wed, 25 Mar 2015 17:16:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YasfU-0002xn-PR for emacs-devel@gnu.org; Wed, 25 Mar 2015 17:16:55 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:55877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YasfJ-0002uz-0e; Wed, 25 Mar 2015 17:16:41 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 17AA985FAD; Wed, 25 Mar 2015 17:16:40 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 730DA1E5874; Wed, 25 Mar 2015 17:16:16 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 50EABB40DB; Wed, 25 Mar 2015 17:16:16 -0400 (EDT) In-Reply-To: (Yuri Khan's message of "Thu, 26 Mar 2015 00:37:06 +0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:184268 Archived-At: > 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. This means you only use the index to do partial commits. This use-case is typically transient. But the index is much more omnipresent. IIUC one of the motivations for the index was also to handle situations such as: I want to merge a change (with "git merge" or "git stash pop") into a non-committed tree, and I don't want to commit before the merge because the pending change is not clean enough (or some other reason). In this case, a naive "git merge/unstash" would lose information, since after the merge you get a tree with potential conflicts and no way to go back to the before-merge state. The problem here is that the merged tree may be so messed up that you *do* want to go back. So the "index" (and I so agree with Alan that this is a poor choice of name) lets Git store the "pre-merge" state without actually making a commit. I've never made use of this "feature", tho. Just like I never make use of the "feature" that "git stash pop" keeps the stash if the result has conflicts, which is a design clearly motivated by the same desire to make it harder for the user to lose some of the work he's done. Stefan