From: Daniel Vetter <daniel@ffwll.ch>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [maintainer-tools PATCH] dim: Add apply and push shorthands for current branch
Date: Mon, 31 Jul 2017 17:51:43 +0200 [thread overview]
Message-ID: <20170731155143.GA4754@dvetter-linux.ger.corp.intel.com> (raw)
In-Reply-To: <20170731141756.26745-1-thierry.reding@gmail.com>
On Mon, Jul 31, 2017 at 04:17:56PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The new apply and push commands are shorthands for applying patches to
> and pushing the current branch, respectively.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> dim | 27 +++++++++++++++++++++++++++
> dim.rst | 8 ++++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/dim b/dim
> index c0cbe352b165..036cb092557e 100755
> --- a/dim
> +++ b/dim
> @@ -326,6 +326,20 @@ function git_fetch_helper # remote
> fi
> }
>
> +function git_current_branch
> +{
> + local line branch
> +
> + git branch --list | while read line; do
> + branch="${line#* }"
> +
> + if test "$branch" != "$line"; then
> + echo "$branch"
> + break
> + fi
> + done
> +}
git symbolic-ref -q --short HEAD
is a much shorter way to type this. Can you respin, maybe also updating
the other helper right below here?
Otherwise I think this is perfect, I think I'll add this shorthand for
some of the maintainer commands for handling pull requests too.
Thanks, Daniel
> +
> function git_is_current_branch # branch
> {
> git branch --list $1 | grep -q '\*'
> @@ -739,6 +753,11 @@ function dim_push_fixes
> dim_push_branch drm-intel-fixes "$@"
> }
>
> +function dim_push
> +{
> + dim_push_branch $(git_current_branch) "$@"
> +}
> +
> # ensure we're on branch $1, and apply patches. the rest of the arguments are
> # passed to git am.
> dim_alias_ab=apply-branch
> @@ -930,6 +949,14 @@ function dim_apply_next_fixes
> dim_apply_branch drm-intel-next-fixes "$@"
> }
>
> +# apply patch to current branch, the rest of the arguments are passed to
> +# git am
> +dim_alias_am=apply
> +function dim_apply
> +{
> + dim_apply_branch $(git_current_branch) "$@"
> +}
> +
> function commit_list_references
> {
> local commit remote log
> diff --git a/dim.rst b/dim.rst
> index c004c30ada17..fa9b587d73bb 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -198,6 +198,10 @@ apply-queued [*git am arguments*]
> **apply-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, and
> *drm-intel-next-queued* branches respectively.
>
> +apply [*git am arguments*]
> +--------------------------
> +**apply-branch** shorthand for the current branch.
> +
> extract-tags *branch* [*git-rangeish*]
> --------------------------------------
> This extracts various tags (e.g. Reviewed-by:) from emails and applies them to the
> @@ -232,6 +236,10 @@ push-queued [*git push arguments*]
> **push-branch** shorthands for *drm-intel-fixes*, *drm-intel-next-fixes*, and
> *drm-intel-next-queued* branches respectively.
>
> +push [*git push arguments*]
> +---------------------------
> +**push** shorthand for the current branch.
> +
> rebuild-tip
> -----------
> Rebuild and push the integration tree.
> --
> 2.13.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
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
next prev parent reply other threads:[~2017-07-31 15:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 14:17 [maintainer-tools PATCH] dim: Add apply and push shorthands for current branch Thierry Reding
2017-07-31 15:51 ` Daniel Vetter [this message]
2017-07-31 17:15 ` [maintainer-tools PATCH v2 1/2] " Thierry Reding
2017-07-31 17:15 ` [maintainer-tools PATCH 2/2] dim: Simplify test " Thierry Reding
2017-08-03 10:50 ` [maintainer-tools PATCH v2 1/2] dim: Add apply and push shorthands " Jani Nikula
2017-08-03 12:39 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170731155143.GA4754@dvetter-linux.ger.corp.intel.com \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox