git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] printk: Remove no longer used second struct cont
       [not found]         ` <CA+55aFxaOFoh+Zrm5tNhU4hWu4Z032+nqV3vXK=QPJyhZsU3_A@mail.gmail.com>
@ 2016-12-16  2:30           ` Joe Perches
  2016-12-16  5:00             ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2016-12-16  2:30 UTC (permalink / raw)
  To: Linus Torvalds, git, Junio C Hamano
  Cc: Sergey Senozhatsky, Petr Mladek, Geert Uytterhoeven,
	Steven Rostedt, Mark Rutland, Andrew Morton,
	Linux Kernel Mailing List

On Thu, 2016-12-15 at 18:10 -0800, Linus Torvalds wrote:
> On Thu, Dec 15, 2016 at 5:57 PM, Joe Perches <joe@perches.com> wrote:
> > > 
> > > In fact, I thought we already upped the check-patch limit to 100?
> > 
> > Nope, CodingStyle neither.
> > 
> > Last time I tried was awhile ago.
> 
> Ok, it must have been just talked about, and with the exceptions for
> strings etc I may not have seen as many of the really annoying line
> breaks lately.
> 
> I don't mind a 80-column "soft limit" per se: if some code
> consistently goes over 80 columns, there really is something seriously
> wrong there. So 80 columns may well be the right limit for that kind
> of check (or even less).

Newspaper column widths were relatively small for a good reason.

I think most of the uses of simple statements should be on a single
line.  I'd rather see just a few arguments on a single line than a
dozen though.  Especially those with long identifiers, functions
with many arguments are just difficult to visually scan.

> But if we have just a couple of lines that are longer (in a file that
> is 3k+ lines), I'd rather not break those.
> 
> I tend use "git grep" a lot, and it's much easier to see function
> argument use if it's all on one line.
> 
> Of course, some function calls really are *so* long that they have to
> be broken up, but that's where the "if it's a couple of lines that go
> a bit over the 80 column limit..." exception basically comes in.
> 
> Put another way: long lines definitely aren't good. But breaking long
> lines has some downsides too, so there should be a balance between the
> two, rather than some black-and-white limit.
> 
> In fact, we've seldom had cases where black-and-white limits work well.

One thing that _would_ be useful is some enhancement to git grep
that would look for multi-line statements more easily.

The git grep -P option doesn't span lines.

grep 2.5.4 was the last version that supported the -P option to
grep through for multiple lines.

It'd be nice to have something like
	git grep --code_style=c90 --function <foo>

that'd show all multiple line uses/definitions/declarations of a
particular function.

I played with extending git grep a bit once, mostly to get the \s
mechanism to span lines.  It kinda worked.

Still, it seems like real work to implement well.

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

* Re: [PATCH] printk: Remove no longer used second struct cont
  2016-12-16  2:30           ` [PATCH] printk: Remove no longer used second struct cont Joe Perches
@ 2016-12-16  5:00             ` Junio C Hamano
  2016-12-16  6:04               ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2016-12-16  5:00 UTC (permalink / raw)
  To: Joe Perches
  Cc: Linus Torvalds, git, Sergey Senozhatsky, Petr Mladek,
	Geert Uytterhoeven, Steven Rostedt, Mark Rutland, Andrew Morton,
	Linux Kernel Mailing List

Joe Perches <joe@perches.com> writes:

> grep 2.5.4 was the last version that supported the -P option to
> grep through for multiple lines.

Does anybody know why it was dropped?

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

* Re: [PATCH] printk: Remove no longer used second struct cont
  2016-12-16  5:00             ` Junio C Hamano
@ 2016-12-16  6:04               ` Joe Perches
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2016-12-16  6:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Linus Torvalds, git, Sergey Senozhatsky, Petr Mladek,
	Geert Uytterhoeven, Steven Rostedt, Mark Rutland, Andrew Morton,
	Linux Kernel Mailing List

On Thu, 2016-12-15 at 21:00 -0800, Junio C Hamano wrote:
> Joe Perches <joe@perches.com> writes:
> 
> > grep 2.5.4 was the last version that supported the -P option to
> > grep through for multiple lines.
> 
> Does anybody know why it was dropped?

perl compatible regexes in grep have always been "experimental"
and never officially supported.

From the grep manual https://www.gnu.org/software/grep/manual/grep.html

    --perl-regexp

        Interpret the pattern as a Perl-compatible regular expression
    (PCRE). This is highly experimental, particularly when combined with
    the -z (--null-data) option, and ‘grep -P’ may warn of unimplemented
    features. See Other Options.


It wasn't dropped so much as "enhanced" away.

Oh well.


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

end of thread, other threads:[~2016-12-16  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1481806438-30185-1-git-send-email-geert@linux-m68k.org>
     [not found] ` <20161215162336.GA18152@pathway.suse.cz>
     [not found]   ` <20161216013706.GA20445@jagdpanzerIV.localdomain>
     [not found]     ` <CA+55aFz3B2BfjG54z7ALOwezCHSdQp+YbFaHcJkCg=fzoKtfNg@mail.gmail.com>
     [not found]       ` <1481853432.29291.76.camel@perches.com>
     [not found]         ` <CA+55aFxaOFoh+Zrm5tNhU4hWu4Z032+nqV3vXK=QPJyhZsU3_A@mail.gmail.com>
2016-12-16  2:30           ` [PATCH] printk: Remove no longer used second struct cont Joe Perches
2016-12-16  5:00             ` Junio C Hamano
2016-12-16  6:04               ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).