GNU bug report logs -
#68183
28.3; vc-dir fails when I have a certain branch checked out
Previous Next
Reported by: Tom Tromey <tom <at> tromey.com>
Date: Sun, 31 Dec 2023 19:00:02 UTC
Severity: normal
Found in version 28.3
Done: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 68183 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:
> Tom Tromey <tom <at> tromey.com> writes:
>
>> Eli> Thanks, but I think we'd appreciate a reproducible recipe for this:
>> Eli> how can one create a Git repository which can be used to reproduce
>> Eli> this issue?
>>
>> This worked for me:
>>
>> $ cd ~/Emacs/trunk
>> # This is my Emacs git repository
>> $ git checkout --track -b vc-dir-bug master
>> branch 'vc-dir-bug' set up to track 'master'.
>> Switched to a new branch 'vc-dir-bug'
>>
>>
>> Now invoke vc-dir on that directory.
>
[…]
> git-config(1) says that branch.<name>.remote is "." when <name> is
> tracking a local branch, whereas branch.<name>.merge points to the local
> branch 'git pull' will resync with. Wonder what TRT would be for the
> purposes of vc-dir?
Here's a patch. tl;dr
(1) When branch.<name>.remote is ".", display…
> Remote : none (tracking local branch)
… instead of raising an error.
(2) When branch.<name>.merge is set to BRANCH, display…
> Tracking : BRANCH
(3) Add tests, because why not.
CC'ing Dmitry and Juri, whom my brain associates with vc-git maintenance
(rightly or wrongly; apologies for the noise if the latter).
I might be slow to respond for the next couple of weeks, so please feel
free to adapt or dismiss the patch as convenient. FWIW, off the top of
my head,
* the test should probably have a (skip-unless (have-git-or-something)),
* maybe "none (tracking local branch)" is not informative and we should
ditch it,
* maybe we should fall back to "origin", like vc-git-repository-url
does,
* rushed the ChangeLog entry; vc-git-test--run should also be declared
as a "new helper" (and maybe I should spell out that I used it to not
have to depend on vc-git-- internal functions),
* maybe the new header deserves a NEWS entry.
I can tackle any of the above (and any other feedback), though again, if
someone has a vision and I don't answer in a timely manner, don't wait
on me.
[0001-Fix-vc-dir-when-remote-Git-branch-is-local.patch (text/x-patch, attachment)]
This bug report was last modified 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.