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

Bug report: Subtree split including extra commits

From
DKDaniel Karp <danielkarp@gmail.com>
Date
Feb 7, 2018, 14:51 UTC
Message-ID
<CAOv5hWewPHqy5KQVBthskx0Ww6cdvpAJrEgSti1Ai4uLxg94Cg@mail.gmail.com>

Apologies if this is the wrong place to send a bug report for Contributed software.

I've run into what seems like an issue/bug with git subtree.

I am trying to split a single directory of our repo into its own repo using git subtree. I ran the the following command from our project root: git subtree split --prefix=geekui2 -b geekui2-split where geekui2 is the name of the subdir.

For commits before mid 2017, the created split branch contains our entire commit history, regardless whether or not they include changes in geekui2. For commits after that point, the commits are properly filtered to include only commits that contain changes in geekui2.

The upshot is that if I push the branch to a new repo, and check out one of those earlier commits, I can essentially recover the entire codebase of our application (at that point), not just the content in geekui2. Since our goal was to share part of our repo while keeping the rest of it private, this is obviously a problem.

I've also tried using git-subrepo for this split--it seems to correctly filter the commits, excluding all commits without changes to geekui2. So something seems to be going wrong with the way git-subtree handles this relative to git subrepo.

Unfortunately, there is a lot going on in our repo--I have no idea how I would generate a minimal reproduction of this.

While our repo is private, I'm happy to help try to help debug this if someone wants to take a look at this issue, although it is not my area of expertise.

My git version is 2.16.1, and I am running it on macOS 10.12.6.

I am not subscribed to the git mailing list, so if anyone wants to get in touch with me about this, I'm most likely to see it if you send an email.

-- Daniel Karp

Message 1 of 1 in “Bug report: Subtree split including extra commits”
  1. Daniel KarpFeb 7, 2018

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.