[PATCH] qf: Actually allow qf rebase from a clean environment.
Daniel Vetter
daniel at ffwll.ch
Tue Jan 30 06:42:41 UTC 2018
On Mon, Jan 29, 2018 at 10:56:10AM -0800, Rodrigo Vivi wrote:
> The intention of commit '663e7293e042 ("qf: Allow rebase
> function to start from anywhere.")' was to allow the
> qf rebase to start from anywhere, including from a place
> where not patch is yet applied with quilt.
>
> However pop -f was not the right answer for that.
>
> We need to make sure that qf pull provides a really clean
> environment so qf rebase can really work from scratch to
> all (-a) patches.
>
> The goal is that a simple
> qf pull && qf rebase drm-tip/drm-tip
>
> Always simply work to rebase from anywhere.
>
> Fixes: 663e7293e042 ("qf: Allow rebase function to start from anywhere.")
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> qf | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/qf b/qf
> index b504b3ae7c44..ea581f67db4e 100755
> --- a/qf
> +++ b/qf
> @@ -268,8 +268,8 @@ function qf_rebase
>
> new_baseline=$(git rev-parse $1)
>
> - current_top=$(quilt top)
> - quiet_pop_all -f
> + current_top=$(quilt top || echo "-a")
> + quiet_pop_all
> echo Resetting baseline to $new_baseline
> git reset --hard $new_baseline
> sed -e "s/BASELINE=.*$/BASELINE=$new_baseline/" -i patches/config
> @@ -420,6 +420,8 @@ function qf_pull
> # make sure you start from a very clean local as well
> git reset --hard HEAD
> cd ..
> + # make sure quilt top is also clean at this point.
> + quiet_pop_all -f
Hm, not sure we want to make this the default behaviour, since it throws
away state. Maybe do this only when you run qf pull -f? And if it's
unclean, maybe warn about it when not supplying the -f flag? Same for the
git reset --hard (which seems in an unpushed patch, or at least I can't
find it).
Imo throwing away stuff with git reset --hard in the worktree is ok-ish
(not really great either, but it's impossible to tell a dirty worktree
apart from one with some qf patches applied). But hard-resetting the
patches/ dir is kinda uncool since it likely ends up throwing away work
eventually.
And the rebase bot can then just qf pull -f since it never cares about
previuos state.
Just an idea to make qf's edges less sharp.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dim-tools
mailing list