From 7b09c86b0fa7ca07238fd10485d1c447fa55b73e Mon Sep 17 00:00:00 2001 From: Thomas O'Donnell Date: Sat, 26 Sep 2020 19:15:52 +0200 Subject: [PATCH] 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. --- docs/config/README.md | 11 ++++++++++- docs/migrating-to-0.45.0/README.md | 31 +++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index 84c3b206..7b2218b1 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -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. diff --git a/docs/migrating-to-0.45.0/README.md b/docs/migrating-to-0.45.0/README.md index 8e419b2d..3a0ea093 100644 --- a/docs/migrating-to-0.45.0/README.md +++ b/docs/migrating-to-0.45.0/README.md @@ -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) "