docs(git_status): Update git_status module docs (#1667)
* docs: Update git_status module docs Have updated the configuration docs for the `git_status` to remove a non-existing option and to add an example for how to achieve the same effect as with the new format strings. * Add git_status changes to migration guide Have added the change to the sync count to the migration guide. I also corrected a few typos in the configuration.
This commit is contained in:
parent
c93bd7b705
commit
7b09c86b0f
|
@ -1120,7 +1120,6 @@ current directory.
|
||||||
| `staged` | `"+"` | The format of `staged` |
|
| `staged` | `"+"` | The format of `staged` |
|
||||||
| `renamed` | `"»"` | The format of `renamed` |
|
| `renamed` | `"»"` | The format of `renamed` |
|
||||||
| `deleted` | `"✘"` | The format of `deleted` |
|
| `deleted` | `"✘"` | The format of `deleted` |
|
||||||
| `show_sync_count` | `false` | Show ahead/behind count of the branch being tracked. |
|
|
||||||
| `style` | `"bold red"` | The style for the module. |
|
| `style` | `"bold red"` | The style for the module. |
|
||||||
| `disabled` | `false` | Disables the `git_status` module. |
|
| `disabled` | `false` | Disables the `git_status` module. |
|
||||||
|
|
||||||
|
@ -1174,6 +1173,16 @@ renamed = "👅"
|
||||||
deleted = "🗑"
|
deleted = "🗑"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Show ahead/behind count of the branch being tracked
|
||||||
|
```toml
|
||||||
|
# ~/.config/starship.toml
|
||||||
|
|
||||||
|
[git_status]
|
||||||
|
ahead = "⇡${count}"
|
||||||
|
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
|
||||||
|
behind = "⇣${count}"
|
||||||
|
```
|
||||||
|
|
||||||
## Golang
|
## Golang
|
||||||
|
|
||||||
The `golang` module shows the currently installed version of Golang.
|
The `golang` module shows the currently installed version of Golang.
|
||||||
|
|
|
@ -137,7 +137,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[directory]
|
||||||
-- prefix = "in "
|
-- prefix = "in "
|
||||||
++ format = "[$path]($style)[$lock_symbol]($lock_style)"
|
++ format = "[$path]($style)[$lock_symbol]($lock_style)"
|
||||||
```
|
```
|
||||||
|
@ -152,7 +152,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[env_var]
|
||||||
-- prefix = ""
|
-- prefix = ""
|
||||||
-- suffix = ""
|
-- suffix = ""
|
||||||
++ format = "with [$env_value]($style) "
|
++ format = "with [$env_value]($style) "
|
||||||
|
@ -168,7 +168,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[git_commit]
|
||||||
-- prefix = "("
|
-- prefix = "("
|
||||||
-- suffix = ")"
|
-- suffix = ")"
|
||||||
++ format = "[\\($hash\\)]($style) "
|
++ format = "[\\($hash\\)]($style) "
|
||||||
|
@ -180,16 +180,33 @@ error_symbol = "[✖](bold red) "
|
||||||
| ------------------- | ----------- |
|
| ------------------- | ----------- |
|
||||||
| `prefix` | `format` |
|
| `prefix` | `format` |
|
||||||
| `suffix` | `format` |
|
| `suffix` | `format` |
|
||||||
|
| `show_sync_count` | `format` |
|
||||||
|
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[git_status]
|
||||||
-- prefix = "["
|
-- prefix = "["
|
||||||
-- suffix = "]"
|
-- suffix = "]"
|
||||||
|
-- show_sync_count = false
|
||||||
++ format = "([$all_status$ahead_behind] )"
|
++ format = "([$all_status$ahead_behind] )"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Previously, the `show_sync_count` property was used to configure the prompt to
|
||||||
|
show the number of commits the branch was ahead or behind the remote branch.
|
||||||
|
|
||||||
|
With the release of v0.45.0, this has been replaced with the
|
||||||
|
|
||||||
|
To configure the prompt to use the older `show_sync_count = true`
|
||||||
|
configuration, set the following to your config file:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[git_status]
|
||||||
|
ahead = "⇡${count}"
|
||||||
|
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
|
||||||
|
behind = "⇣${count}"
|
||||||
|
```
|
||||||
|
|
||||||
#### Hostname
|
#### Hostname
|
||||||
|
|
||||||
| Deprecated Property | Replacement |
|
| Deprecated Property | Replacement |
|
||||||
|
@ -200,7 +217,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[hostname]
|
||||||
-- prefix = ""
|
-- prefix = ""
|
||||||
-- suffix = ""
|
-- suffix = ""
|
||||||
++ format = "[$hostname]($style) in "
|
++ format = "[$hostname]($style) in "
|
||||||
|
@ -217,7 +234,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[singularity]
|
||||||
-- prefix = ""
|
-- prefix = ""
|
||||||
-- suffix = ""
|
-- suffix = ""
|
||||||
++ format = "[$symbol\\[$env\\]]($style) "
|
++ format = "[$symbol\\[$env\\]]($style) "
|
||||||
|
@ -248,7 +265,7 @@ error_symbol = "[✖](bold red) "
|
||||||
**Changes to the Default Configuration**
|
**Changes to the Default Configuration**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
[cmd_duration]
|
[custom.example]
|
||||||
-- prefix = ""
|
-- prefix = ""
|
||||||
-- suffix = ""
|
-- suffix = ""
|
||||||
++ format = "[$symbol$output]($style) "
|
++ format = "[$symbol$output]($style) "
|
||||||
|
|
Loading…
Reference in New Issue