When using Sapling in .git mode (existing git repo, no .sl directory), running sl goto checks out the commit hash
rather than the branch name, leaving git HEAD in a detached state.
Expected behavior: sl goto should attach HEAD to the corresponding git branch (equivalent to git checkout
), so that subsequent commits auto-advance the bookmark.
Actual behavior: git HEAD is detached after sl goto. Commits create new changesets but the bookmark pointer does not move,
requiring a manual sl bookmark -r . to update it.
Steps to reproduce:
In an existing git repo (.git mode, no .sl directory)
sl bookmark feature
sl goto feature
echo "test" > foo.txt
sl addremove && sl commit -m "test commit"
sl bookmarks # feature still points to the pre-commit hash
git branch # HEAD is detached
Workaround: Follow sl goto with git checkout to reattach HEAD. Once attached, commits advance the
bookmark correctly.
Environment:
- Sapling version: 0.2.20260317-201835
- Mode: .git (no .sl directory)
- OS: macOS 14
When using Sapling in .git mode (existing git repo, no .sl directory), running sl goto checks out the commit hash
rather than the branch name, leaving git HEAD in a detached state.
Expected behavior: sl goto should attach HEAD to the corresponding git branch (equivalent to git checkout
), so that subsequent commits auto-advance the bookmark.
Actual behavior: git HEAD is detached after sl goto. Commits create new changesets but the bookmark pointer does not move,
requiring a manual sl bookmark -r . to update it.
Steps to reproduce:
In an existing git repo (.git mode, no .sl directory)
sl bookmark feature
sl goto feature
echo "test" > foo.txt
sl addremove && sl commit -m "test commit"
sl bookmarks # feature still points to the pre-commit hash
git branch # HEAD is detached
Workaround: Follow sl goto with git checkout to reattach HEAD. Once attached, commits advance the
bookmark correctly.
Environment: