From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Stupid git! Date: Sat, 12 Sep 2015 13:40:03 +0300 Message-ID: <55F40103.9080300@yandex.ru> References: <20150912101514.GA2322@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1442054458 1662 80.91.229.3 (12 Sep 2015 10:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2015 10:40:58 +0000 (UTC) To: Alan Mackenzie , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 12:40:47 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 1ZaiEg-0006HM-8C for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 12:40:46 +0200 Original-Received: from localhost ([::1]:60197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiEf-0004Il-AA for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2015 06:40:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiEI-0004Fx-E5 for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:40:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaiEF-0004Da-8D for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:40:22 -0400 Original-Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:35086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaiEE-0004Cs-VG for emacs-devel@gnu.org; Sat, 12 Sep 2015 06:40:19 -0400 Original-Received: by lagj9 with SMTP id j9so62478253lag.2 for ; Sat, 12 Sep 2015 03:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=uf3jFlJ/4XvcF2MUxpUB2RSbrmer82czNVwbVMjfUjY=; b=Xon3UtxVuc2zC+vEw9b/HtTRHxZtAhpjCYCAGQ9H/dPhYSSUlXfdlL65Qpk9E1AR2P zOIBaF8tkXD4760cRJ51mMxg7iyQu5ji+wqRGNO7pycLOYr6K89DAuNKb96g17CSINKp qNwvHM19czucWgWvTXjx/roKL5Vip5ykzyVlxCwMyPbqmQLnrWPReMM4hVI0zvcy3Rua SvIZukZe+uCxrBwPvscrs92fjCoGFlsKIYJXFTW6mylQoWnVMtde+8lAiFd29WTJBy5y euxcMsA3DpgSo4NGJjnwc6z1a1NP2LrcxBFcC2pgiXYo1+34Ura0gFME3U1QRY0wDLy8 tyxA== X-Received: by 10.153.8.135 with SMTP id dk7mr3311417lad.58.1442054417457; Sat, 12 Sep 2015 03:40:17 -0700 (PDT) Original-Received: from [192.168.1.190] ([178.252.127.222]) by smtp.googlemail.com with ESMTPSA id be6sm699748lbc.40.2015.09.12.03.40.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Sep 2015 03:40:16 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 In-Reply-To: <20150912101514.GA2322@acm.fritz.box> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010: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:189856 Archived-At: On 09/12/2015 01:15 PM, Alan Mackenzie wrote: > 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. I don't get it. This sounds like the commit failed because someone has pushed to master in the upstream repo first. Which obviously can't happen because git doesn't have "bound branches" a la Bazaar. But in general, you either 'git stage' and then 'git pull', or 'git add', 'git commit' (!), and then either rebase or merge upstream. The fact that git allows pulling after 'git add' sounds like a bug to me, but apparently it sort-of fine because you can do two-way merge, or even abort the merge and return to the previous state. > 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? Was there a conflict in this file, or not? If yes, you can see the diverging changes. If not, then you don't need to merge it at all, just resolve the conflicts. How were you even "dumped into an editing session"? What tool did that? > 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. That might be a good subject for a bug report. > 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'. git diff --cached (or --staged, it's a synonym) It's pretty easy to find out in the output of 'man git diff' on my system. Not sure what manual you've been reading.