Open mikheys opened 1 year ago
This extension has built-in version checking using Git. It's checking for Git by trying to run "git -v". Only brand new versions of Git have that shorthand for "--version", so older versions return a nonzero exit code indicating that an invalid option was sent.
A dirty fix is to just replace that -v on lines 119 and 123 with the full "--version".
EDIT: And it seems that it only raises further errors. I guess it means we should update our Git. That said...
I would argue as the proper fix that the version checking should be removed entirely, as A1111 already has it built-in.
Agreed. If it's already built into the webui, that is what should be used. Redundancy here isn't going to matter.
EDIT: Can confirm updating Git solves this issue.
Is there an existing issue for this?
Bug Description
Error loading script: better_styles.py Traceback (most recent call last): File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 119, in get_git_command subprocess.run([git, "-v"], cwd=EXTENSION_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, File "H:\stable-diffusion\python\lib\subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', '-v']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "H:\stable-diffusion\modules\scripts.py", line 263, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "H:\stable-diffusion\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 436, in
initialize()
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 428, in initialize
get_git_command()
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 123, in get_git_command
subprocess.run([git, "-v"], cwd=EXTENSION_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
File "H:\stable-diffusion\python\lib\subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git\cmd\git.exe', '-v']' returned non-zero exit status 1.
Steps to Reproduce
After installing the extension and rebooting A1111, an error appears in the console.
Screenshot (optional)