-
Notifications
You must be signed in to change notification settings - Fork 0
feat(fish): add glab-new-pr completion and config #110
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
PR Summary
|
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 configuration support and a completion script for the glab-new-pr alias to enhance GitLab merge request functionality via the fish shell.
- Adds a new fish completion configuration block in nix/hm/fish.nix.
- Introduces a new fish completion script in conf/fish/shellcompl/glab-new-pr.fish.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| nix/hm/fish.nix | Adds configuration for enabling fish completions from a new source. |
| conf/fish/shellcompl/glab-new-pr.fish | Implements a fish completion script for the glab-new-pr alias. |
Comments suppressed due to low confidence (1)
nix/hm/fish.nix:66
- Consider adding a brief inline comment to explain the purpose of the fishCompletions configuration block for future maintainers.
home.file.fishCompletions = {
| # Complete with git branches (local and remote) sorted by commit date | ||
| complete -c glab-new-pr -f -a '(git branch -a --sort=-committerdate 2>/dev/null | string replace -r "^\s*[\*\+]?\s*" "" | string replace -r "^remotes/[^/]+/" "" | awk "!seen[\$0]++" 2>/dev/null)' -d "Create GitLab merge request for branch" |
Copilot
AI
Jun 5, 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.
[nitpick] Consider refactoring the complex piped command into a separate helper script or adding detailed inline comments to enhance readability and future maintainability.
| # Complete with git branches (local and remote) sorted by commit date | |
| complete -c glab-new-pr -f -a '(git branch -a --sort=-committerdate 2>/dev/null | string replace -r "^\s*[\*\+]?\s*" "" | string replace -r "^remotes/[^/]+/" "" | awk "!seen[\$0]++" 2>/dev/null)' -d "Create GitLab merge request for branch" | |
| # Helper function to get git branches (local and remote) sorted by commit date | |
| function __get_git_branches | |
| # List all branches (local and remote) sorted by committer date | |
| git branch -a --sort=-committerdate 2>/dev/null | | |
| # Remove leading symbols (*, +) and whitespace | |
| string replace -r "^\s*[\*\+]?\s*" "" | | |
| # Remove remote prefixes (e.g., "remotes/origin/") | |
| string replace -r "^remotes/[^/]+/" "" | | |
| # Deduplicate branch names | |
| awk "!seen[\$0]++" 2>/dev/null | |
| end | |
| # Complete with git branches (local and remote) sorted by commit date | |
| complete -c glab-new-pr -f -a '(__get_git_branches)' -d "Create GitLab merge request for branch" |
The commit adds detailed API design and function signature guidelines to the prompt generation documentation, including anti-patterns to avoid and best practices for clear function contracts.
58ccaf9 to
235f7cd
Compare
No description provided.