From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [maintainer-tools PATCH 1/2] dim: Accept .mbox and .patch files as apply-branch optional argument.
Date: Thu, 17 Aug 2017 10:30:02 +0300 [thread overview]
Message-ID: <87o9reabyd.fsf@nikula.org> (raw)
In-Reply-To: <20170816181359.29998-1-rodrigo.vivi@intel.com>
On Wed, 16 Aug 2017, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> Instead of forcing users to cat .patch or .mbox let's accept them
> as optional argument for dim apply-branches.
Well, that's a useless use of cat anyway. You could do
$ dim apply-branch branch < patch.mbox
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> dim | 10 +++++++++-
> dim.rst | 2 +-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index 11aa675cc3bc..e98d23b24ec0 100755
> --- a/dim
> +++ b/dim
> @@ -771,7 +771,15 @@ function dim_apply_branch
> assert_branch $branch
> assert_repo_clean
>
> - cat > $file
> + case $1 in
> + *".patch" | *".mbox")
> + cat $1 > $file
> + shift
> + ;;
> + *)
> + cat > $file
> + ;;
> + esac
This would really be a surprising interface, argument parsing based on
file suffixes. I don't approve.
You'll need to make this handle options before the branch argument,
something like:
Usage: dim apply-branch [apply-branch options] branch [--] [git options]
Is stdin redirection really such a bad thing?
BR,
Jani.
>
> message_id=$(message_get_id $file)
>
> diff --git a/dim.rst b/dim.rst
> index 802c776e03f9..7f492edc4c04 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -79,7 +79,7 @@ first need to check out the right branch using::
>
> Applying patches is done in the main repository with::
>
> - $ cat patch.mbox | dim apply-branch <branch>
> + $ dim apply-branch <branch> patch.mbox
>
> This works like a glorified version of git apply-mbox and does basic patch
> checking and adds stuff like patchwork links of the merged patch. It is
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-17 7:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 18:13 [maintainer-tools PATCH 1/2] dim: Accept .mbox and .patch files as apply-branch optional argument Rodrigo Vivi
2017-08-16 18:13 ` [maintainer-tools PATCH 2/2] dim: Accept patchwork URLs " Rodrigo Vivi
2017-08-16 18:17 ` Rodrigo Vivi
2017-08-17 7:45 ` Jani Nikula
2017-08-17 16:18 ` Rodrigo Vivi
2017-08-17 16:49 ` Rodrigo Vivi
2017-08-17 7:37 ` Jani Nikula
2017-08-17 16:08 ` Rodrigo Vivi
2017-08-17 7:30 ` Jani Nikula [this message]
2017-08-17 7:57 ` [maintainer-tools PATCH 1/2] dim: Accept .mbox and .patch files " Daniel Vetter
2017-08-17 8:12 ` Jani Nikula
2017-08-17 8:40 ` Daniel Vetter
2017-08-17 16:24 ` Rodrigo Vivi
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=87o9reabyd.fsf@nikula.org \
--to=jani.nikula@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.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 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.