[PATCH 2/3] qf: Make qf_pull -f forcibly clean
Rodrigo Vivi
rodrigo.vivi at intel.com
Thu Mar 8 01:42:54 UTC 2018
qf_checkout implies that you need to have that baseline
on your local repository, what it is not good for a distributed
maintenance.
Let's make qf pull -f useful for the case we want to start
a clean rebase from anywhere.
v2: Remove dubious comments and use -f.
Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
Cc: Michel Thierry <michel.thierry at intel.com>
Cc: James Ausmus <james.ausmus at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
qf | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/qf b/qf
index 270bcf53000a..fb04aeb71428 100755
--- a/qf
+++ b/qf
@@ -404,11 +404,17 @@ function qf_pull
{
cd_toplevel
- qf fetch
+ qf_fetch
cd patches
git pull --ff-only
- qf co
+ if [[ $FORCE ]]; then
+ git reset --hard HEAD
+ else
+ qf_co
+ fi
+
+ cd ..
}
function qf_stage
@@ -587,6 +593,19 @@ function qf_usage
echo "See '$qf help' for more information."
}
+FORCE=
+while getopts f opt; do
+ case "$opt" in
+ f)
+ FORCE=1
+ ;;
+ *)
+ echo "See '$qf help' for more information."
+ exit
+ esac
+done
+shift $((OPTIND - 1))
+
# qf subcommand aliases (with bash 4.3+)
if ! declare -n subcmd=qf_alias_${subcommand//-/_} &> /dev/null || \
test -z "${subcmd:-}"; then
--
2.13.6
More information about the dim-tools
mailing list