[PATCH] qf: Add more wiggle helpers.

Rodrigo Vivi rodrigo.vivi at intel.com
Sat Jan 27 00:40:37 UTC 2018


When working with wiggle to easily solve rebasing
conflicts we also need to be able to easily continue,
easily see the impacted files and easily clean the
repo to avoid ending up with many .rej and .porig files.

v2: Remove -r from rm. (Lucas)
    Use -z instead of '== ""' comparison. (Lucas)
    Add documentation to the helpers. (Required by make check).

Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
Cc: Michel Thierry <michel.thierry at intel.com>
Cc: James Ausmus <james.ausmus at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 qf     | 32 ++++++++++++++++++++++++++++++++
 qf.rst | 16 ++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/qf b/qf
index b28ca70ddcfd..b504b3ae7c44 100755
--- a/qf
+++ b/qf
@@ -432,6 +432,38 @@ function qf_stage
 	echo All applied patches successfully staged
 }
 
+function qf_wiggle_clean
+{
+	cd_toplevel
+	conflict_files=$(git status --porcelain | grep "\.rej" | cut -c4-)
+	for file in $conflict_files ; do
+		echo cleaning $file ${file%.rej}.porig
+		rm -f $file ${file%.rej}.porig
+	done
+}
+
+function qf_conflict_files
+{
+	cd_toplevel
+	conflict_files=$(git status --porcelain | grep "\.rej" | cut -c4-)
+
+	if [[ -z $conflict_files ]] ; then
+		echo No conflicted files found!
+	else
+		echo Conflict found on:
+		for file in $conflict_files ; do
+			echo ${file%.rej}
+		done
+	fi
+}
+
+function qf_continue
+{
+	cd_toplevel
+	qf_wiggle_clean
+	quilt push -a
+}
+
 qf_alias_wp=wiggle_push
 function qf_wiggle_push
 {
diff --git a/qf.rst b/qf.rst
index 9dac6b9e1eaa..092902bdde75 100644
--- a/qf.rst
+++ b/qf.rst
@@ -199,6 +199,22 @@ Resets the git index and then (re-)applies all currently applied
 quilt patches to it. Useful to use git tools like git diff to
 compare changes against the quilt patch state.
 
+conflict-files
+--------------
+List the files that are probably in a unresolved stage of conflict.
+Wiggle push will leave .rej and .porig files behind.
+This is useful for manual conflict solving during the quilt rebase.
+
+continue
+--------
+Clean up after wiggle and continue with quilt push -a to continue
+applying and rebasing all the following patches.
+
+wiggle-clean
+------------
+Clean up all .rej and .porig files that wiggle probably
+left behind.
+
 wiggle-push|wp
 --------------
 Force-push the next patch and then wiggle in any conflicts. Does
-- 
2.13.6



More information about the dim-tools mailing list