Skip to content

Conversation

das-g
Copy link
Contributor

@das-g das-g commented Sep 16, 2025

Mark transplanted commits with prime, similar to how manpages git-rebase(1) and git-cherry-pick(1) indicate them.

Changes

  • add a prime symbol ( U+2032) to letters representing commits transplanted by
    • git rebase
    • git merge --squash
    • git cherry-pick

Context

Like in the manpages git-rebase(1) and git-cherry-pick(1), we should (also in the new cheat sheet) distinguish between a commit and the commit resulting from transplanting it. They will usually represent the same change, but they aren't the same commit and might (due to different ancestors) not have the same file contents in the trees they refer to (and also some metadata like commit date will differ in general), thus they aren't the same commit.

The manpages use the straight apostrophe (' a.k.a. "single quote") for this, presumably to stay with ASCII-only for compatibility. I guess the cheat sheet may dare to use the semantically more precise Unicode character PRIME instead. For source encoding safety, I've used the corresponding HTML entity.

If I should use the un-escaped Unicode character instead or even just the ASCII straight apostrophe/single quote, please let me know.

similar to how manpages git-rebase(1) and git-cherry-pick(1) indicate them
@To1ne
Copy link
Collaborator

To1ne commented Sep 17, 2025

Before After
Screen Shot 2025-09-17 at 07 03 51 Screen Shot 2025-09-17 at 07 04 16

Copy link
Collaborator

@To1ne To1ne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I'm digging these changes. I didn't realize we needed them, but we do.

@To1ne To1ne merged commit 96f89d8 into git:gh-pages Sep 17, 2025
1 check passed
@To1ne
Copy link
Collaborator

To1ne commented Sep 17, 2025

The manpages use the straight apostrophe (' a.k.a. "single quote") for this, presumably to stay with ASCII-only for compatibility. I guess the cheat sheet may dare to use the semantically more precise Unicode character PRIME instead. For source encoding safety, I've used the corresponding HTML entity.

I had to look this up, but it's the correct thing to do: https://en.wikipedia.org/wiki/Prime_(symbol)#Use_in_mathematics,_statistics,_and_science

If I should use the un-escaped Unicode character instead or even just the ASCII straight apostrophe/single quote, please let me know.

I prefer escaped, like you did.

@das-g das-g deleted the cheat-sheet-mark-transplanted-commits-with-prime branch September 17, 2025 08:56
To1ne added a commit that referenced this pull request Oct 1, 2025
Made a couple of tweaks to #2076 that I think will make things clearer:

1. Make the D' boxes a bit wider, so it doesn't look so cramped
2. Remove the "prime" from the stacked D and E

The idea of the "prime" annotation is that D is somehow a shorthand for
a commit ID, and D' is meant to suggest that the transplanted commit has
a different commit ID. I think this makes sense.

But with the stacked D and E, the two D and E being grouped together are
already doing the work to show that the new commit is modified in some
way, so we don't need to add the "prime" (and it's not clear to me what
the prime could actually mean).
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

Successfully merging this pull request may close these issues.

2 participants