GNU bug report logs - #50643
28.0.50; [feature request] vc command for branch creation, with customization by prefix arg

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Fri, 17 Sep 2021 15:13:01 UTC

Severity: wishlist

Found in version 28.0.50

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50643 in the body.
You can then email your comments to 50643 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Fri, 17 Sep 2021 15:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 17 Sep 2021 15:13:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [feature request] vc command for branch creation, with
 customization by prefix arg
Date: Fri, 17 Sep 2021 18:12:40 +0300
Currently, vc-create-tag creates a branch when given C-u.  With
distributed VCSes like Git, branch creation is a very frequent operation
to be worth a separate command.

The command could have a mode for specifying START-POINT, so for Git the
command becomes "git checkout -b new-branch-name START-POINT".  This
could be on C-u (unless there're other frequent "customization" cases).

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Sat, 18 Sep 2021 00:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Sat, 18 Sep 2021 03:09:13 +0300
On 17.09.2021 18:15, Filipp Gunbin wrote:
> On 16/09/2021 14:54 +0300, Dmitry Gutov wrote:
> 
>> On 16.09.2021 14:46, Filipp Gunbin wrote:
>>> Maybe I should express this wish in a separate bug, but:
>>>
>>> It would be nice if vc-create-tag allowed to specify start-point
>>> conveniently:
>>>
>>> git checkout -b new-branch-name START-POINT
>>>
>>> Currently I do this in shell.
>> Perhaps we could do that with 'C-u C-u'.
>>
>> Yes, a separate feature request is preferable.
> I'm also thinking of a separate command for branch creation, wrote all
> that in bug#50643.  Thanks.

This part might actually fit better in this one: if we add a new command 
which will create a branch by default, then it will fit the new 'b' 
keymap best.

We could actually do the migration this way: create a new command which 
"flips" the branch-tag relationship and put it on 'C-v b c'. Then, if 
we're not removing the 'C-x s' binding in this release, we could 
obsolete the command in favor of the new one because people create 
branches more often tags tags these days (right?).

What do people think?

The command could also prompt for START-POINT by default: it shouldn't 
really hurt to press RET once more at the end. It can also be useful to 
double-check the branch you are currently branching from.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Sat, 18 Sep 2021 19:06:02 GMT) Full text and rfc822 format available.

Message #11 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Sat, 18 Sep 2021 22:03:42 +0300
>>>> It would be nice if vc-create-tag allowed to specify start-point
>>>> conveniently:
>>>>
>>>> git checkout -b new-branch-name START-POINT
>>>>
>>>> Currently I do this in shell.
>>> Perhaps we could do that with 'C-u C-u'.
>>>
>>> Yes, a separate feature request is preferable.
>> I'm also thinking of a separate command for branch creation, wrote all
>> that in bug#50643.  Thanks.
>
> This part might actually fit better in this one: if we add a new command
> which will create a branch by default, then it will fit the new 'b'
> keymap best.

👍 for the new branch command.  Until now, I avoided ‘vc-create-tag’
to not make a mistake that will create a tag instead of the branch.

> We could actually do the migration this way: create a new command which
> "flips" the branch-tag relationship and put it on 'C-v b c'. Then, if we're
> not removing the 'C-x s' binding in this release, we could obsolete the
> command in favor of the new one because people create branches more often
> tags tags these days (right?).

Shouldn't tag commands be moved to another prefix key ‘C-x v t’?
But I don't know how often tag commands are used.

> The command could also prompt for START-POINT by default: it shouldn't
> really hurt to press RET once more at the end. It can also be useful to
> double-check the branch you are currently branching from.

A prompt for START-POINT would be fine with completion on branch names,
and saying what the default value will be used when exiting with RET.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Sun, 19 Sep 2021 00:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Sun, 19 Sep 2021 03:01:48 +0300
On 18.09.2021 22:03, Juri Linkov wrote:

>>>> Yes, a separate feature request is preferable.
>>> I'm also thinking of a separate command for branch creation, wrote all
>>> that in bug#50643.  Thanks.
>>
>> This part might actually fit better in this one: if we add a new command
>> which will create a branch by default, then it will fit the new 'b'
>> keymap best.
> 
> 👍 for the new branch command.  Until now, I avoided ‘vc-create-tag’
> to not make a mistake that will create a tag instead of the branch.
> 
>> We could actually do the migration this way: create a new command which
>> "flips" the branch-tag relationship and put it on 'C-v b c'. Then, if we're
>> not removing the 'C-x s' binding in this release, we could obsolete the
>> command in favor of the new one because people create branches more often
>> tags tags these days (right?).
> 
> Shouldn't tag commands be moved to another prefix key ‘C-x v t’?
> But I don't know how often tag commands are used.

So far we only have one tag command, and it doubles for branches with 
'C-u'. The other tag-related command doesn't differentiate between 
branches and tags.

Would having essentially two copies of these, but with different names, 
be a good idea?

Are there some VCS which would benefit from a more stricter 
differentiation between the two? Hg, perhaps? I don't know how branches 
work there.

Either way, we could put the same command in both keymaps, but I also 
don't know how often the tag commands are used for working with _tags_ 
these days.

>> The command could also prompt for START-POINT by default: it shouldn't
>> really hurt to press RET once more at the end. It can also be useful to
>> double-check the branch you are currently branching from.
> 
> A prompt for START-POINT would be fine with completion on branch names,
> and saying what the default value will be used when exiting with RET.

Yup!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Sun, 19 Sep 2021 17:16:02 GMT) Full text and rfc822 format available.

Message #17 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Sun, 19 Sep 2021 20:04:16 +0300
> So far we only have one tag command, and it doubles for branches with
> 'C-u'. The other tag-related command doesn't differentiate between branches
> and tags.
>
> Would having essentially two copies of these, but with different names, be
> a good idea?

It makes sense to create a copy where the meaning of its arg
is reversed, so by default it will operate on branches,
and only with C-u on tags.

> Are there some VCS which would benefit from a more stricter differentiation
> between the two? Hg, perhaps? I don't know how branches work there.

So the question is what backends already use the arg 'branchp'?
The search shows that vc-cvs-create-tag, vc-git-create-tag,
vc-hg-create-tag all use this arg.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 20 Sep 2021 00:35:02 GMT) Full text and rfc822 format available.

Message #20 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Mon, 20 Sep 2021 03:33:56 +0300
On 19.09.2021 20:04, Juri Linkov wrote:
>> So far we only have one tag command, and it doubles for branches with
>> 'C-u'. The other tag-related command doesn't differentiate between branches
>> and tags.
>>
>> Would having essentially two copies of these, but with different names, be
>> a good idea?
> 
> It makes sense to create a copy where the meaning of its arg
> is reversed, so by default it will operate on branches,
> and only with C-u on tags.

Yup.

But I also wonder if reading START-POINT with completion (with current 
branch name as default) will make sense for creating tags in all 
backends too.

>> Are there some VCS which would benefit from a more stricter differentiation
>> between the two? Hg, perhaps? I don't know how branches work there.
> 
> So the question is what backends already use the arg 'branchp'?
> The search shows that vc-cvs-create-tag, vc-git-create-tag,
> vc-hg-create-tag all use this arg.

I thought of Hg in particular because there was a report or two citing 
some problems with how we handle them.

And: "Mercurial offers a variety of approaches to branching, including 
“named branches”, “bookmarks” (most similar to git), “anonymous 
branches” and using clones." 
(https://markheath.net/post/using-named-branches-in-mercurial)

That's basically all I know about it.

The introduction in 
https://www.draketo.de/software/mercurial-branching-strategy, however, 
sounds very similar to Git's approach.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 20 Sep 2021 07:11:02 GMT) Full text and rfc822 format available.

Message #23 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Mon, 20 Sep 2021 09:49:36 +0300
>> It makes sense to create a copy where the meaning of its arg
>> is reversed, so by default it will operate on branches,
>> and only with C-u on tags.
>
> Yup.
>
> But I also wonder if reading START-POINT with completion (with current
> branch name as default) will make sense for creating tags in all backends
> too.

You mean tag completion for creating tags?  Maybe.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 20 Sep 2021 16:01:02 GMT) Full text and rfc822 format available.

Message #26 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Mon, 20 Sep 2021 18:59:59 +0300
On 18/09/2021 22:03 +0300, Juri Linkov wrote:

> Shouldn't tag commands be moved to another prefix key ‘C-x v t’?
> But I don't know how often tag commands are used.

Sounds good, C-x v t is where I'd look for tag-related commands first.
However, I don't use tags much (besides creation - only "git fetch
--tags"), so I cannot add anything meaningful here.

Otherwise, the plan for C-x v b prefix looks great.

Other commands, like maybe "C-x v b r" - rename, could be added then.

Filipp




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 20 Sep 2021 16:54:02 GMT) Full text and rfc822 format available.

Message #29 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Mon, 20 Sep 2021 19:53:42 +0300
On 20.09.2021 09:49, Juri Linkov wrote:
>>> It makes sense to create a copy where the meaning of its arg
>>> is reversed, so by default it will operate on branches,
>>> and only with C-u on tags.
>> Yup.
>>
>> But I also wonder if reading START-POINT with completion (with current
>> branch name as default) will make sense for creating tags in all backends
>> too.
> You mean tag completion for creating tags?  Maybe.

Branch completion. To specify which branch tip to tag.

This seems like an unusual thing to need to do, but if we keep branch 
and tag creation on the same command, and add START-POINT completion by 
default, it might become the expected behavior in both scenarios, no?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 20 Sep 2021 17:32:02 GMT) Full text and rfc822 format available.

Message #32 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 50344 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 50643 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50344: C-x v keybinding for vc-print-branch-log
Date: Mon, 20 Sep 2021 20:31:13 +0300
On 20/09/2021 19:53 +0300, Dmitry Gutov wrote:

> On 20.09.2021 09:49, Juri Linkov wrote:
>>>> It makes sense to create a copy where the meaning of its arg
>>>> is reversed, so by default it will operate on branches,
>>>> and only with C-u on tags.
>>> Yup.
>>>
>>> But I also wonder if reading START-POINT with completion (with current
>>> branch name as default) will make sense for creating tags in all backends
>>> too.
>> You mean tag completion for creating tags?  Maybe.
>
> Branch completion. To specify which branch tip to tag.
>
> This seems like an unusual thing to need to do, but if we keep branch
> and tag creation on the same command, and add START-POINT completion by
> default, it might become the expected behavior in both scenarios, no?

I think also (maybe that's obvious, but still) that START-POINT
auto-completion should include both branches and tags (because it's
common to create a branch off some tag).  Of course, it should allow
specifying arbitrary commit hash.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Mon, 12 Sep 2022 18:10:02 GMT) Full text and rfc822 format available.

Message #35 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 50643 <at> debbugs.gnu.org
Subject: Re: bug#50643: 28.0.50; [feature request] vc command for branch
 creation, with customization by prefix arg
Date: Mon, 12 Sep 2022 21:09:09 +0300
close 50643 29.0.50
thanks

> Currently, vc-create-tag creates a branch when given C-u.  With
> distributed VCSes like Git, branch creation is a very frequent operation
> to be worth a separate command.
>
> The command could have a mode for specifying START-POINT, so for Git the
> command becomes "git checkout -b new-branch-name START-POINT".  This
> could be on C-u (unless there're other frequent "customization" cases).

This is implemented now in bug#50344.




bug marked as fixed in version 29.0.50, send any further explanations to 50643 <at> debbugs.gnu.org and Filipp Gunbin <fgunbin <at> fastmail.fm> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 12 Sep 2022 18:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50643; Package emacs. (Thu, 15 Sep 2022 01:48:02 GMT) Full text and rfc822 format available.

Message #40 received at 50643 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50643 <at> debbugs.gnu.org
Subject: Re: bug#50643: 28.0.50; [feature request] vc command for branch
 creation, with customization by prefix arg
Date: Thu, 15 Sep 2022 04:46:51 +0300
On 12/09/2022 21:09 +0300, Juri Linkov wrote:

> close 50643 29.0.50
> thanks
>
>> Currently, vc-create-tag creates a branch when given C-u.  With
>> distributed VCSes like Git, branch creation is a very frequent operation
>> to be worth a separate command.
>>
>> The command could have a mode for specifying START-POINT, so for Git the
>> command becomes "git checkout -b new-branch-name START-POINT".  This
>> could be on C-u (unless there're other frequent "customization" cases).
>
> This is implemented now in bug#50344.

Thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Oct 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.