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

fix: better dirty state #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zzhaolei
Copy link

@zzhaolei zzhaolei commented Apr 22, 2024

Current dirty status may be incorrect, use better detection method

Incorrect, Nothing actually changes:
image

Correct:
image

Performance:
No performance regression.

(Can it be tested like this?🤔)
image

@zzhaolei
Copy link
Author

@jorgebucaran Please review this PR

@jorgebucaran
Copy link
Owner

This is probably good. I also had a couple of weird issues with the dirty status. Thank you! I just need to test it on the wild for a while before we're able to merge.

@zzhaolei
Copy link
Author

Hello, I have been using it for three weeks and haven't noticed any problems. Can it be merged?

@jorgebucaran
Copy link
Owner

Good to know, thanks!

@zzhaolei
Copy link
Author

zzhaolei commented May 16, 2024

Now we can use this:

Old ``` count (git status --porcelain=v2 --untracked-files=no) >/dev/null; or count (command git ls-files --others --exclude-standard) >/dev/null; and set info \"$hydro_symbol_git_dirty\" ```

Edited:
Now we can use this:

count (git status --porcelain=v2 --untracked-files=no) >/dev/null;
    or count (command git ls-files --others --exclude-standard \$(command git rev-parse --show-toplevel)) >/dev/null;
    and set info \"$hydro_symbol_git_dirty\"
# Incorrect outputstime command git ls-files --others --exclude-standard                                                                                                    [17:37:03]

________________________________________________________
Executed in   28.84 millis    fish           external
   usr time   16.23 millis    0.09 millis   16.14 millis
   sys time   10.42 millis    1.08 millis    9.33 millis

# Correct outputstime command git ls-files --others --exclude-standard ..                                                                                                 [17:37:05]
../1

________________________________________________________
Executed in  941.38 millis    fish           external
   usr time  202.08 millis    0.11 millis  201.97 millis
   sys time  777.69 millis    1.10 millis  776.59 millis

# Correct outputstime command git ls-files --others --exclude-standard $(command git rev-parse --show-toplevel)                                                           [17:37:10]
../1

________________________________________________________
Executed in  930.11 millis    fish           external
   usr time  198.21 millis    0.12 millis  198.09 millis
   sys time  769.98 millis    1.20 millis  768.78 millis

~/R/nixpkgs/lib master• >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants