Subject: bug#50344: C-x v keybinding for vc-print-branch-log

From: Dmitry Gutov <[email-masked]>
Date: Thu, 7 Oct 2021 03:47:32 +0300

On 06.10.2021 19:28, Juri Linkov wrote:
>>>> Other commands, like maybe "C-x v b r" - rename, could be added then.
>>> I can't find the existing vc API method for renaming tags/branches.
>> I think that's OK.
> But even the current branch creating command fails for git.
> For example, 'C-u C-x v s new_branch RET' fails with the error:
> 
>    (error "Failed (status 1): git --no-pager update-index --refresh .")
> 
> and shows the*vc*  buffer saying that modified files need update.
> 
> Whereas `M-& git checkout -b new_branch` works fine with modified files.

All right, yes, the current behavior is weird. It's actually documented 
in the description of the 'create-tag' action:

;;   Attach the tag NAME to the state of the working copy.  This
;;   should make sure that files are up-to-date before proceeding with
;;   the action.

Perhaps ESR or Dan N. have a good justification for this, but it seems 
to me the contemporary expectation is that tags and branches are created 
from the committed revision history, and not from the "working copy".

Some backends may choose to enforce this kind of limitation, but the 
more modern ones like Git or Hg should skip the check IMHO.

And it seems, from looking at vc-hg-create-tag, Hg already skips it.