[Top][All Lists]

[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: Fri, 27 Mar 2015 16:30:31 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden,  address@hidden,  address@hidden,  address@hidden,  
> address@hidden
> Date: Fri, 27 Mar 2015 08:59:41 -0400
> >   . using the script, the commit+push are not an atomic operation, so
> >     the commit could succeed, but the following push could fail,
> >     leaving your repository out of sync
> That's true: we need to uncommit if the push fails.
> BTW, we could/should make this case very rare by adding a pre-commit
> hook which makes sure that we're up-to-date before we can commit.

That's not a job for a pre-commit hook, IMO.  I think "C-x v v" should
pull before the push, and if there are conflicts, the next "C-x v v"
should do what needs to be done in that case, probably an other commit.

> >   . it will be hard (or even impossible) to do a local commit without
> >     pushing, because the hook will always be run; you need the local
> >     commit for when you merge and resolve conflicts and in other
> >     situations
> I don't see why Richard (or someone in his situation) would ever need to
> do a local commit.

I think you forget commits after a conflict resolution, e.g. after a
merge from another branch.  I'm sure there are more situations like
that.  I don't think we can assume that absolutely _every_ commit can
do a push upstream.

reply via email to

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