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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux