[PATCH] dim: allow all developer commands without full setup
Daniel Vetter
daniel.vetter at ffwll.ch
Tue Nov 28 11:12:57 UTC 2017
Requested by Arek (so CI can use sparse/checkpatch) and Chris (because
it's more useful for developers this way).
v2: Remove debug leftover. Oops (Chris).
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
dim | 27 ++++++++++++++++++++++++++-
dim.rst | 2 ++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/dim b/dim
index 283ae882f113..923ffa361f22 100755
--- a/dim
+++ b/dim
@@ -2129,7 +2129,32 @@ if ! declare -f $subcmd_func >/dev/null; then
exit 1
fi
-if [ "$subcmd" != "setup" ] && [ "$subcmd" != "help" ] && [ "$subcmd" != "usage" ]; then
+# functions useful for developers don't need a full dim setup
+developer_commands=(
+ # developer commands
+ # these should match the developer section in dim.rst
+ "tc"
+ "cite"
+ "fixes"
+ "checkpatch"
+ "sparse"
+ "checker"
+ "retip"
+ # help commands
+ "help"
+ "usage"
+ # include setup
+ "setup"
+)
+
+developer_command=0
+for cmd in "${developer_commands[@]}" ; do
+ if [ $cmd = $subcmd ] ; then
+ developer_command=1
+ fi
+done
+
+if [ $developer_command = "0" ]; then
for d in $DIM_PREFIX $DIM_PREFIX/$DIM_REPO $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
if [ ! -d $d ]; then
echoerr "$d is missing, please check your configuration and/or run dim setup"
diff --git a/dim.rst b/dim.rst
index d123135b2c0d..ba834192785f 100644
--- a/dim.rst
+++ b/dim.rst
@@ -114,6 +114,8 @@ aliases.
COMMANDS FOR DEVELOPERS
=======================
+These commands can all be run without a full dim setup.
+
tc *commit-ish*
---------------
Print the oldest Linux kernel release or -rc tag that contains the supplied
--
2.15.0
More information about the dim-tools
mailing list