{"thread":{"id":"43349","subject":"Re: git-rev-list: --objects list inconsistency","startedAt":"2006-11-14T15:54:17Z","lastAt":"2006-11-14T18:26:46Z","messageCount":3,"participants":["Junio C Hamano","Johannes Sixt","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"294772","messageId":"4559E6A9.9A30A236@eudaptics.com","threadId":"43349","inReplyTo":null,"subject":"git-rev-list: --objects list inconsistency","fromName":"Johannes Sixt","fromEmail":"j.sixt@eudaptics.com","sentAt":"2006-11-14T15:54:17Z","receivedAt":"2006-11-14T15:54:17Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"I observed a puzzling behavior of git-rev-list:\n\n$ git-rev-list master^^..master \nf3364ca9405e17772fecea1d06c40b9965b8e6e4\nbb3bfda219a85d2d49e62c261b9c8f6795ebdc22\n$ git-rev-list --max-count=2 master \nf3364ca9405e17772fecea1d06c40b9965b8e6e4\nbb3bfda219a85d2d49e62c261b9c8f6795ebdc22\n$ git-rev-list --objects master^^..master |wc -l\n     10\n$ git-rev-list --objects --max-count=2 master |wc -l\n   2376\n\nAs you can see, without --objects, master^^..master and --max-count=2\nlist the same two commits.\n\nBut with --objects I get different object lists. I don't even know which\none is the one to expect, but I certainly would not have expected the\nlists to be different. What's wrong here?\n\nBTW, the objects listed with --objects --max-count=2 are basically the\nentire tree at master plus the few objects that changed since master^^.\n\n$ git --version\ngit version 1.4.4.rc2.gc8641\n\n-- Hannes\n"},{"id":"294440","messageId":"7vlkmdzz9v.fsf@assigned-by-dhcp.cox.net","threadId":"43349","inReplyTo":"4559E6A9.9A30A236@eudaptics.com","subject":"Re: git-rev-list: --objects list inconsistency","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-14T17:58:04Z","receivedAt":"2006-11-14T17:58:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <J.Sixt@eudaptics.com> writes:\n\n> I observed a puzzling behavior of git-rev-list:\n>\n> $ git-rev-list master^^..master \n> f3364ca9405e17772fecea1d06c40b9965b8e6e4\n> bb3bfda219a85d2d49e62c261b9c8f6795ebdc22\n> $ git-rev-list --max-count=2 master \n> f3364ca9405e17772fecea1d06c40b9965b8e6e4\n> bb3bfda219a85d2d49e62c261b9c8f6795ebdc22\n> $ git-rev-list --objects master^^..master |wc -l\n>      10\n\nYou are asking to get objects reachable from master but exclude\nobjects reachable from master^^.\n\n> $ git-rev-list --objects --max-count=2 master |wc -l\n>    2376\n\nYou are asking to get objects reachable from master and master^.\n\nYou have 2300+ objects that are common in trees of master,\nmaster^ and master^^.\n"},{"id":"298618","messageId":"Pine.LNX.4.64.0611141020480.3327@woody.osdl.org","threadId":"43349","inReplyTo":"4559E6A9.9A30A236@eudaptics.com","subject":"Re: git-rev-list: --objects list inconsistency","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-11-14T18:26:46Z","receivedAt":"2006-11-14T18:26:46Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 14 Nov 2006, Johannes Sixt wrote:\n> \n> As you can see, without --objects, master^^..master and --max-count=2\n> list the same two commits.\n\n\"--max-count=X\" and \"master^^..master\" are two TOTALLY different things.\n\nThe fact that they happened to give the same results without \"--objects\" \nis a random thing, and not at all guaranteed. For example, if \"master\" (or \nits parent) had been a merge, it probably wouldn't have given the same \nresult even _without_ \"--objects\".\n\n> But with --objects I get different object lists. I don't even know which\n> one is the one to expect, but I certainly would not have expected the\n> lists to be different. What's wrong here?\n\nNothing is wrong. You're asking for two totally different things.\n\nWith \"--max-count=2\", you're saying \"I want the first two commits\", and \nthen the \"--objects\" part extends that to all the other object types too.\n\nSo you get two commits _and_ every single object reachable from those two \ncommits.\n\nIn contrast, with \"master^^..master\", you're saying \"I want everything \nthat is reachable from \"master\", but _not_ reachable from it's \ngrand-parent. And the \"--objects\" flag extends that to all the other \nobject types too.\n\nSo you get (in this case) two commits _and_ all the objects that are \nreachable from those two commits but that are _not_ reachable from the \ngrandparent.\n\nThat's a totally different thing, obviously. There's likely to be a lot of \nobjects in common between \"master\" and its grandparent, and you literally \nasked to not be shown those objects. In the first case, you didn't ask for \nthe exclusion of the grandparent.\n\nSo you should expect a big difference in almost all cases. In one case, \nyou ask for an exclusion, in the other case, you just say \"just the first \ntwo commits, please\". Not at all equivalent.\n\n"}]}