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

Re: Yet another Git tutorial

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2008, 00:17 UTC
Message-ID
<7vskx5a519.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<2D3D2E55-74C7-4373-BC22-9CF4C26C197D@newartisans.com>

Page #5; after teaching "cat-file -t" it would make sense to teach "cat-file blob" to view what was stored.

Page #5; likewise, "cat-file -t HEAD" to inspect and "cat-file commit HEAD" to show its contents would be a much better "bottom-up" way to show how the pieces fit together, instead of doing "show --pretty=format:%T".

Page #6; "HEAD tag"???

Page #6; s/my system/my repository/, as you use that word a few lines later.

You use "id", "hash id", "hash number", "hash" etc. and have your readers guess that you are talking about the same thing. It would be better to use a single word consistently (the official name of this number is the "object name").

s/index cache/the index/.
s/tree owns blob/tree holds blob/, perhaps.

Page #9; before this point, your tree owned blobs but now suddenly it references trees and blobs. There should be a mention of this recursive construction of a tree earlier soon after you introduced the tree objects.

Page #11: s/name:file/name:path/; notice that it can be non-files such as symlinks and trees.

Page #12: s/name{tree}/name^{tree}/.

Page #12: name1..name2; "between name1 and name2, inclusive"? This excludes the left end. "Everything reachable from name2 except the ones reachable from name1".

Page #12: name1...name2. This is a symmetric difference for "git log" family of commands (iow when you talk about set of commits) which means "Reachable either from name1 or name2 but not from both". When used with "git diff" to name two endpoints, this means what you described (differences since the common ancestor of these two to name2).

Page #12: master..; it would also be useful to mention ..other here.

Page #17: The example makes me wonder what you did exactly to commit I. It would contain roughly an equivalent of squashed B+C together, which may or may not be what you want.

Page #18: There is no "two different things" reason behind the name. It was originally called "directory cache" and then renamed to "the index". These days, most of the time we use these two words interchangeably, but when we are picky, index tends to mean the file on the filesystem (i.e. $GIT_INDEX_FILE aka $GIT_DIR/index) while cache tends to mean the in-core structure (i.e. the_index.cache aka active_cache).

Page #22: "git reset --mixed" will remove blobs??? You surely did not mean that. It just reverts the staged contents to that of the HEAD (or whichever commit you named and moved your HEAD to).

Page #24: saves your work in the stash "for the current branch"??? There is no per-branch stash. You can stash, switch branches and then apply the stashed change to the other branch.

Previous: Junio C HamanoNext: Matt Graham
Message 11 of 14 in “Yet another Git tutorial”
  1. John WiegleyApr 28, 2008
  2. Johan HerlandApr 28, 2008
  3. John WiegleyApr 28, 2008
  4. Jeff KingApr 28, 2008
  5. Brian GernhardtApr 28, 2008
  6. Paolo BonziniApr 28, 2008
  7. Brian GernhardtApr 28, 2008
  8. Bob HiestandApr 28, 2008
  9. Dmitry PotapovApr 28, 2008
  10. Junio C HamanoApr 28, 2008
  11. Junio C HamanoApr 29, 2008
  12. Matt GrahamApr 29, 2008
  13. John WiegleyApr 30, 2008
  14. Robert HainesApr 30, 2008

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.