All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] contrib/git-jump: cat output when not a terminal
@ 2020-05-09 19:15 George Brown
  2020-05-09 21:41 ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: George Brown @ 2020-05-09 19:15 UTC (permalink / raw)
  To: git; +Cc: peff

contrib/git-jump: cat output when not a terminal

The current usage to populate Vim's quickfix list cannot be used from
within the editor as it invokes another instance.

Check if stdout is to a terminal or not. If not simply cat the output.

Signed-off-by: George Brown <321.george@gmail.com>
---
 contrib/git-jump/git-jump | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
index 931b0fe3a9..253341c64e 100755
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -19,8 +19,12 @@ EOF
 }

 open_editor() {
-    editor=`git var GIT_EDITOR`
-    eval "$editor -q \$1"
+    if test -t 1; then
+        editor=`git var GIT_EDITOR`
+        eval "$editor -q \$1"
+    else
+        cat "$1"
+    fi
 }

 mode_diff() {

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-05-13  4:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 19:15 [PATCH] contrib/git-jump: cat output when not a terminal George Brown
2020-05-09 21:41 ` Junio C Hamano
2020-05-09 22:04   ` George Brown
2020-05-09 23:42     ` Junio C Hamano
2020-05-10  9:03       ` George Brown
2020-05-10 16:47         ` Junio C Hamano
2020-05-10 17:33           ` George Brown
2020-05-10 18:12             ` Junio C Hamano
2020-05-10 18:34               ` George Brown
2020-05-10 19:10                 ` Junio C Hamano
2020-05-10 19:25                   ` George Brown
2020-05-10 19:38                   ` Junio C Hamano
2020-05-10 20:20                     ` George Brown
2020-05-11 14:31                       ` Junio C Hamano
2020-05-11 14:31                 ` Jeff King
2020-05-11 15:36                   ` Junio C Hamano
2020-05-11 15:42                     ` Jeff King
2020-05-11 16:46                       ` Re* " Junio C Hamano
2020-05-12 19:23                         ` Jeff King
2020-05-12 21:30                           ` Junio C Hamano
2020-05-13  4:52                             ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.