{"thread":{"id":"34635","subject":"Remove old forgotten command: whatchanged","startedAt":"2013-08-07T16:00:35Z","lastAt":"2013-08-13T16:00:04Z","messageCount":31,"participants":["Ramkumar Ramachandra","Stefan Beller","Junio C Hamano","Kyle J. McKay","John Keeping","Matthieu Moy","Damien Robert"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"224759","messageId":"CALkWK0=zZKTwn7cdrJXsVXH-rF=xWMeD_z2XAOCnuaf2bK_h8Q@mail.gmail.com","threadId":"34635","inReplyTo":null,"subject":"Remove old forgotten command: whatchanged","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-08-07T16:00:35Z","receivedAt":"2013-08-07T16:00:35Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nThis is the difference between whatchanged and log:\n\ndiff --git a/whatchanged b/log\nindex fa1b223..004d9aa 100644\n--- a/tmp/whatchanged\n+++ b/tmp/log\n@@ -1,4 +1,4 @@\n-int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n+int cmd_log(int argc, const char **argv, const char *prefix)\n {\n        struct rev_info rev;\n        struct setup_revision_opt opt;\n@@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,\nconst char *prefix)\n        git_config(git_log_config, NULL);\n\n        init_revisions(&rev, prefix);\n-       rev.diff = 1;\n-       rev.simplify_history = 0;\n+       rev.always_show_header = 1;\n        memset(&opt, 0, sizeof(opt));\n        opt.def = \"HEAD\";\n        opt.revarg_opt = REVARG_COMMITTISH;\n        cmd_log_init(argc, argv, prefix, &rev, &opt);\n-       if (!rev.diffopt.output_format)\n-               rev.diffopt.output_format = DIFF_FORMAT_RAW;\n        return cmd_log_walk(&rev);\n }\n\nShould we remove it?\n\nRam\n"},{"id":"224762","messageId":"52027B17.7040602@googlemail.com","threadId":"34635","inReplyTo":"CALkWK0=zZKTwn7cdrJXsVXH-rF=xWMeD_z2XAOCnuaf2bK_h8Q@mail.gmail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-08-07T16:51:35Z","receivedAt":"2013-08-07T16:51:35Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 08/07/2013 06:00 PM, Ramkumar Ramachandra wrote:\n> Hi,\n> \n> This is the difference between whatchanged and log:\n> \n> diff --git a/whatchanged b/log\n> index fa1b223..004d9aa 100644\n> --- a/tmp/whatchanged\n> +++ b/tmp/log\n> @@ -1,4 +1,4 @@\n> -int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n> +int cmd_log(int argc, const char **argv, const char *prefix)\n>  {\n>         struct rev_info rev;\n>         struct setup_revision_opt opt;\n> @@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,\n> const char *prefix)\n>         git_config(git_log_config, NULL);\n> \n>         init_revisions(&rev, prefix);\n> -       rev.diff = 1;\n> -       rev.simplify_history = 0;\n> +       rev.always_show_header = 1;\n>         memset(&opt, 0, sizeof(opt));\n>         opt.def = \"HEAD\";\n>         opt.revarg_opt = REVARG_COMMITTISH;\n>         cmd_log_init(argc, argv, prefix, &rev, &opt);\n> -       if (!rev.diffopt.output_format)\n> -               rev.diffopt.output_format = DIFF_FORMAT_RAW;\n>         return cmd_log_walk(&rev);\n>  }\n> \n> Should we remove it?\n\nI'd deprecate it first for a year or such and remove it then.\nIn the meantime we could implement already remove the code\nand change it to:\n\n+ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n+ {\n+ \treturn cmd_log(argc, argv, prefix)\n+ }\n\nAlso we should make sure everything git whatchanged can do,\ncan easily be done with git log <options>.\n\nStefan\n\n"},{"id":"224764","messageId":"7vtxj1crv6.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"52027B17.7040602@googlemail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-07T17:50:37Z","receivedAt":"2013-08-07T17:50:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <stefanbeller@googlemail.com> writes:\n\n> I'd deprecate it first for a year or such and remove it then.\n> In the meantime we could implement already remove the code\n> and change it to:\n>\n> + int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n> + {\n> + \treturn cmd_log(argc, argv, prefix)\n> + }\n>\n> Also we should make sure everything git whatchanged can do,\n> can easily be done with git log <options>.\n\nThat's even worse than \"deprecating\".\n\nYour first step already changes the behaviour for people who really\nuse the command, without telling them _why_ the behaviour has\nsuddenly changed at all, while not helping *ANYBODY*.\n\nThe only thing it does is to scratch an irrelevant itch by people\nwho peek the codebase and find an old command whose existence does\nnot even hurt them.  They may have too much time on their hand, but\nthat is not an excuse to waste other people's time by adding extra\nmakework on our plate, or changing the behaviour for people who use\nthe command without explanation.\n\nFeeling irritated somewhat...\n"},{"id":"224765","messageId":"4EE8B37B-F6A1-4BC4-9151-8546868E60A5@gmail.com","threadId":"34635","inReplyTo":"CALkWK0=zZKTwn7cdrJXsVXH-rF=xWMeD_z2XAOCnuaf2bK_h8Q@mail.gmail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Kyle J. McKay","fromEmail":"mackyle@gmail.com","sentAt":"2013-08-07T18:01:57Z","receivedAt":"2013-08-07T18:01:57Z","isPatch":false,"sender":{"key":"mackyle@gmail.com","avatar":"https://avatars.githubusercontent.com/u/813346?v=4"},"body":"On Aug 7, 2013, at 09:00, Ramkumar Ramachandra wrote:\n> Hi,\n>\n> This is the difference between whatchanged and log:\n>\n> diff --git a/whatchanged b/log\n> index fa1b223..004d9aa 100644\n> --- a/tmp/whatchanged\n> +++ b/tmp/log\n> @@ -1,4 +1,4 @@\n> -int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n> +int cmd_log(int argc, const char **argv, const char *prefix)\n> {\n>        struct rev_info rev;\n>        struct setup_revision_opt opt;\n> @@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,\n> const char *prefix)\n>        git_config(git_log_config, NULL);\n>\n>        init_revisions(&rev, prefix);\n> -       rev.diff = 1;\n> -       rev.simplify_history = 0;\n> +       rev.always_show_header = 1;\n>        memset(&opt, 0, sizeof(opt));\n>        opt.def = \"HEAD\";\n>        opt.revarg_opt = REVARG_COMMITTISH;\n>        cmd_log_init(argc, argv, prefix, &rev, &opt);\n> -       if (!rev.diffopt.output_format)\n> -               rev.diffopt.output_format = DIFF_FORMAT_RAW;\n>        return cmd_log_walk(&rev);\n> }\n>\n> Should we remove it?\n\nI use it all the time.  Is there some log option to get exactly the  \nsame output?  It doesn't appear that there is.  The closest looks like  \n\"log --name-status\" but it omits the modes and hash values.\n"},{"id":"224767","messageId":"20130807183117.GC2337@serenity.lan","threadId":"34635","inReplyTo":"4EE8B37B-F6A1-4BC4-9151-8546868E60A5@gmail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-08-07T18:31:17Z","receivedAt":"2013-08-07T18:31:17Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Aug 07, 2013 at 11:01:57AM -0700, Kyle J. McKay wrote:\n> On Aug 7, 2013, at 09:00, Ramkumar Ramachandra wrote:\n> > Hi,\n> >\n> > This is the difference between whatchanged and log:\n> >\n> > diff --git a/whatchanged b/log\n> > index fa1b223..004d9aa 100644\n> > --- a/tmp/whatchanged\n> > +++ b/tmp/log\n> > @@ -1,4 +1,4 @@\n> > -int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n> > +int cmd_log(int argc, const char **argv, const char *prefix)\n> > {\n> >        struct rev_info rev;\n> >        struct setup_revision_opt opt;\n> > @@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,\n> > const char *prefix)\n> >        git_config(git_log_config, NULL);\n> >\n> >        init_revisions(&rev, prefix);\n> > -       rev.diff = 1;\n> > -       rev.simplify_history = 0;\n> > +       rev.always_show_header = 1;\n> >        memset(&opt, 0, sizeof(opt));\n> >        opt.def = \"HEAD\";\n> >        opt.revarg_opt = REVARG_COMMITTISH;\n> >        cmd_log_init(argc, argv, prefix, &rev, &opt);\n> > -       if (!rev.diffopt.output_format)\n> > -               rev.diffopt.output_format = DIFF_FORMAT_RAW;\n> >        return cmd_log_walk(&rev);\n> > }\n> >\n> > Should we remove it?\n> \n> I use it all the time.  Is there some log option to get exactly the  \n> same output?  It doesn't appear that there is.  The closest looks like  \n> \"log --name-status\" but it omits the modes and hash values.\n\nIs it not identical to \"log --raw --no-merges\"?\n\nA quick test says \"mostly\", but whatchanged doesn't show empty commits\nwhereas log does seem to; e.g. in git.git:\n\n    diff -u <(git whatchanged) <(git log --raw --no-merges)\n"},{"id":"224768","messageId":"4E3DEEB7-2664-40CC-84C2-9B0A64534AEA@gmail.com","threadId":"34635","inReplyTo":"20130807183117.GC2337@serenity.lan","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Kyle J. McKay","fromEmail":"mackyle@gmail.com","sentAt":"2013-08-07T18:48:13Z","receivedAt":"2013-08-07T18:48:13Z","isPatch":false,"sender":{"key":"mackyle@gmail.com","avatar":"https://avatars.githubusercontent.com/u/813346?v=4"},"body":"On Aug 7, 2013, at 11:31, John Keeping wrote:\n> On Wed, Aug 07, 2013 at 11:01:57AM -0700, Kyle J. McKay wrote:\n>> On Aug 7, 2013, at 09:00, Ramkumar Ramachandra wrote:\n>>> Hi,\n>>>\n>>> This is the difference between whatchanged and log:\n>>>\n>>> diff --git a/whatchanged b/log\n>>> index fa1b223..004d9aa 100644\n>>> --- a/tmp/whatchanged\n>>> +++ b/tmp/log\n>>> @@ -1,4 +1,4 @@\n>>> -int cmd_whatchanged(int argc, const char **argv, const char  \n>>> *prefix)\n>>> +int cmd_log(int argc, const char **argv, const char *prefix)\n>>> {\n>>>       struct rev_info rev;\n>>>       struct setup_revision_opt opt;\n>>> @@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,\n>>> const char *prefix)\n>>>       git_config(git_log_config, NULL);\n>>>\n>>>       init_revisions(&rev, prefix);\n>>> -       rev.diff = 1;\n>>> -       rev.simplify_history = 0;\n>>> +       rev.always_show_header = 1;\n>>>       memset(&opt, 0, sizeof(opt));\n>>>       opt.def = \"HEAD\";\n>>>       opt.revarg_opt = REVARG_COMMITTISH;\n>>>       cmd_log_init(argc, argv, prefix, &rev, &opt);\n>>> -       if (!rev.diffopt.output_format)\n>>> -               rev.diffopt.output_format = DIFF_FORMAT_RAW;\n>>>       return cmd_log_walk(&rev);\n>>> }\n>>>\n>>> Should we remove it?\n>>\n>> I use it all the time.  Is there some log option to get exactly the\n>> same output?  It doesn't appear that there is.  The closest looks  \n>> like\n>> \"log --name-status\" but it omits the modes and hash values.\n>\n> Is it not identical to \"log --raw --no-merges\"?\n>\n> A quick test says \"mostly\", but whatchanged doesn't show empty commits\n> whereas log does seem to; e.g. in git.git:\n>\n>    diff -u <(git whatchanged) <(git log --raw --no-merges)\n\nThat's probably close enough, but if that's all \"whatchanged\" does is  \nbasically be an alias for \"log --raw --no-merges\" that skips commits  \nwith no changes then the help for whatchanged ought to mention that.\n\nI still think \"git whatchanged\" is a lot clearer than \"git log --raw -- \nno-merges\" though.\n"},{"id":"224770","messageId":"5202C109.6040209@googlemail.com","threadId":"34635","inReplyTo":"7vtxj1crv6.fsf@alter.siamese.dyndns.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-08-07T21:50:01Z","receivedAt":"2013-08-07T21:50:01Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 08/07/2013 07:50 PM, Junio C Hamano wrote:\n> Stefan Beller <stefanbeller@googlemail.com> writes:\n> \n>> I'd deprecate it first for a year or such and remove it then.\n>> In the meantime we could implement already remove the code\n>> and change it to:\n>>\n>> + int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n>> + {\n>> + \treturn cmd_log(argc, argv, prefix)\n>> + }\n>>\n>> Also we should make sure everything git whatchanged can do,\n>> can easily be done with git log <options>.\n> \n> That's even worse than \"deprecating\".\n> \n> Your first step already changes the behaviour for people who really\n> use the command, without telling them _why_ the behaviour has\n> suddenly changed at all, while not helping *ANYBODY*.\n> \n> The only thing it does is to scratch an irrelevant itch by people\n> who peek the codebase and find an old command whose existence does\n> not even hurt them.  They may have too much time on their hand, but\n> that is not an excuse to waste other people's time by adding extra\n> makework on our plate, or changing the behaviour for people who use\n> the command without explanation.\n> \n> Feeling irritated somewhat...\n> \n\nWell if we make sure the whatchanged command can easily be reproduced\nwith the log command, we could add the missing parameters to it, hence\nno change for the user. (git whatchanged == git log --raw --no-merges or\ngit log --wc [to be done yet]).\n\nSo I did not mean to introduce a change for users!\n\nBut in general I like the idea to *remove* lines of code.\n\nStefan\n\n\n\n"},{"id":"224785","messageId":"CALkWK0kTfQYZG8R1EMuV37pdJ-aj9btXmfJ1Fb4QoMeZ1QucAw@mail.gmail.com","threadId":"34635","inReplyTo":"7vtxj1crv6.fsf@alter.siamese.dyndns.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-08-08T04:30:30Z","receivedAt":"2013-08-08T04:30:30Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> The only thing it does is to scratch an irrelevant itch by people\n> who peek the codebase and find an old command whose existence does\n> not even hurt them.  They may have too much time on their hand, but\n> that is not an excuse to waste other people's time by adding extra\n> makework on our plate, or changing the behaviour for people who use\n> the command without explanation.\n\nIt's a maintenance burden that confuses users. I'd encourage you to\nread git-whatchanged(1), and tell me why nobody has updated it.\n\nWe're not maintaining a museum.\n"},{"id":"224788","messageId":"7vpptobsa2.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"5202C109.6040209@googlemail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-08T06:39:17Z","receivedAt":"2013-08-08T06:39:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <stefanbeller@googlemail.com> writes:\n\n> Well if we make sure the whatchanged command can easily be reproduced\n> with the log command, we could add the missing parameters to it, hence\n> no change for the user. (git whatchanged == git log --raw --no-merges or\n> git log --wc [to be done yet]).\n>\n> So I did not mean to introduce a change for users!\n\nI certainly did *not* read that from between the lines of what you\nwrote:\n\n+ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n+ {\n+ \treturn cmd_log(argc, argv, prefix)\n+ }\n\nIn principle, I agree that it is a good idea to try to share enough\ncode, while keeping the flexiblity and clarity of the code for\nmaintainability.\n\nIn the extreme, you could rewrite these two functions like so:\n\n\tstatic int cmd_lw_helper(\n\t\tint argc, const char **argv,\n        \tconst char *prefix,\n                int whoami)\t\n        {\n\t\tstruct rev_info rev;\n\t\tstruct setup_revision_opt opt;\n        \n\t\tinit_grep_defaults();\n                git_config(git_log_config, NULL);\n                init_revisions(&rev, prefix);\n\t\tif (whoami == 'l') { /* log */\n\t                rev.always_show_header = always_show_header;\n\t\t} else { /* whatchanged */\n\t                rev.diff = diff;\n\t                rev.simplify_history = simplify_history;\n\t\t}\n                memset(opt, 0, sizeof(opt));\n                opt.def = \"HEAD\";\n                opt.revarg_opt = REVARG_COMMITTISH;\n                cmd_log_init(argc, argv, prefix, &rev, &opt);\n\t\tif (whoami == 'w') {\n\t\t\tif (!rev.diffopt.output_format)\n\t\t\t\trev.diffopt.output_format = DIFF_FORMAT_RAW;\n\t\t}\n                return cmd_log_walk(&rev);\n\t}\n\n        int cmd_log(int argc, const char **argv, const char *prefix)\n\t{\n        \treturn cmd_lw_helper(argc, argv, prefix, 'l');\n\t}\n\n        int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n\t{\n        \treturn cmd_lw_helper(argc, argv, prefix, 'w');\n\t}\n\nbut at that point, the cost you have to pay when you need to update\none of them but not the other becomes higher.\n\nAs whatchanged is kept primarily for people who learned Git by word\nof mouth reading the kernel mailing list and are used to that\ncommand.  Its external interface and what it does is not likely to\ndrastically change.  On the other hand, \"log\" is a primary Porcelain\nand we would expect constant improvements.\n\nBetween the \"share more code for reuse\" and \"keep the flexibility\nand clarity for maintainability\", it is a subtle balancing act.\nPersonally I think the current code strikes a good balance by not\ngoing to the extreme, given that \"change one (i.e. log) but not the\nother\" is a very likely pattern for the evolution of these two\ncommands.\n"},{"id":"224817","messageId":"vpqfvukdy39.fsf@anie.imag.fr","threadId":"34635","inReplyTo":"CALkWK0kTfQYZG8R1EMuV37pdJ-aj9btXmfJ1Fb4QoMeZ1QucAw@mail.gmail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-08T15:03:06Z","receivedAt":"2013-08-08T15:03:06Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> The only thing it does is to scratch an irrelevant itch by people\n>> who peek the codebase and find an old command whose existence does\n>> not even hurt them.  They may have too much time on their hand, but\n>> that is not an excuse to waste other people's time by adding extra\n>> makework on our plate, or changing the behaviour for people who use\n>> the command without explanation.\n>\n> It's a maintenance burden \n\nI'm not really worried about the maintainance of a 20-lines long\nfunction ...\n\n> that confuses users.\n\n... but I do agree that the doc is really confusing. It would be much\nbetter if the doc could be reduced to:\n\n\"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\nPlease refer to the documentation of that command.\"\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"224819","messageId":"CALkWK0kD=adWKVf+zb+Pnjz-HBkhks8ZvmQ3eYSpdXvahr=e4g@mail.gmail.com","threadId":"34635","inReplyTo":"vpqfvukdy39.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-08-08T15:13:53Z","receivedAt":"2013-08-08T15:13:53Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Matthieu Moy wrote:\n> ... but I do agree that the doc is really confusing. It would be much\n> better if the doc could be reduced to:\n>\n> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n> Please refer to the documentation of that command.\"\n\nI don't think there's an exact correspondence with any combination of\ncommand-line options. Perhaps we can describe it in words, and ask\npeople to use log instead?\n"},{"id":"224821","messageId":"vpqvc3gcijh.fsf@anie.imag.fr","threadId":"34635","inReplyTo":"CALkWK0kD=adWKVf+zb+Pnjz-HBkhks8ZvmQ3eYSpdXvahr=e4g@mail.gmail.com","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-08T15:24:18Z","receivedAt":"2013-08-08T15:24:18Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Matthieu Moy wrote:\n>> ... but I do agree that the doc is really confusing. It would be much\n>> better if the doc could be reduced to:\n>>\n>> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n>> Please refer to the documentation of that command.\"\n>\n> I don't think there's an exact correspondence with any combination of\n> command-line options. Perhaps we can describe it in words, and ask\n> people to use log instead?\n\nI'd say either this, or add the missing features to \"git log\" to make my\nsuggestion possible (after all, if some people like \"git whatchanged\",\nthen maybe the feature would be of interest to \"git log\" users ?).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"224829","messageId":"7vwqnw9jv6.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"vpqvc3gcijh.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-08T17:23:57Z","receivedAt":"2013-08-08T17:23:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> I'd say either this, or add the missing features to \"git log\" to make my\n> suggestion possible (after all, if some people like \"git whatchanged\",\n> then maybe the feature would be of interest to \"git log\" users ?).\n\nThere is no _missing feature_ per se.  whatchanged by default (1) gives\ndiffs, (2) does not show empty commits, and (3) uses raw format for\nits diff output.\n\nI am fuzzy about where the name of the command and its default\nbehaviour came from (I suspect it may have been modelled after\nanother SCM kernel folks were familiar with), but I do not mind if\nsomebody does an archaeology (read: ask Linus) and reduce the\ndocument to something like this:\n\ngit-whatchanged(1)\n==================\n\nNAME\n----\ngit-whatchanged - Show logs with difference each commit introduces\n\n\nSYNOPSIS\n--------\n[verse]\n'git whatchanged' <option>...\n\nDESCRIPTION\n-----------\n\nShows commit logs and diff output each commit introduces.  This is\nessentially the same as linkgit:git-log[1] run with different\ndefaults.\n\nThe command name and behaviour were originally borrowed from XXXX\nand the command is kept primarily for historical reasons (fingers of\nmany people who learned Git by reading Linux kernel mailing list are\ntrained to type it before `git log` was invented).\n\nNew users are encouraged to use linkgit:git-log[1] instead.\n\n\nExamples\n--------\n`git whatchanged -p v2.6.12.. include/scsi drivers/scsi`::\n\n\tShow as patches the commits since version 'v2.6.12' that changed\n\tany file in the include/scsi or drivers/scsi subdirectories\n\n`git whatchanged --since=\"2 weeks ago\" -- gitk`::\n\n\tShow the changes during the last two weeks to the file 'gitk'.\n\tThe \"--\" is necessary to avoid confusion with the *branch* named\n\t'gitk'\n\nGIT\n---\nPart of the linkgit:git[1] suite\n"},{"id":"224835","messageId":"ku0lqj$qvs$1@ger.gmane.org","threadId":"34635","inReplyTo":"vpqfvukdy39.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Damien Robert","fromEmail":"damien.olivier.robert+gmane@gmail.com","sentAt":"2013-08-08T17:51:15Z","receivedAt":"2013-08-08T17:51:15Z","isPatch":false,"sender":{"key":"damien.olivier.robert+gmane@gmail.com","avatar":null},"body":"Matthieu Moy  wrote in message <vpqfvukdy39.fsf@anie.imag.fr>:\n>> that confuses users.\n> \n> ... but I do agree that the doc is really confusing. It would be much\n> better if the doc could be reduced to:\n> \n> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n> Please refer to the documentation of that command.\"\n\nIf I may chime in as a user: what really confused me about git whatchanged\nis this part of man gitcore-tutorial:\n\n       To see the whole history of our pitiful little git-tutorial project,\n       you can do\n\n           $ git log\n\n\n       which shows just the log messages, or if we want to see the log\n       together with the associated patches use the more complex (and much\n       more powerful)\n\n           $ git whatchanged -p\n\n\n       and you will see exactly what has changed in the repository over its\n       short history.\n\nI had to go look at the source code to realize that nowadays git log and\ngit whatchanged are basically the same functions with different defaults. A\npointer to that in the man page of git whatchanged would definitively be\nhelpful.\n"},{"id":"224837","messageId":"CALkWK0=qfDo4gYp5b+ENWnxJKZO-9hiuN6xAF-O3odu6Y8uAGQ@mail.gmail.com","threadId":"34635","inReplyTo":"ku0lqj$qvs$1@ger.gmane.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-08-08T18:05:08Z","receivedAt":"2013-08-08T18:05:08Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Damien Robert wrote:\n> If I may chime in as a user\n\nBy all means. Do not feel inhibited to state your problems because you\nare a \"user\": we are all users; we eventually became contributors\nbecause we found certain things that needed fixing, and fixed them\nlittle by little.\n"},{"id":"224838","messageId":"vpqk3jwcb1q.fsf@anie.imag.fr","threadId":"34635","inReplyTo":"ku0lqj$qvs$1@ger.gmane.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-08T18:06:09Z","receivedAt":"2013-08-08T18:06:09Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Damien Robert <damien.olivier.robert+gmane@gmail.com> writes:\n\n> Matthieu Moy  wrote in message <vpqfvukdy39.fsf@anie.imag.fr>:\n>>> that confuses users.\n>> \n>> ... but I do agree that the doc is really confusing. It would be much\n>> better if the doc could be reduced to:\n>> \n>> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n>> Please refer to the documentation of that command.\"\n>\n> If I may chime in as a user: what really confused me about git whatchanged\n> is this part of man gitcore-tutorial:\n\nIndeed.\n\nHow about applying this, to reduce the number of references to\nwhatchanged in the docs?\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3bdd56e..486a58b 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -818,7 +818,7 @@ for further details.\n 'GIT_FLUSH'::\n        If this environment variable is set to \"1\", then commands such\n        as 'git blame' (in incremental mode), 'git rev-list', 'git log',\n-       'git check-attr', 'git check-ignore', and 'git whatchanged' will\n+       'git check-attr', and 'git check-ignore' will\n        force a flush of the output stream after each record have been\n        flushed. If this\n        variable is set to \"0\", the output of these commands will be done\ndiff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\nindex f538a87..c6a1677 100644\n--- a/Documentation/gitcore-tutorial.txt\n+++ b/Documentation/gitcore-tutorial.txt\n@@ -532,12 +532,7 @@ commit, and you can tell it to show a whole series of diffs.\n Alternatively, you can tell it to be \"silent\", and not show the diffs at\n all, but just show the actual commit message.\n \n-In fact, together with the 'git rev-list' program (which generates a\n-list of revisions), 'git diff-tree' ends up being a veritable fount of\n-changes. A trivial (but very useful) script called 'git whatchanged' is\n-included with Git which does exactly this, and shows a log of recent\n-activities.\n-\n+'git log' can also be used to display changes introduced by some commits.\n To see the whole history of our pitiful little git-tutorial project, you\n can do\n \n@@ -550,7 +545,7 @@ with the associated patches use the more complex (and much more\n powerful)\n \n ----------------\n-$ git whatchanged -p\n+$ git log --raw -p\n ----------------\n \n and you will see exactly what has changed in the repository over its\n\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"224846","messageId":"20130808190908.GF2337@serenity.lan","threadId":"34635","inReplyTo":"vpqk3jwcb1q.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-08-08T19:09:08Z","receivedAt":"2013-08-08T19:09:08Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Aug 08, 2013 at 08:06:09PM +0200, Matthieu Moy wrote:\n> --- a/Documentation/gitcore-tutorial.txt\n> +++ b/Documentation/gitcore-tutorial.txt\n> @@ -532,12 +532,7 @@ commit, and you can tell it to show a whole series of diffs.\n>  Alternatively, you can tell it to be \"silent\", and not show the diffs at\n>  all, but just show the actual commit message.\n>  \n> -In fact, together with the 'git rev-list' program (which generates a\n> -list of revisions), 'git diff-tree' ends up being a veritable fount of\n> -changes. A trivial (but very useful) script called 'git whatchanged' is\n> -included with Git which does exactly this, and shows a log of recent\n> -activities.\n> -\n> +'git log' can also be used to display changes introduced by some commits.\n>  To see the whole history of our pitiful little git-tutorial project, you\n>  can do\n>  \n> @@ -550,7 +545,7 @@ with the associated patches use the more complex (and much more\n>  powerful)\n\nIsn't this paragraph slightly misleading now?  We're not using a\ndifferent command any more so this could say:\n\n    which shows just the log messages, or if we want to see the log together\n    with the associated patches use the `--patch` option\n\n\n>  ----------------\n> -$ git whatchanged -p\n> +$ git log --raw -p\n>  ----------------\n\nThen this can be \"git log --patch\", since it seems that the surrounding\ntext doesn't actually care that whatchanged prints the raw diffstat.\n"},{"id":"224848","messageId":"7v61vg9eht.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"ku0lqj$qvs$1@ger.gmane.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-08T19:19:58Z","receivedAt":"2013-08-08T19:19:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Damien Robert <damien.olivier.robert+gmane@gmail.com> writes:\n\n> Matthieu Moy  wrote in message <vpqfvukdy39.fsf@anie.imag.fr>:\n>>> that confuses users.\n>> \n>> ... but I do agree that the doc is really confusing. It would be much\n>> better if the doc could be reduced to:\n>> \n>> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n>> Please refer to the documentation of that command.\"\n>\n> If I may chime in as a user: what really confused me about git whatchanged\n> is this part of man gitcore-tutorial:\n>\n>        To see the whole history of our pitiful little git-tutorial project,\n>        you can do\n>\n>            $ git log\n>\n>\n>        which shows just the log messages, or if we want to see the log\n>        together with the associated patches use the more complex (and much\n>        more powerful)\n>\n>            $ git whatchanged -p\n>\n>\n>        and you will see exactly what has changed in the repository over its\n>        short history.\n>\n> I had to go look at the source code to realize that nowadays git log and\n> git whatchanged are basically the same functions with different defaults. A\n> pointer to that in the man page of git whatchanged would definitively be\n> helpful.\n\nThe \"tutorial\" was written in fairly early days of Git's history, in\norder to primarily help those who want to use the plumbing command\nto script their own Porcelain commands.  As it says at the very\nbeginning, the end-user tutorial to use Git's Porcelain is\ngittutorial.txt and the user manual, not this document.\n\nThe above section primarily explains the use of diff-tree and it was\nappropriate back when git-whatchanged was a script.  The intent of\nthe whole document, not just this section, was to tickle the\ncuriousity of the users and encourage them to see how the above\n\"much more powerful\" whatchanged was implemented by going to the\nsource.\n\nWhich no longer is easy to do, as we have many Porcelains\nreimplemented in C.\n\nI think a good way forward is to rewrite the above to:\n\n        To see the whole history of our pitiful little git-tutorial\n        project, you can do\n\n            $ git log\n\n        which shows just the log messages, or if we want to see the\n        log together with the associated patches, use\n\n            $ git log -p\n\n        and you will see exactly what has changed in the repository\n        over its short history.\n\nand show a skeleton scripted implementation of \"git log\" using the\nplumbing commands which would be essentially \"git rev-list\" piped to\n\"git diff-tree --stdin\".  Either have it as an example under\ncontrib/examples, or as part of the text in this section of this\ndocument.\n"},{"id":"224849","messageId":"7v1u649e5m.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"vpqk3jwcb1q.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-08T19:27:17Z","receivedAt":"2013-08-08T19:27:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Damien Robert <damien.olivier.robert+gmane@gmail.com> writes:\n>\n>> Matthieu Moy  wrote in message <vpqfvukdy39.fsf@anie.imag.fr>:\n>>>> that confuses users.\n>>> \n>>> ... but I do agree that the doc is really confusing. It would be much\n>>> better if the doc could be reduced to:\n>>> \n>>> \"This is a synonym for linkgit:git-log[1] --raw --some --other ---options.\n>>> Please refer to the documentation of that command.\"\n>>\n>> If I may chime in as a user: what really confused me about git whatchanged\n>> is this part of man gitcore-tutorial:\n>\n> Indeed.\n>\n> How about applying this, to reduce the number of references to\n> whatchanged in the docs?\n\nI fully agree with the change to git.txt\n\nI am slightly negative about the rest.\n\ngitcore-tutorial is about teaching people who want to script around\nplumbing to do their own Porcelain.  It is *not* about teaching them\n\"if you want to see the history, use 'git log'\".\n\nIt is meant to teach them \"if you want to do your own 'git log', you\ncan do so with 'rev-list' piped to 'diff-tree --stdin'\".  Changing\n'whatchanged' to 'log' in the latter statement is an improvement,\nbut dropping 'can be done by combining rev-list and diff-tree' goes\nagainst the objective of the whole document.\n\nIf we were to be spending more braincycles to update the latter, I\nthink we should enrich it by finding ways to resurrect good examples\nthat were lost over time due to \"rewrite in C and make them builtin\"\nprocess.\n\n> diff --git a/Documentation/git.txt b/Documentation/git.txt\n> index 3bdd56e..486a58b 100644\n> --- a/Documentation/git.txt\n> +++ b/Documentation/git.txt\n> @@ -818,7 +818,7 @@ for further details.\n>  'GIT_FLUSH'::\n>         If this environment variable is set to \"1\", then commands such\n>         as 'git blame' (in incremental mode), 'git rev-list', 'git log',\n> -       'git check-attr', 'git check-ignore', and 'git whatchanged' will\n> +       'git check-attr', and 'git check-ignore' will\n>         force a flush of the output stream after each record have been\n>         flushed. If this\n>         variable is set to \"0\", the output of these commands will be done\n> diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\n> index f538a87..c6a1677 100644\n> --- a/Documentation/gitcore-tutorial.txt\n> +++ b/Documentation/gitcore-tutorial.txt\n> @@ -532,12 +532,7 @@ commit, and you can tell it to show a whole series of diffs.\n>  Alternatively, you can tell it to be \"silent\", and not show the diffs at\n>  all, but just show the actual commit message.\n>  \n> -In fact, together with the 'git rev-list' program (which generates a\n> -list of revisions), 'git diff-tree' ends up being a veritable fount of\n> -changes. A trivial (but very useful) script called 'git whatchanged' is\n> -included with Git which does exactly this, and shows a log of recent\n> -activities.\n> -\n> +'git log' can also be used to display changes introduced by some commits.\n>  To see the whole history of our pitiful little git-tutorial project, you\n>  can do\n>  \n> @@ -550,7 +545,7 @@ with the associated patches use the more complex (and much more\n>  powerful)\n>  \n>  ----------------\n> -$ git whatchanged -p\n> +$ git log --raw -p\n>  ----------------\n>  \n>  and you will see exactly what has changed in the repository over its\n"},{"id":"224876","messageId":"ku1blo$5so$1@ger.gmane.org","threadId":"34635","inReplyTo":"7v61vg9eht.fsf@alter.siamese.dyndns.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Damien Robert","fromEmail":"damien.olivier.robert+gmane@gmail.com","sentAt":"2013-08-09T00:04:09Z","receivedAt":"2013-08-09T00:04:09Z","isPatch":false,"sender":{"key":"damien.olivier.robert+gmane@gmail.com","avatar":null},"body":"Junio C Hamano  wrote in message\n<7v61vg9eht.fsf@alter.siamese.dyndns.org>:\n> The \"tutorial\" was written in fairly early days of Git's history, in\n> order to primarily help those who want to use the plumbing command\n> to script their own Porcelain commands.  As it says at the very\n> beginning, the end-user tutorial to use Git's Porcelain is\n> gittutorial.txt and the user manual, not this document.\n\nYes, and even if it's old, it is a really well done tutorial to understand the\ninternals of git. I read it after gittutorial and gittutorial-2. It's just\nthat I was surprised to learn about this command, \"much more powerful\" than\ngit-log. To me it looked a lot like git log --raw, and I found git log -p\nmore useful, so I was wondering what I was missing until I read the source\nto see that nowadays the two commands were mostly the same.\n\n> The above section primarily explains the use of diff-tree and it was\n> appropriate back when git-whatchanged was a script.  The intent of\n> the whole document, not just this section, was to tickle the\n> curiousity of the users and encourage them to see how the above\n> \"much more powerful\" whatchanged was implemented by going to the\n> source.\n\nWell in this case you can say that the intent was successful since it made\nme read the source code ;)\n"},{"id":"224877","messageId":"CAPc5daXLzM1zG-6-mfddrSywzA=P3NB5Q9kJ6uEwAy-UWmqucg@mail.gmail.com","threadId":"34635","inReplyTo":"ku1blo$5so$1@ger.gmane.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-09T00:11:10Z","receivedAt":"2013-08-09T00:11:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">> The above section primarily explains the use of diff-tree and it was\n>> appropriate back when git-whatchanged was a script.  The intent of\n>> the whole document, not just this section, was to tickle the\n>> curiousity of the users and encourage them to see how the above\n>> \"much more powerful\" whatchanged was implemented by going to the\n>> source.\n>\n> Well in this case you can say that the intent was successful since it made\n> me read the source code ;)\n\nNo, it is a failure. \"By going to the source\" was meant for\n\"git-whatchanged.sh\" source,\na scripted version of Porcelain, so that users can mimic what is done\nin their script.\n\nReading C source would not help them.\n"},{"id":"224887","messageId":"vpqbo57clnb.fsf@anie.imag.fr","threadId":"34635","inReplyTo":"7v1u649e5m.fsf@alter.siamese.dyndns.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-09T08:29:28Z","receivedAt":"2013-08-09T08:29:28Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> It is meant to teach them \"if you want to do your own 'git log', you\n> can do so with 'rev-list' piped to 'diff-tree --stdin'\".  Changing\n> 'whatchanged' to 'log' in the latter statement is an improvement,\n> but dropping 'can be done by combining rev-list and diff-tree' goes\n> against the objective of the whole document.\n\nThen, we can keep the \"In fact, together with the 'git rev-list'\nprogram ...\" sentence, but drop \"A trivial (but very useful)\nscript ...\", which is both technically incorrect (whatchanged is not a\nscript anymore) and misleading because it advertises whatchanged.\n\nThat would look like this:\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3bdd56e..486a58b 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -818,7 +818,7 @@ for further details.\n 'GIT_FLUSH'::\n        If this environment variable is set to \"1\", then commands such\n        as 'git blame' (in incremental mode), 'git rev-list', 'git log',\n-       'git check-attr', 'git check-ignore', and 'git whatchanged' will\n+       'git check-attr', and 'git check-ignore' will\n        force a flush of the output stream after each record have been\n        flushed. If this\n        variable is set to \"0\", the output of these commands will be done\ndiff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\nindex f538a87..8e53560 100644\n--- a/Documentation/gitcore-tutorial.txt\n+++ b/Documentation/gitcore-tutorial.txt\n@@ -534,9 +534,8 @@ all, but just show the actual commit message.\n \n In fact, together with the 'git rev-list' program (which generates a\n list of revisions), 'git diff-tree' ends up being a veritable fount of\n-changes. A trivial (but very useful) script called 'git whatchanged' is\n-included with Git which does exactly this, and shows a log of recent\n-activities.\n+changes. The porcelain command 'git log' can also be used to display\n+changes introduced by some commits.\n \n To see the whole history of our pitiful little git-tutorial project, you\n can do\n@@ -546,11 +545,10 @@ $ git log\n ----------------\n \n which shows just the log messages, or if we want to see the log together\n-with the associated patches use the more complex (and much more\n-powerful)\n+with the associated patches, use the `--patch` option:\n \n ----------------\n-$ git whatchanged -p\n+$ git log -p\n ----------------\n \n and you will see exactly what has changed in the repository over its\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"224922","messageId":"7vwqnu6aei.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"vpqbo57clnb.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-09T17:28:53Z","receivedAt":"2013-08-09T17:28:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> It is meant to teach them \"if you want to do your own 'git log', you\n>> can do so with 'rev-list' piped to 'diff-tree --stdin'\".  Changing\n>> 'whatchanged' to 'log' in the latter statement is an improvement,\n>> but dropping 'can be done by combining rev-list and diff-tree' goes\n>> against the objective of the whole document.\n>\n> Then, we can keep the \"In fact, together with the 'git rev-list'\n> program ...\" sentence, but drop \"A trivial (but very useful)\n> script ...\", which is both technically incorrect (whatchanged is not a\n> script anymore) and misleading because it advertises whatchanged.\n>\n> That would look like this:\n\nYeah, but I think we further can strip it down and remove \"git log\"\ninvocation that is done without argument.  This document is not\nabout teaching \"the command you use to view the history is 'log'\"\n(the new tutorial and the user manuals are), and this subsection is\nabout diff-tree (in the section about \"Inspecting Changes\" with\nplumbing in the diff family).\n\nHow about doing it like this?\n\n-- >8 --\nSubject: core-tutorial: trim the section on Inspecting Changes\n\nBack when the core tutorial was written, `log` and `whatchanged`\nwere scripted Porcelains.  In the \"Inspecting Changes\" section that\ntalks about the plumbing commands in the diff family, it made sense\nto use `log` and `whatchanged` as good examples of the use of these\nplumbing commands, and because even these scripted Porcelains were\nnovelty (there wasn't the new end-user tutorial written), it made\nsome sense to illustrate uses of the `git log` (and `git\nwhatchanged`) scripted Porcelain commands.\n\nBut we no longer have scripted `log` and `whatchanged` to serve as\nexamples, and this document is not where the end users learn what\n`git log` command is about.  Stop at briefly mentioning the\npossibility of combining rev-list with diff-tree to build your own\nlog, and leave the end-user documentation of `log` to the new\ntutorial and the user manual.\n\nAlso resurrect the last version of `git-log`, `git-whatchanged`, and\n`git-show` to serve as examples to contrib/examples/ directory.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/gitcore-tutorial.txt  | 39 +++----------------------------------\n contrib/examples/git-log.sh         | 15 ++++++++++++++\n contrib/examples/git-whatchanged.sh | 28 ++++++++++++++++++++++++++\n 3 files changed, 46 insertions(+), 36 deletions(-)\n\ndiff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\nindex f538a87..3e83e1e 100644\n--- a/Documentation/gitcore-tutorial.txt\n+++ b/Documentation/gitcore-tutorial.txt\n@@ -534,42 +534,9 @@ all, but just show the actual commit message.\n \n In fact, together with the 'git rev-list' program (which generates a\n list of revisions), 'git diff-tree' ends up being a veritable fount of\n-changes. A trivial (but very useful) script called 'git whatchanged' is\n-included with Git which does exactly this, and shows a log of recent\n-activities.\n-\n-To see the whole history of our pitiful little git-tutorial project, you\n-can do\n-\n-----------------\n-$ git log\n-----------------\n-\n-which shows just the log messages, or if we want to see the log together\n-with the associated patches use the more complex (and much more\n-powerful)\n-\n-----------------\n-$ git whatchanged -p\n-----------------\n-\n-and you will see exactly what has changed in the repository over its\n-short history.\n-\n-[NOTE]\n-When using the above two commands, the initial commit will be shown.\n-If this is a problem because it is huge, you can hide it by setting\n-the log.showroot configuration variable to false. Having this, you\n-can still show it for each command just adding the `--root` option,\n-which is a flag for 'git diff-tree' accepted by both commands.\n-\n-With that, you should now be having some inkling of what Git does, and\n-can explore on your own.\n-\n-[NOTE]\n-Most likely, you are not directly using the core\n-Git Plumbing commands, but using Porcelain such as 'git add', `git-rm'\n-and `git-commit'.\n+changes.  You can emulate `git log` with a trivial script that pipes\n+the output of `git rev-list` to `git diff-tree --stdin`, which was\n+exactly how early versions of `git log` were implemented.\n \n \n Tagging a version\ndiff --git a/contrib/examples/git-log.sh b/contrib/examples/git-log.sh\nnew file mode 100755\nindex 0000000..c2ea71c\n--- /dev/null\n+++ b/contrib/examples/git-log.sh\n@@ -0,0 +1,15 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2005 Linus Torvalds\n+#\n+\n+USAGE='[--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [git-rev-list options]'\n+SUBDIRECTORY_OK='Yes'\n+. git-sh-setup\n+\n+revs=$(git-rev-parse --revs-only --no-flags --default HEAD \"$@\") || exit\n+[ \"$revs\" ] || {\n+\tdie \"No HEAD ref\"\n+}\n+git-rev-list --pretty $(git-rev-parse --default HEAD \"$@\") |\n+LESS=-S ${PAGER:-less}\ndiff --git a/contrib/examples/git-whatchanged.sh b/contrib/examples/git-whatchanged.sh\nnew file mode 100755\nindex 0000000..1fb9feb\n--- /dev/null\n+++ b/contrib/examples/git-whatchanged.sh\n@@ -0,0 +1,28 @@\n+#!/bin/sh\n+\n+USAGE='[-p] [--max-count=<n>] [<since>..<limit>] [--pretty=<format>] [-m] [git-diff-tree options] [git-rev-list options]'\n+SUBDIRECTORY_OK='Yes'\n+. git-sh-setup\n+\n+diff_tree_flags=$(git-rev-parse --sq --no-revs --flags \"$@\") || exit\n+case \"$0\" in\n+*whatchanged)\n+\tcount=\n+\ttest -z \"$diff_tree_flags\" &&\n+\t\tdiff_tree_flags=$(git-repo-config --get whatchanged.difftree)\n+\tdiff_tree_default_flags='-c -M --abbrev' ;;\n+*show)\n+\tcount=-n1\n+\ttest -z \"$diff_tree_flags\" &&\n+\t\tdiff_tree_flags=$(git-repo-config --get show.difftree)\n+\tdiff_tree_default_flags='--cc --always' ;;\n+esac\n+test -z \"$diff_tree_flags\" &&\n+\tdiff_tree_flags=\"$diff_tree_default_flags\"\n+\n+rev_list_args=$(git-rev-parse --sq --default HEAD --revs-only \"$@\") &&\n+diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags \"$@\") &&\n+\n+eval \"git-rev-list $count $rev_list_args\" |\n+eval \"git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args\" |\n+LESS=\"$LESS -S\" ${PAGER:-less}\n"},{"id":"224939","messageId":"7v38qi63bn.fsf_-_@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"7vwqnw9jv6.fsf@alter.siamese.dyndns.org","subject":"[PATCH] whatchanged: document its historical nature","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-09T20:01:48Z","receivedAt":"2013-08-09T20:01:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"After doing a bit of archaeology, I now know why \"whatchanged\" with\nan unwieldy long name persisted in the user's mindset for so long.\n\nMy conclusions are:\n\n - It is better to encourage new users to use `log` very early in\n   the document;\n\n - It is not sensible to remove the command at this point yet.\n   After having used to `log` that does not take diff options for\n   close to a year, it is understandable why there are many people\n   who are used to type `whatchanged`.\n\nIt could be argued that deprecation and retraining of fingers are\ndoing favors to the long-time users.  But the presense of the\ncommand is not hurting anybody, other than the new people who may\nstumble upon both and wonder what their differences are.  By clearly\nindicating that these two are essentially the same, we would help\nthe new people without harming anybody.\n\n-- >8 --\nSubject: [PATCH] whatchanged: document its historical nature\n\nEncourage new users to use 'log' instead.  These days, these\ncommands are unified and just have different defaults.\n\n'git log' only allowed you to view the log messages and no diffs\nwhen it was added in early June 2005.  It was only in early April\n2006 that the command learned to take diff options.  Because of\nthis, power users tended to use 'whatchanged' that already existed\nsince mid May 2005 and supported diff options.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n Documentation/git-whatchanged.txt | 41 ++++++++-------------------------------\n 1 file changed, 8 insertions(+), 33 deletions(-)\n\ndiff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt\nindex c600b61..6faa200 100644\n--- a/Documentation/git-whatchanged.txt\n+++ b/Documentation/git-whatchanged.txt\n@@ -13,43 +13,18 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-Shows commit logs and diff output each commit introduces.  The\n-command internally invokes 'git rev-list' piped to\n-'git diff-tree', and takes command line options for both of\n-these commands.\n \n-This manual page describes only the most frequently used options.\n+Shows commit logs and diff output each commit introduces.\n \n+New users are encouraged to use linkgit:git-log[1] instead.  The\n+`whatchanged` command is essentially the same as linkgit:git-log[1]\n+run with different defaults that shows a --raw diff outputat the\n+end.\n \n-OPTIONS\n--------\n--p::\n-\tShow textual diffs, instead of the Git internal diff\n-\toutput format that is useful only to tell the changed\n-\tpaths and their nature of changes.\n+The command is kept primarily for historical reasons; fingers of\n+many people who learned Git long before `git log` was invented by\n+reading Linux kernel mailing list are trained to type it.\n \n--<n>::\n-\tLimit output to <n> commits.\n-\n-<since>..<until>::\n-\tLimit output to between the two named commits (bottom\n-\texclusive, top inclusive).\n-\n--r::\n-\tShow Git internal diff output, but for the whole tree,\n-\tnot just the top level.\n-\n--m::\n-\tBy default, differences for merge commits are not shown.\n-\tWith this flag, show differences to that commit from all\n-\tof its parents.\n-+\n-However, it is not very useful in general, although it\n-*is* useful on a file-by-file basis.\n-\n-include::pretty-options.txt[]\n-\n-include::pretty-formats.txt[]\n \n Examples\n --------\n-- \n1.8.4-rc2-195-gb76a8e9\n"},{"id":"224944","messageId":"20130809201447.GH2337@serenity.lan","threadId":"34635","inReplyTo":"7v38qi63bn.fsf_-_@alter.siamese.dyndns.org","subject":"Re: [PATCH] whatchanged: document its historical nature","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-08-09T20:14:47Z","receivedAt":"2013-08-09T20:14:47Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, Aug 09, 2013 at 01:01:48PM -0700, Junio C Hamano wrote:\n> After doing a bit of archaeology, I now know why \"whatchanged\" with\n> an unwieldy long name persisted in the user's mindset for so long.\n> \n> My conclusions are:\n> \n>  - It is better to encourage new users to use `log` very early in\n>    the document;\n> \n>  - It is not sensible to remove the command at this point yet.\n>    After having used to `log` that does not take diff options for\n>    close to a year, it is understandable why there are many people\n>    who are used to type `whatchanged`.\n> \n> It could be argued that deprecation and retraining of fingers are\n> doing favors to the long-time users.  But the presense of the\n> command is not hurting anybody, other than the new people who may\n> stumble upon both and wonder what their differences are.  By clearly\n> indicating that these two are essentially the same, we would help\n> the new people without harming anybody.\n> \n> -- >8 --\n> Subject: [PATCH] whatchanged: document its historical nature\n> \n> Encourage new users to use 'log' instead.  These days, these\n> commands are unified and just have different defaults.\n> \n> 'git log' only allowed you to view the log messages and no diffs\n> when it was added in early June 2005.  It was only in early April\n> 2006 that the command learned to take diff options.  Because of\n> this, power users tended to use 'whatchanged' that already existed\n> since mid May 2005 and supported diff options.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n>  Documentation/git-whatchanged.txt | 41 ++++++++-------------------------------\n>  1 file changed, 8 insertions(+), 33 deletions(-)\n> \n> diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt\n> index c600b61..6faa200 100644\n> --- a/Documentation/git-whatchanged.txt\n> +++ b/Documentation/git-whatchanged.txt\n> @@ -13,43 +13,18 @@ SYNOPSIS\n>  \n>  DESCRIPTION\n>  -----------\n> -Shows commit logs and diff output each commit introduces.  The\n> -command internally invokes 'git rev-list' piped to\n> -'git diff-tree', and takes command line options for both of\n> -these commands.\n>  \n> -This manual page describes only the most frequently used options.\n> +Shows commit logs and diff output each commit introduces.\n>  \n> +New users are encouraged to use linkgit:git-log[1] instead.  The\n> +`whatchanged` command is essentially the same as linkgit:git-log[1]\n> +run with different defaults that shows a --raw diff outputat the\n\ns/outputat/output at/\n\nAlthough I wonder if it would be better to say\n\n    New users are encouraged to use linkgit:git-log[1] instead.  The\n    `whatchanged` command is essentially the same as linkgit:git-log[1]\n    with the `--raw` option specified.\n\n> +end.\n>  \n> -OPTIONS\n> --------\n> --p::\n> -\tShow textual diffs, instead of the Git internal diff\n> -\toutput format that is useful only to tell the changed\n> -\tpaths and their nature of changes.\n> +The command is kept primarily for historical reasons; fingers of\n> +many people who learned Git long before `git log` was invented by\n> +reading Linux kernel mailing list are trained to type it.\n>  \n> --<n>::\n> -\tLimit output to <n> commits.\n> -\n> -<since>..<until>::\n> -\tLimit output to between the two named commits (bottom\n> -\texclusive, top inclusive).\n> -\n> --r::\n> -\tShow Git internal diff output, but for the whole tree,\n> -\tnot just the top level.\n> -\n> --m::\n> -\tBy default, differences for merge commits are not shown.\n> -\tWith this flag, show differences to that commit from all\n> -\tof its parents.\n> -+\n> -However, it is not very useful in general, although it\n> -*is* useful on a file-by-file basis.\n> -\n> -include::pretty-options.txt[]\n> -\n> -include::pretty-formats.txt[]\n>  \n>  Examples\n>  --------\n> -- \n> 1.8.4-rc2-195-gb76a8e9\n"},{"id":"224952","messageId":"7vtxiy4m6o.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"20130809201447.GH2337@serenity.lan","subject":"Re: [PATCH] whatchanged: document its historical nature","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-09T20:57:19Z","receivedAt":"2013-08-09T20:57:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n>> +New users are encouraged to use linkgit:git-log[1] instead.  The\n>> +`whatchanged` command is essentially the same as linkgit:git-log[1]\n>> +run with different defaults that shows a --raw diff outputat the\n>\n> s/outputat/output at/\n\nThanks.\n\n> Although I wonder if it would be better to say\n>\n>     New users are encouraged to use linkgit:git-log[1] instead.  The\n>     `whatchanged` command is essentially the same as linkgit:git-log[1]\n>     with the `--raw` option specified.\n\nBut that is different from the truth, no?  \"git whatchanged -p\" will\nnot behave as if \"git whatchanged -p\" with the \"--raw\" specified.\nThe 'raw' kicks in only as a default.\n"},{"id":"224994","messageId":"CALkWK0k61F042_5uZ_1QXAzyZ6u-XppB+TLHwkCDsuj7u=B-WQ@mail.gmail.com","threadId":"34635","inReplyTo":"7v38qi63bn.fsf_-_@alter.siamese.dyndns.org","subject":"Re: [PATCH] whatchanged: document its historical nature","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-08-10T07:04:32Z","receivedAt":"2013-08-10T07:04:32Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n>  Documentation/git-whatchanged.txt | 41 ++++++++-------------------------------\n>  1 file changed, 8 insertions(+), 33 deletions(-)\n\nLooks good. Thanks for doing this.\n"},{"id":"225088","messageId":"20130812074959.GJ2337@serenity.lan","threadId":"34635","inReplyTo":"7vtxiy4m6o.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] whatchanged: document its historical nature","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-08-12T07:50:00Z","receivedAt":"2013-08-12T07:50:00Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, Aug 09, 2013 at 01:57:19PM -0700, Junio C Hamano wrote:\n> John Keeping <john@keeping.me.uk> writes:\n> \n> >> +New users are encouraged to use linkgit:git-log[1] instead.  The\n> >> +`whatchanged` command is essentially the same as linkgit:git-log[1]\n> >> +run with different defaults that shows a --raw diff outputat the\n> >\n> > s/outputat/output at/\n> \n> Thanks.\n> \n> > Although I wonder if it would be better to say\n> >\n> >     New users are encouraged to use linkgit:git-log[1] instead.  The\n> >     `whatchanged` command is essentially the same as linkgit:git-log[1]\n> >     with the `--raw` option specified.\n> \n> But that is different from the truth, no?  \"git whatchanged -p\" will\n> not behave as if \"git whatchanged -p\" with the \"--raw\" specified.\n> The 'raw' kicks in only as a default.\n\nHmm, I hadn't realised that specifying \"-p\" would disable the \"--raw\".\nI still find the last sentence of the original patch slightly awkward\nthough.  How about\n\n    New users are encouraged to use linkgit:git-log[1] instead.  The\n    `whatchanged` command is essentially the same as linkgit:git-log[1]\n    but defaults to ``raw'' diff output and does not show merge\n    commits.\n\n?\n"},{"id":"225132","messageId":"vpqzjsmhvjg.fsf@anie.imag.fr","threadId":"34635","inReplyTo":"7vwqnu6aei.fsf@alter.siamese.dyndns.org","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-08-13T07:58:11Z","receivedAt":"2013-08-13T07:58:11Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> +changes.  You can emulate `git log` with a trivial script that pipes\n\nI'd say \"You can emulate `git log` and `git log -p`\" here, but I'm fine\nwith your version too.\n\n> -[NOTE]\n> -Most likely, you are not directly using the core\n> -Git Plumbing commands, but using Porcelain such as 'git add', `git-rm'\n> -and `git-commit'.\n\nThis removal sounds unrelated, but I don't understand what this note was\ndoing here anyway, so it's good to remove it.\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"225147","messageId":"7v8v05zis7.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"20130812074959.GJ2337@serenity.lan","subject":"Re: [PATCH] whatchanged: document its historical nature","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-13T15:56:24Z","receivedAt":"2013-08-13T15:56:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n> Hmm, I hadn't realised that specifying \"-p\" would disable the \"--raw\".\n> I still find the last sentence of the original patch slightly awkward\n> though.  How about\n>\n>     New users are encouraged to use linkgit:git-log[1] instead.  The\n>     `whatchanged` command is essentially the same as linkgit:git-log[1]\n>     but defaults to ``raw'' diff output and does not show merge\n>     commits.\n>\n> ?\n\nI've pushed out a new version with slight rewording based on your\nversion.\n\nThanks.\n"},{"id":"225148","messageId":"7v4natzim3.fsf@alter.siamese.dyndns.org","threadId":"34635","inReplyTo":"vpqzjsmhvjg.fsf@anie.imag.fr","subject":"Re: Remove old forgotten command: whatchanged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-13T16:00:04Z","receivedAt":"2013-08-13T16:00:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> +changes.  You can emulate `git log` with a trivial script that pipes\n>\n> I'd say \"You can emulate `git log` and `git log -p`\" here, but I'm fine\n> with your version too.\n\nBy `git log`, I meant \"`git log` with its various options\", as it\nfelt unnecessary to single `-p` out.  But will reword anyway.\n\n>> -[NOTE]\n>> -Most likely, you are not directly using the core\n>> -Git Plumbing commands, but using Porcelain such as 'git add', `git-rm'\n>> -and `git-commit'.\n>\n> This removal sounds unrelated, but I don't understand what this note was\n> doing here anyway, so it's good to remove it.\n\nYeah, the removal is part of \"...and this document is not where the\nend users learn what `git log` command is about.  Stop at briefly\nmentioning the possibility of combining rev-list with diff-tree to\nbuild your own log, and leave the end-user documentation of `log` to\nthe new tutorial and the user manual\".\n\nThanks.\n"}]}