Skip to content
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

Feature: Prompt overrides #157

Open
nickradford opened this issue May 9, 2023 · 2 comments
Open

Feature: Prompt overrides #157

nickradford opened this issue May 9, 2023 · 2 comments
Labels
question Further information is requested

Comments

@nickradford
Copy link

Is your feature request related to a problem? Please describe.
My team doesn't use conventional commits, so overriding the title or other prompts would be nice to have.

Describe the solution you'd like
Something like gptcommit eject-prompt {PROMPT_NAME} which would write a file into the repo (.gptcommit/prompts/{PROMPT_NAME}.tera) with the default contents of that prompt, allowing a user to customize it.

Describe alternatives you've considered
This could be on a per-repo basis, or they could be stored in the ~/.config/gptcommit directory, even both with a chain of precendence (default -> dotfiles -> repo)

Additional context
This would allow users to customize their prompts to be better tailored to their workflow, voice, or company requirements.

@nickradford
Copy link
Author

Or is this already achievable using the prompt settings?

let prompt_settings = settings.prompt.unwrap_or_default();
let prompt_file_diff = prompt_settings.file_diff.unwrap_or_default();
let prompt_conventional_commit_prefix = prompt_settings
.conventional_commit_prefix
.unwrap_or_default();
let prompt_commit_summary = prompt_settings.commit_summary.unwrap_or_default();
let prompt_commit_title = prompt_settings.commit_title.unwrap_or_default();
let prompt_translation = prompt_settings.translation.unwrap_or_default();

@zurawiki
Copy link
Owner

Hey @nickradford,

The features you describe should be available already. We could definitely benefit from more thought-out naming.

My team doesn't use conventional commits...

gptcommit config set output.conventional_commit false will disable the conventional commit globally.

gptcommit config set output.conventional_commit false --local will disable the conventional commit format for the current repo.

Something like gptcommit eject-prompt {PROMPT_NAME} which would write a file into the repo

If you want a repo-local override, run the command,
gptcommit config set output.conventional_commit false --local
and a file will be added at .git/gptcommit.toml assuming .git is at the root of your git checkout. This toml file has all the prompts written there for you to edit.

gptcommit config list --save will write out all the prompts to your local home folder.
From there, you can edit the TOML file at ~/.config/gptcommit/config.toml

If you find any better prompts, we'd love to add them back to this repo

@zurawiki zurawiki added the question Further information is requested label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants