[Intel-gfx] [maintainer-tools PATCH] qf: Introduce .qfrc.
Daniel Vetter
daniel at ffwll.ch
Thu Aug 24 06:33:16 UTC 2017
On Wed, Aug 23, 2017 at 10:23:34AM -0700, Rodrigo Vivi wrote:
> 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
Misses the / at the end. Otherwise lgtm, ack.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list