<p>Last week, I asked <a href="/daily/2024/05/15/should-you-include-issue-ids-in-your-commit-messages">whether you should include issue IDs in commit messages</a>.</p>
<p>Another thing I like to reference in a commit message is the commit ID (or SHA) of a related commit.</p>
<p>For example, when I run <code>git log</code> in my website repository, I see commits like this:</p>
Create a cached version of the talk counter service that returns a
cached result of the talk count for that day.
This uses the Decorator design pattern to decorate the existing
`TalkCounter` service and works as they both implement the same
`TalkCounterInterface`.
</code></pre>
<p>The sha for this commit is <code>0c91825c16217d0fe7eff4ea100a67550051c4a9</code>.</p>
<p>If I was to make another commit that was related to this one, I can include this commit sha in my new commit message.</p>
<p>I also don't need to include the entire thing - only enough for it to be unique (usually five or six characters).</p>
<p>Once pushed, the commit IDs should never change, so this will be a permanent reference to the first commit.</p>
<p>Helpfully, websites like GitHub, GitLab and Bitbucket will identify it as a commit sha and make it clickable so you can easily navigate to the referenced commit.</p>
<p>Last week, I asked <a href="/daily/2024/05/15/should-you-include-issue-ids-in-your-commit-messages">whether you should include issue IDs in commit messages</a>.</p>
Create a cached version of the talk counter service that returns a
cached result of the talk count for that day.
This uses the Decorator design pattern to decorate the existing
`TalkCounter` service and works as they both implement the same
`TalkCounterInterface`.
</code></pre>
<p>The sha for this commit is <code>0c91825c16217d0fe7eff4ea100a67550051c4a9</code>.</p>
<p>If I was to make another commit that was related to this one, I can include this commit sha in my new commit message.</p>
<p>I also don't need to include the entire thing - only enough for it to be unique (usually five or six characters).</p>
<p>Once pushed, the commit IDs should never change, so this will be a permanent reference to the first commit.</p>
<p>Helpfully, websites like GitHub, GitLab and Bitbucket will identify it as a commit sha and make it clickable so you can easily navigate to the referenced commit.</p>