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

Re: [PATCH v3 22/28] git-remote-mediawiki: Modify strings for a better coding-style

From
Célestin Matte <celestin.matte@ensimag.fr>
Date
Jun 10, 2013, 10:48 UTC
Message-ID
<51B5AEE6.8010102@ensimag.fr>
In-Reply-To
<CAPig+cQWQ842-ZG3_JQxZ=-2qLPpijx9z3vtXns+G3xxp6PsyQ@mail.gmail.com>
Le 10/06/2013 02:50, Eric Sunshine a écrit :
Show 5 quoted lines
> Given this patch's intention to use ${} within strings, should this be
> ${credential{username}}?
> 
> (I don't have a preference, but it's a genuine question since it's not
> clear if this was an oversight or intentional.)

The answer is simple: I didn't know the exact syntax, so I didn't bother doing it.

Show 8 quoted lines
> The whitespace-only change to line "my $res = do {" is effectively
> noise. The reviewer has to stop and puzzle out what changed on the
> line before continuing with review of the remaining _real_ changes. It
> is a good idea to avoid noise changes if possible.
> 
> In this particular case, it's easy to avoid the noise since the
> trailing space on that line could/should have been removed in patch
> 18/28 when the statement was split over multiple lines.

Actually, I noticed this but didn't find what the difference between the two lines was. I assumed git was making some kind of mistake - but eh, it seems git is never wrong :)

Show 19 quoted lines
>>                 local $/ = undef;
>>                 <$git>
>>         };
>> @@ -475,26 +475,26 @@ sub download_mw_mediafile {
>>                 return $response->decoded_content;
>>         } else {
>>                 print STDERR "Error downloading mediafile from :\n";
>> -               print STDERR "URL: $download_url\n";
>> -               print STDERR "Server response: " . $response->code . " " . $response->message . "\n";
>> +               print STDERR "URL: ${download_url}\n";
>> +               print STDERR 'Server response: ' . $response->code . q{ } . $response->message . "\n";
> 
> To meet the goals of this patch, would you want to do this instead?
> 
>     "Server response: @{[$response->code]} @{[$response->message]}\n";
> 
> Whether this is easier or more difficult to read is a matter of
> opinion. (Again, this is a genuine question rather than a show of
> preference on my part.)

Same as above, I tried to change it but didn't know the exact syntax, so I gave up.

-- 
Célestin Matte
Previous: Eric SunshineNext: Matthieu Moy
Message 33 of 48 in “Follow perlcritic's recommandations”
  1. 00/28 Follow perlcritic's recommandationsCélestin Matte, Jun 9, 2013
  2. 01/28 git-remote-mediawiki: Make a regexp clearerCélestin Matte, Jun 9, 2013
  3. 02/28 git-remote-mediawiki: Move "use warnings;" before any instructionCélestin Matte, Jun 9, 2013
  4. 03/28 git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)Célestin Matte, Jun 9, 2013
  5. 04/28 git-remote-mediawiki: Always end a subroutine with a returnCélestin Matte, Jun 9, 2013
  6. 05/28 git-remote-mediawiki: Move a variable declaration at the top of the codeCélestin Matte, Jun 9, 2013
  7. 06/28 git-remote-mediawiki: Change syntax of map callsCélestin Matte, Jun 9, 2013
  8. 07/28 git-remote-mediawiki: Rewrite unclear line of instructionsCélestin Matte, Jun 9, 2013
  9. Junio C HamanoJun 11, 2013
  10. Matthieu MoyJun 11, 2013
  11. Junio C HamanoJun 11, 2013
  12. Célestin MatteJun 11, 2013
  13. Junio C HamanoJun 11, 2013
  14. 08/28 git-remote-mediawiki: Remove useless regexp modifier (m)Célestin Matte, Jun 9, 2013
  15. 09/28 git-remote-mediawiki: Change the behaviour of a splitCélestin Matte, Jun 9, 2013
  16. Matthieu MoyJun 10, 2013
  17. 10/28 git-remote-mediawiki: Change separator of some regexpsCélestin Matte, Jun 9, 2013
  18. 11/28 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 9, 2013
  19. 12/28 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 9, 2013
  20. 13/28 git-remote-mediawiki: Add newline in the end of die() error messagesCélestin Matte, Jun 9, 2013
  21. 14/28 git-remote-mediawiki: Change the name of a variableCélestin Matte, Jun 9, 2013
  22. 15/28 git-remote-mediawiki: Turn double-negated expressions into simple expressionsCélestin Matte, Jun 9, 2013
  23. 16/28 git-remote-mediawiki: Remove unused variable $entryCélestin Matte, Jun 9, 2013
  24. 17/28 git-remote-mediawiki: Rename a variable ($last) which has the name of a keywordCélestin Matte, Jun 9, 2013
  25. 18/28 git-remote-mediawiki: Assign a variable as undef and make proper indentationCélestin Matte, Jun 9, 2013
  26. 19/28 git-remote-mediawiki: Check return value of openCélestin Matte, Jun 9, 2013
  27. 20/28 git-remote-mediawiki: remove import of unused open2Célestin Matte, Jun 9, 2013
  28. 21/28 git-remote-mediawiki: Put long code into a subroutineCélestin Matte, Jun 9, 2013
  29. Junio C HamanoJun 11, 2013
  30. Célestin MatteJun 11, 2013
  31. 22/28 git-remote-mediawiki: Modify strings for a better coding-styleCélestin Matte, Jun 9, 2013
  32. Eric SunshineJun 10, 2013
  33. Célestin MatteJun 10, 2013
  34. Matthieu MoyJun 10, 2013
  35. Célestin MatteJun 10, 2013
  36. Junio C HamanoJun 10, 2013
  37. Benoît PersonJun 10, 2013
  38. Matthieu MoyJun 10, 2013
  39. Junio C HamanoJun 10, 2013
  40. 23/28 git-remote-mediawiki: Brace file handles for print for more clarityCélestin Matte, Jun 9, 2013
  41. 24/28 git-remote-mediawiki: Replace "unless" statements with negated "if" statementsCélestin Matte, Jun 9, 2013
  42. 25/28 git-remote-mediawiki: Don't use quotes for empty stringsCélestin Matte, Jun 9, 2013
  43. 26/28 git-remote-mediawiki: Put non-trivial numeric values in constants.Célestin Matte, Jun 9, 2013
  44. 27/28 git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")Célestin Matte, Jun 9, 2013
  45. 28/28 git-remote-mediawiki: Clearly rewrite double dereferenceCélestin Matte, Jun 9, 2013
  46. Eric SunshineJun 10, 2013
  47. Matthieu MoyJun 10, 2013
  48. Célestin MatteJun 11, 2013

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.