Skip to content

Clarify tree object example not a continuation of previous examples #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2021

Conversation

excalamus
Copy link

@excalamus excalamus commented Mar 10, 2021

Changes

Alert readers who are following along in the shell that the next example does not use the repository that was just created.

Context

Section 10.2: Git Objects begins with creating a new repository and explaining how blobs are added to it. The active voice used throughout that section implies it is expected for readers to be following along within their own shell. The next section, 10.2: Tree Objects, begins with an example which is not related to the previous examples. The current wording is "most recent tree in a project may look something like this". However, the project created in the previous section is a not a valid interpretation of "a project"; it does not yet have a tree. As a result, readers may enter the command given into their shell and produce an unexpected result:

git cat-file -p master^^{tree}
fatal: Not a valid object name master^{tree}

The topic has just been introduced, so the reader has no understanding from which to make sense of the error. Was it something they did? Is it something else? There is no way for them to know without already understanding the section.

Since the section then continues to use the previously created repository, it seems appropriate to alert readers of the exception in the first example.

This problem has been encountered previously in #421 (fixes #421)

@ben
Copy link
Member

ben commented Jun 16, 2021

✨ Thanks!

@ben ben merged commit 6a19f03 into progit:master Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

git cat-file -p master^{tree}
2 participants