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
Adds plugin for git interactive checkout #12244
base: master
Are you sure you want to change the base?
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.
On top of the other comments, it's probably also a good idea to error check the git commands. Outside a git repo, at least two git commands are executed before the function stops:
❯ gci
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
@@ -0,0 +1,15 @@ | |||
# lol |
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.
This needs to be replaced with a proper title
git checkout "$target_branch" | ||
break | ||
else | ||
break |
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.
This should arguably return a non-zero code, as it's an error state. Even then, why is this a loop at all? Both branches break, so there's no looping in any scenario
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.
If this was supposed to be a continue
and not a break
, the echo -n
on line 39 should be moved into the loop as well
####################################### | ||
|
||
function git-checkout-interactive() { | ||
local ITEMS_TO_SHOW=10 |
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.
This doesn't necessarily need to be changed (it's not a problem, nor something I consider a significant problem), but why have a function-local constant as a variable if it can't be configured in some way?
Co-authored-by: Olivia (Zoe) <zoe.i2k1@gmail.com>
Standards checklist:
Changes:
Other comments:
...