chatgpt_commit_message_hook icon indicating copy to clipboard operation
chatgpt_commit_message_hook copied to clipboard

Does not like not setting proxy.

Open cheako opened this issue 2 years ago • 3 comments

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'

cheako avatar Mar 20 '23 19:03 cheako

Using "prixy=\n" worked.

cheako avatar Mar 20 '23 21:03 cheako

"prixy=\n" or "proxy=\n"?

tom-doerr avatar Mar 21 '23 23:03 tom-doerr

That's an uninteresting distinction for me, I feel that unknown config options should warn over panic. To answer your question "the latter," I made a typo in the issue comment.

cheako avatar Mar 24 '23 16:03 cheako