{"thread":{"id":"59532","subject":"--shallow-exclude commit list is offsetted one commit","startedAt":"2023-04-04T05:38:09Z","lastAt":"2023-04-04T05:38:09Z","messageCount":1,"participants":["Mattias Holmqvist"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"474762","messageId":"CAPMLkzd=VGGqZ0trMMVXUsjGwbjFN-nz3tGQUG-O0Xc84Zc+hw@mail.gmail.com","threadId":"59532","inReplyTo":null,"subject":"--shallow-exclude commit list is offsetted one commit","fromName":"Mattias Holmqvist","fromEmail":"mattias.holmqvist@t-engineering.se","sentAt":"2023-04-04T05:37:51Z","receivedAt":"2023-04-04T05:38:09Z","isPatch":false,"sender":{"key":"mattias.holmqvist@t-engineering.se","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\ngit clone -b A --shallow-exclude=B\n\n\nWhat did you expect to happen? (Expected behavior)\nMy remote repo looks like this:\n\n  A B   # two branches, A and B\n1 |     # commit in A\n2 |\\    # merge from B to A\n3   |   # commit in B\n4 |     # commit in A\n5 |\\    # merge from B to A\n6   |   # commit in B\n\nA and B are branches. 1 is a commit in A, 2 is a merge from B to A etc.\n\nI would have expected the following repo as a result\n\n  A\n1 |\n2 |\n4 |\n5 |\n\nI would also have expected a shallow file with the following commits in .git:\n3\n6\n\nWhat happened instead? (Actual behavior)\n\nWhen I run the command I get a repo like this:\n\n  A\n1 |\n\nI also get a shallow file in .git with the following commit list\n2\n5\n\nWhat's different between what you expected and what actually happened?\nThe commit list in the shallow file is offsetted one commit.\nhe consequence of that is that not only B is excluded but also\neverything in A that depends on B\n\nAnything else you want to add:\nThe result is the same if I use the git fetch --shallow-exclude\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.40.0.windows.1\ncpu: x86_64\nbuilt from commit: 1d90ca2906dd4b7ddaf0669a13c173ec579d794a\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Windows 10.0 22621\ncompiler info: gnuc: 12.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): <unset>\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"}]}