Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing from git_status showing up in prompt #4263

Closed
MCMaurer opened this issue Aug 15, 2022 · 6 comments
Closed

Nothing from git_status showing up in prompt #4263

MCMaurer opened this issue Aug 15, 2022 · 6 comments
Labels
🐛 bug Something isn't working as expected.

Comments

@MCMaurer
Copy link

MCMaurer commented Aug 15, 2022

Current Behavior

Across several different shells, Terminal emulators, and starship.tom configurations, nothing from git_status shows up.

Expected Behavior

I expect to see items from git_status, such as untracked files, shown in the Starship prompt.

Additional context/Screenshots

I have tried this with every combination of bash and fish shells with iTerm2 and kitty.

Environment

  • Starship version: 1.10.0
  • bash version: GNU bash, version 5.0.16(1)-release (x86_64-apple-darwin19.3.0)
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

  • Operating system: Mac OS 12.5.0
  • Terminal emulator: iTerm.app 3.3.6
  • Git Commit Hash:
  • Branch/Tag:
  • Rust Version: rustc 1.63.0
  • Rust channel: release
  • Build Time: 2022-08-14 19:56:27 +00:00

Relevant Shell Configuration

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

# add iCommands Path
export PATH="/Applications/icommands/:$PATH"
export IRODS_PLUGINS_HOME=/Applications/icommands/plugins/

source /Users/MJ/.config/broot/launcher/bash/br
alias config='/usr/bin/git --git-dir=/Users/MJ/.myconfig/ --work-tree=/Users/MJ'

eval "$(starship init bash)"

Starship Configuration

format = "$git_branch$git_status$directory$character"
# Nushell controls the color of commands typed after the prompt.

# Displays text, typically a single character,
# based on the status of the previous command.
[character]
success_symbol = "[▶](bold green)" # normal prompt
error_symbol = "[✗](bold red)" # used if previous command failed
# error_symbol does not work in Nushell

# Displays current directory.
[directory]
format = "[$path]($style)"
style = "yellow"
truncate_to_repo = false
truncation_length = 3 # parent directories to show; default is 3
truncation_symbol = "…/"

# Displays current Git branch when in a directory of a Git repository.
[git_branch]
format = "[$symbol](green)[$branch]($style)"
style = "italic green"
symbol = ""

# Displays status of Git repository when in a directory of a Git repository.
[git_status]
format = "[$all_status$ahead_behind]($style)"
ahead = "⇡ $count "
behind = "⇣ $count "
deleted = "🗑 $count "
diverged = " $count "
stashed = "📦 $count "
modified = "פֿ $count "
staged = '[ $count ](green)'
renamed = "renamed: $count "
untracked = "untracked: ‍$count "
style = "bold red"

Output from env STARSHIP_LOG=trace starship module git_status

[TRACE] - (starship): Parsed arguments: Cli {
    command: Module {
        name: Some(
            "git_status",
        ),
        list: false,
        properties: Properties {
            status_code: None,
            pipestatus: None,
            terminal_width: 99,
            path: None,
            logical_path: None,
            cmd_duration: None,
            keymap: "viins",
            jobs: 0,
        },
    },
}
[DEBUG] - (starship::config): STARSHIP_CONFIG is not set
[DEBUG] - (starship::config): Using default config path: /Users/MJ/.config/starship.toml
[TRACE] - (starship::utils): Trying to read from "/Users/MJ/.config/starship.toml"
[TRACE] - (starship::utils): File read successfully
[TRACE] - (starship::config): Config file content: "
format = "$git_branch$git_status$directory$character"
# Nushell controls the color of commands typed after the prompt.

# Displays text, typically a single character,
# based on the status of the previous command.
[character]
success_symbol = "[▶](bold green)" # normal prompt
error_symbol = "[✗](bold red)" # used if previous command failed
# error_symbol does not work in Nushell

# Displays current directory.
[directory]
format = "[$path]($style)"
style = "yellow"
truncate_to_repo = false
truncation_length = 3 # parent directories to show; default is 3
truncation_symbol = "…/"

# Displays current Git branch when in a directory of a Git repository.
[git_branch]
format = "[$symbol](green)[$branch]($style)"
style = "italic green"
symbol = ""

# Displays status of Git repository when in a directory of a Git repository.
[git_status]
format = "[$all_status$ahead_behind]($style)"
ahead = "⇡ $count "
behind = "⇣ $count "
deleted = "🗑 $count "
diverged = " $count "
stashed = "📦 $count "
modified = "פֿ $count "
staged = '[ $count ](green)'
renamed = "renamed: $count "
untracked = "untracked: ‍$count "
style = "bold red"
"
[DEBUG] - (starship::config): Config parsed: Table({"format": String("$git_branch$git_status$directory$character"), "character": Table({"success_symbol": String("[▶](bold green)"), "error_symbol": String("[✗](bold red)")}), "directory": Table({"format": String("[$path]($style)"), "style": String("yellow"), "truncate_to_repo": Boolean(false), "truncation_length": Integer(3), "truncation_symbol": String("…/")}), "git_branch": Table({"format": String("[$symbol](green)[$branch]($style)"), "style": String("italic green"), "symbol": String("\u{f113}")}), "git_status": Table({"format": String("[$all_status$ahead_behind]($style)"), "ahead": String("⇡ $count "), "behind": String("⇣ $count "), "deleted": String("🗑 $count "), "diverged": String("\u{f5fa} $count "), "stashed": String("📦 $count "), "modified": String("פֿ $count "), "staged": String("[\u{f067} $count ](green)"), "renamed": String("renamed: $count "), "untracked": String("untracked: \u{200d}$count "), "style": String("bold red")})})
[TRACE] - (starship::context): Received completed pipestatus of None
[DEBUG] - (starship::config): Config found for "git_status": Some(Table({"format": String("[$all_status$ahead_behind]($style)"), "ahead": String("⇡ $count "), "behind": String("⇣ $count "), "deleted": String("🗑 $count "), "diverged": String("\u{f5fa} $count "), "stashed": String("📦 $count "), "modified": String("פֿ $count "), "staged": String("[\u{f067} $count ](green)"), "renamed": String("renamed: $count "), "untracked": String("untracked: \u{200d}$count "), "style": String("bold red")}))
[DEBUG] - (starship::modules::git_status): New repo status created
[TRACE] - (starship::context): Executing command "git" with args ["-C", "/Users/MJ/GitHub/pretty_plots", "--no-optional-locks", "stash", "list"] from context
[TRACE] - (starship::context): Executing command "git" with args ["-C", "/Users/MJ/GitHub/pretty_plots", "--no-optional-locks", "status", "--porcelain=2", "--branch"] from context
[TRACE] - (starship::utils): Creating Command for binary "git"
[TRACE] - (starship::utils): Creating Command for binary "git"
[TRACE] - (starship::utils): Using "/usr/local/bin/git" as "git"
[TRACE] - (starship::utils): Using "/usr/local/bin/git" as "git"
[TRACE] - (starship::utils): stdout: "", stderr: "Unknown option: --no-optional-locks\nusage: git [--version] [--help] [-C <path>] [-c name=value]\n           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n           <command> [<args>]\n", exit code: "Some(129)", took 8.60055ms
[TRACE] - (starship::utils): stdout: "", stderr: "Unknown option: --no-optional-locks\nusage: git [--version] [--help] [-C <path>] [-c name=value]\n           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n           <command> [<args>]\n", exit code: "Some(129)", took 8.601581ms
[DEBUG] - (starship::modules::git_status): get_stashed_count: git stash execution failed
[DEBUG] - (starship::modules::git_status): get_repo_status: git status execution failed
[TRACE] - (starship::config): Parsing color_string: red
[TRACE] - (starship::config): Read predefined color: red
[TRACE] - (starship::modules): Took 88.1373ms to compute module "git_status"
[DEBUG] - (starship::config): Config found for "git_status": Some(Table({"format": String("[$all_status$ahead_behind]($style)"), "ahead": String("⇡ $count "), "behind": String("⇣ $count "), "deleted": String("🗑 $count "), "diverged": String("\u{f5fa} $count "), "stashed": String("📦 $count "), "modified": String("פֿ $count "), "staged": String("[\u{f067} $count ](green)"), "renamed": String("renamed: $count "), "untracked": String("untracked: \u{200d}$count "), "style": String("bold red")}))
@MCMaurer MCMaurer added the 🐛 bug Something isn't working as expected. label Aug 15, 2022
@davidkna
Copy link
Member

What version of git are you using? Please try updating it.

@daniel-white
Copy link
Contributor

@MCMaurer if you cargo install gitoxide and run gix config does yours break?

@davidkna
Copy link
Member

@daniel-white The logs mention Unknown option: --no-optional-lock. Some older versions of git don't support that option, but there's an env var we could use instead. I want to confirm if this is the issue first.

@cnDelbert
Copy link

git status/metrics/state/commit breaks up in startship 1.10.1 while using Powershell.
I rolled back to startship 1.9.1 and the "git status/metrics/state/commit " messages showed up in prompt.
@davidkna @daniel-white

@MCMaurer
Copy link
Author

@davidkna good call on the git version, updated from 2.10 to 2.37 and that fixed it up. Thank you!

@andytom
Copy link
Member

andytom commented Aug 19, 2022

Thanks for confirming the fix @MCMaurer I am going to close this issue but feel free to reopen it if needed. @cnDelbert it sounds like you have a separate issue can you try updating to the latest version of starship and if that doesn't work open a separate issue.

@andytom andytom closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

5 participants