Closed jameswalmsley closed 10 months ago
e.g. Attach a note (under git-ps) ref for the HEAD commit).
git notes --ref=git-ps add -m "ps-id: 888ce562-1a4d-4724-8039-3073dbe79a35"
git notes --ref=git-ps show HEAD
outputs:
ps-id: 888ce562-1a4d-4724-8039-3073dbe79a35
git log --show-notes=git-ps
outputs:
commit a6c51daf63a6b42de5291a8a14eea4a588b214db (HEAD -> master)
Author: James Walmsley <james.walmsley@chargepoint.com>
Date: Sat Nov 4 02:56:30 2023 +0000
feat(zephyr): some useful commit
Notes (git-ps):
ps-id: 888ce562-1a4d-4724-8039-3073dbe79a35
But a standard git log would not show this. The notes themselves don't have to be pushed to the remote, but can remain local if desired.
To ensure that rewrites (rebase & amend) preserve the notes:
git config notes.rewriteRef refs/notes/git-ps
I thought about this at one point.
But there are couple problems with this.
Also, I think especially with a user base of primarily developers it is generally a better approach to educate than try and hide things from them.
Beyond that, historically it has proven to facilitate the natural spread of Git Patch Stack due to people asking about it in PRs. Which I think is a good thing. Even to the point that I have contemplated actually making it come with a tag line and URL or something.
Ok that makes sense. I was just playing around with it, and there's a few potential complications anyway. Yes agree the ps-id in the message gets people curious.
I was thinking about scenarios where some developers might be asked not to leave ps-id information in their commit messages. E.g. for devs who work at corporations that might have overly strict / unreasonable rules.
I might be over-thinking a scenario that doesn't really exist..
Feel free to close this issue :)
Yeah, I know we added the HTML comment around it because people worked on teams where people were complaining about it. So the HTML comment hides it in GitHub PRs.
To be honest though. I am more of the mindset of having a tag line to spread the word with a URL to the site now days. It isn't that big of a deal to have a small tagline at the end of the commit, especially if it is a functional tag line.
Since we don't need the ps-id anymore, we should definitely make this a configurable option. I have worked on projects where a clean commit history is necessary, which can make the automatic incusion of psids annoying.
We STILL NEED ps-id. It is how we track a patch when they have different commit shas.
I'm going to close this now, as its obvious notes is really a viable solution to storing the ps-id.
I think it might be possible to use git-notes to store the git-ps-id, and keep it in the "official" git metadata store instead of directly on the commit message.
I was wondering your thoughts on this?