-
Notifications
You must be signed in to change notification settings - Fork 5.1k
feat(shell): add fish support to create-new-feature
#1361
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Fish shell support to the create-new-feature script, providing an alternative implementation for Fish shell users alongside the existing Bash version.
- Implements full feature creation workflow including argument parsing, branch name generation, and spec file setup
- Translates Bash script logic to Fish shell syntax while maintaining functional equivalence
- Supports JSON output mode, custom short names, and manual branch numbering
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text uses a hardcoded script name instead of a variable. The bash version uses 0ドル to dynamically show the script name that was invoked, which is more flexible and accurate. This fish version should use something like (status --current-filename) or basename of it to match the bash behavior and show the actual invoked script name.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment differs from bash version. The bash version says "Filter words: remove stop words and words shorter than 3 chars (unless they're uppercase acronyms in original)" which is more descriptive. The fish version says "Filter words" followed by "Keep words that are NOT stop words AND (length >= 3 OR are potential acronyms)" in a later comment. Consider matching the bash version's comment style for consistency.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing explanatory comment. The bash version has "Function to find the repository root by searching for existing project markers" which is more descriptive than just "Function to find the repository root". The additional context about "searching for existing project markers" helps explain what the function does. Consider adding this for better documentation.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The acronym detection logic differs from the bash version. The bash version checks if the word appears as uppercase in the original description using grep -q "\b${word^^}\b" with word boundaries. The fish version uses string match -q "*"(string upper $word)"*" which performs a substring match and could produce false positives. For example, if the word "id" appears anywhere in "valid", it would match. Consider using a more precise matching approach.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comment about remote fetching. The bash version has "Fetch all remotes to get latest branch info (suppress errors if no remotes)" which explains both the action and the error suppression strategy. The fish version lacks this comment. Consider adding it for better documentation.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing base-10 interpretation prefix. The bash version uses $((10#$BRANCH_NUMBER)) to force base-10 interpretation and prevent octal conversion (e.g., "010" being interpreted as octal 8 instead of decimal 10). The fish version only uses (math $BRANCH_NUMBER + 0) which may not handle this edge case correctly. This could lead to incorrect branch numbering when branch numbers like 008, 009, 010, etc. are provided.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comment for branch name validation section. The bash version includes a comment "Validate and truncate if necessary" after the main comment about GitHub's 244-byte limit. This helps clarify the purpose of the following code block. Consider adding this comment for consistency and clarity.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing detailed comment about repository root detection. The bash version includes an explanatory comment: "Resolve repository root. Prefer git information when available, but fall back to searching for repository markers so the workflow still functions in repositories that were initialised with --no-git." This provides important context about the design decision. Consider adding this comment for better maintainability.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent comment format. The bash version has a more detailed comment explaining "Force base-10 interpretation to prevent octal conversion (e.g., 010 → 8 in octal, but should be 10 in decimal)". This fish version only says "Force base-10 interpretation" without the helpful explanation. For maintainability and clarity, consider adding the full explanation as in the bash version.
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback branch name generation logic differs from the bash version. The bash version uses tr '\n' '-' | sed 's/-$//' to join words and remove trailing hyphens, while the fish version uses string join '-'. While both achieve similar results, the bash version explicitly processes the cleaned output through tr '-' '\n' | grep -v '^$' | head -3 to split, filter empty strings, take first 3, then rejoin. The fish version uses string split '-' | string match -v '' | head -3 | string join '-' which should work equivalently. However, verify this produces identical results in edge cases.
No description provided.