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~3Is there a way to name node C, E, F, H, I or J? Is A also called rev~0?