Skip to content

Conversation

@jjb
Copy link

@jjb jjb commented Jan 10, 2026

closes #1222

image

@jjb jjb force-pushed the default-empty-command-behavior branch from cc5edfe to 1b79340 Compare January 10, 2026 22:24
@jjb jjb force-pushed the default-empty-command-behavior branch from 1b79340 to 7654970 Compare January 10, 2026 22:25
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:
Copy link
Collaborator

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

Copy link
Author

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
Copy link
Collaborator

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?

Copy link
Author

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

Copy link
Collaborator

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?

Copy link
Collaborator

@hyperupcall hyperupcall left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: repl runs status when user hits enter

3 participants