Note that followRemoteHEAD invents a URL-less origin
Git materialises a remote from the existence of any remote.<name>.* key, so remote.origin.followRemoteHEAD makes `git remote` list an origin in every repo without one - this dotfiles repo included. It reads as a broken remote to anyone looking, and has now been misdiagnosed as leftover cruft twice. Nothing is actually wrong: get-url still fails, so the guards in git-sync and nvim's default_branch() hold. Say so in both places someone would look. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c674ee3e93
commit
3b4b84fb20
2 changed files with 12 additions and 0 deletions
|
|
@ -85,6 +85,12 @@ doing so. `git remote` sorts alphabetically, so picking the first remote in
|
|||
be-edition returns `kdog` — a colleague's fork. nvim's `<leader>gm`
|
||||
(diff-against-branch) tries `origin`, then `upstream`, then the rest.
|
||||
|
||||
One wrinkle: setting `remote.origin.followRemoteHEAD` at all is enough for git to
|
||||
invent the remote, so `git remote` lists a URL-less `origin` in repos that have
|
||||
none — this one, whose remotes are `forge` and `github`. It is a listing
|
||||
artefact, not a real remote: `git remote get-url origin` still fails, so the
|
||||
`origin` guard in `git sync` and the fallbacks in `<leader>gm` behave.
|
||||
|
||||
## Light and dark mode
|
||||
|
||||
Most of this is now handled natively and needs no configuration:
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@
|
|||
# branch that may not even exist. `always` re-points it on each fetch, off the
|
||||
# ref advertisement that fetch already receives, so it costs no extra round
|
||||
# trip. Only applies to remotes actually named origin.
|
||||
#
|
||||
# Side effect: git conjures a remote from the existence of any remote.<name>.*
|
||||
# key, so this makes `git remote` list a URL-less origin in every repo that
|
||||
# has not got one - this repo included. Nothing breaks (`git remote get-url
|
||||
# origin` still says No such remote, which is what the scripts test), but do
|
||||
# not read that listing as evidence a real origin exists.
|
||||
followRemoteHEAD = always
|
||||
|
||||
[core]
|
||||
|
|
|
|||
Loading…
Reference in a new issue