> ## Documentation Index
> Fetch the complete documentation index at: https://docs.taho.is/llms.txt
> Use this file to discover all available pages before exploring further.

# VCS Support

> TAHO Lift supports both **Git** and **Sapling** through a unified abstraction layer. VCS detection is automatic.

## Detection

On startup, Lift walks up the directory tree from the working directory looking for VCS markers in priority order:

1. `.sl` — Sapling
2. `.git` — Git
3. `.hg` — legacy Sapling (Mercurial heritage)

If both `.sl` and `.git` exist in the same ancestry, Sapling takes precedence.

Detection runs once per invocation and is cached for the lifetime of the process.

## Supported operations

Every tool in the pipeline uses the same VCS abstraction. The underlying commands differ per backend, but the behavior is identical.

| Operation                | Git                             | Sapling                        |
| ------------------------ | ------------------------------- | ------------------------------ |
| Current commit hash      | `git rev-parse HEAD`            | `sl log -r . -T {node}`        |
| Main branch hash         | `git rev-parse <branch>`        | `sl log -r <branch> -T {node}` |
| Working directory status | `git status --porcelain`        | `sl status`                    |
| Commit message           | `git log -1 --format=%B`        | `sl log -r . -T {desc}`        |
| Commit diff              | `git show HEAD`                 | `sl show`                      |
| Amend commit             | `git commit --amend`            | `sl amend`                     |
| Submit PR                | `gh pr create [--draft] --fill` | `sl pr submit [--draft]`       |

<Note>
  The main branch name defaults to `main` and can be overridden via the `main_branch` config setting. PR draft mode is controlled by the `pr.draft` config setting.
</Note>

## Pull request workflow

The `--pr` flag triggers PR creation or update after the pipeline finishes. The workflow differs by backend.

### Sapling

Sapling has native PR support. Lift calls `sl pr submit --draft` directly.

### Git

Git PR submission requires the [GitHub CLI](https://cli.github.com/) (`gh`). When you submit a PR through Lift:

1. Pushes the current branch with `git push --force-with-lease -u origin HEAD`
2. Checks whether a PR already exists for the branch
3. Creates a new draft PR, or updates the existing one

<Warning>
  If `gh` is not installed, Lift prints the manual command and continues without creating the PR.
</Warning>

## Dependency validation

Lift checks for required dependencies on startup:

| Dependency | Required                 | Purpose                                      |
| ---------- | ------------------------ | -------------------------------------------- |
| `sl`       | When Sapling is detected | All VCS operations                           |
| `git`      | When Git is detected     | All VCS operations                           |
| `gh`       | Optional (Git only)      | PR creation and updates                      |
| `claude`   | Always                   | AI-powered commit messages and documentation |

Missing required dependencies cause Lift to exit with installation instructions. Missing optional dependencies produce a warning.

## Commit tracking

Lift tracks which commits each tool has processed in `~/.taho/lift/`:

```
~/.taho/lift/ink    # Commits processed by Inky
~/.taho/lift/doc    # Commits processed by Doc
```

Tracking is VCS-agnostic — it stores commit hashes regardless of backend. This means switching between Git and Sapling on the same repository preserves processing history as long as commit hashes remain stable.

## Preconditions

Before running the pipeline, Lift verifies:

1. **Clean working directory** — uncommitted changes cause an error
2. **Not on main** — Lift refuses to amend commits on the main branch
3. **Non-empty diff** — tools skip commits with no changes
