8000 What if git is missing from machine? · Issue #39 · edouard-lopez/pure.py · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

What if git is missing from machine? #39

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

Open
edouard-lopez opened this issue Feb 16, 2023 · 0 comments
Open

What if git is missing from machine? #39

edouard-lopez opened this issue Feb 16, 2023 · 0 comments
Labels
🚀 enhancement performance/ux or maintanability

Comments

@edouard-lopez
88CF
Copy link
Owner

Currently git is a requirement as it required by gitpython and we run git-related command unconditionally. However, not everyone use git.

This could lead to this kind of error:

Traceback (most recent call last):                                                                                                                                                                                           [432/1843]
  File "/home/pure/.pure//pure/prompt.py", line 45, in <module>                                                    
    prompt(parser.parse_args())                                                                                    
  File "/home/pure/.pure//pure/prompt.py", line 16, in prompt                                                  
    'git_is_dirty': repository.IsDirty(os.getcwd()).segment(),                                                     
  File "/home/pure/.pure/pure/repository.py", line 46, in segment                                                  
    'text': self.raw(),                                                                                            
  File "/home/pure/.pure/pure/repository.py", line 40, in raw                                                      
    return '*' if self.repo.is_dirty(untracked_files=True) else constants.NOTHING
  File "/usr/lib/python3.10/site-packages/git/repo/base.py", line 646, in is_dirty                                 
    len(self.git.diff('--cached', *default_args)):                                                                 
  File "/usr/lib/python3.10/site-packages/git/cmd.py", line 542, in <lambda>                                                                                                                                                           
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)                                                                                                                                                           
  File "/usr/lib/python3.10/site-packages/git/cmd.py", line 1005, in _call_process                                                                                                                                                     
    return self.execute(call, **exec_kwargs)                                                                                                                                                                                           
  File "/usr/lib/python3.10/site-packages/git/cmd.py", line 822, in execute                                                                                                                                                            
    raise GitCommandError(command, status, stderr_value, stdout_value)                                                                                                                                                                 
git.exc.GitCommandError: Cmd('git') failed due to: exit code(129)                                                                                                                                                                      
  cmdline: git diff --cached --abbrev=40 --full-index --raw                                                                                                                                                                            
  stderr: 'error: unknown option `cached'                                                                                                                                                                                              
usage: git diff --no-index [<options>] <path> <path>   
@edouard-lopez edouard-lopez added the 🚀 enhancement performance/ux or maintanability label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement performance/ux or maintanability
Projects
None yet
Development

No branches or pull requests

1 participant
0