{"thread":{"id":"64864","subject":"[regression][bisected] git-subtree remote desynchronization","startedAt":"2026-01-24T12:09:02Z","lastAt":"2026-02-15T21:06:13Z","messageCount":7,"participants":["Christian Heusel","Junio C Hamano","Colin Stagner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"534600","messageId":"755578cb-07e0-4b40-aa90-aacf4d45ccaa@heusel.eu","threadId":"64864","inReplyTo":null,"subject":"[regression][bisected] git-subtree remote desynchronization","fromName":"Christian Heusel","fromEmail":"christian@heusel.eu","sentAt":"2026-01-24T11:43:42Z","receivedAt":"2026-01-24T12:09:02Z","isPatch":false,"sender":{"key":"christian@heusel.eu","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\nI have upgraded my local git installation from v2.53.0-rc0 to 2.53.0-rc1 and\nnoticed that I can not use my local packaging repository monorepo (via\naurpublish) anymore.\n\nThe steps for reproduction are the following:\n\n1. Update to the 2.53.0-rc1 git release candidate\n2. Clone my monorepo for packages in the Arch User Repository:\n   ```\n   git clone https://github.com/christian-heusel/aur.git && cd aur\n   ```\n3. Push changes to one of the contained subtree remotes (this would normally be\n   done via `aurpublish google-chrome`):\n   ```\n   git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n   ```\n\nWhat did you expect to happen? (Expected behavior)\n\nThere are no changes expected since the repositories are synced after each\nmodification to publish the updates to the AUR:\n```\n$ git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\ngit push using:  ssh://aur.archlinux.org/google-chrome.git master\nEverything up-to-date\n```\n\nWhat happened instead? (Actual behavior)\n\n```\n$ git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\ngit push using:  ssh://aur.archlinux.org/google-chrome.git master\nTo ssh://aur.archlinux.org/google-chrome.git\n ! [rejected]          70b3d81e370936e96f98d0aba357490b75ade7a9 -> master (non-fast-forward)\nerror: failed to push some refs to 'ssh://aur.archlinux.org/google-chrome.git'\nhint: Updates were rejected because a pushed branch tip is behind its remote\nhint: counterpart. If you want to integrate the remote changes, use 'git pull'\nhint: before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details.\n```\n\nWhat's different between what you expected and what actually happened?\n\nI would expect the `git subtree push` command to stay functionally equivalent\nand the change mentioned above regresses my workflow. This tool and setup is\nalso not really special as a lot of users within the Arch Linux packaging\necosystem are relying on this workflow.\n\nAnything else you want to add:\n\nI have bisected the issue to the following commit:\n\n    28a7e27cff (\"contrib/subtree: detect rewritten subtree commits\")\n\nThis is my bisection log:\n```\n$ git bisect start\n# status: waiting for both good and bad commits\n# good: [7264e61d87e58b9d0f5e6424c47c11e9657dfb75] Git 2.53-rc0\ngit bisect good 7264e61d87e58b9d0f5e6424c47c11e9657dfb75\n# status: waiting for bad commit, 1 good commit known\n# bad: [83a69f19359e6d9bc980563caca38b2b5729808c] Git 2.53-rc1\ngit bisect bad 83a69f19359e6d9bc980563caca38b2b5729808c\n# bad: [0a5dcc1259fa0c8f5c21352c90b3cd3d43273345] Merge branch 'tb/macos-iconv-workarounds'\ngit bisect bad 0a5dcc1259fa0c8f5c21352c90b3cd3d43273345\n# good: [ffae4da0128e035acd1887654c98b4f02785adec] Merge branch 'kh/doc-patch-id'\ngit bisect good ffae4da0128e035acd1887654c98b4f02785adec\n# good: [6edbb7b1d0b50c70e2af0b5f68b7db0984b10be2] Merge branch 'en/fsck-snapshot-ref-state'\ngit bisect good 6edbb7b1d0b50c70e2af0b5f68b7db0984b10be2\n# good: [9813aace1e52765e01e688672cdcdcbe25336ec7] Merge branch 'je/doc-reset'\ngit bisect good 9813aace1e52765e01e688672cdcdcbe25336ec7\n# good: [d28124151851e42a3bb92963f5b747ad843f33e0] utf8.c: enable workaround for iconv under macOS 14/15\ngit bisect good d28124151851e42a3bb92963f5b747ad843f33e0\n# bad: [79e3055baba32e2952e6e8994cdcd4fc145ba7f0] Merge branch 'cs/rebased-subtree-split'\ngit bisect bad 79e3055baba32e2952e6e8994cdcd4fc145ba7f0\n# bad: [28a7e27cff717e5ef91f7445e6a418068608082d] contrib/subtree: detect rewritten subtree commits\ngit bisect bad 28a7e27cff717e5ef91f7445e6a418068608082d\n# first bad commit: [28a7e27cff717e5ef91f7445e6a418068608082d] contrib/subtree: detect rewritten subtree commits\n```\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.53.0.rc0\ncpu: x86_64\nbuilt from commit: 7264e61d87e58b9d0f5e6424c47c11e9657dfb75\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nrust: enabled\nlibcurl: 8.18.0\nOpenSSL: OpenSSL 3.6.0 1 Oct 2025\nzlib-ng: 2.3.2\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\ndefault-ref-format: files\ndefault-hash: sha1\nuname: Linux 6.19.0-rc6-1-mainline #1 SMP PREEMPT_DYNAMIC Mon, 19 Jan 2026 06:13:35 +0000 x86_64\ncompiler info: gnuc: 15.2\nlibc info: glibc: 2.42\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\napplypatch-msg\ncommit-msg\npost-applypatch\npost-checkout\npost-commit\npost-merge\npre-applypatch\npre-commit\npre-merge-commit\npre-push\npre-rebase\nprepare-commit-msg\n"},{"id":"534605","messageId":"xmqqikcql8cq.fsf@gitster.g","threadId":"64864","inReplyTo":"755578cb-07e0-4b40-aa90-aacf4d45ccaa@heusel.eu","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-25T02:44:05Z","receivedAt":"2026-01-25T02:44:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Heusel <christian@heusel.eu> writes:\n\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n>\n> I have upgraded my local git installation from v2.53.0-rc0 to 2.53.0-rc1 and\n> noticed that I can not use my local packaging repository monorepo (via\n> aurpublish) anymore.\n>\n> The steps for reproduction are the following:\n>\n> 1. Update to the 2.53.0-rc1 git release candidate\n> 2. Clone my monorepo for packages in the Arch User Repository:\n>    ```\n>    git clone https://github.com/christian-heusel/aur.git && cd aur\n>    ```\n> 3. Push changes to one of the contained subtree remotes (this would normally be\n>    done via `aurpublish google-chrome`):\n>    ```\n>    git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n>    ```\n\nThanks for noticing and reporting a regression before the change got\nreleased in an official release.\n\nIf a fix materializes and gets verified before -rc2 (scheduled for\ncoming Tuesday), we should revert the merge of the problematic\ntopic.\n\n> What did you expect to happen? (Expected behavior)\n>\n> There are no changes expected since the repositories are synced after each\n> modification to publish the updates to the AUR:\n> ```\n> $ git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n> git push using:  ssh://aur.archlinux.org/google-chrome.git master\n> Everything up-to-date\n> ```\n>\n> What happened instead? (Actual behavior)\n>\n> ```\n> $ git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n> git push using:  ssh://aur.archlinux.org/google-chrome.git master\n> To ssh://aur.archlinux.org/google-chrome.git\n>  ! [rejected]          70b3d81e370936e96f98d0aba357490b75ade7a9 -> master (non-fast-forward)\n> error: failed to push some refs to 'ssh://aur.archlinux.org/google-chrome.git'\n> hint: Updates were rejected because a pushed branch tip is behind its remote\n> hint: counterpart. If you want to integrate the remote changes, use 'git pull'\n> hint: before pushing again.\n> hint: See the 'Note about fast-forwards' in 'git push --help' for details.\n> ```\n>\n> What's different between what you expected and what actually happened?\n>\n> I would expect the `git subtree push` command to stay functionally equivalent\n> and the change mentioned above regresses my workflow. This tool and setup is\n> also not really special as a lot of users within the Arch Linux packaging\n> ecosystem are relying on this workflow.\n>\n> Anything else you want to add:\n>\n> I have bisected the issue to the following commit:\n>\n>     28a7e27cff (\"contrib/subtree: detect rewritten subtree commits\")\n>\n> This is my bisection log:\n> ```\n> $ git bisect start\n> # status: waiting for both good and bad commits\n> # good: [7264e61d87e58b9d0f5e6424c47c11e9657dfb75] Git 2.53-rc0\n> git bisect good 7264e61d87e58b9d0f5e6424c47c11e9657dfb75\n> # status: waiting for bad commit, 1 good commit known\n> # bad: [83a69f19359e6d9bc980563caca38b2b5729808c] Git 2.53-rc1\n> git bisect bad 83a69f19359e6d9bc980563caca38b2b5729808c\n> # bad: [0a5dcc1259fa0c8f5c21352c90b3cd3d43273345] Merge branch 'tb/macos-iconv-workarounds'\n> git bisect bad 0a5dcc1259fa0c8f5c21352c90b3cd3d43273345\n> # good: [ffae4da0128e035acd1887654c98b4f02785adec] Merge branch 'kh/doc-patch-id'\n> git bisect good ffae4da0128e035acd1887654c98b4f02785adec\n> # good: [6edbb7b1d0b50c70e2af0b5f68b7db0984b10be2] Merge branch 'en/fsck-snapshot-ref-state'\n> git bisect good 6edbb7b1d0b50c70e2af0b5f68b7db0984b10be2\n> # good: [9813aace1e52765e01e688672cdcdcbe25336ec7] Merge branch 'je/doc-reset'\n> git bisect good 9813aace1e52765e01e688672cdcdcbe25336ec7\n> # good: [d28124151851e42a3bb92963f5b747ad843f33e0] utf8.c: enable workaround for iconv under macOS 14/15\n> git bisect good d28124151851e42a3bb92963f5b747ad843f33e0\n> # bad: [79e3055baba32e2952e6e8994cdcd4fc145ba7f0] Merge branch 'cs/rebased-subtree-split'\n> git bisect bad 79e3055baba32e2952e6e8994cdcd4fc145ba7f0\n> # bad: [28a7e27cff717e5ef91f7445e6a418068608082d] contrib/subtree: detect rewritten subtree commits\n> git bisect bad 28a7e27cff717e5ef91f7445e6a418068608082d\n> # first bad commit: [28a7e27cff717e5ef91f7445e6a418068608082d] contrib/subtree: detect rewritten subtree commits\n> ```\n"},{"id":"534606","messageId":"xmqqecnel2fs.fsf@gitster.g","threadId":"64864","inReplyTo":"xmqqikcql8cq.fsf@gitster.g","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-25T04:51:51Z","receivedAt":"2026-01-25T04:51:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Thanks for noticing and reporting a regression before the change got\n> released in an official release.\n>\n> If a fix materializes and gets verified before -rc2 (scheduled for\n> coming Tuesday), we should revert the merge of the problematic\n> topic.\n\nOops, sorry for an obvious typo.  \"If\" -> \"Unless\", of course.\n"},{"id":"534633","messageId":"023ae712-8f67-441c-aada-fb5b097ec617@howdoi.land","threadId":"64864","inReplyTo":"xmqqecnel2fs.fsf@gitster.g","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Colin Stagner","fromEmail":"ask+git@howdoi.land","sentAt":"2026-01-26T05:14:25Z","receivedAt":"2026-01-26T05:14:47Z","isPatch":false,"sender":{"key":"ask+git@howdoi.land","avatar":null},"body":"On 1/24/26 22:51, Junio C Hamano wrote:\n\n> Unless a fix materializes and gets verified before -rc2 (scheduled for\n> coming Tuesday), we should revert the merge of the problematic\n> topic.\nUnderstood and no worries. This is a surprisingly complicated issue, and \nwhile I've made progress I don't think I'll have a fix that is mergeable \nby Tuesday. Feel free to revert as needed.\n\nThe \"exclude other subtrees\" logic was first introduced in 98ba49ccc2 \n(subtree: fix split processing with multiple subtrees present, \n2023-12-01). It was intended as a speed optimization only, but every \niteration of this logic—including mine—has changed the `git subtree \nsplit` output in at least one practical repo.\n\nI am becoming increasingly convinced that any version of this logic is \nlikely to change someone's `subtree split` history, somewhere. Our tests \njust don't cover everything that might be out there.\n\nThe documentation promises that,\n\n> Repeated splits of exactly the same history are guaranteed to be\n> identical as long as the settings passed to split are the same.\n\nMaybe the safer approach is to gate this logic behind a new CLI option, \nlike \"--fast-exclude,\" \"--ignore-other-trees,\" or something to that effect?\n\n\nOn 1/24/26 05:43, Christian Heusel wrote:\n\n> 1. Update to the 2.53.0-rc1 git release candidate\n> 2. Clone my monorepo for packages in the Arch User Repository:\n>     ```\n>     git clone https://github.com/christian-heusel/aur.git && cd aur\n>     ```\n> 3. Push changes to one of the contained subtree remotes (this would normally be\n>     done via `aurpublish google-chrome`):\n>     ```\n>     git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n>     ```\n\nI cannot `git subtree push` to your remote, but I can instead run:\n\n     git subtree split -P 'google-chrome'\n\nwhich happens internally prior to the push.\n\nBefore the bisected patch [1], running this on your aur.git's master \nbranch [2] generates a split commit with hash:\n\n     e6f4613797c0eea5a8939441a1fb58211e9184e0\n\nThis is the result you expect, right?\n\nI am also testing the other subtrees of aur.git to make sure none of \nthem change, either. With the patch reverted, none of them appear to.\n\nI have made some progress on a fix, but I have not yet achieved 100% \nhash equivalence across the board. The bisected patch will likely be \nreverted while I work on a more permanent solution.\n\n\n\n[1]: 28a7e27cff (contrib/subtree: detect rewritten subtree commits, \n2026-01-09)\n\n[2]: aur.git@29bfddf (upgpkg: rider-eap 1:261.17801.69-1, 2026-01-24)\n\n"},{"id":"534667","messageId":"8c588acc-1626-4ebe-824d-319d721537a1@heusel.eu","threadId":"64864","inReplyTo":"023ae712-8f67-441c-aada-fb5b097ec617@howdoi.land","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Christian Heusel","fromEmail":"christian@heusel.eu","sentAt":"2026-01-26T14:12:30Z","receivedAt":"2026-01-26T14:12:44Z","isPatch":false,"sender":{"key":"christian@heusel.eu","avatar":null},"body":"On 26/01/25 11:14PM, Colin Stagner wrote:\n> <snip>\n> \n> On 1/24/26 05:43, Christian Heusel wrote:\n> \n> > 1. Update to the 2.53.0-rc1 git release candidate\n> > 2. Clone my monorepo for packages in the Arch User Repository:\n> >     ```\n> >     git clone https://github.com/christian-heusel/aur.git && cd aur\n> >     ```\n> > 3. Push changes to one of the contained subtree remotes (this would normally be\n> >     done via `aurpublish google-chrome`):\n> >     ```\n> >     git subtree push -P \"google-chrome\" ssh://aur.archlinux.org/google-chrome.git master\n> >     ```\n> \n> I cannot `git subtree push` to your remote, but I can instead run:\n> \n>     git subtree split -P 'google-chrome'\n> \n> which happens internally prior to the push.\n> \n> Before the bisected patch [1], running this on your aur.git's master branch\n> [2] generates a split commit with hash:\n> \n>     e6f4613797c0eea5a8939441a1fb58211e9184e0\n> \n> This is the result you expect, right?\n\nYes this is the result that I expect to get.\n\nAll these repositories are also public if you want to take a look at\nthem, the HTTPS remote is \"https://aur.archlinux.org/google-chrome.git\",\nso you can easily compare the current state to the expected state:\n\n    $ git ls-remote --refs https://aur.archlinux.org/google-chrome.git\n    e6f4613797c0eea5a8939441a1fb58211e9184e0\trefs/heads/master\n\nThis also works equivalently for the other subtrees in that repository.\n\n> I am also testing the other subtrees of aur.git to make sure none of them\n> change, either. With the patch reverted, none of them appear to.\n\nThanks for investigating this, your work is really appreciated!\n\n> I have made some progress on a fix, but I have not yet achieved 100% hash\n> equivalence across the board. The bisected patch will likely be reverted\n> while I work on a more permanent solution.\n\nI guess that is for you and Junio to judge, but rushing a fix sounds\nlike unneccesary risk for an optimization.\n\n> [1]: 28a7e27cff (contrib/subtree: detect rewritten subtree commits,\n> 2026-01-09)\n> \n> [2]: aur.git@29bfddf (upgpkg: rider-eap 1:261.17801.69-1, 2026-01-24)\n\nCheers,\nChris\n"},{"id":"534678","messageId":"xmqqy0lki8jb.fsf@gitster.g","threadId":"64864","inReplyTo":"023ae712-8f67-441c-aada-fb5b097ec617@howdoi.land","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-01-26T17:32:56Z","receivedAt":"2026-01-26T17:32:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Colin Stagner <ask+git@howdoi.land> writes:\n\n> On 1/24/26 22:51, Junio C Hamano wrote:\n>\n>> Unless a fix materializes and gets verified before -rc2 (scheduled for\n>> coming Tuesday), we should revert the merge of the problematic\n>> topic.\n> Understood and no worries. This is a surprisingly complicated issue, and \n> while I've made progress I don't think I'll have a fix that is mergeable \n> by Tuesday. Feel free to revert as needed.\n\nDone.  Thanks.\n"},{"id":"536074","messageId":"3e8b0ada-2fd8-497b-afde-5e02fe78a2fa@howdoi.land","threadId":"64864","inReplyTo":"8c588acc-1626-4ebe-824d-319d721537a1@heusel.eu","subject":"Re: [regression][bisected] git-subtree remote desynchronization","fromName":"Colin Stagner","fromEmail":"ask+git@howdoi.land","sentAt":"2026-02-15T21:05:52Z","receivedAt":"2026-02-15T21:06:13Z","isPatch":false,"sender":{"key":"ask+git@howdoi.land","avatar":null},"body":"On 1/26/26 08:12, Christian Heusel wrote:\n\n> On 26/01/25 11:14PM, Colin Stagner wrote:\n>> I have made some progress on a fix, but I have not yet achieved 100% hash\n>> equivalence across the board. The bisected patch will likely be reverted\n>> while I work on a more permanent solution.\n> \n> I guess that is for you and Junio to judge, but rushing a fix sounds\n> like unneccesary risk for an optimization.\n\nChris,\n\nI've CC'd you on some proposed changes to remove the git-subtree \n\"should_ignore_subtree_split_commit\" logic.\n\nI have tested both of my patch series [1], [2] against every \nsubdirectory of your aur.git repo [3]. I checked the split of every \ntop-level directory as follows:\n\n     for d in *\n     do\n       test -d \"$d\" || continue;\n       echo >>split-results \"$d  $(git subtree split -P \"$d\")\"\n     done\n\nI compared the results to git 2.43.7 and found no changes. I would \nappreciate some more eyeballs and testing on this series to make sure it \ndoesn't introduce any breakage.\n\nThanks,\n\nColin\n\n[1]: 20260215201748.889866-1-ask+git@howdoi.land\n\n[2]: 20260215201906.889951-1-ask+git@howdoi.land\n\n[3]: https://github.com/christian-heusel/aur.git\n\n"}]}