From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Stupid git! Date: Sat, 12 Sep 2015 12:40:20 +0200 Message-ID: <87pp1n6huz.fsf@fencepost.gnu.org> References: <20150912101514.GA2322@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442054468 1773 80.91.229.3 (12 Sep 2015 10:41:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2015 10:41:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 12:41:08 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 1ZaiF1-0006gs-Q3 for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 12:41:07 +0200 Original-Received: from localhost ([::1]:60199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiF0-0004xk-83 for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 06:41:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiEo-0004vN-0c for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:40:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaiEn-0004VR-5d for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:40:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiEn-0004VD-2k; Sat, 12 Sep 2015 06:40:53 -0400 Original-Received: from localhost ([127.0.0.1]:45850 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZaiEm-0005x7-D1; Sat, 12 Sep 2015 06:40:52 -0400 Original-Received: by lola (Postfix, from userid 1000) id 83816E2295; Sat, 12 Sep 2015 12:40:20 +0200 (CEST) In-Reply-To: <20150912101514.GA2322@acm.fritz.box> (Alan Mackenzie's message of "Sat, 12 Sep 2015 10:15:14 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:189857 Archived-At: Alan Mackenzie writes: > Hello, Emacs. > > 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. Uh, no? git commit goes to your local repository. There is nobody else who could "get in before you". You never need to pull before committing. You may want to rebase after pulling, depending on your kind of change. > 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. > > How do I see what changes are in file-notify-tests.el, which is in the > staging area? git diff --cached > Time to save my changed file and have a coffee. Isn't git wonderful! When things start looking fishy, don't just stumble on blindly. Save what you got somewhere else, and _then_ try muddling through. That's not particular to Git. -- David Kastrup