Repository navigation
Refactor/default command: updated default tool call command - #16
Conversation
Signed-off-by: rohansen856 <rohansen856@gmail.com>
Signed-off-by: rohansen856 <rohansen856@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors argument handling to improve user experience by automatically fetching Git configuration defaults and removes the help request detection logic to simplify CLI behavior.
- Introduced Git configuration utilities to fetch user name and email from Git config
- Enhanced prompting to show Git config values as suggested defaults
- Removed help request detection logic and related test cases
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/utils/git_config.rs |
New module with cross-platform Git config parsing and retrieval functions |
src/utils/prompt.rs |
Added prompt_with_default function for enhanced user prompting |
src/utils/mod.rs |
Added git_config module export |
src/args.rs |
Updated argument handling to use Git config defaults and removed help detection |
src/main.rs |
Removed help request check from main execution flow |
tests/integration_tests.rs |
Removed help request assertions from integration tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| let config = r#" | ||
| # This is a comment | ||
| [user] | ||
| name = John Doe # inline comment |
There was a problem hiding this comment.
The gitconfig parser doesn't handle inline comments correctly. It includes the comment as part of the value instead of stripping it. The parser should split on '#' or ';' and only use the part before the comment.
|
|
||
| // We can't assert specific values since they depend on the environment | ||
| // but we can ensure the functions execute without panicking | ||
| assert!(true); |
There was a problem hiding this comment.
Using assert!(true) is a no-op assertion that doesn't test anything meaningful. Consider removing this assertion or replacing it with a more specific test that validates the functions don't panic.
| assert!(true); |
|
|
||
| // We can't test the actual path since it depends on the OS and Git installation | ||
| // but we can ensure the function doesn't panic | ||
| assert!(true); |
There was a problem hiding this comment.
Using assert!(true) is a no-op assertion that doesn't test anything meaningful. Consider removing this assertion or replacing it with a more specific test that validates the function doesn't panic.
| assert!(true); |
Signed-off-by: rohansen856 <rohansen856@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: rohansen856 <rohansen856@gmail.com>
This pull request improves the user experience for providing author information by automatically fetching the user's name and email from their Git configuration, and refactors the argument handling logic accordingly. It also introduces new utilities for reading Git config files cross-platform and removes the previous "help request" detection logic.
Enhancements to argument handling and user experience:
nameoremailarguments, the application now tries to fetch defaults from the user's Git configuration (viagit configor directly from.gitconfig), and displays these as suggested defaults in the prompt. (src/args.rs,src/utils/prompt.rs,src/utils/git_config.rs) [1] [2] [3]prompt_with_defaultto prompt the user with a suggested default value, improving usability. (src/utils/prompt.rs)Utilities for Git configuration:
git_configthat provides cross-platform functions to retrieve the user's Git name and email, including direct parsing of.gitconfigfiles. (src/utils/git_config.rs,src/utils/mod.rs) [1] [2]Refactoring and cleanup:
is_help_requestlogic and all related test cases, simplifying how the CLI determines when to prompt for arguments. (src/args.rs,src/main.rs,tests/integration_tests.rs) [1] [2] [3] [4] [5] [6]Testing improvements:
src/utils/git_config.rs)prompt_with_default. (src/utils/prompt.rs)