From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Sun, 05 Apr 2015 09:58:05 +0300 Message-ID: <83619bnjsy.fsf@gnu.org> 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> <87y4mdi7tj.fsf@uwakimon.sk.tsukuba.ac.jp> <20150331214347.GH2871@acm.fritz.box> <20150401103225.GA2633@acm.fritz.box> <87h9t080gx.fsf@javad.com> <83384jsx3o.fsf@gnu.org> <83pp7nrfdn.fsf@gnu.org> <83a8yqr226.fsf@gnu.org> <831tk2qvz5.fsf@gnu.org> <87384ii26v.fsf@uwakimon.sk.tsukuba.ac.jp> <83wq1tptvp.fsf@gnu.org> <87pp7lhc9h.fsf@uwakimon.sk.tsukuba.ac.jp> <83sichpqe9.fsf@gnu.org> <87ioddglu6.fsf@uwakimon.sk.tsukuba.ac.jp> <83a8yoq56m.fsf@gnu.org> <87384ghm1a.fsf@uwakimon.sk.tsukuba.ac.jp> <837ftspcis.fsf@gnu.org> <87vbhbft9a.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1428217199 24430 80.91.229.3 (5 Apr 2015 06:59:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Apr 2015 06:59:59 +0000 (UTC) Cc: sorganov@gmail.com, emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 05 08:59:50 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 1YeeX7-0007sW-IB for ged-emacs-devel@m.gmane.org; Sun, 05 Apr 2015 08:59:49 +0200 Original-Received: from localhost ([::1]:35394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeeX6-0001tf-Jp for ged-emacs-devel@m.gmane.org; Sun, 05 Apr 2015 02:59:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeeX3-0001ta-CD for emacs-devel@gnu.org; Sun, 05 Apr 2015 02:59:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeeX0-0002wS-3u for emacs-devel@gnu.org; Sun, 05 Apr 2015 02:59:45 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:43821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeeWz-0002wE-Mr for emacs-devel@gnu.org; Sun, 05 Apr 2015 02:59:42 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NMB00B00MXS1W00@mtaout27.012.net.il> for emacs-devel@gnu.org; Sun, 05 Apr 2015 09:52:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NMB003MDN46L570@mtaout27.012.net.il>; Sun, 05 Apr 2015 09:52:55 +0300 (IDT) In-reply-to: <87vbhbft9a.fsf@uwakimon.sk.tsukuba.ac.jp> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 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:184900 Archived-At: > From: "Stephen J. Turnbull" > Cc: sorganov@gmail.com, > emacs-devel@gnu.org > Date: Sun, 05 Apr 2015 07:01:05 +0900 > > Eli Zaretskii writes: > > > > It did? It's not clear to me. I still haven't seen an explanation of > > > how he ended up with a ton of modified files that he didn't touch, or > > > how he's going to get past that safely. > > > > We've been through that: those are files from the merge already in the > > index, ready to be committed when the conflicts are resolved. > > I've been through that too, I tried to reproduce and failed. My > understanding was that Richard had edited and had uncommitted changes > *before* "the" pull. I'm not sure this is what happened; I think he had _committed_ changes that conflicted. Let's reiterate what Richard described in his original message: I committed some changes using C-x v v in vc-dir. Something went wrong with lisp/ChangeLog. It appears that my change log entries went into an old version of that file; I don't know why this happened, since I wrote them today after doing 'git pull'. After this, I did 'git pull' again, and it said there was a merge conflict in lisp/ChangeLpg. A lot of text appears to be missing from the file. It said, "fix conflicts and then commit the result." I edited lisp/ChangeLog and tried to commit it with C-x v v. That gave me the error message fatal: cannot do a partial commit during a merge. I am now stuck. I don't know what a "merge" is; it is certainly nothing I asked to do. Note the "merge conflict" part and the error message Richard cites: "fix conflicts and then commit the result." This is a message displayed by Git when you have a conflict in _committed_ changes, and the merge fails half-way through. Error messages about conflicts in uncommitted changes are different The second error message, viz.: fatal: cannot do a partial commit during a merge. is because "C-x v v" invokes "git commit --only lisp/ChangeLog", which AFAIR always fails in this situation, for the reason hinted by the error message. The result of "git status -s" is consistent with the hypothesis that the only problem during pull was conflicting changes in lisp/ChangeLog. The uncommitted changes, if there were present, didn't generate conflicts, and so were silently kept by the merge. > So your hypothesis is something like > > 1. Richard cloned the repo. > 2. He did the edit-commit cycle three times (according to reflog). > 3. At some point, he did a couple of branch switches (according to > reflog; result was a no-op). > 3. He pulled (when fully committed), and got a conflict in > lisp/Changelog during the merge phase (so no reflog entry). > 4. He hasn't edited since (except maybe the ChangeLog) > 5. Maybe he has pulled since, but that would have no visible changes > (there would be a fetch to origin/master, but no merge at all). > > ? Yes, something like that. In fact, I think the root cause of the original problem was that "C-x v v", which tried to commit a single file in the middle of a merge. Instead, the correct action is either 'v' from vc-dir or "git commit" from the shell prompt. It would be good if "C-x v v" tried to support this situation better. I hope Eric Raymond is reading this. > In that case, yes, commit-pull[-fix-commit]?-push should do the > trick. I would recommend a diff (or diffstat) against origin/master > to make sure he recognizes all the changes as his own before pushing. Yes, I agree. "git diff origin/master" is a good idea.