Skip to content

sl goto detaches git HEAD in .git mode, preventing bookmark auto-advance on commit #1304

@dhruvrajan

Description

@dhruvrajan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions