[Intel-gfx] [maintainer-tools PATCH] qf: Introduce .qfrc.

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Aug 23 17:23:34 UTC 2017


Soon we will need to extend qf for very specific
usages of our internal maintenance and rebase bot.

So let's start with the only environment configuration
we have but also let's allow qfrc to extend qf commands
and aliases.

Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 qf          | 18 +++++++++++++++---
 qf.rst      | 25 +++++++++++++++++++++++++
 qfrc.sample |  7 +++++++
 3 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 qfrc.sample

diff --git a/qf b/qf
index a7a106148733..ea3509f0421b 100755
--- a/qf
+++ b/qf
@@ -26,12 +26,24 @@
 
 # quilt git flow script
 
-# config
-QUILT_PREFIX=quilt/
-
 # fail on any goof-up
 set -e
 
+#
+# User configuration. Set in environment or configuration file. See
+# qfrc.sample for an example.
+#
+
+# qf configuration file
+QF_CONFIG=${QF_CONFIG:-$HOME/.qfrc}
+if [ -r $QF_CONFIG ]; then
+	# shellcheck source=/dev/null
+	. $QF_CONFIG
+fi
+
+# prefix for quilt branch
+QUILT_PREFIX=${QUILT_PREFIX:-quilt/}
+
 function cd_toplevel
 {
 	cd $(git rev-parse --show-toplevel)
diff --git a/qf.rst b/qf.rst
index 10447dded391..136c695e604c 100644
--- a/qf.rst
+++ b/qf.rst
@@ -254,6 +254,31 @@ directory as git commands. When using quilt flow in scripts it is
 import to use the explicit forwarding to avoid clashes with
 furture extensions.
 
+
+ALIASES
+=======
+
+Extending **qf** functionalities
+---------------------------------
+
+It is possible to create your own qf helper and aliases by adding them to \$HOME/.qfrc::
+
+	qf_my_fancy_list_aliases()
+	{
+		echo "Hello world!"
+		qf_list_aliases
+	}
+
+	qf_alias_list_aliases=my-fancy-list-aliases
+
+ENVIRONMENT
+===========
+
+QUILT_PREFIX
+------------
+Quilt branch prefix. This is a prefix for the git branch that contains the
+patch files and quilt series file.
+
 CONTRIBUTING
 ============
 
diff --git a/qfrc.sample b/qfrc.sample
new file mode 100644
index 000000000000..d56981609b00
--- /dev/null
+++ b/qfrc.sample
@@ -0,0 +1,7 @@
+# Sample configuration file for qf. Place this at $HOME/.qfrc or point
+# QF_CONFIG environment variable to it.
+#
+# Defaults are in the comments below.
+
+# Quilt branch prefix
+#QUILT_PREFIX=quilt
\ No newline at end of file
-- 
2.13.2



More information about the Intel-gfx mailing list