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: Stupid git! Date: Sat, 12 Sep 2015 10:21:59 +0000 Message-ID: <20150912102159.GB2322@acm.fritz.box> References: <20150912101514.GA2322@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 1442053276 17800 80.91.229.3 (12 Sep 2015 10:21:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2015 10:21:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 12:21:07 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 1Zahve-0004Uv-V0 for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 12:21:07 +0200 Original-Received: from localhost ([::1]:60166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zahve-0000Al-2x for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 06:21:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZahvQ-0000Ae-Qn for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:20:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZahvL-0004vr-U6 for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:20:52 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:23982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZahvL-0004vB-Jt for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:20:47 -0400 Original-Received: (qmail 64445 invoked by uid 3782); 12 Sep 2015 10:20:46 -0000 Original-Received: from acm.muc.de (p548A4594.dip0.t-ipconnect.de [84.138.69.148]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 12 Sep 2015 12:20:45 +0200 Original-Received: (qmail 3190 invoked by uid 1000); 12 Sep 2015 10:21:59 -0000 Content-Disposition: inline In-Reply-To: <20150912101514.GA2322@acm.fritz.box> 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.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:189855 Archived-At: Hello, Emacs. On Sat, Sep 12, 2015 at 10:15:14AM +0000, Alan Mackenzie wrote: > git has struck again, and another couple of hours valuable time have > been lost. > Having "staged" a change with `git add', I then tried to commit it with > `git commit'. Somebody else had got in before me, so I had to pull > their changes first - fair enough. > So I did `git pull'. I was then dumped into an editing session for a > merge operation for .../test/automated/file-notify-tests.el. Eh? I've > never touched this file in my life, and didn't even know it existed. So > why is a merge necessary/why has a merge been (half-)done? Why didn't > git pull simply merge the changes to this file into my repository and > working directory? > So I aborted this merge operation, in order to see what it's doing > first. git has kindly discarded my (staged) change, leaving no record > of its existence - good job I've still got a copy of the changed file in > Emacs. Scrabbling around in the .git directory, I found the commit > message in a file there. So all is not lost. Sorry, scrub that bit! My commit had saved the file OK. I'd got confused with another situation in which git delete[sd] changes. > How do I see what changes are in file-notify-tests.el, which is in the > staging area? I would have thought some variety of `git diff' ought to > do the trick, but how to do this is not made obvious in the fine manual > for `git diff'. > Time to save my changed file and have a coffee. Isn't git wonderful! > -- > Alan Mackenzie (Nuremberg, Germany).