feat(git_commit): Show the hash of commits when detached HEAD (#738)

This commit is contained in:
nesmyslny
2020-02-12 20:56:29 +01:00
committed by GitHub
parent a485fd6896
commit 0312c7b91e
4 changed files with 66 additions and 21 deletions
+8 -15
View File
@@ -493,22 +493,16 @@ truncation_symbol = ""
The `git_commit` module shows the current commit hash of the repo in your current directory.
::: tip
This module is disabled by default.
To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Variable | Default | Description |
| -------------------- | -------------- | ------------------------------------------------ |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `prefix` | `"("` | Prefix to display immediately before git commit. |
| `suffix` | `")"` | Suffix to display immediately after git commit. |
| `style` | `"bold green"` | The style for the module. |
| `disabled` | `true` | Disables the `git_commit` module. |
| Variable | Default | Description |
| -------------------- | -------------- | ----------------------------------------------------- |
| `commit_hash_length` | `7` | The length of the displayed git commit hash. |
| `prefix` | `"("` | Prefix to display immediately before git commit. |
| `suffix` | `")"` | Suffix to display immediately after git commit. |
| `style` | `"bold green"` | The style for the module. |
| `only_detached` | `true` | Only show git commit hash when in detached HEAD state |
| `disabled` | `false` | Disables the `git_commit` module. |
### Example
@@ -516,7 +510,6 @@ To enable it, set `disabled` to `false` in your configuration file.
# ~/.config/starship.toml
[git_commit]
disabled = false
commit_hash_length = 4
```