* [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands
@ 2016-01-29 7:40 Jani Nikula
2016-02-10 8:14 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2016-01-29 7:40 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Add two new subcommands for cherry-picking fixes from dinq to
drm-intel-fixes and drm-intel-next-fixes. The only difference in the
subcommands is the assert branch check to ensure the user is on the
right branch.
The commands scan dinq for commits Cc'd to stable or drm-intel-fixes,
checks whether they've already been backported, attempts cherry-pick,
and asks for directions on failed cherry-pick.
It's still rough around the edges and slow as molasses due to unlimited
scan for backports (should just check a release or two back at most),
and an aborted run just starts over next time (though it should take the
freshly backported commits into account).
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
Undecided whether we should apply this already or not. It's crude, but I
use it.
---
dim | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/dim b/dim
index 203c6b60cf1b..c64f6e86af62 100755
--- a/dim
+++ b/dim
@@ -473,6 +473,55 @@ function dim_cherry_pick
$DRY git cherry-pick $1
}
+function dim_cherry_pick_branch
+{
+ for commit in $(git log --reverse --format=format:%h --grep="drm-intel-fixes@lists.freedesktop.org" --grep="stable@vger.kernel.org" origin/master..$DIM_DRM_INTEL_REMOTE/drm-intel-next-queued -- drivers/gpu/drm/i915); do
+ echo "Considering $(git --no-pager log --oneline -1 $commit)"
+ log=$(mktemp)
+ # note *local* branches to account for unpushed ones
+ git log drm-intel-fixes --oneline --grep="cherry picked .* $commit" > $log
+ git log drm-intel-next-fixes --oneline --grep="cherry picked .* $commit" >> $log
+ if [ "$(cat $log)" = "" ]; then
+ if ! git cherry-pick -e -x -s $commit; then
+ select choice in "Diff" "Resolve" "Skip" "Abort"; do
+ case $choice in
+ Diff)
+ git diff
+ ;;
+ Resolve)
+ exit
+ ;;
+ Skip)
+ git cherry-pick --abort
+ break
+ ;;
+ Abort)
+ git cherry-pick --abort
+ exit
+ ;;
+ esac
+ done
+ fi
+ else
+ echo "Already backported as:"
+ sed 's/^/\t/' < $log
+ fi
+ rm -f $log
+ done
+}
+
+function dim_cherry_pick_fixes
+{
+ assert_branch drm-intel-fixes
+ dim_cherry_pick_branch "$@"
+}
+
+function dim_cherry_pick_next_fixes
+{
+ assert_branch drm-intel-next-fixes
+ dim_cherry_pick_branch "$@"
+}
+
dim_alias_ar=apply-resolved
function dim_apply_resolved
{
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands
2016-01-29 7:40 [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands Jani Nikula
@ 2016-02-10 8:14 ` Daniel Vetter
2016-02-17 12:58 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2016-02-10 8:14 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Fri, Jan 29, 2016 at 09:40:32AM +0200, Jani Nikula wrote:
> Add two new subcommands for cherry-picking fixes from dinq to
> drm-intel-fixes and drm-intel-next-fixes. The only difference in the
> subcommands is the assert branch check to ensure the user is on the
> right branch.
>
> The commands scan dinq for commits Cc'd to stable or drm-intel-fixes,
> checks whether they've already been backported, attempts cherry-pick,
> and asks for directions on failed cherry-pick.
>
> It's still rough around the edges and slow as molasses due to unlimited
> scan for backports (should just check a release or two back at most),
> and an aborted run just starts over next time (though it should take the
> freshly backported commits into account).
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> Undecided whether we should apply this already or not. It's crude, but I
> use it.
Imo add help text and push it. We can prettify later on. Oh and maybe bash
completion too. Wrt speeding this up, have you looked at gregkh's
toolchaing for stable kernels? It should be out there somewhere.
-Daniel
> ---
> dim | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
>
> diff --git a/dim b/dim
> index 203c6b60cf1b..c64f6e86af62 100755
> --- a/dim
> +++ b/dim
> @@ -473,6 +473,55 @@ function dim_cherry_pick
> $DRY git cherry-pick $1
> }
>
> +function dim_cherry_pick_branch
> +{
> + for commit in $(git log --reverse --format=format:%h --grep="drm-intel-fixes@lists.freedesktop.org" --grep="stable@vger.kernel.org" origin/master..$DIM_DRM_INTEL_REMOTE/drm-intel-next-queued -- drivers/gpu/drm/i915); do
> + echo "Considering $(git --no-pager log --oneline -1 $commit)"
> + log=$(mktemp)
> + # note *local* branches to account for unpushed ones
> + git log drm-intel-fixes --oneline --grep="cherry picked .* $commit" > $log
> + git log drm-intel-next-fixes --oneline --grep="cherry picked .* $commit" >> $log
> + if [ "$(cat $log)" = "" ]; then
> + if ! git cherry-pick -e -x -s $commit; then
> + select choice in "Diff" "Resolve" "Skip" "Abort"; do
> + case $choice in
> + Diff)
> + git diff
> + ;;
> + Resolve)
> + exit
> + ;;
> + Skip)
> + git cherry-pick --abort
> + break
> + ;;
> + Abort)
> + git cherry-pick --abort
> + exit
> + ;;
> + esac
> + done
> + fi
> + else
> + echo "Already backported as:"
> + sed 's/^/\t/' < $log
> + fi
> + rm -f $log
> + done
> +}
> +
> +function dim_cherry_pick_fixes
> +{
> + assert_branch drm-intel-fixes
> + dim_cherry_pick_branch "$@"
> +}
> +
> +function dim_cherry_pick_next_fixes
> +{
> + assert_branch drm-intel-next-fixes
> + dim_cherry_pick_branch "$@"
> +}
> +
> dim_alias_ar=apply-resolved
> function dim_apply_resolved
> {
> --
> 2.1.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands
2016-02-10 8:14 ` Daniel Vetter
@ 2016-02-17 12:58 ` Jani Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2016-02-17 12:58 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
On Wed, 10 Feb 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Jan 29, 2016 at 09:40:32AM +0200, Jani Nikula wrote:
>> Add two new subcommands for cherry-picking fixes from dinq to
>> drm-intel-fixes and drm-intel-next-fixes. The only difference in the
>> subcommands is the assert branch check to ensure the user is on the
>> right branch.
>>
>> The commands scan dinq for commits Cc'd to stable or drm-intel-fixes,
>> checks whether they've already been backported, attempts cherry-pick,
>> and asks for directions on failed cherry-pick.
>>
>> It's still rough around the edges and slow as molasses due to unlimited
>> scan for backports (should just check a release or two back at most),
>> and an aborted run just starts over next time (though it should take the
>> freshly backported commits into account).
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>> ---
>>
>> Undecided whether we should apply this already or not. It's crude, but I
>> use it.
>
> Imo add help text and push it. We can prettify later on. Oh and maybe bash
> completion too. Wrt speeding this up, have you looked at gregkh's
> toolchaing for stable kernels? It should be out there somewhere.
Added help and pushed.
BR,
Jani.
> -Daniel
>
>> ---
>> dim | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 49 insertions(+)
>>
>> diff --git a/dim b/dim
>> index 203c6b60cf1b..c64f6e86af62 100755
>> --- a/dim
>> +++ b/dim
>> @@ -473,6 +473,55 @@ function dim_cherry_pick
>> $DRY git cherry-pick $1
>> }
>>
>> +function dim_cherry_pick_branch
>> +{
>> + for commit in $(git log --reverse --format=format:%h --grep="drm-intel-fixes@lists.freedesktop.org" --grep="stable@vger.kernel.org" origin/master..$DIM_DRM_INTEL_REMOTE/drm-intel-next-queued -- drivers/gpu/drm/i915); do
>> + echo "Considering $(git --no-pager log --oneline -1 $commit)"
>> + log=$(mktemp)
>> + # note *local* branches to account for unpushed ones
>> + git log drm-intel-fixes --oneline --grep="cherry picked .* $commit" > $log
>> + git log drm-intel-next-fixes --oneline --grep="cherry picked .* $commit" >> $log
>> + if [ "$(cat $log)" = "" ]; then
>> + if ! git cherry-pick -e -x -s $commit; then
>> + select choice in "Diff" "Resolve" "Skip" "Abort"; do
>> + case $choice in
>> + Diff)
>> + git diff
>> + ;;
>> + Resolve)
>> + exit
>> + ;;
>> + Skip)
>> + git cherry-pick --abort
>> + break
>> + ;;
>> + Abort)
>> + git cherry-pick --abort
>> + exit
>> + ;;
>> + esac
>> + done
>> + fi
>> + else
>> + echo "Already backported as:"
>> + sed 's/^/\t/' < $log
>> + fi
>> + rm -f $log
>> + done
>> +}
>> +
>> +function dim_cherry_pick_fixes
>> +{
>> + assert_branch drm-intel-fixes
>> + dim_cherry_pick_branch "$@"
>> +}
>> +
>> +function dim_cherry_pick_next_fixes
>> +{
>> + assert_branch drm-intel-next-fixes
>> + dim_cherry_pick_branch "$@"
>> +}
>> +
>> dim_alias_ar=apply-resolved
>> function dim_apply_resolved
>> {
>> --
>> 2.1.4
>>
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-17 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29 7:40 [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands Jani Nikula
2016-02-10 8:14 ` Daniel Vetter
2016-02-17 12:58 ` Jani Nikula
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.