{"thread":{"id":"2228","subject":"[PATCH] Avoid using dc in git-count-objects","startedAt":"2005-10-25T23:22:11Z","lastAt":"2005-10-28T05:22:08Z","messageCount":18,"participants":["Johannes Schindelin","Junio C Hamano","Petr Baudis","Andreas Ericsson","Matthias Urlichs","Linus Torvalds","Herbert Xu","H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10621","messageId":"Pine.LNX.4.63.0510260120260.28994@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2228","inReplyTo":null,"subject":"[PATCH] Avoid using dc in git-count-objects","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-25T23:22:11Z","receivedAt":"2005-10-25T23:22:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Using dc is not really necessary, since expr understands summing 32 bit \nsigned integers. Which means that git-count-objects will now fail when 2 \nGB of unpacked objects have accumulated.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tThis is (again) something I found on a default cygwin setup:\n\tdc is not installed. I do not even know if you can install\n\tdc on cygwin without compiling it yourself.\n\n\tFYI: I use git-count-objects in t5500-fetch-pack to find out\n\tif the correct number of objects was fetched.\n\n git-count-objects.sh |   14 ++++++++++----\n 1 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/git-count-objects.sh b/git-count-objects.sh\nindex 843d2fd..7f9d8e5 100755\n--- a/git-count-objects.sh\n+++ b/git-count-objects.sh\n@@ -2,12 +2,18 @@\n \n . git-sh-setup\n \n+function sum () {\n+\tlocal result=0\n+\twhile read line; do\n+\t\tresult=$(expr $result + $line)\n+\tdone\n+\techo $result\n+}\n+\n echo $(find \"$GIT_DIR/objects\"/?? -type f -print 2>/dev/null | wc -l) objects, \\\n $({\n-    echo 0\n     # \"no-such\" is to help Darwin folks by not using xargs -r.\n     find \"$GIT_DIR/objects\"/?? -type f -print 2>/dev/null |\n     xargs du -k \"$GIT_DIR/objects/no-such\" 2>/dev/null |\n-    sed -e 's/[ \t].*/ +/'\n-    echo p\n-} | dc) kilobytes\n+    sed -e 's/[ \t].*//'\n+} | sum) kilobytes\n"},{"id":"10632","messageId":"7vd5ltcf05.fsf@assigned-by-dhcp.cox.net","threadId":"2228","inReplyTo":"Pine.LNX.4.63.0510260120260.28994@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-26T00:12:58Z","receivedAt":"2005-10-26T00:12:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Using dc is not really necessary, since expr understands summing 32 bit \n> signed integers. Which means that git-count-objects will now fail when 2 \n> GB of unpacked objects have accumulated.\n\nSorry, but I am not very happy about this patch.  \"local\"\nbashism aside, doesn't this spawn expr for every unpacked\nobject?\n"},{"id":"10643","messageId":"Pine.LNX.4.63.0510261031400.7424@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2228","inReplyTo":"7vd5ltcf05.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-26T08:33:33Z","receivedAt":"2005-10-26T08:33:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 25 Oct 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Using dc is not really necessary, since expr understands summing 32 bit \n> > signed integers. Which means that git-count-objects will now fail when 2 \n> > GB of unpacked objects have accumulated.\n> \n> Sorry, but I am not very happy about this patch.  \"local\"\n> bashism aside, doesn't this spawn expr for every unpacked\n> object?\n\nAargh! I had the impression \"expr\" was a builtin... Just forget about the \npatch, okay?\n\nCiao,\nDscho\n"},{"id":"10645","messageId":"20051026083658.GE30889@pasky.or.cz","threadId":"2228","inReplyTo":"Pine.LNX.4.63.0510261031400.7424@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-10-26T08:36:58Z","receivedAt":"2005-10-26T08:36:58Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Oct 26, 2005 at 10:33:33AM CEST, I got a letter\nwhere Johannes Schindelin <Johannes.Schindelin@gmx.de> told me that...\n> Aargh! I had the impression \"expr\" was a builtin... Just forget about the \n> patch, okay?\n\nI think that builtin or not, $() will always spawn a subshell. ...?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"10649","messageId":"Pine.LNX.4.63.0510261057560.26001@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2228","inReplyTo":"Pine.LNX.4.63.0510261031400.7424@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-26T08:58:57Z","receivedAt":"2005-10-26T08:58:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Oct 2005, Johannes Schindelin wrote:\n\n> On Tue, 25 Oct 2005, Junio C Hamano wrote:\n> \n> > Sorry, but I am not very happy about this patch.  \"local\"\n> > bashism aside, doesn't this spawn expr for every unpacked\n> > object?\n> \n> Aargh! I had the impression \"expr\" was a builtin... Just forget about \n> the patch, okay?\n\nThis patch should be better:\n\ndiff --git a/git-count-objects.sh b/git-count-objects.sh\nindex 843d2fd..ceb1ff2 100755\n--- a/git-count-objects.sh\n+++ b/git-count-objects.sh\n@@ -2,6 +2,19 @@\n \n . git-sh-setup\n \n+case $SHELL in\n+*bash)\n+\tfunction dc () {\n+\t\twhile read a b; do\n+\t\t\tcase $a,$b in\n+\t\t\t0,) result=0;;\n+\t\t\t*,+) result=$(($result+$a));;\n+\t\t\tp,) echo $result\n+\t\t\tesac\n+\t\tdone\n+\t}\n+esac\n+\n echo $(find \"$GIT_DIR/objects\"/?? -type f -print 2>/dev/null | wc -l) objects, \\\n $({\n     echo 0\n"},{"id":"10653","messageId":"435F4B05.4010702@op5.se","threadId":"2228","inReplyTo":"7vd5ltcf05.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-10-26T09:23:17Z","receivedAt":"2005-10-26T09:23:17Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> \n>>Using dc is not really necessary, since expr understands summing 32 bit \n>>signed integers. Which means that git-count-objects will now fail when 2 \n>>GB of unpacked objects have accumulated.\n> \n> \n> Sorry, but I am not very happy about this patch.  \"local\"\n> bashism aside, doesn't this spawn expr for every unpacked\n> object?\n> \n\nI'd be more worried about the fact that the kilobytes count is way off \nas it is. du (at least from coreutils-5.2.1) rounds up to nearest \nkilobyte *for each file* when printing kb-count.\n\nTry these:\n    du -skc .git/objects/?? | grep total\n    du -skc .git/objects/??/* | grep total\n    du -sbc .git/objects/?? | grep total\n    du -sbc .git/objects/??/* | grep total\n\nwhich will all yield different values.\n\nI have no idea which of those values people expect to get back, so it \nmight be correct right now, although I doubt it.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"10660","messageId":"Pine.LNX.4.63.0510261637070.26622@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2228","inReplyTo":"435F4B05.4010702@op5.se","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-26T14:44:11Z","receivedAt":"2005-10-26T14:44:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Oct 2005, Andreas Ericsson wrote:\n\n> I'd be more worried about the fact that the kilobytes count is way off \n> as it is. du (at least from coreutils-5.2.1) rounds up to nearest \n> kilobyte *for each file* when printing kb-count.\n\nThe rationale behind this: You want to know how much space it takes on \nyour hard disk. Remember, git-count-objects should give you a clue whether \nto repack or not.\n\nActually, \"du -k\" in my tests rounds up to nearest block size or kilobytes \n(whichever is greater): For example, \"du -k\" on a very small file (53 \nbytes) says \"1\" on an ext2fs yields \"1\", \"4\" on hfs, and 32 on a big \nFAT32. Of course, you may get different values, since the block sizes \nsometimes depend on the total size of the media.\n\nHth,\nDscho\n"},{"id":"10661","messageId":"435F98E4.8040301@op5.se","threadId":"2228","inReplyTo":"Pine.LNX.4.63.0510261637070.26622@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-10-26T14:55:32Z","receivedAt":"2005-10-26T14:55:32Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 26 Oct 2005, Andreas Ericsson wrote:\n> \n> \n>>I'd be more worried about the fact that the kilobytes count is way off \n>>as it is. du (at least from coreutils-5.2.1) rounds up to nearest \n>>kilobyte *for each file* when printing kb-count.\n> \n> \n> The rationale behind this: You want to know how much space it takes on \n> your hard disk. Remember, git-count-objects should give you a clue whether \n> to repack or not.\n> \n\nOh. I thought it was so I would know how much data would be sent over \nthe network. Diskspace is cheap, bandwidth is... well, that's cheap too \n(in Sweden at least), but it's boring to wait.\n\n> Actually, \"du -k\" in my tests rounds up to nearest block size or kilobytes \n> (whichever is greater): For example, \"du -k\" on a very small file (53 \n> bytes) says \"1\" on an ext2fs yields \"1\", \"4\" on hfs, and 32 on a big \n> FAT32. Of course, you may get different values, since the block sizes \n> sometimes depend on the total size of the media.\n> \n\n From my du man-page:\n\n  -k     like --block-size=1K\n\nI think *most* du implementations work like this, but apparently not all \nof them. I'll hack something up in C instead so it's at least consistent \nregardless of what version of du is used.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"10694","messageId":"pan.2005.10.27.08.49.59.849081@smurf.noris.de","threadId":"2228","inReplyTo":"20051026083658.GE30889@pasky.or.cz","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-10-27T08:50:00Z","receivedAt":"2005-10-27T08:50:00Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Petr Baudis wrote:\n\n> Dear diary, on Wed, Oct 26, 2005 at 10:33:33AM CEST, I got a letter\n> where Johannes Schindelin <Johannes.Schindelin@gmx.de> told me that...\n>> Aargh! I had the impression \"expr\" was a builtin... Just forget about the \n>> patch, okay?\n> \n> I think that builtin or not, $() will always spawn a subshell. ...?\n\nIt'll fork a subshell, but if the $() is a builtin, it won't exec.\n\n(My built-in dictionary says: \"spawn\"==\"fork+exec\"; sorry if that\ndisagrees with yours.)\n\nThat being said, \"echo $((1 + 2 + $((3 + 4))))\" will not even fork.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nPrunes give you a run for your money.\n"},{"id":"10699","messageId":"Pine.LNX.4.63.0510271149110.16500@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2228","inReplyTo":"pan.2005.10.27.08.49.59.849081@smurf.noris.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-10-27T09:56:50Z","receivedAt":"2005-10-27T09:56:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 27 Oct 2005, Matthias Urlichs wrote:\n\n> That being said, \"echo $((1 + 2 + $((3 + 4))))\" will not even fork.\n\n<germanenglish>\nBut zats not troo. It forks fine for mee: ze result is 10.\n</germanenglish>\n\n;-)\n\nCiao,\nDscho\n"},{"id":"10708","messageId":"Pine.LNX.4.64.0510270801560.4664@g5.osdl.org","threadId":"2228","inReplyTo":"pan.2005.10.27.08.49.59.849081@smurf.noris.de","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-10-27T15:12:19Z","receivedAt":"2005-10-27T15:12:19Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 27 Oct 2005, Matthias Urlichs wrote:\n> \n> It'll fork a subshell, but if the $() is a builtin, it won't exec.\n> \n> That being said, \"echo $((1 + 2 + $((3 + 4))))\" will not even fork.\n\nRight. Don't confuse $(..) with $((..)).\n\nThey have absolutely nothing to do with each other, except for looking a \nbit similar. \n\nThe $((..)) is shell-builtin arithmetic. I could imagine a broken shell \nforking and executing \"dc\" for it, but quite frankly, that sounds so \nunlikely as to be totally silly. So realistically, a shell either supports \nit or not. \n\nOh - there's another similarity between $(..) and $((..)). They're both \nPOSIX 1003.2 standard features, so any \"modern\" shell should support them. \nAlthough in practice I don't know if that means anything else than ksh \n(where both syntaxes came from, actually).\n\n\t\tLinus\n"},{"id":"10713","messageId":"7vmzku3kmy.fsf@assigned-by-dhcp.cox.net","threadId":"2228","inReplyTo":"Pine.LNX.4.64.0510270801560.4664@g5.osdl.org","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-27T18:00:37Z","receivedAt":"2005-10-27T18:00:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Oh - there's another similarity between $(..) and $((..)). They're both \n> POSIX 1003.2 standard features, so any \"modern\" shell should support them. \n> Although in practice I don't know if that means anything else than ksh \n> (where both syntaxes came from, actually).\n\nOK, you prodded me enough to come to 21st century ;-).\n\nI was hoping that doing .git/objects/ traversal and disk block\naccounting ourselves maybe in C or Perl would be enough for that\nparticular program, but I would not object if the community\nconcensus is we would run on only POSIX shells anymore.\n\nI still resist saying that we run only on Bash, though.  I\nsuspect we already have some bashism on the periphery, but\neradicating them has been lower priority for me.\n"},{"id":"10743","messageId":"E1EVKmt-0003xn-00@gondolin.me.apana.org.au","threadId":"2228","inReplyTo":"Pine.LNX.4.64.0510270801560.4664@g5.osdl.org","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2005-10-28T03:20:15Z","receivedAt":"2005-10-28T03:20:15Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"Linus Torvalds <torvalds@osdl.org> wrote:\n> \n> Oh - there's another similarity between $(..) and $((..)). They're both \n> POSIX 1003.2 standard features, so any \"modern\" shell should support them. \n> Although in practice I don't know if that means anything else than ksh \n> (where both syntaxes came from, actually).\n\nThere is also dash (http://gondor.apana.org.au/~herbert/dash/).\nIt complies with POSIX, is less than half the size of pdksh (83960 bytes\ncurrently on i386), and is faster than pdksh.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"10748","messageId":"4361A5BB.5040100@zytor.com","threadId":"2228","inReplyTo":"E1EVKmt-0003xn-00@gondolin.me.apana.org.au","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-28T04:14:51Z","receivedAt":"2005-10-28T04:14:51Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Herbert Xu wrote:\n> Linus Torvalds <torvalds@osdl.org> wrote:\n> \n>>Oh - there's another similarity between $(..) and $((..)). They're both \n>>POSIX 1003.2 standard features, so any \"modern\" shell should support them. \n>>Although in practice I don't know if that means anything else than ksh \n>>(where both syntaxes came from, actually).\n> \n> \n> There is also dash (http://gondor.apana.org.au/~herbert/dash/).\n> It complies with POSIX, is less than half the size of pdksh (83960 bytes\n> currently on i386), and is faster than pdksh.\n\nCurrent ash also has these features, and is about that size compiled \nstatic with klibc :)\n\n\t-hpa\n"},{"id":"10749","messageId":"20051028043211.GA781@gondor.apana.org.au","threadId":"2228","inReplyTo":"4361A5BB.5040100@zytor.com","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2005-10-28T04:32:11Z","receivedAt":"2005-10-28T04:32:11Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, Oct 27, 2005 at 09:14:51PM -0700, H. Peter Anvin wrote:\n> \n> Current ash also has these features, and is about that size compiled \n> static with klibc :)\n\nInteresting.  I just tried it on my POSIX testsuite and unfortunately\nit failed a number of simple tests including the case statement and\nsegfaulted on quite a few occasions too.  I've included one of the\nsegfault scripts here.\n\nDash is already used in busybox where it has been linked with ulibc.\nSo it can't be that hard to make it work with klibc.\n\nPerhaps you could use dash for your project as well?\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n\n\ntrap 'rm -f $TMP' EXIT\nTMP=$(tempfile)\n\ncat <<- EOF > $TMP\n\treturn\n\techo not here\nEOF\n\na() {\n\t. $TMP\n\techo here\n}\n\na\n\ncat <<- EOF > $TMP\n\texit\nEOF\n\n(false; . $TMP)\necho $?\n"},{"id":"10750","messageId":"4361AA56.2090906@zytor.com","threadId":"2228","inReplyTo":"20051028043211.GA781@gondor.apana.org.au","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-28T04:34:30Z","receivedAt":"2005-10-28T04:34:30Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Herbert Xu wrote:\n> On Thu, Oct 27, 2005 at 09:14:51PM -0700, H. Peter Anvin wrote:\n> \n>>Current ash also has these features, and is about that size compiled \n>>static with klibc :)\n> \n> \n> Interesting.  I just tried it on my POSIX testsuite and unfortunately\n> it failed a number of simple tests including the case statement and\n> segfaulted on quite a few occasions too.  I've included one of the\n> segfault scripts here.\n> \n> Dash is already used in busybox where it has been linked with ulibc.\n> So it can't be that hard to make it work with klibc.\n> \n> Perhaps you could use dash for your project as well?\n> \n\nDepends on how big it is.\n\n\t-hpa\n"},{"id":"10751","messageId":"20051028045837.GA1167@gondor.apana.org.au","threadId":"2228","inReplyTo":"4361AA56.2090906@zytor.com","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2005-10-28T04:58:37Z","receivedAt":"2005-10-28T04:58:37Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, Oct 27, 2005 at 09:34:30PM -0700, H. Peter Anvin wrote:\n>\n> >Perhaps you could use dash for your project as well?\n> \n> Depends on how big it is.\n\nI just noticed that you were building it with -Os.  So I built\ndash with -Os and this is what I get:\n\n$ size dash\n   text    data     bss     dec     hex filename\n  64397     884   10240   75521   12701 dash\n$ size klibc-1.1.1/ash/sh.shared\n   text    data     bss     dec     hex filename\n  66237     424   70908  137569   21961 klibc-1.1.1/ash/sh.shared\n\nSo it looks like as long as dash can link with klibc then:\n\n1) It should be smaller in size.\n2) It should be more stable due to much wider testing coverage (Debian).\n3) You get some extra bells & whistles thrown in for free like printf.\n\nI'll let you know when I have a version that links with klibc.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"10752","messageId":"4361B580.9090100@zytor.com","threadId":"2228","inReplyTo":"20051028045837.GA1167@gondor.apana.org.au","subject":"Re: [PATCH] Avoid using dc in git-count-objects","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-28T05:22:08Z","receivedAt":"2005-10-28T05:22:08Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Herbert Xu wrote:\n> On Thu, Oct 27, 2005 at 09:34:30PM -0700, H. Peter Anvin wrote:\n> \n>>>Perhaps you could use dash for your project as well?\n>>\n>>Depends on how big it is.\n> \n> \n> I just noticed that you were building it with -Os.  So I built\n> dash with -Os and this is what I get:\n> \n> $ size dash\n>    text    data     bss     dec     hex filename\n>   64397     884   10240   75521   12701 dash\n> $ size klibc-1.1.1/ash/sh.shared\n>    text    data     bss     dec     hex filename\n>   66237     424   70908  137569   21961 klibc-1.1.1/ash/sh.shared\n> \n> So it looks like as long as dash can link with klibc then:\n> \n> 1) It should be smaller in size.\n> 2) It should be more stable due to much wider testing coverage (Debian).\n> 3) You get some extra bells & whistles thrown in for free like printf.\n> \n> I'll let you know when I have a version that links with klibc.\n> \n> Cheers,\n\nCool, thanks!\n\n\t-hpa\n"}]}