[Top][All Lists]

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

vc-dwim when nothing to commit (was: VC mode and git)

From: Ted Zlatanov
Subject: vc-dwim when nothing to commit (was: VC mode and git)
Date: Fri, 17 Apr 2015 21:38:55 -0400
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

On Tue, 24 Mar 2015 21:15:31 +0200 Eli Zaretskii <address@hidden> wrote: 

>> From: Sebastien Vauban <address@hidden>
>> Date: Tue, 24 Mar 2015 20:05:33 +0100
>> I think that the real conclusion of the discussion is: shouldn't vc-dir
>> have a command to push?  And, to that, I guess most of us would answer
>> yes, right?

EZ> A related question is: does "C-x v v" at all make sense with Git and
EZ> other dVCSes?  If it does, what would be the DWIM cycle there?  E.g.,
EZ> would it make sense for "C-x v v" to push when the previous action was
EZ> commit and there are not uncommitted changes?

My suggestion is really simple: if there is nothing to commit (implying
that a push may be wanted), `vc-dwim' should run `vc-runthis'.

Now, `vc-runthis' (name can be changed) will initially present "git
push" in the minibuffer with history, for a Git repo. So if I previously
said "git push myrepo onebranch:otherbranch" that's the command that
shows up. I edit it, then hit `RET' and it runs. Or I don't want it and
hit `C-g'. Or I move back in the history to a previous command.

This is how many other interactions in Emacs work when they don't know
what to do next automatically, so I think it makes sense here too.
Maybe it could even have completion.

Note the new `vc-runthis' command is also available for explicit
invocation.  I suspect in Git's case that will be very useful.
Currently I use `M-x eshell' all the time inside VC.

(Sorry if my suggestion is a duplicate. I was literally unable to read
the whole damn thread. For such a simple thing, a lot of arguing over
semantics and technicalities...)


reply via email to

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