{"thread":{"id":"1240","subject":"Getting list of changed objects...","startedAt":"2005-07-14T17:58:27Z","lastAt":"2005-07-14T20:20:17Z","messageCount":3,"participants":["James Ketrenos","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"6139","messageId":"Pine.LNX.4.58.0507141053540.19183@g5.osdl.org","threadId":"1240","inReplyTo":"42D6ACF0.30303@linux.intel.com","subject":"Re: Getting list of changed objects...","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-14T17:58:27Z","receivedAt":"2005-07-14T17:58:27Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 14 Jul 2005, James Ketrenos wrote:\n> \n> The problem is that if I run:\n> \n>   git-rev-list --objects B ^C\n> \n> It shows me all of the tree and commit objects but also gives a \n> list of all of the files that changed between A and C as if they \n> are needed to move C to B.\n\nSince you haven't merged A and B in the above, they _are_ needed, aren't \nthey?\n\nMaybe what you want is \n\n\tgit-rev-list --objects B ^A ^C\n\nie \"objects that are in B, but not in A or in C\", since you seem to \nconsider A uninteresting too?\n\nI don't actually understand what you want to do, and also, \"git-rev-list\n--objects\" is actually not 100% careful - it can include objects that are\nin the \"not\" group, just because it doesn't actually bother to do a full\nnegative list (it only creates a negative list for the \"boundary\" objects,\nbut it won't even do \"mark_tree_uninteresting()\" for commits that it has\ndecided cannot be meaningful, so it's not in any way guaranteed to be a\n_minimal_ set of objects).\n\n\t\t\tLinus\n"},{"id":"6138","messageId":"42D6ACF0.30303@linux.intel.com","threadId":"1240","inReplyTo":null,"subject":"Getting list of changed objects...","fromName":"James Ketrenos","fromEmail":"jketreno@linux.intel.com","sentAt":"2005-07-14T18:20:32Z","receivedAt":"2005-07-14T18:20:32Z","isPatch":false,"sender":{"key":"jketreno@linux.intel.com","avatar":"https://gravatar.com/avatar/f4a487ad53c70943ed10ba220390cc7a004e4ba617c962bc4b7afcbd2bc08cc7?d=mp&s=160"},"body":"\nI have the following tree path:\n\n  A   C   B\n  |   |\n  | 3.|<--.   \n  |   |   |\n2.|-->'   |\n  |       |\n1.|------>'\n  |\n\nWhere A is the root repository for my overlays.  B was created by \ncloning A (1)\n\nB is where development has been progressing.  Finding the set of \nobjects to move from A to B is easily obtained via:\n\n  git-rev-list --objects B ^A \n\nThe problem is now when I want to re-sync B with the latest version \nof A.  What I currently do is:\n\nCreate a new C tree based on latest A (2) and then merge B back into \nit (3):\n\n  git-merge-tree -m $(git-merge-base C B) C B\n\nThat works great.  I now have a tree with all of the latest A code\nand the B changes applied.  The problem is now in getting the list\nof objects to create the overlay repository.\n\n  cg-log -f -r C:B\n\nWill correctly show only those files that have actually changed \nbetween C and B in the first log entry.  However, cg-log does \nnot show me the list of tree objects that have changed between \nC and B.  \n\nThe problem is that if I run:\n\n  git-rev-list --objects B ^C\n\nIt shows me all of the tree and commit objects but also gives a \nlist of all of the files that changed between A and C as if they \nare needed to move C to B.\n\nAm I overlooking something, misusing things, or ?\n\nThanks,\nJames\n"},{"id":"6143","messageId":"42D6C901.2060409@linux.intel.com","threadId":"1240","inReplyTo":"Pine.LNX.4.58.0507141053540.19183@g5.osdl.org","subject":"Re: Getting list of changed objects...","fromName":"James Ketrenos","fromEmail":"jketreno@linux.intel.com","sentAt":"2005-07-14T20:20:17Z","receivedAt":"2005-07-14T20:20:17Z","isPatch":false,"sender":{"key":"jketreno@linux.intel.com","avatar":"https://gravatar.com/avatar/f4a487ad53c70943ed10ba220390cc7a004e4ba617c962bc4b7afcbd2bc08cc7?d=mp&s=160"},"body":"Linus Torvalds wrote:\n\n>Since you haven't merged A and B in the above, they _are_ needed, aren't \n>they?\n>  \n>\nMy original email wasn't worded quite right.  I think you are tracking\nwhat I'm trying to do... but here is a different view anyway:\n\ntime\n      |\n1     A ------->  B  clone A to B\n2     |           |  make changes on B and A\n3     | --> C     |  clone A to C\n4     |     | <---'  merge B into C\n5     |     |\n      A     C\n\nI am merging B (as it was at time 3, or B3) into C (as it was at time 3,\nor C3) via:\n\n    git-read-tree -m $(git-merge-base B3 C3) C3 B3\n\nwhere $(git-merge-base B3 C3) resolves to A1.  After I run git-read-tree,\nI resolve any conflicts via git-merge-cache, etc. and write the\ntree via git-write-tree.\n\n>Maybe what you want is \n>\n>\tgit-rev-list --objects B ^A ^C\n>\n>ie \"objects that are in B, but not in A or in C\", since you seem to \n>consider A uninteresting too?\n>  \n>\nThat does seem to work here by doing:\n\n    git-rev-list --objects C5 ^C3 ^$(git-merge-base C3 B3)\n\n>, and also, \"git-rev-list\n>--objects\" is actually not 100% careful - it can include objects that are\n>in the \"not\" group, just because it doesn't actually bother to do a full\n>negative list (it only creates a negative list for the \"boundary\" objects,\n>but it won't even do \"mark_tree_uninteresting()\" for commits that it has\n>decided cannot be meaningful, so it's not in any way guaranteed to be a\n>_minimal_ set of objects).\n>  \n>\nGood to know.  If git-rev-list is just checking the boundary, and the merge\ncommit is between C5 and C3 (at C4) then that explains why I see what I\nsee.  It would grab all the objects listed in C4 and not exhuaustively be\nremoving them via one of its ancestors.\n\nThe goal is to create the list of objects (tree, commit, and blob)\nrequired such\nthat if someone already has all the objects for repo A, they just need to\ndownload the 'in C, not in A' objects and the HEAD from C and then they can\ncreate a full copy of C.\n\nI'll look to modify my scripts that merge the parent repository to cache\nthe parent\nrepository's SHA.  I can then pass that list of merge points to\nget-rev-list as a\nset of boundaries.\n\nThanks,\nJames\n"}]}