{"thread":{"id":"42386","subject":"Confusing --graph --all output with detached branches","startedAt":"2016-05-19T13:45:46Z","lastAt":"2016-05-23T21:18:31Z","messageCount":4,"participants":["Bjørnar Snoksrud","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"286980","messageId":"CA+cck7FPzK-zccBVzphY_N41acOvqjwmDmgQH7ZE3SHG2k1rFw@mail.gmail.com","threadId":"42386","inReplyTo":null,"subject":"Confusing --graph --all output with detached branches","fromName":"Bjørnar Snoksrud","fromEmail":"snoksrud@gmail.com","sentAt":"2016-05-19T13:45:46Z","receivedAt":"2016-05-19T13:45:46Z","isPatch":false,"sender":{"key":"snoksrud@gmail.com","avatar":"https://gravatar.com/avatar/bd7f988a0a0941712c4bb875eb852d6038a15a6e18cb4dc880ba8f6d8c4040fd?d=mp&s=160"},"body":"If you end up with a history containing commit A with parent B, where\na detached branch is merged into A while an unrelated branch branches\noff of B, you will get the following output:\n\n$ git log --graph --all\n*   commit ff4265fcbfe94a2abe93c97d86e0d9f0e0a136cb\n|\\  Merge: 8b62de9 0bbc311\n| | Author: XXX\n| | Date:   Thu May 19 15:31:46 2016 +0200\n| |\n| |     Merge branch 'bar'\n| |\n| * commit 0bbc3115caa089d8578eb52ba6c12c1b43153dad\n| | Author: XXX\n| | Date:   Thu May 19 15:31:40 2016 +0200\n| |\n| |     5\n| |\n| * commit b1c9c491a05d9ffeca2e1d7b5cbd392cd90eef82\n|   Author: XXX\n|   Date:   Thu May 19 15:31:39 2016 +0200\n|\n|       4\n|\n| * commit ce053f92a9290f5472aac3319ddadbaf5bf62371\n|/  Author: XXX\n|   Date:   Thu May 19 15:31:31 2016 +0200\n|\n|       3\n|\n* commit 8b62de9f421c0be46300a3e68f85c6e7608c24f6\n| Author: XXX\n| Date:   Thu May 19 15:31:02 2016 +0200\n|\n|     2\n|\n* commit cb7e7e2662f1477f030a889cab135ed5a19ba43e\n  Author: XXX\n  Date:   Thu May 19 15:31:00 2016 +0200\n\n      1\n\n-\n\nWhich is pretty informative  - after '2' we branched out for commit 3,\nand the branch containing 4 and 5 was merged into master.\n\nHowever, if you use the pretty common `one line` git log alias, you get this:\n\n*   ff4265f  (HEAD -> master) Merge branch 'bar'\n|\\\n| * 0bbc311  (bar) 5\n| * b1c9c49  4\n| * ce053f9  (foo) 3\n|/\n* 8b62de9  2\n* cb7e7e2  1\n\n.. which indicates that `foo` is contained within `bar`. Maybe\n\n*   ff4265f  (HEAD -> master) Merge branch 'bar'\n|\\\n| * 0bbc311  (bar) 5\n| * b1c9c49  4\n|\n| * ce053f9  (foo) 3\n|/\n* 8b62de9  2\n* cb7e7e2  1\n\n.. would be better?\n\nReproduction steps:\n\ngit init\ngit commit --allow-empty -m 1\ngit commit --allow-empty -m 2\ngit checkout --branch foo\ngit checkout -b foo\ngit commit --allow-empty -m 3\ngit checkout --orphan bar\ngit commit --allow-empty -m 4\ngit commit --allow-empty -m 5\ngit checkout master\ngit merge bar -m merge\ngit log --graph --all  --pretty=format:'%Cred%h %C(yellow)%-d%Creset %s '\n\n\n-- \nbjornar@snoksrud.no\n"},{"id":"289392","messageId":"xmqqzirmoz38.fsf@gitster.mtv.corp.google.com","threadId":"42386","inReplyTo":"CA+cck7FPzK-zccBVzphY_N41acOvqjwmDmgQH7ZE3SHG2k1rFw@mail.gmail.com","subject":"Re: Confusing --graph --all output with detached branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-19T15:18:51Z","receivedAt":"2016-05-19T15:18:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":""},{"id":"286988","messageId":"xmqqvb2aoz13.fsf@gitster.mtv.corp.google.com","threadId":"42386","inReplyTo":"CA+cck7FPzK-zccBVzphY_N41acOvqjwmDmgQH7ZE3SHG2k1rFw@mail.gmail.com","subject":"Re: Confusing --graph --all output with detached branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-19T15:20:08Z","receivedAt":"2016-05-19T15:20:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bjørnar Snoksrud <snoksrud@gmail.com> writes:\n\n> .. which indicates that `foo` is contained within `bar`. Maybe\n>\n> *   ff4265f  (HEAD -> master) Merge branch 'bar'\n> |\\\n> | * 0bbc311  (bar) 5\n> | * b1c9c49  4\n> |\n> | * ce053f9  (foo) 3\n> |/\n> * 8b62de9  2\n> * cb7e7e2  1\n>\n> .. would be better?\n>\n\nYes, it would be.\n"},{"id":"287313","messageId":"xmqqa8jg8od4.fsf@gitster.mtv.corp.google.com","threadId":"42386","inReplyTo":"xmqqvb2aoz13.fsf@gitster.mtv.corp.google.com","subject":"Re: Confusing --graph --all output with detached branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-23T21:18:31Z","receivedAt":"2016-05-23T21:18:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Bjørnar Snoksrud <snoksrud@gmail.com> writes:\n>\n>> .. which indicates that `foo` is contained within `bar`. Maybe\n>>\n>> *   ff4265f  (HEAD -> master) Merge branch 'bar'\n>> |\\\n>> | * 0bbc311  (bar) 5\n>> | * b1c9c49  4\n>> |\n>> | * ce053f9  (foo) 3\n>> |/\n>> * 8b62de9  2\n>> * cb7e7e2  1\n>>\n>> .. would be better?\n>\n> Yes, it would be.\n\nAnother possibility would be to shift the columns between 4 and 3.\n"}]}