All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dim: replace pipe commands with single sed
@ 2018-05-09 21:28 Lucas De Marchi
  2018-05-09 23:32 ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2018-05-09 21:28 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Daniel Vetter

A single sed can do the job of taking the second line after a match and
it looks simpler.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---

I noticed this while reviewing "[PATCH 2/4] dim: shut up sed broken pipe
noise in apply-pull".

 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dim b/dim
index 6b684ba5308c..f7cf255db3e1 100755
--- a/dim
+++ b/dim
@@ -924,7 +924,7 @@ function dim_apply_pull
 
 	cat > $file
 
-	pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
+	pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file)
 
 	if [[ -z "$pull_branch" ]] ; then
 		echoerr "no pull request found"
-- 
2.17.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dim: replace pipe commands with single sed
  2018-05-09 21:28 [PATCH] dim: replace pipe commands with single sed Lucas De Marchi
@ 2018-05-09 23:32 ` Lucas De Marchi
  2018-05-12 19:44   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2018-05-09 23:32 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Daniel Vetter, intel-gfx, dim-tools, Daniel Vetter

Now CC the right mailing list.  The way dim sets up the repository you
can't have individual git configs, e.g. to  set a different
sendemail.to for dim-tools :(

Lucas De Marchi

On Wed, May 9, 2018 at 2:28 PM, Lucas De Marchi
<lucas.demarchi@intel.com> wrote:
> A single sed can do the job of taking the second line after a match and
> it looks simpler.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>
> I noticed this while reviewing "[PATCH 2/4] dim: shut up sed broken pipe
> noise in apply-pull".
>
>  dim | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 6b684ba5308c..f7cf255db3e1 100755
> --- a/dim
> +++ b/dim
> @@ -924,7 +924,7 @@ function dim_apply_pull
>
>         cat > $file
>
> -       pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
> +       pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file)
>
>         if [[ -z "$pull_branch" ]] ; then
>                 echoerr "no pull request found"
> --
> 2.17.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Lucas De Marchi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dim: replace pipe commands with single sed
  2018-05-09 23:32 ` Lucas De Marchi
@ 2018-05-12 19:44   ` Daniel Vetter
  2018-05-17  9:13     ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2018-05-12 19:44 UTC (permalink / raw)
  To: Lucas De Marchi
  Cc: Daniel Vetter, intel-gfx, dim-tools, Lucas De Marchi,
	Daniel Vetter

On Wed, May 09, 2018 at 04:32:53PM -0700, Lucas De Marchi wrote:
> Now CC the right mailing list.  The way dim sets up the repository you
> can't have individual git configs, e.g. to  set a different
> sendemail.to for dim-tools :(
> 
> Lucas De Marchi
> 
> On Wed, May 9, 2018 at 2:28 PM, Lucas De Marchi
> <lucas.demarchi@intel.com> wrote:
> > A single sed can do the job of taking the second line after a match and
> > it looks simpler.
> >
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > ---
> >
> > I noticed this while reviewing "[PATCH 2/4] dim: shut up sed broken pipe
> > noise in apply-pull".

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> >
> >  dim | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/dim b/dim
> > index 6b684ba5308c..f7cf255db3e1 100755
> > --- a/dim
> > +++ b/dim
> > @@ -924,7 +924,7 @@ function dim_apply_pull
> >
> >         cat > $file
> >
> > -       pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
> > +       pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file)
> >
> >         if [[ -z "$pull_branch" ]] ; then
> >                 echoerr "no pull request found"
> > --
> > 2.17.0
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
> 
> -- 
> Lucas De Marchi

-- 
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] 4+ messages in thread

* Re: [PATCH] dim: replace pipe commands with single sed
  2018-05-12 19:44   ` Daniel Vetter
@ 2018-05-17  9:13     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2018-05-17  9:13 UTC (permalink / raw)
  To: Daniel Vetter, Lucas De Marchi
  Cc: Lucas De Marchi, Daniel Vetter, intel-gfx, dim-tools,
	Daniel Vetter

On Sat, 12 May 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, May 09, 2018 at 04:32:53PM -0700, Lucas De Marchi wrote:
>> Now CC the right mailing list.  The way dim sets up the repository you
>> can't have individual git configs, e.g. to  set a different
>> sendemail.to for dim-tools :(
>> 
>> Lucas De Marchi
>> 
>> On Wed, May 9, 2018 at 2:28 PM, Lucas De Marchi
>> <lucas.demarchi@intel.com> wrote:
>> > A single sed can do the job of taking the second line after a match and
>> > it looks simpler.
>> >
>> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> > ---
>> >
>> > I noticed this while reviewing "[PATCH 2/4] dim: shut up sed broken pipe
>> > noise in apply-pull".
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks, pushed.

>
>> >
>> >  dim | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/dim b/dim
>> > index 6b684ba5308c..f7cf255db3e1 100755
>> > --- a/dim
>> > +++ b/dim
>> > @@ -924,7 +924,7 @@ function dim_apply_pull
>> >
>> >         cat > $file
>> >
>> > -       pull_branch=$(sed -e '0,/[gG]it repository at:$/d' $file | head -n 2 | tail -n 1)
>> > +       pull_branch=$(sed -ne '/[gG]it repository at:$/{n;n;p}' $file)
>> >
>> >         if [[ -z "$pull_branch" ]] ; then
>> >                 echoerr "no pull request found"
>> > --
>> > 2.17.0
>> >
>> > _______________________________________________
>> > Intel-gfx mailing list
>> > Intel-gfx@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>> 
>> 
>> 
>> -- 
>> Lucas De Marchi

-- 
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] 4+ messages in thread

end of thread, other threads:[~2018-05-17  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09 21:28 [PATCH] dim: replace pipe commands with single sed Lucas De Marchi
2018-05-09 23:32 ` Lucas De Marchi
2018-05-12 19:44   ` Daniel Vetter
2018-05-17  9:13     ` 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.