{"thread":{"id":"37854","subject":"Bug in log for path in case of identical commit","startedAt":"2014-10-31T08:40:38Z","lastAt":"2014-11-05T19:49:23Z","messageCount":4,"participants":["Alexandre Garnier","Junio C Hamano","Phil Hord"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251260","messageId":"CAFFOgCUeqcEPdjUyri0bivCj-Ofzp_9GhH3mR7UTzD-8PY9tGw@mail.gmail.com","threadId":"37854","inReplyTo":null,"subject":"Bug in log for path in case of identical commit","fromName":"Alexandre Garnier","fromEmail":"zigarn+git@gmail.com","sentAt":"2014-10-31T08:40:38Z","receivedAt":"2014-10-31T08:40:38Z","isPatch":false,"sender":{"key":"zigarn+git@gmail.com","avatar":null},"body":"When merging 2 branches with the same modifications on the both sides,\ndepending the merge side, one branch disappear from the file history.\n\nTo be more clear, there is a script in attachment to reproduce, but\nhere is the result :\n$ git log --graph --oneline --all --decorate --name-status\n*   63c807f (HEAD, master) Merge branch 'branch' into 'master'\n|\\\n| * 5dc8785 (branch) Change line 15 on branch\n| | M   file\n| * d9cd3ce Change line 25 on branch\n| | M   file\n* | 7220d52 Change line 15 on master\n|/\n|   M   file\n* 7566672 Initial commit\n  A     file\n\n$ git log --graph --oneline --all --decorate --name-status -- file\n* 5dc8785 (branch) Change line 15 on branch\n| M     file\n* d9cd3ce Change line 25 on branch\n| M     file\n* 7566672 Initial commit\n  A     file\n\n=> The commit 7220d52 modified the file but is not shown in file\nhistory anymore.\nThe expected result would be:\n* 5dc8785 (branch) Change line 15 on branch\n| M     file\n* d9cd3ce Change line 25 on branch\n| M     file\n| * 7220d52 Change line 15 on master\n|/\n|   M   file\n* 7566672 Initial commit\n  A     file\n\nThe order between the 2 commits on the branch is not important.\nIf you do a 'cherry-pick 7220d52' or a 'merge --squash master' instead\nof applying the same modification for commit 5dc8785, you get the same\nresult (cherry-picking was my initial use-case).\nIf you do not create the commit d9cd3ce, then the file history show all commits.\nIf you merge 'master' into 'branch', then the file history show all commits.\n\nAm I missing something or is it really a bug?\nThanks.\n\n-- \nAlex\n"},{"id":"251354","messageId":"xmqqwq7cqchw.fsf@gitster.dls.corp.google.com","threadId":"37854","inReplyTo":"CAFFOgCUeqcEPdjUyri0bivCj-Ofzp_9GhH3mR7UTzD-8PY9tGw@mail.gmail.com","subject":"Re: Bug in log for path in case of identical commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-03T20:02:03Z","receivedAt":"2014-11-03T20:02:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexandre Garnier <zigarn+git@gmail.com> writes:\n\n> When merging 2 branches with the same modifications on the both sides,\n> depending the merge side, one branch disappear from the file history.\n\nIsn't this a basic and fundamental of feature of Git called merge\nsimplification, i.e. if two or more branches did the same thing and\ndid not contribute to the end result, drop all but the one of them\nto show one simplest explanation of the history?\n\nAn option to get messier and fuller history is --full-history, if\nthe above matches what you are seeing.\n\n>\n> To be more clear, there is a script in attachment to reproduce, but\n> here is the result :\n> $ git log --graph --oneline --all --decorate --name-status\n> *   63c807f (HEAD, master) Merge branch 'branch' into 'master'\n> |\\\n> | * 5dc8785 (branch) Change line 15 on branch\n> | | M   file\n> | * d9cd3ce Change line 25 on branch\n> | | M   file\n> * | 7220d52 Change line 15 on master\n> |/\n> |   M   file\n> * 7566672 Initial commit\n>   A     file\n>\n> $ git log --graph --oneline --all --decorate --name-status -- file\n> * 5dc8785 (branch) Change line 15 on branch\n> | M     file\n> * d9cd3ce Change line 25 on branch\n> | M     file\n> * 7566672 Initial commit\n>   A     file\n>\n> => The commit 7220d52 modified the file but is not shown in file\n> history anymore.\n> The expected result would be:\n> * 5dc8785 (branch) Change line 15 on branch\n> | M     file\n> * d9cd3ce Change line 25 on branch\n> | M     file\n> | * 7220d52 Change line 15 on master\n> |/\n> |   M   file\n> * 7566672 Initial commit\n>   A     file\n>\n> The order between the 2 commits on the branch is not important.\n> If you do a 'cherry-pick 7220d52' or a 'merge --squash master' instead\n> of applying the same modification for commit 5dc8785, you get the same\n> result (cherry-picking was my initial use-case).\n> If you do not create the commit d9cd3ce, then the file history show all commits.\n> If you merge 'master' into 'branch', then the file history show all commits.\n>\n> Am I missing something or is it really a bug?\n> Thanks.\n"},{"id":"251375","messageId":"CABURp0qZ5Ba3EFhqF0LfoEz7J4Vq2DiStqcDc_bpK62XT7s7eQ@mail.gmail.com","threadId":"37854","inReplyTo":"CAFFOgCUeqcEPdjUyri0bivCj-Ofzp_9GhH3mR7UTzD-8PY9tGw@mail.gmail.com","subject":"Re: Bug in log for path in case of identical commit","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2014-11-04T16:21:29Z","receivedAt":"2014-11-04T16:21:29Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"On Fri, Oct 31, 2014 at 4:40 AM, Alexandre Garnier <zigarn+git@gmail.com> wrote:\n> When merging 2 branches with the same modifications on the both sides,\n> depending the merge side, one branch disappear from the file history.\n>\n> To be more clear, there is a script in attachment to reproduce, but\n> here is the result :\n> $ git log --graph --oneline --all --decorate --name-status\n> *   63c807f (HEAD, master) Merge branch 'branch' into 'master'\n> |\\\n> | * 5dc8785 (branch) Change line 15 on branch\n> | | M   file\n> | * d9cd3ce Change line 25 on branch\n> | | M   file\n> * | 7220d52 Change line 15 on master\n> |/\n> |   M   file\n> * 7566672 Initial commit\n>   A     file\n>\n> $ git log --graph --oneline --all --decorate --name-status -- file\n> * 5dc8785 (branch) Change line 15 on branch\n> | M     file\n> * d9cd3ce Change line 25 on branch\n> | M     file\n> * 7566672 Initial commit\n>   A     file\n>\n> => The commit 7220d52 modified the file but is not shown in file\n> history anymore.\n> The expected result would be:\n> * 5dc8785 (branch) Change line 15 on branch\n> | M     file\n> * d9cd3ce Change line 25 on branch\n> | M     file\n> | * 7220d52 Change line 15 on master\n> |/\n> |   M   file\n> * 7566672 Initial commit\n>   A     file\n>\n> The order between the 2 commits on the branch is not important.\n> If you do a 'cherry-pick 7220d52' or a 'merge --squash master' instead\n> of applying the same modification for commit 5dc8785, you get the same\n> result (cherry-picking was my initial use-case).\n> If you do not create the commit d9cd3ce, then the file history show all commits.\n> If you merge 'master' into 'branch', then the file history show all commits.\n\nThis last line was confusing to me.  But I think you've misinterpreted\nthe results a bit.  There is no difference between \"merge master into\nbranch\" and \"merge branch into master\" in this case.  The real reason\nthe \"extra\" commit is shown in the former case is that you used\n'--all' (include all refs as commandline arguments) and the commit\nwhich was being omitted was directly referenced by a ref, 'master'.\n\nWhen I remove the \"--all\" from your test script, I get consistent logs\nfor the two merges.\n\nMaybe this has misled your other tests as well.  Read the \"History\nSimplification\" section of \"git help log\".\n"},{"id":"251417","messageId":"CAFFOgCVvz8mog86pMynHtkssUj9GruC=58YLbEoRK_BVz+v-GA@mail.gmail.com","threadId":"37854","inReplyTo":"CABURp0qZ5Ba3EFhqF0LfoEz7J4Vq2DiStqcDc_bpK62XT7s7eQ@mail.gmail.com","subject":"Re: Bug in log for path in case of identical commit","fromName":"Alexandre Garnier","fromEmail":"zigarn+git@gmail.com","sentAt":"2014-11-05T19:49:23Z","receivedAt":"2014-11-05T19:49:23Z","isPatch":false,"sender":{"key":"zigarn+git@gmail.com","avatar":null},"body":"2014-11-04 17:21 GMT+01:00 Phil Hord <phil.hord@gmail.com>:\n> On Fri, Oct 31, 2014 at 4:40 AM, Alexandre Garnier <zigarn+git@gmail.com> wrote:\n>> When merging 2 branches with the same modifications on the both sides,\n>> depending the merge side, one branch disappear from the file history.\n>>\n>> To be more clear, there is a script in attachment to reproduce, but\n>> here is the result :\n>> $ git log --graph --oneline --all --decorate --name-status\n>> *   63c807f (HEAD, master) Merge branch 'branch' into 'master'\n>> |\\\n>> | * 5dc8785 (branch) Change line 15 on branch\n>> | | M   file\n>> | * d9cd3ce Change line 25 on branch\n>> | | M   file\n>> * | 7220d52 Change line 15 on master\n>> |/\n>> |   M   file\n>> * 7566672 Initial commit\n>>   A     file\n>>\n>> $ git log --graph --oneline --all --decorate --name-status -- file\n>> * 5dc8785 (branch) Change line 15 on branch\n>> | M     file\n>> * d9cd3ce Change line 25 on branch\n>> | M     file\n>> * 7566672 Initial commit\n>>   A     file\n>>\n>> => The commit 7220d52 modified the file but is not shown in file\n>> history anymore.\n>> The expected result would be:\n>> * 5dc8785 (branch) Change line 15 on branch\n>> | M     file\n>> * d9cd3ce Change line 25 on branch\n>> | M     file\n>> | * 7220d52 Change line 15 on master\n>> |/\n>> |   M   file\n>> * 7566672 Initial commit\n>>   A     file\n>>\n>> The order between the 2 commits on the branch is not important.\n>> If you do a 'cherry-pick 7220d52' or a 'merge --squash master' instead\n>> of applying the same modification for commit 5dc8785, you get the same\n>> result (cherry-picking was my initial use-case).\n>> If you do not create the commit d9cd3ce, then the file history show all commits.\n>> If you merge 'master' into 'branch', then the file history show all commits.\n>\n> This last line was confusing to me.  But I think you've misinterpreted\n> the results a bit.  There is no difference between \"merge master into\n> branch\" and \"merge branch into master\" in this case.  The real reason\n> the \"extra\" commit is shown in the former case is that you used\n> '--all' (include all refs as commandline arguments) and the commit\n> which was being omitted was directly referenced by a ref, 'master'.\n>\n> When I remove the \"--all\" from your test script, I get consistent logs\n> for the two merges.\n>\n> Maybe this has misled your other tests as well.  Read the \"History\n> Simplification\" section of \"git help log\".\n\nThanks for pointing me out the 'history simplification' [1]. Didn't\nknow about this and missed it in the large help of 'git log'.\nI will now use the '--full-history' option more often as it has more\nsense to me (but it's not available in EGit: bug #341028) [2])\n\n[1] http://git-scm.com/docs/git-log#_history_simplification\n[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=341028\n\n-- \nAlex\n"}]}