Description
Since the project ID is based on the initial commit:
git rev-list --max-parents=0 --all
… once you perform a Git subtree merge, to merge a smaller repository as a subdirectory of the larger monorepo, it will potentially change the project ID (depending on which repository is newer).
The new project ID is then also the initial commit of the smaller repository, so now you share session history between the smaller repository and the monorepo, after the subtree merge.
I understand how and why this occurs, but it’s a little confusing. Perhaps if there were more than one root commit, something else should happen.
Plugins
none
OpenCode version
1.1.47
Steps to reproduce
- Open a project, start a session.
- Now either:
- merge another repo as a subdirectory of this one:
git subtree add --prefix=subdir other-remote other-branch,
- or just add another root to the commit tree:
git switch --orphan orphan and commit something.
- Reopen the project – the session history is gone.
Screenshot and/or share link
No response
Operating System
Linux
Terminal
Alacritty
Description
Since the project ID is based on the initial commit:
… once you perform a Git subtree merge, to merge a smaller repository as a subdirectory of the larger monorepo, it will potentially change the project ID (depending on which repository is newer).
The new project ID is then also the initial commit of the smaller repository, so now you share session history between the smaller repository and the monorepo, after the subtree merge.
I understand how and why this occurs, but it’s a little confusing. Perhaps if there were more than one root commit, something else should happen.
Plugins
none
OpenCode version
1.1.47
Steps to reproduce
git subtree add --prefix=subdir other-remote other-branch,git switch --orphan orphanand commit something.Screenshot and/or share link
No response
Operating System
Linux
Terminal
Alacritty