From: wheakerd Date: Tue, 17 Nov 2026 01:07:25 GMT Subject: [BUG] push: a remote group that lists a remote of its own name makes "git push " recurse Message-ID: What did you do before the bug happened? (Steps to reproduce your issue) git init -q -b main client git init -q --bare -b main a.git git init -q --bare -b main b.git git -C client commit -q --allow-empty -m base git -C client remote add origin ../a.git git -C client remote add member ../b.git git -C client config remotes.origin "origin member" timeout -s KILL 12 git -C client push origin refs/heads/main:refs/heads/main Caution: the last command starts several thousand nested "git push" processes. Please keep the time limit. What did you expect to happen? (Expected behavior) Either one push to the remote "origin" and one to "member", or an error that says a group must not contain its own name. What happened instead? (Actual behavior) The command prints "Pushing to origin" again and again and starts one nested "git push origin" per line. In a 12-second run it printed that line 5,945 times, and I sampled up to 5,898 "git" processes alive at the same time. Once the nesting stops growing, each level reports "error: could not push to origin", then prints "Pushing to member" and pushes to member. When the 12 seconds were over, b.git had received main, and a.git, the repository that the remote "origin" names, had no ref. An earlier run without a time limit ended by itself with exit status 1. I did not measure how long it took. There, too, the other member had received the push and the repository of the remote "origin" had not. What's different between what you expected and what actually happened? The remote that has the same name as the group is never pushed to, the other member is pushed to once per nesting level, and the number of processes is limited only by whatever makes the deepest child fail. Anything else you want to add: Reading v2.56.0: push_multiple() in builtin/push.c runs "git push " as a child process for every member of the group, and add_remote_or_group() in remote.c resolves a name as a group first when remotes. exists. The child for the member "origin" therefore expands the same group again. On 2026-11-15 the two functions read the same way on master, and push_multiple() on next and seen still runs one child per member without a guard. I did not run the reproduction on anything newer than 2.56.0. "git push " is new in 2.55.0. t/t5566-push-group.sh has no case for a group that contains its own name, and git-push(1) does not mention one. The fetch side has an older report of the same cycle: Fwd: Runaway "git remote" if group definition contains a remote by the same name https://mail-archive.com/git@vger.kernel.org/msg41422.html Alex Riesen first sent it on 2010-11-17 and re-posted it on 2013-12-28, with git -c remotes.origin='origin other' remote update origin as the reproduction. Jeff King's reply names the reference cycle and sketches a fix: expand groups in one process, tell the child processes not to expand again, and detect cycles. I found no patch in that thread, and fetch_multiple() in builtin/fetch.c on master passes no such option to its children. A group named like one of its members is easy to write by accident, for example remotes.origin = "origin backup" to mean "origin and its backup". [System Info] git version: git version 2.56.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh rust: disabled feature: fsmonitor--daemon uname: Linux 7.2.11-200.fc44.x86_64 x86_64 [Enabled Hooks] none in the reproduction repository