-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ability to specify command when hitting enter #1223
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
base: main
Are you sure you want to change the base?
Conversation
cc5edfe to
1b79340
Compare
1b79340 to
7654970
Compare
| Any arguments to git repl will be taken as the first command to execute in | ||
| the repl. | ||
|
|
||
| You can specify a default command to run when hitting enter: |
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.
Let's also update https://github.com/tj/git-extras/blob/main/man/git-repl.md and generate new man page
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.
done
| if test -n "$on_enter_cmd"; then | ||
| eval "$on_enter_cmd" | ||
| fi | ||
| continue |
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 continue will skip exit_status=$? below?
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.
before my change, when there was an empty command, the result was continue
after my change, now there is the optional command executed, and then always continue like before
(maybe you know this and are asking something else)
i just now tested the exit_status feature with and without git-extras.repl.on-enter-command being set and it still works
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.
@jjb
So the custom command, unlike the command input for prompt, doesn't affect the exit status. Is it intended?
hyperupcall
left a comment
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 LGTM assuming the comments by @spacewander are addressed!
closes #1222