{"thread":{"id":"1115","subject":"[PATCH] Add commify function to cg-Xlib","startedAt":"2005-07-06T07:00:50Z","lastAt":"2005-07-06T17:57:58Z","messageCount":4,"participants":["Frank Sorenson","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5689","messageId":"42CB81A2.7080405@tuxrocks.com","threadId":"1115","inReplyTo":null,"subject":"[PATCH] Add commify function to cg-Xlib","fromName":"Frank Sorenson","fromEmail":"frank@tuxrocks.com","sentAt":"2005-07-06T07:00:50Z","receivedAt":"2005-07-06T07:00:50Z","isPatch":true,"sender":{"key":"frank@tuxrocks.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHere is a patch to add a commify function to cg-Xlib.  I'll follow \nthis up with a patch that uses the new function to commify the \nnumber and size of objects pulled in cg-pull.\n\nSigned-off-by: Frank Sorenson <frank@tuxrocks.com>\n\nAdd a commify function to cg-Xlib\n\n- ---\ncommit de4fd646c8307777137b9a4c1b5735f9573167f6\ntree 1b9d3d0db498fde457d60f6658f616a1aa6b9fe3\nparent b21855b8734ca76ea08c0c17e4a204191b6e3add\nauthor Frank Sorenson <frank@tuxrocks.com> Wed, 06 Jul 2005 00:38:16 -0600\ncommitter Frank Sorenson <frank@tuxrocks.com> Wed, 06 Jul 2005 00:38:16 -0600\n\n cg-Xlib |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n- --- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -128,6 +128,9 @@ update_index () {\n \tgit-update-cache --refresh | sed 's/needs update$/locally modified/'\n }\n \n+commify() {\n+\techo $1 | sed ':a;s/\\B[0-9]\\{3\\}\\>/,&/;ta'\n+}\n \n print_help () {\n \twhich \"cg-$1\" >/dev/null 2>&1 || exit 1\n\n\nFrank\n- -- \nFrank Sorenson - KD7TZK\nSystems Manager, Computer Science Department\nBrigham Young University\nfrank@tuxrocks.com\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.2.6 (GNU/Linux)\nComment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org\n\niD8DBQFCy4GiaI0dwg4A47wRAg+vAJ9ZCn7ptBARMY+ELyS+uQ893/aDLgCgsk8b\ndhfcgflxQRURowVFP2qiRe4=\n=u7ap\n-----END PGP SIGNATURE-----\n"},{"id":"5690","messageId":"42CB8279.10603@tuxrocks.com","threadId":"1115","inReplyTo":"42CB81A2.7080405@tuxrocks.com","subject":"[PATCH] Commify numbers in cg-pull","fromName":"Frank Sorenson","fromEmail":"frank@tuxrocks.com","sentAt":"2005-07-06T07:04:25Z","receivedAt":"2005-07-06T07:04:25Z","isPatch":true,"sender":{"key":"frank@tuxrocks.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHere is a patch to commify the number and size of objects pulled\nin cg-pull.  Depends on the previous \"Add commify function\" patch.\n\nSigned-off-by: Frank Sorenson <frank@tuxrocks.com>\n\nCommify number and size of objects pulled in pull_progress\n\n- ---\ncommit 03fb604eb8c24851096cca14bed19f4eacc79686\ntree 191e8aa3a034e302aa660a9a5b5c0c64e2e88ac9\nparent de4fd646c8307777137b9a4c1b5735f9573167f6\nauthor Frank Sorenson <frank@tuxrocks.com> Wed, 06 Jul 2005 00:47:56 -0600\ncommitter Frank Sorenson <frank@tuxrocks.com> Wed, 06 Jul 2005 00:47:56 -0600\n\n cg-pull |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-pull b/cg-pull\n- --- a/cg-pull\n+++ b/cg-pull\n@@ -82,7 +82,7 @@ pull_progress() {\n \t\tsize=$(($size + $(stat -c '%s' \"$object\" 2>/dev/null)))\n \t\tobjects=$(($objects + 1));\n \n- -\t\techo -ne \"progress: $objects objects, $size bytes$percentage\\r\"\n+\t\techo -ne \"progress: $(commify $objects) objects, $(commify $size) bytes$percentage\\r\"\n \tdone;\n \t[ \"$last_objects\" != \"$objects\" ] && echo\n }\n\n\nFrank\n- -- \nFrank Sorenson - KD7TZK\nSystems Manager, Computer Science Department\nBrigham Young University\nfrank@tuxrocks.com\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.2.6 (GNU/Linux)\nComment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org\n\niD8DBQFCy4J4aI0dwg4A47wRAihxAKCOAioNWvYBDPkOvk/hYUgfUuMdewCgm1ea\n4IGx09Ew6tytbOAyPrUxHZU=\n=YM7f\n-----END PGP SIGNATURE-----\n"},{"id":"5698","messageId":"20050706075938.GB7054@pasky.ji.cz","threadId":"1115","inReplyTo":"42CB81A2.7080405@tuxrocks.com","subject":"Re: [PATCH] Add commify function to cg-Xlib","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-07-06T07:59:38Z","receivedAt":"2005-07-06T07:59:38Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Jul 06, 2005 at 09:00:50AM CEST, I got a letter\nwhere Frank Sorenson <frank@tuxrocks.com> told me that...\n> Here is a patch to add a commify function to cg-Xlib.  I'll follow \n> this up with a patch that uses the new function to commify the \n> number and size of objects pulled in cg-pull.\n> \n> Signed-off-by: Frank Sorenson <frank@tuxrocks.com>\n\nI don't know. Could you give some supporting argumentation, please? Is\nit really that hard to read for the Americans without the commas? It is\nat least harder to read for me as an European - we don't have any\ncommas in there, just spaces (if anything at all). Besides, the number\nis usually not in higher order than thousands, so... why is it worth it?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"},{"id":"5727","messageId":"42CC1BA6.9000200@tuxrocks.com","threadId":"1115","inReplyTo":"20050706075938.GB7054@pasky.ji.cz","subject":"Re: [PATCH] Add commify function to cg-Xlib","fromName":"Frank Sorenson","fromEmail":"frank@tuxrocks.com","sentAt":"2005-07-06T17:57:58Z","receivedAt":"2005-07-06T17:57:58Z","isPatch":true,"sender":{"key":"frank@tuxrocks.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nPetr Baudis wrote:\n> I don't know. Could you give some supporting argumentation, please? Is\n> it really that hard to read for the Americans without the commas? It is\n> at least harder to read for me as an European - we don't have any\n> commas in there, just spaces (if anything at all). Besides, the number\n> is usually not in higher order than thousands, so... why is it worth it?\n\nOkay.  Not a problem.  It just cleaned things up a little for me.  If I\nwant to keep it, I'll probably just maintain it in my local tree.\n\nFrank\n- --\nFrank Sorenson - KD7TZK\nSystems Manager, Computer Science Department\nBrigham Young University\nfrank@tuxrocks.com\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.2.6 (GNU/Linux)\nComment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org\n\niD8DBQFCzBumaI0dwg4A47wRAmKKAJ90HJymEjSHwvpKq7pjQkXf9wz7sACfXl8F\nBttVqvdhovFaGYEn9PibeC0=\n=N90S\n-----END PGP SIGNATURE-----\n"}]}