Thread (10 messages) 10 messages, 3 authors, 2025-05-22

Re: [PATCH v2 1/2] new: Add a new parameter (name/emailid) in the "new" script

From: Dave Chinner <david@fromorbit.com>
Date: 2025-05-20 23:31:40
Also in: fstests, linux-xfs

On Thu, May 15, 2025 at 11:00:16AM +0000, Nirjhar Roy (IBM) wrote:
quoted hunk ↗ jump to hunk
This patch another optional interactive prompt to enter the
author name and email id for each new test file that is
created using the "new" file.

The sample output looks like something like the following:

./new selftest
Next test id is 007
Append a name to the ID? Test name will be 007-$name. y,[n]:
Creating test file '007'
Add to group(s) [auto] (separate by space, ? for list): selftest quick
Enter <author_name> <email-id>: Nirjhar Roy [off-list ref]
Creating skeletal script for you to edit ...
 done.

...
...

Signed-off-by: Nirjhar Roy (IBM) <redacted>
---
 new | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/new b/new
index 6b50ffed..636648e2 100755
--- a/new
+++ b/new
@@ -136,6 +136,9 @@ else
 	check_groups "${new_groups[@]}" || exit 1
 fi
 
+read -p "Enter <author_name>: " -r
+author_name="${REPLY:=YOUR NAME HERE}"
+
 echo -n "Creating skeletal script for you to edit ..."
 
 year=`date +%Y`
@@ -143,7 +146,7 @@ year=`date +%Y`
 cat <<End-of-File >$tdir/$id
 #! /bin/bash
 # SPDX-License-Identifier: GPL-2.0
-# Copyright (c) $year YOUR NAME HERE.  All Rights Reserved.
+# Copyright (c) $year $author_name.  All Rights Reserved.
In many cases, this is incorrect.

For people who are corporate employees, copyright for the code they
write is typically owned by their employer, not the employee who
wrote the code. i.e. this field generally contains something like
"Red Hat, Inc", "Oracle, Inc", "IBM Corporation", etc in these
cases, not the employee's name.

-Dave.
-- 
Dave Chinner
david@fromorbit.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help