{"thread":{"id":"10623","subject":"Strange git-show-branch behavior.","startedAt":"2007-11-03T17:46:39Z","lastAt":"2007-11-08T09:58:38Z","messageCount":3,"participants":["Sergei Organov","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"58158","messageId":"871wb79q80.fsf@osv.gnss.ru","threadId":"10623","inReplyTo":null,"subject":"Strange git-show-branch behavior.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2007-11-03T17:46:39Z","receivedAt":"2007-11-03T17:46:39Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Hello,\n\nI need to ask about git-show-branch once again as I really can't\nunderstand its behavior myself. Could please anybody either confirm bug(s) in\ngit-show-branch, or explain why does it work this way.\n\nConsider its invocation in a toy repository that has total 6 commits, as\ncan be seen from this output:\n\n$ git branch\n* master\n  mybranch\n$ git rev-list master mybranch --pretty=oneline\ne9217caffebd6311073867d410f0c6e46910a13d Go to sleep\n5f19837be87493e9b284fe7db03f00f23d006d2e Merged mybranch\n2e2a4956db9737faf5f4f296b895500fafab7350 Some fun.\n6478a15c48b0a7ce28069310ff5e51f95b250c7c Some work.\n48d3660dc2005471c27f1d5b09d334885b612380 Commit message\n2c14c05709bde3c1a7bbdd7effbf73a5667fa265 Initial commit\n$\n\nOr, using git-show-branch itself:\n\n$ git-show-branch --more=9 master\n[master] Go to sleep\n[master^] Merged mybranch\n[master^^2] Some work.\n[master~2] Some fun.\n[master~3] Commit message\n[master~4] Initial commit\n$\n\n[NOTE: the format of this output contradicts the manual page, but it's\n not the topic of this post]\n\nNow comes the confusion:\n\n$ git-show-branch --more=9 master mybranch\n* [master] Go to sleep\n ! [mybranch] Some work.\n--\n*  [master] Go to sleep\n*+ [mybranch] Some work.\n*  [master~2] Some fun.\n*+ [master~3] Commit message\n*+ [master~4] Initial commit\n$\n\nIn this output, why git doesn't show the merge commit having \"Merged\nmybranch\" commit message?\n\nYet another confusion: \n\n$ git-show-branch master mybranch\n* [master] Go to sleep\n ! [mybranch] Some work.\n--\n*  [master] Go to sleep\n*+ [mybranch] Some work.\n$\n\nWhy does it stop at \"Some work.\" commit? The manual page says: \"Usually\nthe command stops output upon showing the commit that is the common\nancestor of all the branches.\", so I'd expect it should go down to\n\"Commit message\" commit that is the fork point.\n\n$ git --version\ngit version 1.5.3.5.529.ge3d6d\n$\n\n[The version is from today's master, but I tried with git version 1.5.3.4\nas well, and with the same result]\n\n-- \nSergei.\n"},{"id":"58161","messageId":"20071103182224.GA16345@atjola.homenet","threadId":"10623","inReplyTo":"871wb79q80.fsf@osv.gnss.ru","subject":"Re: Strange git-show-branch behavior.","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-11-03T18:22:24Z","receivedAt":"2007-11-03T18:22:24Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2007.11.03 20:46:39 +0300, Sergei Organov wrote:\n> Hello,\n> \n> I need to ask about git-show-branch once again as I really can't\n> understand its behavior myself. Could please anybody either confirm bug(s) in\n> git-show-branch, or explain why does it work this way.\n> \n> Consider its invocation in a toy repository that has total 6 commits, as\n> can be seen from this output:\n> \n> $ git branch\n> * master\n>   mybranch\n> $ git rev-list master mybranch --pretty=oneline\n> e9217caffebd6311073867d410f0c6e46910a13d Go to sleep\n> 5f19837be87493e9b284fe7db03f00f23d006d2e Merged mybranch\n> 2e2a4956db9737faf5f4f296b895500fafab7350 Some fun.\n> 6478a15c48b0a7ce28069310ff5e51f95b250c7c Some work.\n> 48d3660dc2005471c27f1d5b09d334885b612380 Commit message\n> 2c14c05709bde3c1a7bbdd7effbf73a5667fa265 Initial commit\n> $\n> \n> Or, using git-show-branch itself:\n> \n> $ git-show-branch --more=9 master\n> [master] Go to sleep\n> [master^] Merged mybranch\n> [master^^2] Some work.\n> [master~2] Some fun.\n> [master~3] Commit message\n> [master~4] Initial commit\n> $\n> \n> [NOTE: the format of this output contradicts the manual page, but it's\n>  not the topic of this post]\n> \n> Now comes the confusion:\n> \n> $ git-show-branch --more=9 master mybranch\n> * [master] Go to sleep\n>  ! [mybranch] Some work.\n> --\n> *  [master] Go to sleep\n> *+ [mybranch] Some work.\n> *  [master~2] Some fun.\n> *+ [master~3] Commit message\n> *+ [master~4] Initial commit\n> $\n> \n> In this output, why git doesn't show the merge commit having \"Merged\n> mybranch\" commit message?\n\nBecause you didn't pass --sparse.\n\n> \n> Yet another confusion: \n> \n> $ git-show-branch master mybranch\n> * [master] Go to sleep\n>  ! [mybranch] Some work.\n> --\n> *  [master] Go to sleep\n> *+ [mybranch] Some work.\n> $\n> \n> Why does it stop at \"Some work.\" commit? The manual page says: \"Usually\n> the command stops output upon showing the commit that is the common\n> ancestor of all the branches.\", so I'd expect it should go down to\n> \"Commit message\" commit that is the fork point.\n\nCommon ancestor means, that the commit is reachable through all refs.\nLet's take a look at your history:\n\n         .-F-.  mybranch\n        /     \\\n   A---B---C---D---E  master\n\nThere you can see that mybranch can of course reach F, and that master\ncan reach it, too. E -> D -> F. So the output stops at F, not at B.\n\nBjörn\n"},{"id":"58851","messageId":"87bqa583e9.fsf@osv.gnss.ru","threadId":"10623","inReplyTo":"20071103182224.GA16345@atjola.homenet","subject":"Re: Strange git-show-branch behavior.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2007-11-08T09:58:38Z","receivedAt":"2007-11-08T09:58:38Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Björn Steinbrink <B.Steinbrink@gmx.de> writes:\n> On 2007.11.03 20:46:39 +0300, Sergei Organov wrote:\n[...]\n>> $ git-show-branch --more=9 master mybranch\n>> * [master] Go to sleep\n>>  ! [mybranch] Some work.\n>> --\n>> *  [master] Go to sleep\n>> *+ [mybranch] Some work.\n>> *  [master~2] Some fun.\n>> *+ [master~3] Commit message\n>> *+ [master~4] Initial commit\n>> $\n>> \n>> In this output, why git doesn't show the merge commit having \"Merged\n>> mybranch\" commit message?\n>\n> Because you didn't pass --sparse.\n\nWell, therefore, provided I have the following history:\n\n          .-F-.  mybranch\n         /     \\\n    A---B---C---D---E  master\n\nthe 'D' merge commit is reachable only from 'master', so 'D' is not\nshown unless I specify --sparse, right? Rather confusing, I'd say, and\nthe name 'sparse' for the option suggests that the output will have less\nrevisions in the output, not more. I mean I even didn't care to look at\nthe description of --sparse when I first read the manual page in order to\nfind some option to increase number of revs output, while I did look at\nthe --more.\n\nWhat is the rationale for skipping such merge commits by default?\n\nAnyway, courtesy to your explanation, I think I will be able to come\nwith a patch for the 'Documentation/core-tutorial.txt' that seems to\nhave wrong description for one of its examples.\n\n>> \n>> Yet another confusion: \n>> \n>> $ git-show-branch master mybranch\n>> * [master] Go to sleep\n>>  ! [mybranch] Some work.\n>> --\n>> *  [master] Go to sleep\n>> *+ [mybranch] Some work.\n>> $\n>> \n>> Why does it stop at \"Some work.\" commit? The manual page says: \"Usually\n>> the command stops output upon showing the commit that is the common\n>> ancestor of all the branches.\", so I'd expect it should go down to\n>> \"Commit message\" commit that is the fork point.\n>\n> Common ancestor means, that the commit is reachable through all refs.\n> Let's take a look at your history:\n>\n>          .-F-.  mybranch\n>         /     \\\n>    A---B---C---D---E  master\n>\n> There you can see that mybranch can of course reach F, and that master\n> can reach it, too. E -> D -> F. So the output stops at F, not at B.\n\nYou are right, this particular confusion was due to my misunderstanding\nof the term \"common ancestor\".\n\nHowever, shouldn't \"*the* common ancestor\" in the manual be replaced by\n\"*a* common ancestor\"? I mean that according to git-merge-base, there\ncould be multiple common ancestors even for 2 commits, so saying \"*the*\ncommon ancestor\" implies use of particular algorithm to select\n*the* common ancestor among all the possibilities, and therefore I'd\nexpect some explanation of the algorithm being used to get *the* common\nancestor.\n\n-- \nSergei.\n"}]}