4 ms·
> There needs to be a way to add an annotation[...] to a previous message to correct assumptions You rarely want to do _just_ this, i.e. call out the bad commi
by cxr 2y ago
> There needs to be a way to add an annotation[...] to a previous message to correct assumptions
You rarely want to do _just_ this, i.e. call out the bad commit message in question and nothing else; you're generally going to have something to fix because of that "bad assumption", too. You just branch off the old commit, do the needful (read: make the correction to the code), commit it, and then merge that into mainline. It seems like a lot of people fail to consider that a branch merged into mainline does not become immutable; at any point you can check it out and make further changes and then remerge those and do all of this as many times as necessary.
If you really do need to only draw attention to a bad commit message in a past commit and correct the record but nothing else, then you can just "annotate" it with an ordinary merge commit—
1. Check out the old commit that you want to annotate (create a branch there if you want, but it's optional).
2. Merge the mainline into this HEAD/branch, making sure force a merge commit using --no-ff, and write your "annotation" in the commit message.
3. Merge that into the mainline branch.