From 4724ca20aecba3b51be6b68ed2840e4add739bd6 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 23 Dec 2024 08:27:18 +0100 Subject: [PATCH] utils/get-developers: read patch from stdin when it's not a tty It is very common that get-developers be used with its stdin a pipe from git-show: git show |./utils-get-developers - In this case, the '-' is superfluous: we can very easily deduce that the user wants to read stdin as the patch. So, if no other action was requested, and stdin is not a tty, use it as the source of the patch, and thus '-' is then no longer required. Signed-off-by: Yann E. MORIN Signed-off-by: Julien Olivain (cherry picked from commit d10d22221f93c2a1f5950045a4f95fbb4984d685) Signed-off-by: Peter Korsgaard --- utils/get-developers | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/get-developers b/utils/get-developers index 8e5796beaf..b45e617bff 100755 --- a/utils/get-developers +++ b/utils/get-developers @@ -42,7 +42,9 @@ def __main__(): if action > 1: parser.error("Cannot do more than one action") if action == 0: - parser.error("No action specified") + if sys.stdin.isatty(): + parser.error("No action specified") + args.patches.append(sys.stdin) devs = getdeveloperlib.parse_developers(args.filename) if devs is None: