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: Mon, 30 Mar 2015 22:44:07 +0300

> From: "Stephen J. Turnbull" <address@hidden>
> Date: Tue, 31 Mar 2015 04:24:48 +0900
> Cc: address@hidden, address@hidden, address@hidden, address@hidden,
>       Mike Gerwitz <address@hidden>, address@hidden
> 
>  > In any case, I think it is clear now that post-commit hooks cannot
>  > be the solution, because they are not versatile enough,
> 
> Eli, that's ridiculous.  While I don't think it's obvious that a
> post-commit hook can meet all requirements (specifically, when I
> explained to Richard that files add'ed, rm'ed, or mv'ed since HEAD^
> and committed in HEAD will be not be in the same state after "git
> reset --soft HEAD^", he characterized that as a defect in git), they
> come pretty close already (in Emacs practice, manipulations of
> directories are relatively rare, so this is going to bite only in very
> rare circumstances).  I believe those are the only state changes that
> get reverted by reset --soft.  File modifications are preserved, and
> I'm pretty sure that chmod is as well.
> 
> Furthermore, a complex pre-commit hook probably can parse the output
> of git status and preserve the add/rm/mv state.  Or maybe the thing to
> do is save the index (it may be possible to just stash that state, and
> I'm pretty sure it can be committed to a temporary branch, and
> restored from that if the push fails) -- that would preserve
> everything that's observable by git.

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.

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



reply via email to

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