Add include_prompts_in_repositories whitelist for prompt storage #362
+443
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Summary
include_prompts_in_repositoriesconfig option to whitelist repositories for enterprise prompt storage (CAS)default_prompt_storageconfig option to specify fallback storage mode for non-whitelisted reposPromptStorageModeenum for type-safe handling of storage modeseffective_prompt_storage()resolver to handle the new whitelist logic with proper precedenceMotivation
This enables two common use cases:
User A (wants git-ai everywhere, CAS for work repos, notes for OSS):
{ "prompt_storage": "default", "include_prompts_in_repositories": ["https://github.com/myorg/*"], "default_prompt_storage": "notes" }User B (wants git-ai only for work repos with CAS):
{ "prompt_storage": "default", "allow_repositories": ["https://github.com/myorg/*"], "include_prompts_in_repositories": ["*"] }Changes
src/config.rs: AddedPromptStorageModeenum, new config fields,effective_prompt_storage()resolver, and testssrc/authorship/post_commit.rs: Updated to use neweffective_prompt_storage()resolversrc/commands/config.rs: Added CLI support for get/set/unset of new config optionsTest plan
PromptStorageMode::from_str()andas_str()effective_prompt_storage()covering:🤖 Generated with Claude Code