{"thread":{"id":"809","subject":"[PATCH] cg-log: cleanup line wrapping by using bash internals","startedAt":"2005-06-02T14:46:21Z","lastAt":"2005-06-02T20:01:08Z","messageCount":2,"participants":["Jonas Fonseca","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4417","messageId":"20050602144621.GB16143@diku.dk","threadId":"809","inReplyTo":null,"subject":"[PATCH] cg-log: cleanup line wrapping by using bash internals","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-06-02T14:46:21Z","receivedAt":"2005-06-02T14:46:21Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Use ${#var} instead of echo + wc combo. Additionally also gives\na minor speedup.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\ncg-log -f\n\nnew code:\n\treal    1m15.462s\n\tuser    0m27.195s\n\tsys     0m40.639s\n\nold code:\n\treal    1m38.222s\n\tuser    0m32.563s\n\tsys     0m56.034s\n\nBTW, I noticed the following errors:\n\n\tfatal: internal error in diffcore: unmodified entry remains\n\tfatal: internal error in diffcore: unmodified entry remains\n\tfatal: internal error in diffcore: unmodified entry remains\n\nwith both current cogito and git.\n\nTo reproduce run either of the following in the cogito repo:\n\ngit-diff-tree -r 7c1f9aa894ce91928d982a0b197ab596375825a3 e30dd6c68e576d37bddd011aa7131a6d30297b4c\t\ngit-diff-tree -r c49cd3e4f1dfe4ccbf2b8d00188beaa251fee028 9fec8b26eff58e1f595e8619abf1e42c07645ff8\n\nThe last one also triggers in the git repo.\nThe log entries for the two commits are:\n\ncommit 6616d1835e81ac0d2304702102d210451c04832a\ntree 7c1f9aa894ce91928d982a0b197ab596375825a3\nparent e30dd6c68e576d37bddd011aa7131a6d30297b4c\nparent e8871e88adca0637eb0299a41d85400beac928bd\nauthor Petr Baudis <pasky@ucw.cz> Sun, 17 Apr 2005 19:30:32 +0200\ncommitter Petr Baudis <xpasky@machine> Sun, 17 Apr 2005 19:30:32 +0200\n\n    Merging: d72ff74f5fd172c6ec9630ee8e08895a0525dcfe\n\n    Merge with Linus. Nothing particularily interesting.\n\ncommit e44794706eeb57f2ee38ed1604821aa38b8ad9d2\ntree c49cd3e4f1dfe4ccbf2b8d00188beaa251fee028\nparent 9fec8b26eff58e1f595e8619abf1e42c07645ff8\nauthor Linus Torvalds <torvalds@ppc970.osdl.org> Sat, 16 Apr 2005 22:26:31 -0700\ncommitter Linus Torvalds <torvalds@ppc970.osdl.org> Sat, 16 Apr 2005 22:26:31 -0700\n\n    Be much more liberal about the file mode bits.\n\n    We only really care about the difference between a file being executable\n    or not (by its owner). Everything else we leave for the user umask to\n    decide.\n\nAny ideas?\n\n cg-log |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/cg-log b/cg-log\n--- a/cg-log\n+++ b/cg-log\n@@ -129,8 +129,8 @@ list_commit_files()\n \t$list_cmd | cut -f 2- | while read file; do\n \t\techo -n \"$sep\"\n \t\tsep=\", \"\n-\t\tif [ $(echo \"$line$sep$file\" | wc -c) -le 75 ]; then\n-\t\t\tline=\"$line$sep$file\"\n+\t\tline=\"$line$sep$file\"\n+\t\tif [ \"${#line}\" -le 74 ]; then\n \t\t\techo -n \"$file\"\n \t\telse\n \t\t\tline=\"      $file\"\n-- \nJonas Fonseca\n"},{"id":"4443","messageId":"7vacm834vv.fsf@assigned-by-dhcp.cox.net","threadId":"809","inReplyTo":"20050602144621.GB16143@diku.dk","subject":"Re: [PATCH] cg-log: cleanup line wrapping by using bash internals","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-06-02T20:01:08Z","receivedAt":"2005-06-02T20:01:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"JF\" == Jonas Fonseca <fonseca@diku.dk> writes:\n\nJF> BTW, I noticed the following errors:\n\nJF> \tfatal: internal error in diffcore: unmodified entry remains\nJF> \tfatal: internal error in diffcore: unmodified entry remains\nJF> \tfatal: internal error in diffcore: unmodified entry remains\n\nJF> with both current cogito and git.\n\nIf you have acquired this fix and still see the above please let\nme know.\n\nCommit    67574c403f1e27660bbd0348b81b31adc9889b20\nAuthor    Junio C Hamano <junkio@cox.net>, Wed Jun 1 11:38:07 2005 -0700\nCommitter Linus Torvalds <torvalds@ppc970.osdl.org>, Wed Jun 1 13:24:03 2005 -0700\n\n[PATCH] diff: mode bits fixes\n\nThe core GIT repository has trees that record regular file mode\nin 0664 instead of normalized 0644 pattern.  Comparing such a\ntree with another tree that records the same file in 0644\npattern without content changes with git-diff-tree causes it to\nfeed otherwise unmodified pairs to the diff_change() routine,\nwhich triggers a sanity check routine and barfs.  This patch\nfixes the problem, along with the fix to another caller that\nuses unnormalized mode bits to call diff_change() routine in a\nsimilar way.\n\nWithout this patch, you will see \"fatal error\" from diff-tree\nwhen you run git-deltafy-script on the core GIT repository\nitself.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n\n"}]}