diff mbox series

[v3,6/8] git-contributors: make revspec required and shebang fix

Message ID 20250211-update-release-v3-6-7b80ae52c61f@kernel.org (mailing list archive)
State New
Headers show
Series Update release.sh | expand

Commit Message

Andrey Albershteyn Feb. 11, 2025, 5:26 p.m. UTC
Without default value script will show help instead of just hanging
waiting for input on stdin.

Shebang fix for system with different python location than the
/usr/bin one.

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
 tools/git-contributors.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Darrick J. Wong Feb. 11, 2025, 6:59 p.m. UTC | #1
On Tue, Feb 11, 2025 at 06:26:58PM +0100, Andrey Albershteyn wrote:
> Without default value script will show help instead of just hanging
> waiting for input on stdin.
> 
> Shebang fix for system with different python location than the
> /usr/bin one.
> 
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
> ---
>  tools/git-contributors.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/git-contributors.py b/tools/git-contributors.py
> index 83bbe8ce0ee1dcbd591c6d3016d553fac2a7d286..628d6d0b4d8795e10b1317fa6fc91c6b98b21f3e 100755
> --- a/tools/git-contributors.py
> +++ b/tools/git-contributors.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python3
> +#!/usr/bin/env python3
>  
>  # List all contributors to a series of git commits.
>  # Copyright(C) 2025 Oracle, All Rights Reserved.
> @@ -71,8 +71,7 @@ class find_developers(object):
>  
>  def main():
>      parser = argparse.ArgumentParser(description = "List email addresses of contributors to a series of git commits.")
> -    parser.add_argument("revspec", nargs = '?', default = None, \
> -            help = "git revisions to process.")
> +    parser.add_argument("revspec", help = "git revisions to process.")

Might want to get rid of the "read patch from stdin" code if you're not
going to accept that anymore.

--D

>      parser.add_argument("--delimiter", type = str, default = '\n', \
>              help = "Separate each email address with this string.")
>      args = parser.parse_args()
> 
> -- 
> 2.47.2
> 
>
diff mbox series

Patch

diff --git a/tools/git-contributors.py b/tools/git-contributors.py
index 83bbe8ce0ee1dcbd591c6d3016d553fac2a7d286..628d6d0b4d8795e10b1317fa6fc91c6b98b21f3e 100755
--- a/tools/git-contributors.py
+++ b/tools/git-contributors.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/python3
+#!/usr/bin/env python3
 
 # List all contributors to a series of git commits.
 # Copyright(C) 2025 Oracle, All Rights Reserved.
@@ -71,8 +71,7 @@  class find_developers(object):
 
 def main():
     parser = argparse.ArgumentParser(description = "List email addresses of contributors to a series of git commits.")
-    parser.add_argument("revspec", nargs = '?', default = None, \
-            help = "git revisions to process.")
+    parser.add_argument("revspec", help = "git revisions to process.")
     parser.add_argument("--delimiter", type = str, default = '\n', \
             help = "Separate each email address with this string.")
     args = parser.parse_args()