[Intel-gfx] [maintainer-tools PATCH 1/2] dim: Accept .mbox and .patch files as apply-branch optional argument.

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Aug 16 18:13:58 UTC 2017


Instead of forcing users to cat .patch or .mbox let's accept them
as optional argument for dim apply-branches.

Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 dim     | 10 +++++++++-
 dim.rst |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index 11aa675cc3bc..e98d23b24ec0 100755
--- a/dim
+++ b/dim
@@ -771,7 +771,15 @@ function dim_apply_branch
 	assert_branch $branch
 	assert_repo_clean
 
-	cat > $file
+	case $1 in
+		*".patch" | *".mbox")
+			cat $1 > $file
+			shift
+			;;
+		*)
+			cat > $file
+			;;
+	esac
 
 	message_id=$(message_get_id $file)
 
diff --git a/dim.rst b/dim.rst
index 802c776e03f9..7f492edc4c04 100644
--- a/dim.rst
+++ b/dim.rst
@@ -79,7 +79,7 @@ first need to check out the right branch using::
 
 Applying patches is done in the main repository with::
 
-    $ cat patch.mbox | dim apply-branch <branch>
+    $ dim apply-branch <branch> patch.mbox
 
 This works like a glorified version of git apply-mbox and does basic patch
 checking and adds stuff like patchwork links of the merged patch. It is
-- 
2.13.2



More information about the Intel-gfx mailing list