emacs-devel
[Top][All Lists]
Advanced

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

Re: VC mode and git


From: Harald Hanche-Olsen
Subject: Re: VC mode and git
Date: Sun, 05 Apr 2015 14:43:21 +0200
User-agent: Postbox 3.0.11 (Macintosh/20140602)

Richard Stallman wrote:
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.

That is way too drastic.

For one, if you run

git diff f1cea3e dca743f

then you will have all the changes you made since you checked out master a long time ago (f1cea3e) until your third commit (dca743f) on March 22. If I got it correctly, that is all the changes you have made, with the exception of changes to lisp/ChangeLog. (But I am not sure you made no other changes after that third commit. Are you?)

That output of git diff should be suitable as an input to patch, if you are so inclined. But I don't think it will come to that. As a last ditch maneuver, though, consider this possibility:

git reset --hard origin/master
git pull
git diff f1cea3e dca743f | patch -p1
# edit lisp/Changelog
git commit -a
git push

(Though I think git has better builtin commands than the above pipeline into patch; I just don't know them.)

In any case, the reason I recommend that you commit in the situation you are now in, is that it gives you much more freedom to explore the situation. With uncommitted changes in the index and/or work tree, your hands are tied to some extent (which is one reason git stash exists).

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

The usual answer to this is to use development branches instead of workin directly in the master branch. I think it was decided not to recommend these for simple workflows, but I don't think it is that much harder, and it is certainly easier than having separate repositories.

– Harald



reply via email to

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