8000 Commit hashes are wrong in Git Internals chapter · Issue #1423 · progit/progit2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit hashes are wrong in Git Internals chapter #1423

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

Closed
Smaug123 opened this issue May 3, 2020 · 1 comment
Closed

Commit hashes are wrong in Git Internals chapter #1423

Smaug123 opened this issue May 3, 2020 · 1 comment

Comments

@Smaug123
Copy link
Contributor
Smaug123 commented May 3, 2020

Which version of the book is affected?
All versions since 4f55250

Describe the bug:

An update changed commit messages without correspondingly changing the commit hashes in the walkthroughs of how to create a commit and so on (Chapter 10).

Steps to reproduce:

export GIT_AUTHOR_DATE="2009-05-22T18:09:34+00:00-0700" \
export GIT_AUTHOR_EMAIL="schacon@gmail.com" \
export GIT_AUTHOR_NAME="Scott Chacon" \
export GIT_COMMITTER_DATE="2009-05-22T18:09:34+00:00-0700" \
export GIT_COMMITTER_EMAIL="schacon@gmail.com" \
export GIT_COMMITTER_NAME="Scott Chacon"

Then follow the instructions in the book, chapter 10.2 onwards.

Expected behavior:
The commit hashes to match the book. In fact they don't; commit 1 is 70d4408b5020e81d19906d6abdd87a73233ebf34, commit 2 is 1513b13a72f5277252cfce4ed0eda0620aca2f6a; commit 3 is 95cce637b4e889eee8042515db402128bd62c0d2.

I am doing this with git version 2.26.1, but I don't think this has changed ever.

Additional context:
I raised #1422 before realising that this was an annoying amount of work to update the diagrams and the rest of the chapter.

I then tried to simply back out the rogue part of the bad commit, but while this fixed commit 1, I got a different hash again for commit 2:

➜ echo 'second commit' | git commit-tree 0155eb -p fdf4fc3
bd9c476d4e5b95299f01fd2c711a7d23c7a00c6b
➜ git cat-file -p bd9c476d4e5b95299f01fd2c711a7d23c7a00c6b
tree 0155eb4229851634a0f03eb265b69f5a2d56f341
parent fdf4fc3344e67ab068f836878b6c4951e3b15f3d
author Scott Chacon <schacon@gmail.com> 1243040974 -0700
committer Scott Chacon <schacon@gmail.com> 1243040974 -0700

second commit                                  
@Smaug123
Copy link
Contributor Author
Smaug123 commented May 8, 2020

"Fixed" in the sense that we now warn the reader that these commit hashes are wrong.

@Smaug123 Smaug123 closed this as completed May 8, 2020
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

No branches or pull requests

1 participant
0