tom-doerr / chatgpt_commit_message_hook Goto Github PK
View Code? Open in Web Editor NEWEnhance your git workflow using AI-generated commit messages from ChatGPT. Seamless integration for a well-documented commit log.
License: MIT License
Enhance your git workflow using AI-generated commit messages from ChatGPT. Seamless integration for a well-documented commit log.
License: MIT License
I don't have the error handy, but I think it couldn't find .git/COMMIT_MSG
.
Also what if I wanted to re-word every commit, say for when a new language model is released. Edit: Or the first lang model, https://gitlab.com/cheako/ash-tray-rs/-/commits/master
The config file was just 3 lines, not 4 like the example.
cheako@mx1:~/src/gitlab/hazel-rs$ git commit -a
Traceback (most recent call last):
File "/usr/bin/prepare-commit-msg", line 161, in <module>
api_key, proxy, max_changed_lines = initialize_openai_api()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/prepare-commit-msg", line 149, in initialize_openai_api
proxy = config["openai"]["proxy"].strip('"').strip("'")
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.11/configparser.py", line 1273, in __getitem__
raise KeyError(key)
KeyError: 'proxy'
I do not know why I'm getting this.
cheako@mx1:~/src/gitlab/hazel-rs$ git commit -a
Traceback (most recent call last):
File "/usr/bin/prepare-commit-msg", line 162, in <module>
changes_dict = count_staged_changes()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/prepare-commit-msg", line 36, in count_staged_changes
staged_diff = index.diff("HEAD", create_patch=True, R=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/index/base.py", line 1386, in diff
other = self.repo.rev_parse(other)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/repo/fun.py", line 378, in rev_parse
obj = cast(Commit_ish, name_to_object(repo, rev))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/repo/fun.py", line 187, in name_to_object
return Object.new_from_sha(repo, hex_to_bin(hexsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/objects/base.py", line 94, in new_from_sha
oinfo = repo.odb.info(sha1)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/db.py", line 40, in info
hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1383, in get_object_header
return self.__get_object_header(cmd, ref)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1370, in __get_object_header
return self._parse_object_header(cmd.stdout.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1329, in _parse_object_header
raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))
ValueError: SHA could not be resolved, git returned: b''
cheako@mx1:~/src/gitlab/hazel-rs$ git commit
Traceback (most recent call last):
File "/usr/bin/prepare-commit-msg", line 162, in <module>
changes_dict = count_staged_changes()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/prepare-commit-msg", line 36, in count_staged_changes
staged_diff = index.diff("HEAD", create_patch=True, R=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/index/base.py", line 1386, in diff
other = self.repo.rev_parse(other)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/repo/fun.py", line 378, in rev_parse
obj = cast(Commit_ish, name_to_object(repo, rev))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/repo/fun.py", line 187, in name_to_object
return Object.new_from_sha(repo, hex_to_bin(hexsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/objects/base.py", line 94, in new_from_sha
oinfo = repo.odb.info(sha1)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/db.py", line 40, in info
hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1383, in get_object_header
return self.__get_object_header(cmd, ref)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1370, in __get_object_header
return self._parse_object_header(cmd.stdout.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/git/cmd.py", line 1329, in _parse_object_header
raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))
ValueError: SHA could not be resolved, git returned: b''
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.