...please don't post any answers saying things like "you're doing it wrong" or "that's not how versioning is supposed to work" unless you can also provide a constructive alternative. I need a way to mark commits that will persist after a rebase...
You're doing it wrong; that's not how versioning is supposed to work. Now for my constructive alternative—I do have one, and it's not "Git doesn't do this."
Using "tags" is out. If you do use git tags, even if you hack together some scripts that will delete the old tags and create new ones every time you rebase, your new tags won't be pulled by any other users collaborating with you, making the tags worse than useless as they would be actively misleading. (See LESS=+/DISCUSSION man git-tag
for more info about this.)
However, there is a clean and elegant way to accomplish what you intend, without the use of tags. Note that it will not allow you to "pseudo-tag" a commit after the fact without rebasing to modify that commit, but since you're rebasing often already, I believe it will be perfect for your workflow.
The key to my pseudo-tag method is an understanding of a seldom-used method of specifying a git revision. See LESS='+/:/<text>' man gitrevisions
to read up on it.
Decide on a text string that is short and won't show up in a commit message accidentally, and use it as a prefix for your pseudo-tags. For example, my-pseudo-tag-
.
Then, for any commit which you want to pseudo-tag, modify that commit message (using rebase) to include the string, e.g., my-pseudo-tag-v0.7.5
.
Now any time you want to refer to that pseudo-tag, e.g. to check out that version, or to create a new branch pointing there, use the git revision specifier like so:
git checkout :/my-pseudo-tag-v0.7.5
git checkout -b new_branch :/my-pseudo-tag-v1.3.0
Voila! Since your pseudo-tags are actually part of the commit message rather than a separate object pointing to the commit, they are unaffected by a rebase and can still be found only in the commit message where you expect to find them!
In other words, the way to mark commits that will persist after a rebase, is to include specific text in the commit messages that will only be found in that commit's message.
(Of course, if you are working with other people, you will have to dream up some way to ensure that they don't use the "reserved word" in their own commit messages...but that's beyond the scope of your question and my solution.)
Note: Please don't rebase commits that are available to others; it will make for future headaches. (This is directed at any future readers, not the Original Poster of this question whose workflow evidently demands rebasing.)