1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 07:46:28 +00:00

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:
Thomas O'Donnell 2020-09-26 19:15:52 +02:00 committed by GitHub
parent c93bd7b705
commit 7b09c86b0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 8 deletions

View File

@ -1120,7 +1120,6 @@ current directory.
| `staged` | `"+"` | The format of `staged` |
| `renamed` | `"»"` | The format of `renamed` |
| `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. |
| `disabled` | `false` | Disables the `git_status` module. |
@ -1174,6 +1173,16 @@ renamed = "👅"
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
The `golang` module shows the currently installed version of Golang.

View File

@ -137,7 +137,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[directory]
-- prefix = "in "
++ format = "[$path]($style)[$lock_symbol]($lock_style)"
```
@ -152,7 +152,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[env_var]
-- prefix = ""
-- suffix = ""
++ format = "with [$env_value]($style) "
@ -168,7 +168,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[git_commit]
-- prefix = "("
-- suffix = ")"
++ format = "[\\($hash\\)]($style) "
@ -180,16 +180,33 @@ error_symbol = "[✖](bold red) "
| ------------------- | ----------- |
| `prefix` | `format` |
| `suffix` | `format` |
| `show_sync_count` | `format` |
**Changes to the Default Configuration**
```diff
[cmd_duration]
[git_status]
-- prefix = "["
-- suffix = "]"
-- show_sync_count = false
++ 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
| Deprecated Property | Replacement |
@ -200,7 +217,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[hostname]
-- prefix = ""
-- suffix = ""
++ format = "[$hostname]($style) in "
@ -217,7 +234,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[singularity]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol\\[$env\\]]($style) "
@ -248,7 +265,7 @@ error_symbol = "[✖](bold red) "
**Changes to the Default Configuration**
```diff
[cmd_duration]
[custom.example]
-- prefix = ""
-- suffix = ""
++ format = "[$symbol$output]($style) "