emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VC mode and git


From: Eli Zaretskii
Subject: Re: VC mode and git
Date: Sun, 05 Apr 2015 15:55:07 +0300

> Date: Sun, 05 Apr 2015 05:11:07 -0400
> From: Richard Stallman <address@hidden>
> Cc: address@hidden, address@hidden
> 
> Having stashed my changes, I tried 'git pull'.  It said that the merge failed
> and reported conflicts in lisp/ChangeLog.
> 
> I fixed those by hand, and tried various ways to proceed from there.
> I tried to commit lisp/ChangeLog with C-x v v in that file
> and got an error that partial commits are not allowed in the middle of a
> merge.

"C-x v v" does the wrong thing in this situation: it attempts to
commit that single file, lisp/ChangeLog in your case.  Git will not
allow you to do that when you are in the middle of a merge.  That
merge is the second part of what "git pull" does (the first part is
fetching the last changes from upstream).  Normally, if the merge
succeeds, Git automatically commits the result, but in this case it
failed, and the merge was suspended.

Since you are in the middle of a merge, you need to commit
_everything_ that awaits to be committed, after resolving the
conflicts.  This includes the stuff Git successfully merged, and the
single file where it failed and left it to you to resolve the
conflicts.  To commit everything, you need to issue "git commit"
without any file-name arguments from the shell prompt, or 'v' from the
vc-dir buffer.

> You had recommended
> 
>     git add lisp/ChangeLog
>     git commit
> 
> so I tried that.  git add completed with no output.
> git commit showed me a monster list of files with
> changes to be committed, and asked me for the log message.
> I killed it.

You should have let it proceed: that long list of files are the
changes from upstream that Git succeeded in merging, and which await
to be committed.  I would use "Fix pull conflicts" as the log message.

You can still do that, since you are now exactly in the same situation
you were before the "git commit" command.  Just type it again.

> I know one way to get out of this.  I can extract my changes by hand,
> from the files ChangeLog says I had changed.  Then I can delete this
> repository and make another to use to install these changes.

Yes, that's one way.  It is not the best one, though.

> I could make another repository each time I need to install something.
> But cvs was much more convenient.

I wrote up simple procedures, very similar to what you did with CVS,
on the Wiki.  While writing, I tried to follow a CVS procedure as
close as possible; I wonder whether that succeeded.

Please read http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs
and see if what's there now keeps you out of trouble.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]