{"thread":{"id":"25401","subject":"[PATCH] CodingGuidelines: Fix a typo","startedAt":"2010-10-09T11:18:39Z","lastAt":"2010-10-11T06:44:04Z","messageCount":5,"participants":["stepnem@gmail.com","Jonathan Nieder","Štěpán Němec","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"153053","messageId":"1286623119-13766-1-git-send-email-stepnem@gmail.com","threadId":"25401","inReplyTo":null,"subject":"[PATCH] CodingGuidelines: Fix a typo","fromName":"","fromEmail":"stepnem@gmail.com","sentAt":"2010-10-09T11:18:39Z","receivedAt":"2010-10-09T11:18:39Z","isPatch":true,"sender":{"key":"stepnem@gmail.com","avatar":"https://avatars.githubusercontent.com/u/106838?v=4"},"body":"From: Štěpán Němec <stepnem@gmail.com>\n\n`${parameter/pattern/string}' shell expansion uses glob patterns, so\ntalking about `regexp' is confusing.\n\nSigned-off-by: Štěpán Němec <stepnem@gmail.com>\n---\n Documentation/CodingGuidelines |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 8346c19..df50ccf 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -53,7 +53,7 @@ For shell scripts specifically (not exhaustive):\n \n  - No strlen ${#parameter}.\n \n- - No regexp ${parameter/pattern/string}.\n+ - No substitution ${parameter/pattern/string}.\n \n  - We do not use Process Substitution <(list) or >(list).\n \n-- \n1.7.3.rc2.221.gbf93f.dirty\n"},{"id":"153064","messageId":"20101009152758.GA17799@burratino","threadId":"25401","inReplyTo":"1286623119-13766-1-git-send-email-stepnem@gmail.com","subject":"Re: [PATCH] CodingGuidelines: Fix a typo","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-09T15:27:58Z","receivedAt":"2010-10-09T15:27:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"stepnem@gmail.com wrote:\n\n> `${parameter/pattern/string}' shell expansion uses glob patterns, so\n> talking about `regexp' is confusing.\n\nOkay.\n\n> - - No regexp ${parameter/pattern/string}.\n> + - No substitution ${parameter/pattern/string}.\n\nA bit confusing, since ${parameter%word} and $parameter are\nsubstitutions, too.\n\nMaybe\n\n - No pattern substitution ${parameter/pattern/string}.\n\nto match the bash manual, would be clearer?\n"},{"id":"153066","messageId":"87y6a7s20i.fsf@gmail.com","threadId":"25401","inReplyTo":"20101009152758.GA17799@burratino","subject":"Re: [PATCH] CodingGuidelines: Fix a typo","fromName":"Štěpán Němec","fromEmail":"stepnem@gmail.com","sentAt":"2010-10-09T17:35:09Z","receivedAt":"2010-10-09T17:35:09Z","isPatch":true,"sender":{"key":"stepnem@gmail.com","avatar":"https://avatars.githubusercontent.com/u/106838?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> stepnem@gmail.com wrote:\n>\n>> `${parameter/pattern/string}' shell expansion uses glob patterns, so\n>> talking about `regexp' is confusing.\n>\n> Okay.\n>\n>> - - No regexp ${parameter/pattern/string}.\n>> + - No substitution ${parameter/pattern/string}.\n>\n> A bit confusing, since ${parameter%word} and $parameter are\n> substitutions, too.\n\nNot really. They are all parameter expansions. The former a \"pattern\nremoval\", the latter a plain expansion (yeah I know you can _call_ it a\nsubstitution anyway, but I assume you were trying to be precise/match\nthe Bash manual wording here).\n\nBut I agree \"pattern substitution\" is even clearer, thanks.\n\nBTW, when we continue on this slightly bike-shedding note, it would make\nsense to unify the capitalisation of those termini technici in there\n(\"Arithmetic Expansion\", \"Process Substitution\"). Personally I would\nprefer having them all in lower-case; it feels a bit funny to read \"We\nuse Arithmetic Expansion\". WDYT?\n\nI hope the whitespace goes through undisturbed this time:\n\n--- 8< ---\nSubject: CodingGuidelines: Fix a typo\n\n    `${parameter/pattern/string}' shell expansion uses glob patterns, so\n    talking about `regexp' is confusing.\n\nSigned-off-by: Štěpán Němec <stepnem@gmail.com>\n---\n Documentation/CodingGuidelines |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 8346c19..e52474b 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -53,7 +53,7 @@ For shell scripts specifically (not exhaustive):\n\n  - No strlen ${#parameter}.\n\n- - No regexp ${parameter/pattern/string}.\n+ - No pattern substitution ${parameter/pattern/string}.\n\n  - We do not use Process Substitution <(list) or >(list).\n\n--\n"},{"id":"153067","messageId":"7v39sfuue3.fsf@alter.siamese.dyndns.org","threadId":"25401","inReplyTo":"20101009152758.GA17799@burratino","subject":"Re: [PATCH] CodingGuidelines: Fix a typo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-09T17:51:32Z","receivedAt":"2010-10-09T17:51:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> stepnem@gmail.com wrote:\n>\n>> `${parameter/pattern/string}' shell expansion uses glob patterns, so\n>> talking about `regexp' is confusing.\n>\n> Okay.\n>\n>> - - No regexp ${parameter/pattern/string}.\n>> + - No substitution ${parameter/pattern/string}.\n>\n> A bit confusing, since ${parameter%word} and $parameter are\n> substitutions, too.\n\nI had the same reaction.  Perhaps moving other parameter substitions\ncloser to these two would help?\n\n\tSide note: this is totally unrelated, but the below is --patience;\n\tour output without --patience is almost unreadable in this case.\n\n Documentation/CodingGuidelines |   27 +++++++++++++++------------\n 1 files changed, 15 insertions(+), 12 deletions(-)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 8346c19..09ffc46 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -35,11 +35,22 @@ For shell scripts specifically (not exhaustive):\n    properly nests.  It should have been the way Bourne spelled\n    it from day one, but unfortunately isn't.\n \n- - We use ${parameter-word} and its [-=?+] siblings, and their\n-   colon'ed \"unset or null\" form.\n+ - We use POSIX compliant parameter substitutions and avoid bashisms;\n+   namely:\n \n- - We use ${parameter#word} and its [#%] siblings, and their\n-   doubled \"longest matching\" form.\n+   - We use ${parameter-word} and its [-=?+] siblings, and their\n+     colon'ed \"unset or null\" form.\n+\n+   - We use ${parameter#word} and its [#%] siblings, and their\n+     doubled \"longest matching\" form.\n+\n+   - No \"Substring Expansion\" ${parameter:offset:length}.\n+\n+   - No shell arrays.\n+\n+   - No strlen ${#parameter}.\n+\n+   - No pattern replacement ${parameter/pattern/string}.\n \n  - We use Arithmetic Expansion $(( ... )).\n \n@@ -47,14 +58,6 @@ For shell scripts specifically (not exhaustive):\n    of them, as some shells do not grok $((x)) while accepting $(($x))\n    just fine (e.g. dash older than 0.5.4).\n \n- - No \"Substring Expansion\" ${parameter:offset:length}.\n-\n- - No shell arrays.\n-\n- - No strlen ${#parameter}.\n-\n- - No regexp ${parameter/pattern/string}.\n-\n  - We do not use Process Substitution <(list) or >(list).\n \n  - We prefer \"test\" over \"[ ... ]\".\n"},{"id":"153222","messageId":"20101011064404.GB32034@burratino","threadId":"25401","inReplyTo":"7v39sfuue3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] CodingGuidelines: Fix a typo","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-10-11T06:44:04Z","receivedAt":"2010-10-11T06:44:04Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> I had the same reaction.  Perhaps moving other parameter substitions\n> closer to these two would help?\n\nYes, that looks like a definite improvement.\n"}]}