{"thread":{"id":"33914","subject":"--follow is ignored when used with --reverse","startedAt":"2013-05-23T23:23:24Z","lastAt":"2013-07-02T19:11:46Z","messageCount":9,"participants":["Alois Mahdal","alois.mahdal.1-ndmail@zxcvb.cz","Ramkumar Ramachandra","John Keeping","Lukas Fleischer","Thomas Rast","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"218334","messageId":"20130524012324.295dec77@hugo.daonet.home","threadId":"33914","inReplyTo":null,"subject":"--follow is ignored when used with --reverse","fromName":"Alois Mahdal","fromEmail":"alois.mahdal.1-ndmail@zxcvb.cz","sentAt":"2013-05-23T23:23:24Z","receivedAt":"2013-05-23T23:23:24Z","isPatch":false,"sender":{"key":"alois.mahdal.1-ndmail@zxcvb.cz","avatar":null},"body":"Hello!\n\nThis [has been reported][1] to this list about half a year ago\nbut with no response so I'm  not even sure if it's been\nacknowledged as bug.\n\n  [1]: http://marc.info/?l=git&m=135215709307126&q=raw\n\nWhen I use `git log --follow file` all is OK, but once I add\n`--reverse` to it, it no longer follows the file beyond renames.\n\nThis makes it hard to query for when the file was really added,\nwhich I was trying to achieve with\n\n    $ git -1 --reverse --follow several_times_renamed_file\n\nIs this going to be fixed?\n\nThanks,\naL.\n\n-- \nAlois Mahdal\n"},{"id":"222355","messageId":"8c83f60d8eb4b7aaf4686f065e49ac93@zxcvb.cz","threadId":"33914","inReplyTo":"20130524012324.295dec77@hugo.daonet.home","subject":"Re: --follow is ignored when used with --reverse","fromName":"","fromEmail":"alois.mahdal.1-ndmail@zxcvb.cz","sentAt":"2013-07-02T08:56:08Z","receivedAt":"2013-07-02T08:56:08Z","isPatch":false,"sender":{"key":"alois.mahdal.1-ndmail@zxcvb.cz","avatar":null},"body":"On 2013-05-24 01:23, Alois Mahdal wrote:\n> [...]\n>\n> When I use `git log --follow file` all is OK, but once I add\n> `--reverse` to it, it no longer follows the file beyond renames.\n>\n> This makes it hard to query for when the file was really added,\n> which I was trying to achieve with\n>\n>     $ git -1 --reverse --follow several_times_renamed_file\n\nI see that this list is **really** busy---my question got lost as\na needle in an ocean.. :-)  Immediately.\n\nMaybe I should record an incident?\n\nCould anyone point me in the right direction?  Just say the word! :)\n\naL.\n\n-- \nAlois Mahdal\n"},{"id":"222358","messageId":"CALkWK0ngwvQzL1cMGL5pWJoJHLYBHV2kUU=i3YiWt5V_uVLz7A@mail.gmail.com","threadId":"33914","inReplyTo":"20130524012324.295dec77@hugo.daonet.home","subject":"Re: --follow is ignored when used with --reverse","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-07-02T09:12:59Z","receivedAt":"2013-07-02T09:12:59Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Alois Mahdal wrote:\n> This [has been reported][1] to this list about half a year ago\n> but with no response so I'm  not even sure if it's been\n> acknowledged as bug.\n\nYes, this is a bug.  However, it is not at all easy to fix; so I would\nrecommend that you contribute a documentation patch/ failing test for\nnow (hint: patch emails get more attention that non-patch ones ;)\n"},{"id":"222359","messageId":"20130702091936.GA9161@serenity.lan","threadId":"33914","inReplyTo":"20130524012324.295dec77@hugo.daonet.home","subject":"Re: --follow is ignored when used with --reverse","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-02T09:19:36Z","receivedAt":"2013-07-02T09:19:36Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, May 24, 2013 at 01:23:24AM +0200, Alois Mahdal wrote:\n> Hello!\n> \n> This [has been reported][1] to this list about half a year ago\n> but with no response so I'm  not even sure if it's been\n> acknowledged as bug.\n> \n>   [1]: http://marc.info/?l=git&m=135215709307126&q=raw\n> \n> When I use `git log --follow file` all is OK, but once I add\n> `--reverse` to it, it no longer follows the file beyond renames.\n> \n> This makes it hard to query for when the file was really added,\n> which I was trying to achieve with\n> \n>     $ git -1 --reverse --follow several_times_renamed_file\n\nIn my testing it actually seems to be worse than that.  In git.git:\n\n    $ git log --oneline builtin/clone.c | wc -l\n    99\n    $ git log --oneline --reverse builtin/clone.c | wc -l\n    99\n    $ git log --oneline --follow builtin/clone.c | wc -l\n    125\n    $ git log --oneline --follow --reverse builtin/clone.c | wc -l\n    3\n\nSo the combination of --reverse and --follow appears to have lost the\nmajority of the commits!\n"},{"id":"222361","messageId":"20130702093842.GA4353@blizzard","threadId":"33914","inReplyTo":"20130702091936.GA9161@serenity.lan","subject":"Re: --follow is ignored when used with --reverse","fromName":"Lukas Fleischer","fromEmail":"git@cryptocrack.de","sentAt":"2013-07-02T09:38:42Z","receivedAt":"2013-07-02T09:38:42Z","isPatch":false,"sender":{"key":"git@cryptocrack.de","avatar":null},"body":"On Tue, Jul 02, 2013 at 10:19:36AM +0100, John Keeping wrote:\n> On Fri, May 24, 2013 at 01:23:24AM +0200, Alois Mahdal wrote:\n> > Hello!\n> > \n> > This [has been reported][1] to this list about half a year ago\n> > but with no response so I'm  not even sure if it's been\n> > acknowledged as bug.\n> > \n> >   [1]: http://marc.info/?l=git&m=135215709307126&q=raw\n> > \n> > When I use `git log --follow file` all is OK, but once I add\n> > `--reverse` to it, it no longer follows the file beyond renames.\n> > \n> > This makes it hard to query for when the file was really added,\n> > which I was trying to achieve with\n> > \n> >     $ git -1 --reverse --follow several_times_renamed_file\n> \n> In my testing it actually seems to be worse than that.  In git.git:\n> \n>     $ git log --oneline builtin/clone.c | wc -l\n>     99\n>     $ git log --oneline --reverse builtin/clone.c | wc -l\n>     99\n>     $ git log --oneline --follow builtin/clone.c | wc -l\n>     125\n>     $ git log --oneline --follow --reverse builtin/clone.c | wc -l\n>     3\n\nI just wanted to point out that it works fine when specifying the *original*\nfile name (which kind of makes sense given that everything is done in reverse\norder):\n\n    $ git init >/dev/null\n    $ echo foo >a && git add a && git commit -m first\n    [master (root-commit) 3631134] first\n     1 file changed, 1 insertion(+)\n     create mode 100644 a\n    $ echo bar >b && git add b && git commit -m second\n    [master 7772184] second\n     1 file changed, 1 insertion(+)\n     create mode 100644 b\n    $ git mv b c && git commit -m third\n    [master 0275097] third\n     1 file changed, 0 insertions(+), 0 deletions(-)\n     rename b => c (100%)\n    $ git log --oneline --follow --reverse -- c\n    0275097 third\n    $ git log --oneline --follow --reverse -- b\n    7772184 second\n    0275097 third\n\nHowever, that also doesn't seem to work for builtin/clone.c:\n\n    $ git log --oneline --follow --reverse -- builtin-clone.c | wc -l\n    65\n\n> \n> So the combination of --reverse and --follow appears to have lost the\n> majority of the commits!\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"222362","messageId":"87vc4t9tn5.fsf@linux-k42r.v.cablecom.net","threadId":"33914","inReplyTo":"20130702093842.GA4353@blizzard","subject":"Re: --follow is ignored when used with --reverse","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-07-02T09:51:42Z","receivedAt":"2013-07-02T09:51:42Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Lukas Fleischer <git@cryptocrack.de> writes:\n\n> On Tue, Jul 02, 2013 at 10:19:36AM +0100, John Keeping wrote:\n[...]\n>>     $ git log --oneline --follow builtin/clone.c | wc -l\n>>     125\n>>     $ git log --oneline --follow --reverse builtin/clone.c | wc -l\n>>     3\n>\n> I just wanted to point out that it works fine when specifying the *original*\n> file name (which kind of makes sense given that everything is done in reverse\n> order):\n[...]\n> However, that also doesn't seem to work for builtin/clone.c:\n>\n>     $ git log --oneline --follow --reverse -- builtin-clone.c | wc -l\n>     65\n\nI'm pretty sure that is simply because --follow iis a horrible hack,\nknown to be broken in many ways.  I have it on my longer-term todo list\nto unify it with -L -M, which already does the Right Thing (more\ngenerally, not in the --reverse interaction, which it never occurred to\nme I should check).\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"222365","messageId":"20130702104119.GB9161@serenity.lan","threadId":"33914","inReplyTo":"87vc4t9tn5.fsf@linux-k42r.v.cablecom.net","subject":"Re: --follow is ignored when used with --reverse","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-02T10:41:19Z","receivedAt":"2013-07-02T10:41:19Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Jul 02, 2013 at 11:51:42AM +0200, Thomas Rast wrote:\n> Lukas Fleischer <git@cryptocrack.de> writes:\n> \n> > On Tue, Jul 02, 2013 at 10:19:36AM +0100, John Keeping wrote:\n> [...]\n> >>     $ git log --oneline --follow builtin/clone.c | wc -l\n> >>     125\n> >>     $ git log --oneline --follow --reverse builtin/clone.c | wc -l\n> >>     3\n> >\n> > I just wanted to point out that it works fine when specifying the *original*\n> > file name (which kind of makes sense given that everything is done in reverse\n> > order):\n> [...]\n> > However, that also doesn't seem to work for builtin/clone.c:\n> >\n> >     $ git log --oneline --follow --reverse -- builtin-clone.c | wc -l\n> >     65\n> \n> I'm pretty sure that is simply because --follow iis a horrible hack,\n> known to be broken in many ways.  I have it on my longer-term todo list\n> to unify it with -L -M, which already does the Right Thing (more\n> generally, not in the --reverse interaction, which it never occurred to\n> me I should check).\n\nInteresting... this tells me that --reverse doesn't work the way I\nthought it did (although without any real evidence).  Given how\n--reverse interacts with other options (like --max-count), I assumed it\nwould generate the commit list first and then simply reverse it before\ndisplay but it seems that this isn't what happens with --follow.\n\nI guess that makes sense to avoid calculating the diff twice but I\nsuspect we have to pay that price to get correct output.\n"},{"id":"222368","messageId":"51D2B781.7000906@viscovery.net","threadId":"33914","inReplyTo":"20130524012324.295dec77@hugo.daonet.home","subject":"Re: --follow is ignored when used with --reverse","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-07-02T11:20:33Z","receivedAt":"2013-07-02T11:20:33Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/24/2013 1:23, schrieb Alois Mahdal:\n> ...query for when the file was really added,\n> which I was trying to achieve with\n> \n>     $ git -1 --reverse --follow several_times_renamed_file\n\nAssuming you meant 'git log -1 ...' or similar. It won't do what you think\nit would do because:\n\n* -1 is a revision traversal options.\n\n* --reverse is an \"output\" option.\n\nThis means: First, revisions are collected, at which point -1 is honored.\nSecond, the revisions found are listed in --reverse order.\n\nWhen you have only one revision in the list, the output is the same with\nor without --reverse ;-)\n\n-- Hannes\n"},{"id":"222392","messageId":"7v38rw93pp.fsf@alter.siamese.dyndns.org","threadId":"33914","inReplyTo":"87vc4t9tn5.fsf@linux-k42r.v.cablecom.net","subject":"Re: --follow is ignored when used with --reverse","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-02T19:11:46Z","receivedAt":"2013-07-02T19:11:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@inf.ethz.ch> writes:\n\n> Lukas Fleischer <git@cryptocrack.de> writes:\n>\n>> On Tue, Jul 02, 2013 at 10:19:36AM +0100, John Keeping wrote:\n> [...]\n>>>     $ git log --oneline --follow builtin/clone.c | wc -l\n>>>     125\n>>>     $ git log --oneline --follow --reverse builtin/clone.c | wc -l\n>>>     3\n>>\n>> I just wanted to point out that it works fine when specifying the *original*\n>> file name (which kind of makes sense given that everything is done in reverse\n>> order):\n> [...]\n>> However, that also doesn't seem to work for builtin/clone.c:\n>>\n>>     $ git log --oneline --follow --reverse -- builtin-clone.c | wc -l\n>>     65\n>\n> I'm pretty sure that is simply because --follow iis a horrible hack,\n> known to be broken in many ways.\n\nThe machinery the follow uses simplifies the history with dynamic\npathspec correctly (in a simple history, at least), but the output\nis coupled too strongly to the traversal. If you collect all the\nrevs you will show first, reverse them and then try to show (which\nis what --reverse essentially is), the dynamic pathspec used for\neach rev is long gone.\n\nPerhaps we should make --follow mutually incompatible with\nproblematic options (I suspect --reverse is not the only case) at\nthe command line parser level to avoid hurting users.\n"}]}