gitwatch / gitwatch

Watch a file or folder and automatically commit changes to a git repo easily.
GNU General Public License v3.0
1.51k stars 218 forks source link

Feature request: commit message determined by external script #113

Open cdf1982 opened 1 year ago

cdf1982 commented 1 year ago

Hi, I just discovered gitwatch and it is simply amazing for some use cases, thank you!

Since we're in the "AI all the things" phase of our lives, I was wondering if – in the future – a tool like AI Commits can be invoked to get a more description auto-commit message.

Not high priority, I know, but I thought it'd be cool, so I decided to open this. If out of scope, please don't hesitate to close this. Thanks again!

dmusican commented 1 year ago

Thanks for the idea, I can see why some people might like to have this. I think that linking to a specific tool like AI Commits would be hard to maintain due to depending on a new and potentially rapidly changing tool. There's also privacy concerns as to whether individuals would want their code sent off to Open AI. So I wouldn't want to bake this in, but I think a fine approach would be for gitwatch to enable a user to run an external command of their own choice to produce a commit message. This wouldn't be hard; all we would need would be a command line option to specify a script to run when producing a commit message, and a few modifications in gitwatch itself to call that script.

I'd happily review a pull request that does something like the above if someone wants to submit one. I'll leave this open and edit the title of the feature request accordingly.

cdf1982 commented 1 year ago

So I wouldn't want to bake this in, but I think a fine approach would be for gitwatch to enable a user to run an external command of their own choice to produce a commit message.

Without a doubt, you've clarified my request with a much more sensible approach. I can't say I'm able to contribute with a pull request myself, but I appreciate you taking the time to consider this!

Update: I realise that my idea not only requires modifications to Gitwatch, but also to AI Commits; I've opened a feature request there as well, but I realise I'm asking lots of things to lots of people, so please only build this if you see intrinsic value in the feature, as there's no guarantee the AI Commits team will actually make the required modifications. Thank you again for your consideration and time!

sskras commented 1 year ago

@dmusican commented on Mar 12:

I think a fine approach would be for gitwatch to enable a user to run an external command of their own choice to produce a commit message. This wouldn't be hard; all we would need would be a command line option to specify a script to run when producing a commit message, and a few modifications in gitwatch itself to call that script.

... also passing list of the files to be committed (preferably via pipe).