Content-Length: 223414 | pFad | http://github.com/starship/starship/issues/6448

86 Add -i flag to the fossil_metrics module's command · Issue #6448 · starship/starship · GitHub
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

Add -i flag to the fossil_metrics module's command #6448

Open
Me1m0th opened this issue Dec 26, 2024 · 1 comment
Open

Add -i flag to the fossil_metrics module's command #6448

Me1m0th opened this issue Dec 26, 2024 · 1 comment
Labels
🐛 bug Something isn't working as expected. 🌱 good first issue Good first issue to get your feet wet.

Comments

@Me1m0th
Copy link

Me1m0th commented Dec 26, 2024

Current Behavior

fossil_metrics module fails to report the correct number of diffs in the repository if the user has delegated the diff behavior to another program, like: "fossil set --global diff-command 'diff -dwu --color=always'".

Expected Behavior

The metrics being displayed.

Additional context/Screenshots

None

Possible Solution

Instead of running "fossil diff --numstat" in the module, run "fossil diff -i --numstat", the -i flag makes the command use fossil's own engine, so just adding that flag to the command should fix the problem.

Environment

  • Starship version: 1.21.1
  • fish version: fish, version 3.7.1
  • Operating system: Android Unknown
  • Terminal emulator:
  • Git Commit Hash:
  • Branch/Tag:
  • Rust Version: rustc 1.83.0 (90b35a623 2024-11-26)
  • Rust channel: 1.83.0-x86_64-unknown-linux-gnu release
  • Build Time: 2024-12-14 13:50:59 +00:00

Relevant Shell Configuration

starship init fish | source

Starship Configuration

# ~/.config/starship.toml
"$schema" = 'https://starship.rs/config-schema.json'

format = """
[](color_orange)\
$os\
[](bg:color_yellow fg:color_orange)\
$directory\
[](fg:color_yellow bg:color_aqua)\
$fossil_branch\
[](fg:color_aqua bg:color_blue)\
$fossil_metrics\
[](fg:color_blue bg:color_bg3)\
$jobs\
[](fg:color_bg3 bg:color_bg1)\
$time\
$cmd_duration\
[ ](fg:color_bg1)\
$status\
$line_break$character"""

palette = 'gruvbox_dark'

[palettes.gruvbox_dark]
color_fg0 = '#fbf1c7'
color_bg1 = '#26233a'
color_bg3 = '#575279'
color_blue = '#f6c177'
color_aqua = '#56949f'
color_green = '#98971a'
color_orange = '#b4637a'
color_purple = '#b16286'
color_red = '#cc241d'
color_yellow = '#6e6a86'

[status]
style = 'color_orange'
format = '[\[$common_meaning$signal_name$maybe_int\]]($style) '
disabled = false

[os]
disabled = false
style = "bg:color_orange fg:color_fg0"
[os.symbols]
Android = ""

[jobs]
disabled = false
symbol = ''
format = '[[$symbol$number](fg:color_blue bg:color_bg3)]($style)'

[directory]
style = "fg:color_fg0 bg:color_yellow"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"

[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = ""
"Music" = "󰝚 "
"Pictures" = ""
"Developer" = "󰲋 "

[time]
disabled = false
time_format = "%R"
style = "bg:color_bg1"
format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)'

[cmd_duration]
disabled = false
min_time = 5_000
format = '[[~$duration](fg:color_yellow bg:color_bg1)]($style)'

[line_break]
disabled = false

[character]
disabled = false
success_symbol = '[](bold fg:color_green)'
error_symbol = '[](bold fg:color_red)'
vimcmd_symbol = '[](bold fg:color_green)'

[fossil_branch]
disabled = false
symbol = '🦎'
format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)'

[fossil_metrics]
disabled = false
only_nonzero_diffs = true
format = '[$added ](fg:color_aqua bg:color_blue)[$deleted](fg:color_red bg:color_blue)($style)'
@Me1m0th Me1m0th added the 🐛 bug Something isn't working as expected. label Dec 26, 2024
@Me1m0th Me1m0th changed the title fossil_metrics when other diff programs are used Add -i flag to the fossil_metrics module's command Dec 28, 2024
@andytom andytom added the 🌱 good first issue Good first issue to get your feet wet. label Dec 29, 2024
@Me1m0th
Copy link
Author

Me1m0th commented Dec 31, 2024

A little hack that I came up with, which can be used as an alternative until this is fixed. But this too probably has its own set of problems.

[custom.fossil_hack]
disabled = false
command = 'fossil diff -i --numstat | awk "END{if (\$1 || \$2) printf \"\033[32m+%d \033[31m-%d\033[0m\", \$1, \$2}"'
when = 'fossil status'
shell = ['/usr/bin/bash']
format = '[$output](fg:color_aqua bg:color_blue)($style)'

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. 🌱 good first issue Good first issue to get your feet wet.
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/starship/starship/issues/6448

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy