From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: vc.el support for staging hunks/files Date: Fri, 03 Jan 2014 10:29:38 +0000 Message-ID: <87bnztgxyl.fsf_-_@gmail.com> References: <20140102211452.GA28685@c3po> <83d2k9xx1f.fsf@gnu.org> 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 1388745103 13017 80.91.229.3 (3 Jan 2014 10:31:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2014 10:31:43 +0000 (UTC) Cc: Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 03 11:31:49 2014 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 1Vz22e-0008Rp-Iq for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2014 11:31:48 +0100 Original-Received: from localhost ([::1]:49068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz22d-0001qZ-Ts for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2014 05:31:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz22V-0001ig-JB for emacs-devel@gnu.org; Fri, 03 Jan 2014 05:31:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz22Q-0001De-4a for emacs-devel@gnu.org; Fri, 03 Jan 2014 05:31:39 -0500 Original-Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:34026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz22P-0001DZ-TY for emacs-devel@gnu.org; Fri, 03 Jan 2014 05:31:34 -0500 Original-Received: by mail-we0-f170.google.com with SMTP id w61so13457496wes.29 for ; Fri, 03 Jan 2014 02:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=Ahvhk2BhZWS8jMTQHsU0LBWGtiNdNLnsl7OCUNF3hKQ=; b=So8mL192q3lyLtCTwcP+NlPBjlE+tTLEVdW6xbefiJCwFg0E25eZGAu4URL9DaSCCF SR5GZZ8jgg6B1+IiMCTG9fknXP2ULxUWGk3HXo0dlPvPphJe5UjjMuH2xEe12MZSTs1/ ou8JTy//YU8SBnfid27BzWHUTc3fNYdNGyj4G9VG6Tc/UV1vSWjYQ5i9I+5cqKG4wuA/ fFXn97q7OfaXECKnkTuLEEmvwSofmP94FS1ellH0hkiF9N7fSWURUf4PrBrN372Tf44w 9g43VodDEGqwSom8oYpzQsnc6cTnPkKSHFgKNbyTKJXO78YoSPOBLGEVsKXd5u45VsSa hL6Q== X-Received: by 10.180.149.175 with SMTP id ub15mr1366007wib.10.1388745093066; Fri, 03 Jan 2014 02:31:33 -0800 (PST) Original-Received: from kitaj.yourcompany.com (66.207.108.93.rev.vodafone.pt. [93.108.207.66]) by mx.google.com with ESMTPSA id z2sm1801500wiy.11.2014.01.03.02.31.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 Jan 2014 02:31:32 -0800 (PST) In-Reply-To: (Yuri Khan's message of "Fri, 3 Jan 2014 16:21:26 +0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::22a 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:167144 Archived-At: > On Fri, Jan 3, 2014 at 3:57 PM, Eli Zaretskii wrote: >> I've managed to grasp all that, I've made an alias for "commit -a", >> because that's what I almost always want. (And why isn't that the >> default, dammit?) Yuri Khan writes: > Because staging is a key concept in git and it enables a whole lot of > useful workflows. E.g. you can work all day and half the next day on a > feature, making small formatting changes and fix coding style > violations on your way as you spot them, then fire up a commit tool > and make three commits, one for trivial formatting changes, another > for coding style fixes, and a third one with the feature you actually > worked on. > > Without staging, you would have to look at the diff, back up and > revert some changes so that the working directory looks the way you > want for one commit, then the other, then the next one. Or you would > hold off fixing small things until you have committed the feature, and > risk forgetting to do them. +1 for git and +1 for this technique in particular. This has to be the most useful thing that git brought to the table for me. I also thought git commit -a would be always what I wanted, but I was obviously wrong. Now my favourite workflow is to prototype a change with some initial commits, semantically independent, sometimes even empty. Then hack away at everything at once like in pre-VCS days. Then use git add -p (or git gui) to make many "fixup" commits that can be squashed onto the initial ones first set using `git rebase --interactive`. Finally, when the stage is set, `git push`. I admit I also had trouble with the git docs at first, but the "stage"" metaphor couldn't be cleverer. My question is, since we're on emacs-devel: could vc.el support this workflow? * git-add --edit seems to indicate so; * diff-mode apparently has diff-marker calculation logic built in; * magit supports it apparently and its git-rebase-mode.el could be used independently. Is there interest in such a feature? Jo=C3=A3o