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: Tue, 31 Mar 2015 20:46:09 +0000 Message-ID: <20150331204609.GG2871@acm.fritz.box> References: <83twx2xoc8.fsf@gnu.org> <87619hke3u.fsf@uwakimon.sk.tsukuba.ac.jp> <551A3F17.6020903@math.ntnu.no> <20150331085055.GA2871@acm.fritz.box> <87zj6tiko1.fsf@uwakimon.sk.tsukuba.ac.jp> <20150331104935.GB2871@acm.fritz.box> <86ego5cp95.fsf@dod.no> <20150331154839.GE2871@acm.fritz.box> <87pp7phxt1.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1427834824 29817 80.91.229.3 (31 Mar 2015 20:47:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 20:47:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 31 22:46:56 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 1Yd33e-0005yY-2u for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 22:46:46 +0200 Original-Received: from localhost ([::1]:40536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd33d-0004Ay-Fy for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 16:46:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd33I-0003vd-Bh for emacs-devel@gnu.org; Tue, 31 Mar 2015 16:46:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yd33E-0007e1-Vg for emacs-devel@gnu.org; Tue, 31 Mar 2015 16:46:24 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:54486 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yd33E-0007dd-Mc for emacs-devel@gnu.org; Tue, 31 Mar 2015 16:46:20 -0400 Original-Received: (qmail 40634 invoked by uid 3782); 31 Mar 2015 20:46:19 -0000 Original-Received: from acm.muc.de (pD9519B17.dip0.t-ipconnect.de [217.81.155.23]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 31 Mar 2015 22:46:18 +0200 Original-Received: (qmail 6945 invoked by uid 1000); 31 Mar 2015 20:46:09 -0000 Content-Disposition: inline In-Reply-To: <87pp7phxt1.fsf@uwakimon.sk.tsukuba.ac.jp> 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:184674 Archived-At: Hello, Stephen. On Wed, Apr 01, 2015 at 02:38:34AM +0900, Stephen J. Turnbull wrote: > Alan Mackenzie writes: > > I've never used git reset or a git --force argument. I did lose > > some changes, however. > The only other possibilities I can think of is that for some reason > you nuked them yourself and forgot about it (perhaps you never saved > them), or that you "lost" them on a different branch, and they're > still in your repo, you just don't know where to find them. Maybe you're right. I can't remember any more. > > That's a fix? So every time I want to do a pull I have to stash, pull, > > unstash. Yuck! A proper fix would be for merge to actually merge the > > new changes into the working directory. > You may think that's a fix, but the git developers will call it a bug, > because it's irreversible -- there's no way for git to get back to the > pre-merge state, ensuring that your uncommitted changes are preserved. Irreversable? Any patch operation without conflicts is reversable, and if there are conflicts, a backup of the original should have been made by the patch program. Anyhow, there are lots of irreversable things that happen in a VCS repository. The act of having committed, or merged, or whatever cannot, with some exceptions, be reversed. > And they're in good company: Mercurial won't allow you to do that *at > all* AFAICT (and the restriction is *not* documented in that man page > you think is so concise and adequate), .... It is documented in the hg page. It says (under merge): "The current working directory is updated with all changes made in the requested revision since the last common predecessor revision.". If this doesn't work when a file in the W.D. has been changed, that looks like a bug, whether in the code or the documentation. > .... and Bazaar requires that you use "bzr merge --force". I really > don't understand how you can criticize git alone for this. Because it's only git that's ever given me problems in this respect. I don't recall ever having problems with bzr update when I had uncommitted changes. I use hg in such a way that mergeing is rarely, if ever, needed. > > Not me. In my normal workflow, I commit at the last minute, then > > push. > Risk-lover! No wonder you lose changes. I do not love risk. The risk of getting my repository in an inextricable tangle, like Richard has done, far outweighs any supposed risks of just-in-time committing. > > Just before committing, I get the latest changes from savannah, do > > any necessary merging, then commit and push as quickly as possible. > > This is to minimise the hassle which invariably occurs when other > > people's commits get mixed up with my own. > I think that "git pull --rebase" was made in heaven for you. I think I've used this at one time or another. > > Is it really too much to expect that git merge should merge these > > new fetched changes into my working directory? > If you have uncommitted changes, yes, it's too much to expect. See > above. -- Alan Mackenzie (Nuremberg, Germany).