git/list[1] front-page[2] threads[3] people[4] search[5] about
 

--shallow-exclude commit list is offsetted one commit

From
MHMattias Holmqvist <mattias.holmqvist@t-engineering.se>
Date
Apr 4, 2023, 05:37 UTC
Message-ID
<CAPMLkzd=VGGqZ0trMMVXUsjGwbjFN-nz3tGQUG-O0Xc84Zc+hw@mail.gmail.com>

What did you do before the bug happened? (Steps to reproduce your issue) git clone -b A --shallow-exclude=B

What did you expect to happen? (Expected behavior) My remote repo looks like this:

  A B   # two branches, A and B
1 |     # commit in A
2 |\    # merge from B to A
3   |   # commit in B
4 |     # commit in A
5 |\    # merge from B to A
6   |   # commit in B
A and B are branches. 1 is a commit in A, 2 is a merge from B to A etc.
I would have expected the following repo as a result
  A
1 |
2 |
4 |
5 |

I would also have expected a shallow file with the following commits in .git: 3 6

What happened instead? (Actual behavior)
When I run the command I get a repo like this:
  A
1 |

I also get a shallow file in .git with the following commit list 2 5

What's different between what you expected and what actually happened? The commit list in the shallow file is offsetted one commit. he consequence of that is that not only B is excluded but also everything in A that depends on B

Anything else you want to add: The result is the same if I use the git fetch --shallow-exclude

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.40.0.windows.1 cpu: x86_64 built from commit: 1d90ca2906dd4b7ddaf0669a13c173ec579d794a sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 22621 compiler info: gnuc: 12.2 libc info: no libc information available $SHELL (typically, interactive shell): <unset>

[Enabled Hooks] not run from a git repository - no hooks to show

Message 1 of 1 in “--shallow-exclude commit list is offsetted one commit”
  1. Mattias HolmqvistApr 4, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.