From 2454c63429c36a624c6c87313cff5e7dc37e4766 Mon Sep 17 00:00:00 2001 From: John Bachir Date: Sat, 10 Jan 2026 14:18:14 -0800 Subject: [PATCH 1/4] ability to specify command when hitting enter --- bin/git-repl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/git-repl b/bin/git-repl index a706de37..b6df7271 100755 --- a/bin/git-repl +++ b/bin/git-repl @@ -39,7 +39,13 @@ while true; do # Built-in commands case $cmd in ls) cmd=ls-files;; - "") continue;; + "") + on_enter_cmd=$(git config --get --default '' git-extras.repl.on-enter-command) + if test -n "$on_enter_cmd"; then + eval "$on_enter_cmd" + fi + continue + ;; quit|exit|q) break;; esac From 7654970b2dcc8b87dd88bc084e935e84fe62ae22 Mon Sep 17 00:00:00 2001 From: John Bachir Date: Sat, 10 Jan 2026 14:24:05 -0800 Subject: [PATCH 2/4] documentation --- Commands.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Commands.md b/Commands.md index fa596142..76606cef 100644 --- a/Commands.md +++ b/Commands.md @@ -392,6 +392,12 @@ Type `exit`, `quit`, or `q` to end the repl session. 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: + +```bash +git config --global git-extras.repl.on-enter-command "git status -sb" +``` + ```bash $ git repl git version 2.34.1 From be75ea45d2b17a30e593f681f1254906a698f6be Mon Sep 17 00:00:00 2001 From: John Bachir Date: Thu, 15 Jan 2026 18:18:32 -0800 Subject: [PATCH 3/4] man page --- man/git-repl.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/git-repl.md b/man/git-repl.md index db51b76e..47a0b435 100644 --- a/man/git-repl.md +++ b/man/git-repl.md @@ -38,6 +38,11 @@ git-repl(1) -- git read-eval-print-loop Ends the repl session. +## CONFIGURATION + + You can specify a default command to run when hitting enter: + + `git config --global git-extras.repl.on-enter-command "git status -sb"` ## EXAMPLES From 6d3f7927cd3a298a18c5357aed38ded8c617ba1b Mon Sep 17 00:00:00 2001 From: John Bachir Date: Thu, 15 Jan 2026 21:11:15 -0800 Subject: [PATCH 4/4] generate man page and html --- man/git-repl.1 | 10 +++++++--- man/git-repl.html | 13 ++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/man/git-repl.1 b/man/git-repl.1 index b3721f44..bd59954d 100644 --- a/man/git-repl.1 +++ b/man/git-repl.1 @@ -1,6 +1,6 @@ -.\" generated with Ronn-NG/v0.9.1 -.\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GIT\-REPL" "1" "September 2024" "" "Git Extras" +.\" generated with Ronn-NG/v0.10.1 +.\" http://github.com/apjanke/ronn-ng/tree/0.10.1 +.TH "GIT\-REPL" "1" "January 2026" "" "Git Extras" .SH "NAME" \fBgit\-repl\fR \- git read\-eval\-print\-loop .SH "SYNOPSIS" @@ -31,6 +31,10 @@ Equivalent of 'git ls\-files'\. exit|quit|q .P Ends the repl session\. +.SH "CONFIGURATION" +You can specify a default command to run when hitting enter: +.P +\fBgit config \-\-global git\-extras\.repl\.on\-enter\-command "git status \-sb"\fR .SH "EXAMPLES" .nf $ git repl diff --git a/man/git-repl.html b/man/git-repl.html index 3f9750e6..e1995ab6 100644 --- a/man/git-repl.html +++ b/man/git-repl.html @@ -1,8 +1,8 @@ - - + + git-repl(1) - git read-eval-print-loop