{"thread":{"id":"15358","subject":"blame vs annotate?","startedAt":"2008-09-03T16:43:03Z","lastAt":"2008-09-05T12:06:55Z","messageCount":17,"participants":["Jonathan del Strother","Miklos Vajna","Petr Baudis","Junio C Hamano","Jakub Narebski","Matthieu Moy","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"89643","messageId":"57518fd10809030943i35af222fw82cf591c737b8c04@mail.gmail.com","threadId":"15358","inReplyTo":null,"subject":"blame vs annotate?","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2008-09-03T16:43:03Z","receivedAt":"2008-09-03T16:43:03Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"What's the difference between 'git blame' & 'git annotate'?  The\noutput is practically identical - it's not obvious when you would use\none over the other\n"},{"id":"89658","messageId":"20080903174939.GH16514@genesis.frugalware.org","threadId":"15358","inReplyTo":"57518fd10809030943i35af222fw82cf591c737b8c04@mail.gmail.com","subject":"Re: blame vs annotate?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-09-03T17:49:39Z","receivedAt":"2008-09-03T17:49:39Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, Sep 03, 2008 at 05:43:03PM +0100, Jonathan del Strother <maillist@steelskies.com> wrote:\n> What's the difference between 'git blame' & 'git annotate'?  The\n> output is practically identical - it's not obvious when you would use\n> one over the other\n\n'git annoate' is the same as 'git blame -c'.\n"},{"id":"89659","messageId":"20080903175422.GV10544@machine.or.cz","threadId":"15358","inReplyTo":"20080903174939.GH16514@genesis.frugalware.org","subject":"Re: blame vs annotate?","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-09-03T17:54:22Z","receivedAt":"2008-09-03T17:54:22Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Wed, Sep 03, 2008 at 07:49:39PM +0200, Miklos Vajna wrote:\n> On Wed, Sep 03, 2008 at 05:43:03PM +0100, Jonathan del Strother <maillist@steelskies.com> wrote:\n> > What's the difference between 'git blame' & 'git annotate'?  The\n> > output is practically identical - it's not obvious when you would use\n> > one over the other\n> \n> 'git annoate' is the same as 'git blame -c'.\n\nBut 'git blame -c' is defined as \"the same as 'git annotate'\". So this\nanswer does not really help. :-)\n\n(And yes, I'd love to hear some as well. When pruning the completion\nlist, I've been on the verge of setting 'git annotate' as deprecated,\nbut decided to do that in a separate patch later and properly. Please\nsomeone beat me to it. ;-)\n\n\t\t\t\tPetr \"Pasky\" Baudis\n"},{"id":"89663","messageId":"7v8wu9cd7i.fsf@gitster.siamese.dyndns.org","threadId":"15358","inReplyTo":"57518fd10809030943i35af222fw82cf591c737b8c04@mail.gmail.com","subject":"Re: blame vs annotate?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-03T18:10:41Z","receivedAt":"2008-09-03T18:10:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jonathan del Strother\" <maillist@steelskies.com> writes:\n\n> What's the difference between 'git blame' & 'git annotate'?  The\n> output is practically identical - it's not obvious when you would use\n> one over the other\n\nIn short, don't use git-annotate unless you are an ancient script that was\nwritten before git-blame was written.  They are functionally equivalent,\nuses the same blame assigning engine, and the only difference is the\ndefault output format, and blame knows how to mimick annotate output.\n\nHistory.\n\nThe first implementation was called git-annotate that was implemented in\nPerl.\n\n    c65e898 (Add git-annotate, a tool for assigning blame., 2006-02-20)\n\nA competing implementation in C was done and was called git-blame:\n\n    cbfb73d (Add git-blame, a tool for assigning blame., 2006-02-21)\n\nThey competed for a while but it became more and more apparent that blame\nwas a better implementation.  After blame learned to mimick annotate\noutput, which some scripts depended on, Perl implementation was retired,\nbut the name git-annotate was left as a backward compatibility alias:\n\n    f789e34 (Remove git-annotate.perl and create a builtin-alias for git-blame, 2006-10-09)\n\nThen as an experiment, a reimplementation of blame in C, confusingly\ncodenamed git-pickaxe, was started, to detect code movements across and\nwithin files:\n\n    cee7f24 (git-pickaxe: blame rewritten., 2006-10-19)\n\nThis had the same output format as git-blame, also with compatibility\noutput format implemented for the older git-annotate.  After it matured,\nit took over the original git-blame name.\n\n    acca687 (git-pickaxe: retire pickaxe, 2006-11-08)\n"},{"id":"89664","messageId":"m3zlmpp0ac.fsf@localhost.localdomain","threadId":"15358","inReplyTo":"57518fd10809030943i35af222fw82cf591c737b8c04@mail.gmail.com","subject":"Re: blame vs annotate?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-03T18:11:25Z","receivedAt":"2008-09-03T18:11:25Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Jonathan del Strother\" <maillist@steelskies.com> writes:\n\n> What's the difference between 'git blame' & 'git annotate'?  The\n> output is practically identical - it's not obvious when you would use\n> one over the other\n\nLong, long time ago (which in git terms mean almost 2 years ago:\ngit-annotate.perl was removed on Oct 9, 2006) there were two competing\nimplementations: git-annotate, which IIRC was first (starting at Feb\n20, 2006) and was written in Perl, and git-blame (stated at Feb 21,\n2006) which was written in C.  In long term git-blame won, if I\nremember correctly because it avoided some strange corner case, and\nassigned blame better.  Then git-annotate was made alias to \"git-blame\n-c\", perhaps in additon to different synopsis (order of arguments and\npossible options), for backward compatibility.\n\nHTH.\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"89743","messageId":"vpq7i9smg5e.fsf@bauges.imag.fr","threadId":"15358","inReplyTo":"7v8wu9cd7i.fsf@gitster.siamese.dyndns.org","subject":"Re: blame vs annotate?","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-04T09:09:17Z","receivedAt":"2008-09-04T09:09:17Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Jonathan del Strother\" <maillist@steelskies.com> writes:\n>\n>> What's the difference between 'git blame' & 'git annotate'?  The\n>> output is practically identical - it's not obvious when you would use\n>> one over the other\n>\n> In short, don't use git-annotate unless you are an ancient script that was\n> written before git-blame was written.  They are functionally equivalent,\n> uses the same blame assigning engine, and the only difference is the\n> default output format, and blame knows how to mimick annotate output.\n\nThen, does it make sense to apply this?\n\n--- a/Documentation/git-annotate.txt\n+++ b/Documentation/git-annotate.txt\n@@ -14,6 +14,10 @@ DESCRIPTION\n Annotates each line in the given file with information from the commit\n which introduced the line. Optionally annotate from a given revision.\n \n+This command exists for backward compatibility. If you don't have\n+existing scripts using 'git annotate', you should use\n+linkgit:git-blame[1] instead.\n+\n OPTIONS\n -------\n include::blame-options.txt[]\n\n-- \nMatthieu\n"},{"id":"89744","messageId":"bd6139dc0809040216v40914e82h6a4032941cf65996@mail.gmail.com","threadId":"15358","inReplyTo":"vpq7i9smg5e.fsf@bauges.imag.fr","subject":"Re: blame vs annotate?","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-09-04T09:16:13Z","receivedAt":"2008-09-04T09:16:13Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Thu, Sep 4, 2008 at 11:09, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:\n> +This command exists for backward compatibility. If you don't have\n> +existing scripts using 'git annotate', you should use\n> +linkgit:git-blame[1] instead.\n\nThis implies that if you do have a script that uses git-annotate, you\nshould use it in your daily use too. Maybe something like \"For regular\nuse you should use ....\"?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"89759","messageId":"1220529652-24050-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"15358","inReplyTo":"bd6139dc0809040216v40914e82h6a4032941cf65996@mail.gmail.com","subject":"[PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-04T12:00:52Z","receivedAt":"2008-09-04T12:00:52Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-annotate.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt\nindex 8b6b56a..6e05825 100644\n--- a/Documentation/git-annotate.txt\n+++ b/Documentation/git-annotate.txt\n@@ -14,6 +14,9 @@ DESCRIPTION\n Annotates each line in the given file with information from the commit\n which introduced the line. Optionally annotate from a given revision.\n \n+This command exists for backward compatibility. For regular use, you\n+should use linkgit:git-blame[1] instead.\n+\n OPTIONS\n -------\n include::blame-options.txt[]\n-- \n1.6.0.7.g161c\n"},{"id":"89760","messageId":"20080904123046.GX10544@machine.or.cz","threadId":"15358","inReplyTo":"1220529652-24050-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-09-04T12:30:47Z","receivedAt":"2008-09-04T12:30:47Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Thu, Sep 04, 2008 at 02:00:52PM +0200, Matthieu Moy wrote:\n> \n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  Documentation/git-annotate.txt |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt\n> index 8b6b56a..6e05825 100644\n> --- a/Documentation/git-annotate.txt\n> +++ b/Documentation/git-annotate.txt\n> @@ -14,6 +14,9 @@ DESCRIPTION\n>  Annotates each line in the given file with information from the commit\n>  which introduced the line. Optionally annotate from a given revision.\n>  \n> +This command exists for backward compatibility. For regular use, you\n> +should use linkgit:git-blame[1] instead.\n> +\n>  OPTIONS\n>  -------\n>  include::blame-options.txt[]\n\nCan you please also mark it deprecated in the bash completion and\ncommand-list.txt?\n\nWill we still keep it around indefinitely or do we have any phase-out\nplan? If the latter, we should also start printing warning when\nexecuting it.\n\nI'm also curious about\n\n                if (suspect->commit->object.flags & UNINTERESTING) {\n                        if (blank_boundary)\n                                memset(hex, ' ', length);\n                        else if (!cmd_is_annotate) {\n                                length--;\n                                putchar('^');\n                        }\n                }\n\nin builtin-blame.c. Junio, you introduced this in e68989a739d - why\ndo you use a separate flag instead of OUTPUT_ANNOTATE_COMPAT? The fact\nthat git annotate == git blame -c does not hold true because of this\n(admittedly obscure case).\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe next generation of interesting software will be done\non the Macintosh, not the IBM PC.  -- Bill Gates\n"},{"id":"89761","messageId":"1220533421-26057-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"15358","inReplyTo":"20080904123046.GX10544@machine.or.cz","subject":"[PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-04T13:03:41Z","receivedAt":"2008-09-04T13:03:41Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git-annotate.txt         |    4 ++++\n command-list.txt                       |    2 +-\n contrib/completion/git-completion.bash |    1 +\n 3 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt\nindex 8b6b56a..76f2b8c 100644\n--- a/Documentation/git-annotate.txt\n+++ b/Documentation/git-annotate.txt\n@@ -14,6 +14,10 @@ DESCRIPTION\n Annotates each line in the given file with information from the commit\n which introduced the line. Optionally annotate from a given revision.\n \n+This command exists for backward compatibility, as an alias for 'git\n+blame -c'. For regular use, you should now use linkgit:git-blame[1]\n+instead.\n+\n OPTIONS\n -------\n include::blame-options.txt[]\ndiff --git a/command-list.txt b/command-list.txt\nindex 3583a33..03d1023 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -2,7 +2,7 @@\n # command name\t\t\t\tcategory [deprecated] [common]\n git-add                                 mainporcelain common\n git-am                                  mainporcelain\n-git-annotate                            ancillaryinterrogators\n+git-annotate                            ancillaryinterrogators deprecated\n git-apply                               plumbingmanipulators\n git-archimport                          foreignscminterface\n git-archive                             mainporcelain\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 4f64f8a..6630033 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -380,6 +380,7 @@ __git_porcelain_commands ()\n \tdo\n \t\tcase $i in\n \t\t*--*)             : helper pattern;;\n+\t\tannotate)         : deprecated;;\n \t\tapplymbox)        : ask gittus;;\n \t\tapplypatch)       : ask gittus;;\n \t\tarchimport)       : import;;\n-- \n1.6.0.7.g161c\n"},{"id":"89782","messageId":"7vd4jj3etz.fsf@gitster.siamese.dyndns.org","threadId":"15358","inReplyTo":"20080904123046.GX10544@machine.or.cz","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-04T19:12:40Z","receivedAt":"2008-09-04T19:12:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> I'm also curious about\n>\n>                 if (suspect->commit->object.flags & UNINTERESTING) {\n>                         if (blank_boundary)\n>                                 memset(hex, ' ', length);\n>                         else if (!cmd_is_annotate) {\n>                                 length--;\n>                                 putchar('^');\n>                         }\n>                 }\n>\n> in builtin-blame.c. Junio, you introduced this in e68989a739d - why\n> do you use a separate flag instead of OUTPUT_ANNOTATE_COMPAT? The fact\n> that git annotate == git blame -c does not hold true because of this\n> (admittedly obscure case).\n\nI do not recall the context of this change, but I do not think this is a\ndeliberate omission.  The breakage the quoted commit fixed was about\ncvsserver that does run \"git-annotate\" not \"git-blame -c\" and that must be\nthe reason this has been unnoticed for a long time.\n\nOh, by the way, somebody should update cvsserver to run \"git annotate\" and\nsend in a tested patch, please?\n"},{"id":"89783","messageId":"7v63pb3emm.fsf@gitster.siamese.dyndns.org","threadId":"15358","inReplyTo":"20080904123046.GX10544@machine.or.cz","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-04T19:17:05Z","receivedAt":"2008-09-04T19:17:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> Can you please also mark it deprecated in the bash completion and\n> command-list.txt?\n\nI am hesitant to use the word \"deprecated\" in git(7) manual page, as the\nword has much stronger connotation than merely \"because a more often used\nequivalent exists, there is no reason to encourage this for new people,\nbut on the other hand there is no reason to remove or phase it out to hurt\nexisting users\", which is what \"git annotate\" is.\n\n\"Deprecated\" is more like \"it is still supported but its use is actively\ndiscouraged\".  I do not think we actively discourage it, nor need to phase\nit out.\n\nPeople coming from different background may look for annotate and get\nfrustrated until they find out blame is the equivalent (or vice versa).\n\nWhile I do not mind marking annotate as \": infrequently used ;;\" in the\ncompletion script, I am skeptical about the value of such a change.\nDropping annotate from the completion is a _slight_ improvement in that\nwhen people type \"git a<TAB>\" they will see one less candidates, but it is\nnot a great deal of improvement: four down from five.\n\nMentioning that we support both names for findability in both annotate and\nblame manual pages (not just annotate page) might be a better thing to do.\n"},{"id":"89828","messageId":"vpqaben6r3n.fsf@bauges.imag.fr","threadId":"15358","inReplyTo":"7v63pb3emm.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-05T06:31:40Z","receivedAt":"2008-09-05T06:31:40Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Petr Baudis <pasky@suse.cz> writes:\n>\n>> Can you please also mark it deprecated in the bash completion and\n>> command-list.txt?\n\n[...]\n\n> While I do not mind marking annotate as \": infrequently used ;;\" in the\n> completion script, I am skeptical about the value of such a change.\n> Dropping annotate from the completion is a _slight_ improvement in that\n> when people type \"git a<TAB>\" they will see one less candidates, but it is\n> not a great deal of improvement: four down from five.\n\nHm, right. Someone used to \"$scm annotate\" will probably try\n\"git an<TAB>\" and not finding anything there would be misleading\n(probably why svn has \"annotate\" as an alias for \"blame\").\n\n> Mentioning that we support both names for findability in both annotate and\n> blame manual pages (not just annotate page) might be a better thing to do.\n\ngit-blame.txt already somehow has it in the documentation for \"-c\". I\ncan't think of a good wording to improve it.\n\n-- \nMatthieu\n"},{"id":"89831","messageId":"7v3akfxd74.fsf@gitster.siamese.dyndns.org","threadId":"15358","inReplyTo":"vpqaben6r3n.fsf@bauges.imag.fr","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-05T07:29:51Z","receivedAt":"2008-09-05T07:29:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> ...\n> Hm, right. Someone used to \"$scm annotate\" will probably try\n> \"git an<TAB>\" and not finding anything there would be misleading\n> (probably why svn has \"annotate\" as an alias for \"blame\").\n>\n>> Mentioning that we support both names for findability in both annotate and\n>> blame manual pages (not just annotate page) might be a better thing to do.\n>\n> git-blame.txt already somehow has it in the documentation for \"-c\". I\n> can't think of a good wording to improve it.\n\nWhen somebody is reading git-blame.txt (or git-annotate.txt) for the first\ntime, I think the message we would like to send is:\n\n (1) Here is why you would want to use this command, what it can do\n     (perhaps more than what you would have expected from \"$scm blame\"),\n     and how you tell it to do what it does.\n\n     This is obvious.\n\n (2) You might have heard of the command with the other name.  There is no\n     difference between the two, except they differ in their default\n     output formats.  For historical reasons, we will continue supporting\n     both.\n\n     This is essential to squelch noises about \"git has both?  how are\n     they different?\"\n\n (3) We tend to encourage blame over annotate for new scripts and new\n     people, but there is no reason to choose one over the other.\n\n     This is not as important as (2), but would be useful to squelch\n     noises about \"when will we start deprecating this?\"\n\nThe mention of \"annotate\" in the description of \"-c\" hints almost nothing\nin (2) except that the output format might be different (otherwise we\nwould not have \"-c\" command to begin with), but I guess that's Ok.  As\nlong as we describe (2) on git-annotate page clearly enough, people who\nare really curious could refer to git-annotate page.\n\nSo based on your wording, how about doing it like this?  I chose to only\nhint (3) subtly in this version instead of being overly explicit.\n\ndiff --git c/Documentation/git-annotate.txt w/Documentation/git-annotate.txt\nindex 8b6b56a..78dc5e2 100644\n--- c/Documentation/git-annotate.txt\n+++ w/Documentation/git-annotate.txt\n@@ -14,6 +14,11 @@ DESCRIPTION\n Annotates each line in the given file with information from the commit\n which introduced the line. Optionally annotate from a given revision.\n \n+The only difference from this command and linkgit:git-blame[1] is that\n+they use slightly different output formats, and this command exists only\n+for backward compatibility to support existing scripts, and provide more\n+familiar command name for people coming from other SCM systems.\n+\n OPTIONS\n -------\n include::blame-options.txt[]\n"},{"id":"293754","messageId":"7vod33vxeo.fsf@gitster.siamese.dyndns.org","threadId":"15358","inReplyTo":"20080904123046.GX10544@machine.or.cz","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-05T07:56:15Z","receivedAt":"2008-09-05T07:56:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> I'm also curious about\n> ...\n> in builtin-blame.c. Junio, you introduced this in e68989a739d - why\n> do you use a separate flag instead of OUTPUT_ANNOTATE_COMPAT?\n\nLet's do this.  Still passes t8001 and t9400.\n\n-- >8 --\n\"blame -c\" should be compatible with \"annotate\"\n\nThere is no reason to have a separate variable cmd_is_annotate;\nOUTPUT_ANNOTATE_COMPAT option is supposed to produce the compatibility\noutput, and we should produce the same output even when the command was\nnot invoked as \"annotate\" but as \"blame -c\".\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-blame.c                 |    9 +++++----\n t/t9400-git-cvsserver-server.sh |   13 +++++++++++++\n 2 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git i/builtin-blame.c w/builtin-blame.c\nindex d2fc68c..9bc901c 100644\n--- i/builtin-blame.c\n+++ w/builtin-blame.c\n@@ -38,7 +38,6 @@ static int show_root;\n static int reverse;\n static int blank_boundary;\n static int incremental;\n-static int cmd_is_annotate;\n static int xdl_opts = XDF_NEED_MINIMAL;\n static struct string_list mailmap;\n \n@@ -1686,7 +1685,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)\n \t\tif (suspect->commit->object.flags & UNINTERESTING) {\n \t\t\tif (blank_boundary)\n \t\t\t\tmemset(hex, ' ', length);\n-\t\t\telse if (!cmd_is_annotate) {\n+\t\t\telse if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {\n \t\t\t\tlength--;\n \t\t\t\tputchar('^');\n \t\t\t}\n@@ -2317,8 +2316,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t};\n \n \tstruct parse_opt_ctx_t ctx;\n-\n-\tcmd_is_annotate = !strcmp(argv[0], \"annotate\");\n+\tint cmd_is_annotate = !strcmp(argv[0], \"annotate\");\n \n \tgit_config(git_blame_config, NULL);\n \tinit_revisions(&revs, NULL);\n@@ -2346,6 +2344,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n parse_done:\n \targc = parse_options_end(&ctx);\n \n+\tif (cmd_is_annotate)\n+\t\toutput_option |= OUTPUT_ANNOTATE_COMPAT;\n+\n \tif (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))\n \t\topt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |\n \t\t\tPICKAXE_BLAME_COPY_HARDER);\ndiff --git i/t/t9400-git-cvsserver-server.sh w/t/t9400-git-cvsserver-server.sh\nindex 4b91f8d..c1850d2 100755\n--- i/t/t9400-git-cvsserver-server.sh\n+++ w/t/t9400-git-cvsserver-server.sh\n@@ -488,4 +488,17 @@ test_expect_success 'cvs co -c (shows module database)' '\n     ! grep -v \"^master[\t ]\\+master$\" < out\n '\n \n+#------------\n+# CVS ANNOTATE\n+#------------\n+\n+cd \"$WORKDIR\"\n+test_expect_success 'cvs annotate' '\n+    cd cvswork &&\n+    GIT_CONFIG=\"$git_config\" cvs annotate merge >../out &&\n+    sed -e \"s/ .*//\" ../out >../actual &&\n+    for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&\n+    test_cmp ../expect ../actual\n+'\n+\n"},{"id":"89832","messageId":"20080905080759.GN10360@machine.or.cz","threadId":"15358","inReplyTo":"7v3akfxd74.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-09-05T08:07:59Z","receivedAt":"2008-09-05T08:07:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Fri, Sep 05, 2008 at 12:29:51AM -0700, Junio C Hamano wrote:\n> diff --git c/Documentation/git-annotate.txt w/Documentation/git-annotate.txt\n> index 8b6b56a..78dc5e2 100644\n> --- c/Documentation/git-annotate.txt\n> +++ w/Documentation/git-annotate.txt\n> @@ -14,6 +14,11 @@ DESCRIPTION\n>  Annotates each line in the given file with information from the commit\n>  which introduced the line. Optionally annotate from a given revision.\n>  \n> +The only difference from this command and linkgit:git-blame[1] is that\n                       ^^^^ between?\n> +they use slightly different output formats, and this command exists only\n> +for backward compatibility to support existing scripts, and provide more\n> +familiar command name for people coming from other SCM systems.\n> +\n>  OPTIONS\n>  -------\n>  include::blame-options.txt[]\n\nI like this one. I'm still not too happy about leaving the command in\nthe command list and tab completion since I believe reducing the number\nof commands (which is still quite intimidating for the user), even just\nby a little, is more important than encouraging people to use\ncompatibility aliases. I don't feel very strongly about it, though.\n\nAcked-by: Petr Baudis <pasky@suse.cz>\n"},{"id":"89838","messageId":"vpqy7266bkw.fsf@bauges.imag.fr","threadId":"15358","inReplyTo":"20080905080759.GN10360@machine.or.cz","subject":"Re: [PATCH] Mention the fact that 'git annotate' is only for backward compatibility.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-05T12:06:55Z","receivedAt":"2008-09-05T12:06:55Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> On Fri, Sep 05, 2008 at 12:29:51AM -0700, Junio C Hamano wrote:\n>> diff --git c/Documentation/git-annotate.txt w/Documentation/git-annotate.txt\n>> index 8b6b56a..78dc5e2 100644\n>> --- c/Documentation/git-annotate.txt\n>> +++ w/Documentation/git-annotate.txt\n>> @@ -14,6 +14,11 @@ DESCRIPTION\n>>  Annotates each line in the given file with information from the commit\n>>  which introduced the line. Optionally annotate from a given revision.\n>>  \n>> +The only difference from this command and linkgit:git-blame[1] is that\n>                        ^^^^ between?\n>> +they use slightly different output formats, and this command exists only\n\nI'm not sure it's clear enough that \"this command\" is \"annotate\" since\nyou talked about git blame right before, but I'm being picky.\n\n>> +for backward compatibility to support existing scripts, and provide more\n>> +familiar command name for people coming from other SCM systems.\n>> +\n>>  OPTIONS\n>>  -------\n>>  include::blame-options.txt[]\n>\n> I like this one.\n\nMeetoo.\n\n-- \nMatthieu\n"}]}