2023-02-16 06:18:21 -08:00
---
id: sapling
title: Sapling
sidebar_label: Sapling
---
## What
Display [sapling][sapling] information when in a sapling repository.
## Sample Configuration
2023-04-08 01:59:37 -07:00
import Config from "@site/src/components/Config.js";
<Config
data={{
type: "sapling",
style: "powerline",
powerline_symbol: "\uE0B0",
foreground: "#193549",
background: "#4C9642",
background_templates: ["{{ if .Bookmark }}#4C9642{{ end }}"],
properties: {
fetch_status: true,
},
}}
/>
2023-02-16 06:18:21 -08:00
## Properties
### Fetching information
2023-06-25 23:44:17 -07:00
| Name | Type | Description |
| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fetch_status` | `boolean` | fetch the local changes - defaults to `true` |
| `native_fallback` | `boolean` | when set to `true` and `sl.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native sapling executable to fetch data. Not all information can be displayed in this case. Defaults to `false` |
| `status_formats` | `map[string]string` | a key, value map allowing to override how individual status items are displayed. For example, `"status_formats": { "Added": "Added: %d" }` will display the added count as `Added: 1` instead of `+1`. See the [Status](#status) section for available overrides. Defaults to an empty map. |
2023-02-16 06:18:21 -08:00
## Template ([info][templates])
:::note default template
```template
{{ if .Bookmark }}\uf097 {{ .Bookmark }}*{{ else }}\ue729 {{ .ShortHash }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}
```
:::
### Properties
2023-06-25 23:44:17 -07:00
| Name | Type | Description |
| -------------- | --------- | ------------------------------------------ |
| `.RepoName` | `string` | the repo folder name |
| `.Working` | `Status` | changes in the worktree (see below) |
| `.Description` | `string` | the first line of the commit's description |
| `.Author` | `string` | the author of the commit |
| `.Hash` | `string` | the full hash of the commit |
| `.ShortHash` | `string` | the short hash of the commit |
| `.When` | `string` | the commit's relative time indication |
| `.Bookmark` | `string` | the commit's bookmark (if any) |
| `.Dir` | `string` | the repository's root directory |
| `.New` | `boolean` | true when there are no commits in the repo |
### Status
2023-02-16 06:18:21 -08:00
| Name | Type | Description |
| ------------ | --------- | -------------------------------------------- |
| `.Modified` | `int` | number of modified changes |
| `.Added` | `int` | number of added changes |
| `.Deleted` | `int` | number of removed changes |
| `.Untracked` | `boolean` | number of untracked changes |
| `.Clean` | `int` | number of clean changes |
| `.Missing` | `int` | number of missing changes |
| `.Ignored` | `boolean` | number of ignored changes |
| `.String` | `string` | a string representation of the changes above |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
2023-06-25 23:44:17 -07:00
| `~` | Modified |
| `+` | Added |
| `-` | Deleted |
| `?` | Untracked |
| `=` | Clean |
| `!` | Missing |
| `Ø` | Ignored |
2023-02-16 06:18:21 -08:00
[sapling]: https://sapling-scm.com/
[templates]: /docs/configuration/templates