git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Some ASCII Art

From
Jon Loeliger <jdl@freescale.com>
Date
Oct 6, 2005, 18:05 UTC
Message-ID
<1128621923.29904.30.camel@cashmere.sps.mot.com>
Guys,

I tend to be a visual learner. So I made up some ASCII art and annotated it with some Git operations and stuff.

First, I'd love to have any feedback on these drawings, especially if it actually misrepresents things. If there are obvious additions to these, that'd be nice to know too.

Second, if you think they are generally useful, please feel free to add them to whatever documentation seems appropriate. (If you want a patch to a certain file and a Sign-Off, let me know!)

Thanks, jdl

Fundamental Git Index Operations ================================

                    +-----------+
                    | Object DB |
                    |  Backing  |
                    |   Store   |
                    +-----------+
                       ^
           write-tree  |     |
             tree obj  |     |
                       |     |  read-tree
                       |     |  tree obj
                             V
                    +-----------+
                    |   Index   |
                    |  "cache"  |
                    +-----------+
                       ^
         update-index  |     |
             blob obj  |     |
                       |     |  checkout-index
                       |     |  blob obj
                             V
                    +-----------+
                    |  Working  |
                    | Directory |
                    +-----------+

Git Index Operations ====================

                    +-----------+
                    | Object DB |
                    |  Backing  |
                    |   Store   | -----------+
                    +-----------+            |
                       ^                     |
          commit-tree  |     |               |
           commit obj  |     | read-tree -m  |
                       |     | tree obj      |
                       |     |               |
                             V               |
                    +-----------+            |
                    |   Index   | <- - - - - +
                    |  "cache"  | - - - - - >+
                    +-----------+            |
                       ^                     |
                       |                     |
         update-index  |     read-tree -m -u |
             blob obj  |            tree obj |
                       |                     |
                                             |
                    +-----------+            |
                    |  Working  |<-----------+
                    | Directory |
                    +-----------+

Git Diff Types ==============

                      diff-tree
                       +----+
                       |    |
                       |    |
                       V    V
                    +-----------+
                    | Object DB |
                    |  Backing  |
                    |   Store   |
                    +-----------+
                      ^    ^
                      |    |
                      |    |  diff-index --cached
                      |    |
          diff-index  |    V
                      |  +-----------+
                      |  |   Index   |
                      |  |  "cache"  |
                      |  +-----------+
                      |    ^
                      |    |
                      |    |  diff-files
                      |    |
                      V    V
                    +-----------+
                    |  Working  |
                    | Directory |
                    +-----------+

Commit DAG Revision Naming ==========================

Both node B and C are a commit parents of node A.
    G   H   I   J
     \ /     \ /
      D   E   F
       \  |  /
        \ | /
         \|/
          B     C
           \   /
            \ /
             A
    A = rev    = rev^0
    B = rev^   = rev^1     = rev~1
    D = rev^^  = rev^1^1   = rev~2
    G = rev^^^ = rev^1^1^1 = rev~3

Is there a way to name node C, E, F, H, I or J? Is A also called rev~0?

Next: Junio C Hamano
Message 1 of 4 in “Some ASCII Art”
  1. Jon LoeligerOct 6, 2005
  2. Junio C HamanoOct 6, 2005
  3. Jon LoeligerOct 7, 2005
  4. Junio C HamanoOct 7, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.