Skip to contentSkip to conversation

new: Improvements to new script

PATCH Superseded Nirjhar Roy (IBM) 2 participants 6 messages May 19, 2025 – May 23, 2025

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover new: Improvements to new script

This series adds a couple of improvements to the "new" script.
Patch-1/2 - Adds an optional name/email id parameter prompt to the new script while creating
a new test file using the "new" file.
Patch 2/2 - Replace "status=0;exit 0" with _exit 0 in the skeleton file in "new".

[v2] -> v3
- Modified the commit message to remove "email-id" from it (patch 1).

[v1] -> [v2]
- Added RB of Zorro in patch 2 of [v1]
- Modified the prompt message for entering the author name (patch 1 of [v1])
- Removed patch 3 (Suggested by Zorro) of [v1]

[v1] https://lore.kernel.org/all/[email protected]/
[v2] https://lore.kernel.org/all/[email protected]/

Nirjhar Roy (IBM) (2):
new: Add a new parameter (name) in the "new" script
new: Replace "status=0; exit 0" with _exit 0

 new | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--
2.34.1

#1 lore raw

PATCH v3 1/2 new: Add a new parameter (name) in the "new" script

This patch another optional interactive prompt to enter the author name 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>: Nirjhar Roy <[email protected]> Creating skeletal script for you to edit ...
done.

---
 new | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
new +4 -1
index 6b50ffed..636648e2 100755
@@ -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.
 #
 # FS QA Test $id
 #
Signature · 1 line
2.34.1
#2 lore raw

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

Quoted 35 lines · Nirjhar Roy (IBM)

This patch another optional interactive prompt to enter the author name 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>: Nirjhar Roy <[email protected]> Creating skeletal script for you to edit ...
done.

---
 new | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
new +3 -0
index 6b50ffed..636648e2 100755
@@ -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`

new year=`date +%Y` · line 149

Quoted 5 lines
new +1 -1
@@ -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.

Dave thought we shouldn't use "author_name" at here:
https://lore.kernel.org/fstests/[email protected]/

If you don't mind, I'll merge PATCH 2/2 this week. If you still hope to have the 1/2, please consider the review point from Dave.

Thanks,
Zorro

Quoted 7 lines
new +0 -0
 #
 # FS QA Test $id
 #
Signature · 1 line
2.34.1
#3 lore raw

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

Quoted 45 lines · Zorro Lang
Quoted 35 lines · Nirjhar Roy (IBM)

This patch another optional interactive prompt to enter the author name 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>: Nirjhar Roy <[email protected]> Creating skeletal script for you to edit ...
done.

---
 new | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
new +3 -0
index 6b50ffed..636648e2 100755
@@ -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`

new year=`date +%Y` · line 149

Quoted 5 lines
new +1 -1
@@ -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.

Dave thought we shouldn't use "author_name" at here:
https://lore.kernel.org/fstests/[email protected]/

Quoted 2 lines

If you don't mind, I'll merge PATCH 2/2 this week. If you still hope to have the 1/2, please consider the review point from Dave.

Oh, sorry, you've sent a V4... Please ignore this one, I'm going to review your V4.

Quoted 11 lines

Thanks,
Zorro

Quoted 7 lines
new +0 -0
 #
 # FS QA Test $id
 #
Signature · 1 line
2.34.1
#4 lore raw

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

Quoted 45 lines · Zorro Lang
Quoted 44 lines · Zorro Lang
Quoted 35 lines · Nirjhar Roy (IBM)

This patch another optional interactive prompt to enter the author name 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>: Nirjhar Roy <[email protected]> Creating skeletal script for you to edit ...
done.

---
  new | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
new +3 -0
index 6b50ffed..636648e2 100755
@@ -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`

new year=`date +%Y` · line 149

Quoted 5 lines
new +1 -1
@@ -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.

Dave thought we shouldn't use "author_name" at here:
https://lore.kernel.org/fstests/[email protected]/

Quoted 4 lines
Quoted 2 lines

If you don't mind, I'll merge PATCH 2/2 this week. If you still hope to have the 1/2, please consider the review point from Dave.

Oh, sorry, you've sent a V4... Please ignore this one, I'm going to review your V4.

Yes, I have sent the v4 after addressing the review comments.

--NR

Quoted 11 lines
Quoted 11 lines

Thanks,
Zorro

Quoted 7 lines
new +0 -0
  #
  # FS QA Test $id
  #
Signature · 1 line
2.34.1
Signature · 3 lines
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
#5 lore raw

PATCH v3 2/2 new: Replace "status=0; exit 0" with _exit 0

In reply to Nirjhar Roy (IBM)

We should now start using _exit 0 for every new test that we add.

---
 new | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
new +1 -2
index 636648e2..dff69265 100755
@@ -176,8 +176,7 @@ exit
 #echo "If failure, check \$seqres.full (this) and \$seqres.full.ok (reference)"
 
 # success, all done
-status=0
-exit
+_exit 0
 End-of-File
 
 sleep 2		# latency to read messages to this point
Signature · 1 line
2.34.1