{"thread":{"id":"2033","subject":"Some ASCII Art","startedAt":"2005-10-06T18:05:24Z","lastAt":"2005-10-07T19:42:52Z","messageCount":4,"participants":["Jon Loeliger","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"9770","messageId":"1128621923.29904.30.camel@cashmere.sps.mot.com","threadId":"2033","inReplyTo":null,"subject":"Some ASCII Art","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2005-10-06T18:05:24Z","receivedAt":"2005-10-06T18:05:24Z","isPatch":false,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"Guys,\n\nI tend to be a visual learner.  So I made up some ASCII\nart and annotated it with some Git operations and stuff.\n\nFirst, I'd love to have any feedback on these drawings,\nespecially if it actually misrepresents things.  If there\nare obvious additions to these, that'd be nice to know too.\n\nSecond, if you think they are generally useful, please\nfeel free to add them to whatever documentation seems\nappropriate.  (If you want a patch to a certain file\nand a Sign-Off, let me know!)\n\nThanks,\njdl\n\n\nFundamental Git Index Operations\n================================\n\n                    +-----------+\n                    | Object DB |\n                    |  Backing  |\n                    |   Store   |\n                    +-----------+\n                       ^\n           write-tree  |     |\n             tree obj  |     |\n                       |     |  read-tree\n                       |     |  tree obj\n                             V\n                    +-----------+\n                    |   Index   |\n                    |  \"cache\"  |\n                    +-----------+\n                       ^\n         update-index  |     |\n             blob obj  |     |\n                       |     |  checkout-index\n                       |     |  blob obj\n                             V\n                    +-----------+\n                    |  Working  |\n                    | Directory |\n                    +-----------+\n\n\nGit Index Operations\n====================\n\n\n                    +-----------+\n                    | Object DB |\n                    |  Backing  |\n                    |   Store   | -----------+\n                    +-----------+            |\n                       ^                     |\n          commit-tree  |     |               |\n           commit obj  |     | read-tree -m  |\n                       |     | tree obj      |\n                       |     |               |\n                             V               |\n                    +-----------+            |\n                    |   Index   | <- - - - - +\n                    |  \"cache\"  | - - - - - >+\n                    +-----------+            |\n                       ^                     |\n                       |                     |\n         update-index  |     read-tree -m -u |\n             blob obj  |            tree obj |\n                       |                     |\n                                             |\n                    +-----------+            |\n                    |  Working  |<-----------+\n                    | Directory |\n                    +-----------+\n\n\n\nGit Diff Types\n==============\n\n\n                      diff-tree\n\n                       +----+\n                       |    |\n                       |    |\n                       V    V\n                    +-----------+\n                    | Object DB |\n                    |  Backing  |\n                    |   Store   |\n                    +-----------+\n                      ^    ^\n                      |    |\n                      |    |  diff-index --cached\n                      |    |\n          diff-index  |    V\n                      |  +-----------+\n                      |  |   Index   |\n                      |  |  \"cache\"  |\n                      |  +-----------+\n                      |    ^\n                      |    |\n                      |    |  diff-files\n                      |    |\n                      V    V\n                    +-----------+\n                    |  Working  |\n                    | Directory |\n                    +-----------+\n\n\nCommit DAG Revision Naming\n==========================\n\nBoth node B and C are a commit parents of node A.\n\n    G   H   I   J\n     \\ /     \\ /\n      D   E   F\n       \\  |  /\n        \\ | /\n         \\|/\n          B     C\n           \\   /\n            \\ /\n             A\n\n\n    A = rev    = rev^0\n    B = rev^   = rev^1     = rev~1\n    D = rev^^  = rev^1^1   = rev~2\n    G = rev^^^ = rev^1^1^1 = rev~3\n\nIs there a way to name node C, E, F, H, I or J?\nIs A also called rev~0?\n"},{"id":"9777","messageId":"7v8xx67559.fsf@assigned-by-dhcp.cox.net","threadId":"2033","inReplyTo":"1128621923.29904.30.camel@cashmere.sps.mot.com","subject":"Re: Some ASCII Art","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-06T20:38:10Z","receivedAt":"2005-10-06T20:38:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jon Loeliger <jdl@freescale.com> writes:\n\n> Fundamental Git Index Operations\n> Git Index Operations\n\nThese two look almost the same.\n\nI find the label \"commit-tree\" on index -> odb in the second\npicture a bit misleading.  \"commit-tree\" takes a tree and zero\nor more commit objects to create a new commit object, so it\nworks solely inside odb.\n\nIt is good that you mention that \"read-tree -u\" form updates\nworking tree in the second picture.  In the same spirit, you\nmight also want to mention that \"checkout-index -u\" updates the\nindex (i.e. matches the stat information) in the same picture.\n\nDiff drawing looks good.  If you are aiming for completeness,\ndiff-stages is lacking -- it compares between stages in the\nindex file.  But diff-stages is really a specialized operation\nwhose usefulness is still unproven, so not drawing it for the\nsake of simplicity is also OK.\n\n> Commit DAG Revision Naming\n> ==========================\n>\n> Both node B and C are a commit parents of node A.\n\nI assume that parents are left to right in this picture, that\nis, B's first parent is D, second E, and third F.\n\n>\n>     G   H   I   J\n>      \\ /     \\ /\n>       D   E   F\n>        \\  |  /\n>         \\ | /\n>          \\|/\n>           B     C\n>            \\   /\n>             \\ /\n>              A\n>\n>\n>     A = rev    = rev^0\n>     B = rev^   = rev^1     = rev~1\n>     D = rev^^  = rev^1^1   = rev~2\n>     G = rev^^^ = rev^1^1^1 = rev~3\n\n> Is there a way to name node C, E, F, H, I or J?\n\nC = A^2\nE = B^2 = A^^2\nF = B^3 = A^^3\nH = D^2 = B^^2 = A^^^2 = A~2^2\nI = F^ = B^3^ = A^^3^\nJ = F^2 = B^3^2 = A^^3^2\n\nThey look like line noise ;-)\n\n> Is A also called rev~0?\n\nIf you are talking about only commit objects, then REV^0 is\nalways the same as REV.  You could write REV^0^0^0^0 if you\nwant but that is rather pointless ;-).\n"},{"id":"9805","messageId":"1128713749.29904.84.camel@cashmere.sps.mot.com","threadId":"2033","inReplyTo":"7v8xx67559.fsf@assigned-by-dhcp.cox.net","subject":"Re: Some ASCII Art","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2005-10-07T19:35:50Z","receivedAt":"2005-10-07T19:35:50Z","isPatch":false,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Thu, 2005-10-06 at 15:38, Junio C Hamano wrote:\n> Jon Loeliger <jdl@freescale.com> writes:\n> \n> > Fundamental Git Index Operations\n> > Git Index Operations\n> \n> These two look almost the same.\n\nYeah, the first one was intended to capture the\noperations discussed the first four points of the\n\"The Workflow\" section of the main Git doc page.\n\nThe second is \"more of same\", but the one picture with\nevery ASCII arc on it was getting confusing and crowded.\n\n> I find the label \"commit-tree\" on index -> odb in the second\n> picture a bit misleading.  \"commit-tree\" takes a tree and zero\n> or more commit objects to create a new commit object, so it\n> works solely inside odb.\n\nAh!  Of course.  Thanks!\n\n> It is good that you mention that \"read-tree -u\" form updates\n> working tree in the second picture.\n\nDiscovering how this related was a key insight for me. :-)\n\n>   In the same spirit, you\n> might also want to mention that \"checkout-index -u\" updates the\n> index (i.e. matches the stat information) in the same picture.\n\nOoh.  Yes!  Good idea.\n\n\n> > Commit DAG Revision Naming\n> > ==========================\n> >\n> > Both node B and C are a commit parents of node A.\n> \n> I assume that parents are left to right in this picture, that\n> is, B's first parent is D, second E, and third F.\n\nYeah, I even meant to add that sentence before\nsending the mail. \n\n> > Is there a way to name node C, E, F, H, I or J?\n> \n> C = A^2\n> E = B^2 = A^^2\n> F = B^3 = A^^3\n> H = D^2 = B^^2 = A^^^2 = A~2^2\n> I = F^ = B^3^ = A^^3^\n> J = F^2 = B^3^2 = A^^3^2\n\nAh!\n\n> They look like line noise ;-)\n\nIndeed. :-)\n\nWould it be a useful option to git-show-branch\nthat would state the commit SHA1s as well?\n\n    % git show-branch --show-revs\n\n    * [master] Merge paul's branch\n     ! [origin] Fix drm 'debug' sysfs permissions\n      ! [paul] powerpc: Fix idle.c compile warning\n    ---\n    +   [06a41091c93e529e6cef68ba60deeb1b9ceabc7f] Merge paul's branch\n    + + [05f62a5c049845eab8dfb3aeda55c18a2d4396e3] powerpc: Fix idle.c compile warning\n    + + [c16ff7e44883afc05cbf6fde0e6913bb10c66885] powerpc: Define a _sdata symbol\n    + + [8dad3f9257414f151cd821bfe01f54d7f52d2507] powerpc: Merge traps.c a bit more\n    + + [b3491269f5604e4265ee2f27b47a76ce1e3678b6] powerpc: Use the merged of_device.c with ARCH=powerpc\n\n\nThanks for your feedback!\n\njdl\n"},{"id":"9807","messageId":"7vk6gpyuyr.fsf@assigned-by-dhcp.cox.net","threadId":"2033","inReplyTo":"1128713749.29904.84.camel@cashmere.sps.mot.com","subject":"Re: Some ASCII Art","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-07T19:42:52Z","receivedAt":"2005-10-07T19:42:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jon Loeliger <jdl@freescale.com> writes:\n\n> Would it be a useful option to git-show-branch\n> that would state the commit SHA1s as well?\n>\n>     % git show-branch --show-revs\n>\n>     * [master] Merge paul's branch\n>      ! [origin] Fix drm 'debug' sysfs permissions\n>       ! [paul] powerpc: Fix idle.c compile warning\n>     ---\n>     +   [06a41091c93e529e6cef68ba60deeb1b9ceabc7f] Merge paul's branch\n>     + + [05f62a5c049845eab8dfb3aeda55c18a2d4396e3] powerpc: Fix idle.c compile warning\n>     + + [c16ff7e44883afc05cbf6fde0e6913bb10c66885] powerpc: Define a _sdata symbol\n>     + + [8dad3f9257414f151cd821bfe01f54d7f52d2507] powerpc: Merge traps.c a bit more\n>     + + [b3491269f5604e4265ee2f27b47a76ce1e3678b6] powerpc: Use the merged of_device.c with ARCH=powerpc\n\nIn practice, probably 30 or so bits prefix would identify an\nobject uniquely within a repository, so one possibility is to\nuse the first 7 or so letters from 40-byte SHA1, after making\nsure 7 is enough for that particular prefix -- otherwise use\nmore for that particular object.\n\nThe current \"relative to the head\" notation is descriptive and\neasier to see when you do not have too many branches and complex\nmerge structure but one major drawback is that it is not stable;\nyou add a commit then what was used to be master~5 now suddenly\nbecome master~6.\n"}]}