[Top][All Lists]

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

Re: VC mode and git

From: Stephen J. Turnbull
Subject: Re: VC mode and git
Date: Tue, 31 Mar 2015 13:03:33 +0900

Eli Zaretskii writes:

 > If it needs to cater to non-experts, let alone people who cannot
 > afford or be bothered to learn enough of Git, it should also make sure
 > the repository is left in a state from which it is easy to proceed
 > with fixing whatever problems are left after backing out the commit.
 > I'm not sure this is easy.
"Easy to proceed with fixing" is an impossible standard, when you're
talking about people who don't follow instructions to the letter and
probably don't remember exactly what they did.  For example, I have no
fscking idea how Richard put his workspace into a state where git
thinks a zillion source files are modified.  The burden of resolving
that should not be placed on git or on the Emacs workflow.

What can be done is revert to the exact state in which "git commit"
was invoked.  I explained in general how to do that.  I am rather sure
that approach works.  The problems are (1) I lack the *shell-foo* to
script it reliably (including cleaning up leftover stashes or
temporary branches etc), and (2) I really don't think it will be used
by anybody but Richard, and I've got a plane to catch so for the
foreseeable future I'm not going to spend effort on making it robust.

 > But if someone who knows their ways around Git comes up with such a
 > script, I'll be the first to applaud.

As Stefan posted, put "git push || git reset --soft HEAD^" in the
post-commit hook.  Richard should try that.  He may or may not ever be
back complaining that it forgot about a "git add".  In the meantime,
you can worry about fixing that problem (or finding somebody to test
my suggestions about stash and branching for you).

reply via email to

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