{"thread":{"id":"38203","subject":"[PATCH 1/5] update_unicode.sh: simplify output capture","startedAt":"2014-12-19T14:39:27Z","lastAt":"2014-12-19T15:48:11Z","messageCount":9,"participants":["dev+git@drbeat.li","Beat Bolli","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"253833","messageId":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","threadId":"38203","inReplyTo":null,"subject":"[PATCH 1/5] update_unicode.sh: simplify output capture","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2014-12-19T14:39:27Z","receivedAt":"2014-12-19T14:39:27Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\nInstead of capturing the output of each echo and uniset invocation, wrap\nthe whole section in a group command and redirect its output all at\nonce.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n update_unicode.sh | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/update_unicode.sh b/update_unicode.sh\nindex 000b937..c1c876c 100755\n--- a/update_unicode.sh\n+++ b/update_unicode.sh\n@@ -26,12 +26,13 @@ fi &&\n \t\t\t./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'\n \t\tfi &&\n \t\tmake\n-\t) &&\n-\techo \"static const struct interval zero_width[] = {\" >$UNICODEWIDTH_H &&\n-\tUNICODE_DIR=. ./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n-\tgrep -v plane >>$UNICODEWIDTH_H &&\n-\techo \"};\" >>$UNICODEWIDTH_H &&\n-\techo \"static const struct interval double_width[] = {\" >>$UNICODEWIDTH_H &&\n-\tUNICODE_DIR=. ./uniset/uniset --32 eaw:F,W >>$UNICODEWIDTH_H &&\n-\techo \"};\" >>$UNICODEWIDTH_H\n+\t) && {\n+\t\techo \"static const struct interval zero_width[] = {\" &&\n+\t\tUNICODE_DIR=. ./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n+\t\tgrep -v plane &&\n+\t\techo \"};\" &&\n+\t\techo \"static const struct interval double_width[] = {\" &&\n+\t\tUNICODE_DIR=. ./uniset/uniset --32 eaw:F,W &&\n+\t\techo \"};\"\n+\t} >$UNICODEWIDTH_H\n )\n-- \n2.1.3\n"},{"id":"253835","messageId":"1418999971-21548-2-git-send-email-dev+git@drbeat.li","threadId":"38203","inReplyTo":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","subject":"[PATCH 2/5] update_unicode.sh: set UNICODE_DIR only once","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2014-12-19T14:39:28Z","receivedAt":"2014-12-19T14:39:28Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\nThe value is the same on both uniset invocations, so \"Don't Repeat\nYourself\" applies.\n\nSince we're in a subshell already, there's no need to unset UNICODE_DIR\nat the end.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n update_unicode.sh | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/update_unicode.sh b/update_unicode.sh\nindex c1c876c..bed8916 100755\n--- a/update_unicode.sh\n+++ b/update_unicode.sh\n@@ -27,12 +27,13 @@ fi &&\n \t\tfi &&\n \t\tmake\n \t) && {\n+\t\tUNICODE_DIR=. && export UNICODE_DIR &&\n \t\techo \"static const struct interval zero_width[] = {\" &&\n-\t\tUNICODE_DIR=. ./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n+\t\t./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n \t\tgrep -v plane &&\n \t\techo \"};\" &&\n \t\techo \"static const struct interval double_width[] = {\" &&\n-\t\tUNICODE_DIR=. ./uniset/uniset --32 eaw:F,W &&\n+\t\t./uniset/uniset --32 eaw:F,W &&\n \t\techo \"};\"\n \t} >$UNICODEWIDTH_H\n )\n-- \n2.1.3\n"},{"id":"253834","messageId":"1418999971-21548-3-git-send-email-dev+git@drbeat.li","threadId":"38203","inReplyTo":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","subject":"[PATCH 3/5] update_unicode.sh: shorten uniset invocation path","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2014-12-19T14:39:29Z","receivedAt":"2014-12-19T14:39:29Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\n\"uniset/uniset\" is a relative path; there's no need to prefix it with \"./\".\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n update_unicode.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/update_unicode.sh b/update_unicode.sh\nindex bed8916..f5cc14b 100755\n--- a/update_unicode.sh\n+++ b/update_unicode.sh\n@@ -29,11 +29,11 @@ fi &&\n \t) && {\n \t\tUNICODE_DIR=. && export UNICODE_DIR &&\n \t\techo \"static const struct interval zero_width[] = {\" &&\n-\t\t./uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n+\t\tuniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n \t\tgrep -v plane &&\n \t\techo \"};\" &&\n \t\techo \"static const struct interval double_width[] = {\" &&\n-\t\t./uniset/uniset --32 eaw:F,W &&\n+\t\tuniset/uniset --32 eaw:F,W &&\n \t\techo \"};\"\n \t} >$UNICODEWIDTH_H\n )\n-- \n2.1.3\n"},{"id":"253837","messageId":"1418999971-21548-4-git-send-email-dev+git@drbeat.li","threadId":"38203","inReplyTo":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","subject":"[PATCH 4/5] update_unicode.sh: Make the output structure visible","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2014-12-19T14:39:30Z","receivedAt":"2014-12-19T14:39:30Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\nBy using printf instead of the echo/uniset sequence, the final structure\nof the generated file becomes obvious.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n update_unicode.sh | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)\n\ndiff --git a/update_unicode.sh b/update_unicode.sh\nindex f5cc14b..61968d9 100755\n--- a/update_unicode.sh\n+++ b/update_unicode.sh\n@@ -28,12 +28,16 @@ fi &&\n \t\tmake\n \t) && {\n \t\tUNICODE_DIR=. && export UNICODE_DIR &&\n-\t\techo \"static const struct interval zero_width[] = {\" &&\n-\t\tuniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n-\t\tgrep -v plane &&\n-\t\techo \"};\" &&\n-\t\techo \"static const struct interval double_width[] = {\" &&\n-\t\tuniset/uniset --32 eaw:F,W &&\n-\t\techo \"};\"\n+\t\tprintf \"\\\n+static const struct interval zero_width[] = {\n+%s\n+};\n+static const struct interval double_width[] = {\n+%s\n+};\n+\" \\\n+\t\t\"$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n+\t\tgrep -v plane)\" \\\n+\t\t\"$(uniset/uniset --32 eaw:F,W)\"\n \t} >$UNICODEWIDTH_H\n )\n-- \n2.1.3\n"},{"id":"253836","messageId":"1418999971-21548-5-git-send-email-dev+git@drbeat.li","threadId":"38203","inReplyTo":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","subject":"[PATCH 5/5] update_unicode.sh: Delete the command group","fromName":"","fromEmail":"dev+git@drbeat.li","sentAt":"2014-12-19T14:39:31Z","receivedAt":"2014-12-19T14:39:31Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"From: Beat Bolli <dev+git@drbeat.li>\n\nNow that the whole file is generated by one single command, the command\ngroup is no longer needed.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n update_unicode.sh | 13 ++++++-------\n 1 file changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/update_unicode.sh b/update_unicode.sh\nindex 61968d9..45bd12a 100755\n--- a/update_unicode.sh\n+++ b/update_unicode.sh\n@@ -26,9 +26,9 @@ fi &&\n \t\t\t./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'\n \t\tfi &&\n \t\tmake\n-\t) && {\n-\t\tUNICODE_DIR=. && export UNICODE_DIR &&\n-\t\tprintf \"\\\n+\t) &&\n+\tUNICODE_DIR=. && export UNICODE_DIR &&\n+\tprintf \"\\\n static const struct interval zero_width[] = {\n %s\n };\n@@ -36,8 +36,7 @@ static const struct interval double_width[] = {\n %s\n };\n \" \\\n-\t\t\"$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n-\t\tgrep -v plane)\" \\\n-\t\t\"$(uniset/uniset --32 eaw:F,W)\"\n-\t} >$UNICODEWIDTH_H\n+\t\"$(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |\n+\tgrep -v plane)\" \\\n+\t\"$(uniset/uniset --32 eaw:F,W)\" >$UNICODEWIDTH_H\n )\n-- \n2.1.3\n"},{"id":"253838","messageId":"54944059.7000404@ewanet.ch","threadId":"38203","inReplyTo":"1418999971-21548-1-git-send-email-dev+git@drbeat.li","subject":"Re: [PATCH 1/5] update_unicode.sh: simplify output capture","fromName":"Beat Bolli","fromEmail":"bbolli@ewanet.ch","sentAt":"2014-12-19T15:12:25Z","receivedAt":"2014-12-19T15:12:25Z","isPatch":true,"sender":{"key":"bbolli@ewanet.ch","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 19.12.14 15:39, dev+git@drbeat.li wrote:\n\n> From: Beat Bolli <dev+git@drbeat.li>\n\nSorry, it looks like git send-email borked these messages. This line\nshould be part of the mail headers.\n\nRegards,\nBeat Bolli\n\n-- \nhttps://drbeat.li\npgp: 0x506A903A; 49D5 794A EA77 F907 764F  D89E 304B 93CF 506A 903A\ngsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa\nicbm: 47.0452 N, 7.2715 E\n\n\"It takes love over gold, and mind over matter\" -- Dire Straits\n\n"},{"id":"253840","messageId":"20141219152211.GA16967@peff.net","threadId":"38203","inReplyTo":"1418999971-21548-4-git-send-email-dev+git@drbeat.li","subject":"Re: [PATCH 4/5] update_unicode.sh: Make the output structure visible","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-12-19T15:22:11Z","receivedAt":"2014-12-19T15:22:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 19, 2014 at 03:39:30PM +0100, dev+git@drbeat.li wrote:\n\n> By using printf instead of the echo/uniset sequence, the final structure\n> of the generated file becomes obvious.\n\nThis whole series looks pretty sane to me, and the result is easier to\nread.\n\nI did wonder if a here-doc would be even easier than a PDF, like:\n\n  cat >$UNICODEWIDTH_H <<-EOF\n  static const struct interval zero_width[] = {\n    $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD | grep -v plane)\n  };\n  static const struct interval double_width[] = {\n    $(uniset/uniset --32 eaw:F,W)\n  };\n  EOF\n\nThe nice thing is that <<- will strip leading tabs, which means you can\nindent properly to match the surrounding code. I don't know if you find\nthe in-line $() more readable or not, though.\n\nI think either way it is an improvement over the current state.\n\n-Peff\n"},{"id":"253841","messageId":"549447B7.8070602@ewanet.ch","threadId":"38203","inReplyTo":"20141219152211.GA16967@peff.net","subject":"Re: [PATCH 4/5] update_unicode.sh: Make the output structure visible","fromName":"Beat Bolli","fromEmail":"bbolli@ewanet.ch","sentAt":"2014-12-19T15:43:51Z","receivedAt":"2014-12-19T15:43:51Z","isPatch":true,"sender":{"key":"bbolli@ewanet.ch","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 19.12.14 16:22, Jeff King wrote:\n> On Fri, Dec 19, 2014 at 03:39:30PM +0100, dev+git@drbeat.li wrote:\n> \n>> By using printf instead of the echo/uniset sequence, the final structure\n>> of the generated file becomes obvious.\n> \n> This whole series looks pretty sane to me, and the result is easier to\n> read.\n> \n> I did wonder if a here-doc would be even easier than a PDF, like:\n> \n>   cat >$UNICODEWIDTH_H <<-EOF\n>   static const struct interval zero_width[] = {\n>     $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD | grep -v plane)\n>   };\n>   static const struct interval double_width[] = {\n>     $(uniset/uniset --32 eaw:F,W)\n>   };\n>   EOF\n> \n> The nice thing is that <<- will strip leading tabs, which means you can\n> indent properly to match the surrounding code. I don't know if you find\n> the in-line $() more readable or not, though.\n\nI think the code looks much nicer with a here doc.\n\nChecking in t/, it looks that there's no consensus about whether to\nindent the content relative to the cat statement or not. What do you\nsuggest?\n\n> I think either way it is an improvement over the current state.\n\nThanks!\n\nBeat\n\n\n"},{"id":"253843","messageId":"20141219154810.GB16967@peff.net","threadId":"38203","inReplyTo":"549447B7.8070602@ewanet.ch","subject":"Re: [PATCH 4/5] update_unicode.sh: Make the output structure visible","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-12-19T15:48:11Z","receivedAt":"2014-12-19T15:48:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 19, 2014 at 04:43:51PM +0100, Beat Bolli wrote:\n\n> I think the code looks much nicer with a here doc.\n> \n> Checking in t/, it looks that there's no consensus about whether to\n> indent the content relative to the cat statement or not. What do you\n> suggest?\n\nI think we typically do it at the same level as the `cat`. Checking \"git\ngrep -A1 '<<-'\" does show a mix, but skimming over it I think what I\nsuggested is more common.\n\n-Peff\n"}]}