[PATCH 3/3] qf: make clean-patches an "alias" to list-unused-patches

Lucas De Marchi lucas.demarchi at intel.com
Wed Feb 21 01:02:58 UTC 2018


clean-patches is easier to remember, at least for me. However
list-unused-patches already supports purging the files, so just use it.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 qf     | 11 +----------
 qf.rst |  3 ++-
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/qf b/qf
index c9ade42225e7..140305fef9f3 100755
--- a/qf
+++ b/qf
@@ -302,16 +302,7 @@ function qf_refresh
 
 function qf_clean_patches
 {
-	cd_toplevel
-	cd patches
-
-	for patch in $(git ls-files '*.patch') ; do
-		if grep "^${patch}$" series &> /dev/null ; then
-			continue
-		fi
-		echo No reference to $patch, deleting it.
-		rm $patch
-	done
+	qf_list_unused_patches --purge
 }
 
 function qf_export
diff --git a/qf.rst b/qf.rst
index 9dac6b9e1eaa..98c17c2390c1 100644
--- a/qf.rst
+++ b/qf.rst
@@ -152,7 +152,8 @@ patches/config.
 
 clean-patches
 -------------
-Removes all unused patch files from the patches/ directory.
+Removes all unused patch files from the patches/ directory. This
+is the same as calling "qf list-unused-patches --purge".
 
 refresh
 -------
-- 
2.14.3



More information about the dim-tools mailing list