{"thread":{"id":"18112","subject":"Re: [PATCH] grep: add --blame so grep can show blame result at the same time","startedAt":"2009-03-03T15:33:18Z","lastAt":"2009-03-03T15:33:18Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"106850","messageId":"7v7i36ei4h.fsf@gitster.siamese.dyndns.org","threadId":"18112","inReplyTo":"1b29507a0903030427y15ad89d7y9f55a945612f0e20@mail.gmail.com","subject":"Re: [PATCH] grep: add --blame so grep can show blame result at the same time","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T15:33:18Z","receivedAt":"2009-03-03T15:33:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"pi song <pi.songs@gmail.com> writes:\n\n> My god, this is too big. I cannot attach or paste in email. What should I\n> do?\n\nFor a starter, try removing hunks that record only unwarranted changes,\nsuch as the following.  They are all style regressions.\n\n@@ -517,6 +563,8 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\t\t\tshow_name(opt, name);\n \t\t\t\treturn 1;\n \t\t\t}\n+\n+                        \n \t\t\t/* Hit at this line.  If we haven't shown the\n \t\t\t * pre-context lines, we would need to show them.\n \t\t\t * When asked to do \"count\", this still show\n@@ -524,7 +572,9 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t\t\t * deserves to get that ;-).\n \t\t\t */\n \t\t\tif (opt->pre_context) {\n+                            \n \t\t\t\tunsigned from;\n+\n \t\t\t\tif (opt->pre_context < lno)\n \t\t\t\t\tfrom = lno - opt->pre_context;\n \t\t\t\telse\n@@ -590,8 +664,10 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,\n \t * make it another option?  For now suppress them.\n \t */\n \tif (opt->count && count)\n+        {\n \t\tprintf(\"%s%c%u\\n\", name,\n \t\t       opt->null_following_name ? '\\0' : ':', count);\n+        }\n \treturn !!last_hit;\n }\n \n"}]}