git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC][PATCH] userdiff: add built-in pattern for golang

From
Alban Gruin <alban.gruin@gmail.com>
Date
Feb 28, 2018, 22:43 UTC
Message-ID
<5683c0ae-9510-a54f-c50e-79718cb2eb1e@gmail.com>
In-Reply-To
<xmqqvaegiw3o.fsf@gitster-ct.c.googlers.com>
Le 28/02/2018 à 23:32, Junio C Hamano a écrit :
Show 28 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
> 
>> On Wed, Feb 28, 2018 at 5:17 PM, Alban Gruin <alban.gruin@gmail.com> wrote:
>>> Yes, but I can split the line like that:
>>>
>>>     % cat >baz.go<<\EOF
>>>     package baz
>>>     func baz(arg1 int64,
>>>         arg2 int64) {
>>>     }
>>>     EOF
>>>     % go build baz.go
>>>
>>> This complies to the standard formatting (at least, gofmt doesn't change
>>> it), but making the regex strict about the brace would cause it to
>>> ignore those funcs, although I don't know how common they are.
>>
>> Makes sense. Thanks for the clarifying example. I wouldn't be at all
>> surprised it such formatting exists in the wild, so keeping the regex
>> as-is seems a good idea.
> 
> Does input like that appear in the tests the patch adds?  If not, it
> probably is a good idea to have it somewhere in the commit (even if
> there is no test addition, having it in the log message to explain
> why the regex is done like so would be a good idea).
> 
> Thanks.
> 

Yes, it's in a file called "golang-long-func". I'll send another patch later to fix the typo in the commit message and the indentation in the tests. I'll clarify the regex in the message, too.

Previous: Junio C HamanoNext: Alban Gruin
Message 8 of 10 in “userdiff: add built-in pattern for golang”
  1. Alban GruinFeb 28, 2018
  2. Eric SunshineFeb 28, 2018
  3. Alban GruinFeb 28, 2018
  4. Eric SunshineFeb 28, 2018
  5. Alban GruinFeb 28, 2018
  6. Eric SunshineFeb 28, 2018
  7. Junio C HamanoFeb 28, 2018
  8. Alban GruinFeb 28, 2018
  9. [GSoC][PATCH v2] userdiff: add built-in pattern for golangAlban Gruin, Mar 1, 2018
  10. Eric SunshineMar 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.