bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#57807: 29.0.50; Make vc-print-branch-log able to log multiple branch


From: Sean Whitton
Subject: bug#57807: 29.0.50; Make vc-print-branch-log able to log multiple branches
Date: Wed, 14 Sep 2022 15:44:49 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hello,

On Wed 14 Sep 2022 at 10:17PM +03, Juri Linkov wrote:

>> vc-git-log-edit-mode is already able to properly understand git-log(1)
>
> I suppose vc-git-log-view-mode, not vc-git-log-edit-mode?

Yes, sorry.

>> output which logs multiple branches.  Here's a hack to demonstrate that:
>>
>>     (let ((default-directory "~/src/emacs/")
>>           (vc-git-log-switches
>>            (cons "origin/scratch/posix-spawn" vc-git-log-switches)))
>>       (call-process-shell-command "git branch -f tmp 4b2ca6bfc0")
>>       (vc-print-branch-log "tmp"))
>>
>> (4b2ca6bfc0 is an old tip of master close to scratch/posix-spawn.)
>
> Is this equivalent to `M-& git log origin/scratch/posix-spawn 4b2ca6bfc0`,
> then enabling vc-git-log-view-mode in the output buffer?

It's not, because vc-git-log-view-mode requires you pass four or five
options to git-log to get output it can properly display.  That
knowledge is locked up in vc-git.el right now.

> Maybe vc-print-branch-logs, to keep the original vc-print-branch-log
> uncomplicated.

Perhaps a prefix argument?

>> (2) How could vc-print-branch-log prompt the user for multiple branch
>> names?  Magit has the user separate branch names with commas, offering
>> completion for each branch name.  But I suppose commas never appearing
>> in branch names is git-specific.  So the command could prompt the user
>> repeatedly for branch names, until the user hits RET to input a
>> zero-length branch name, indicating they've input them all.
>
> Maybe by using completing-read-multiple with branch names separated
> by crm-separator, not necessarily comma?

I guess it would be a strange VC system that allows spaces in branch
names, huh?

-- 
Sean Whitton





reply via email to

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