Skip to content
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

Clarify the non-incremental nature of tree objects. #1401

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eric-s-raymond
Copy link

The one confirming detail left out of the exposition.

Comment on lines +347 to +350
To be clear clear, the tree object built for a commit references *all* of the files and directories visible at the commit
It does not only reference the content altered from the parent commit.
If the tree object for a commit fails to include a file that was present in its parent commit, that absence is interpreted as deletion of the file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I like the intent here, there's definitely information that was left unspecified.

Let's reword a bit. How about this?

Suggested change
To be clear clear, the tree object built for a commit references *all* of the files and directories visible at the commit
It does not only reference the content altered from the parent commit.
If the tree object for a commit fails to include a file that was present in its parent commit, that absence is interpreted as deletion of the file.
To be clear, a commit's tree structure represents the complete contents of the working directory at that moment in time.
If the parent commit's tree includes a file that is not present in this commit's tree, that absence is interpreted as deletion of the file.

What do you think?

Copy link
Contributor

@ugultopu ugultopu Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To be clear clear, the tree object built for a commit references *all* of the files and directories visible at the commit
It does not only reference the content altered from the parent commit.
If the tree object for a commit fails to include a file that was present in its parent commit, that absence is interpreted as deletion of the file.
To be clear, a commit's tree structure represents the complete contents of the staging area at that moment in time.
If the parent commit's tree includes a file that is not present in this commit's tree, that absence is interpreted as deletion of the file.

I thought a commit is a snapshot of the staging area (as opposed to the working directory). Please correct me if I'm wrong.

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.

None yet

3 participants