That is not the point.
Closer to the point is that I returned to work this week, and resumed working on tracking down a bug that I had been looking at just before going on vacation. I knew I had captured the bug in my latest rr recording, but I had moved off to other things since making that recording and so my source checkout no longer matched what my debugged binary was built from.
rr doesn’t really care, so it let me replay the recording. I had all my old log messages, tied to the exact point in time they corresponded to. (I get that from my .gdbinit setup, but that’s not all that relevant here.) So I could jump to the points in time that I cared about. But gdb showed me the wrong source, so I found myself staring at a blank line just after a comment, and I’m pretty sure my problem does not originate from a blank line after a comment.
So what to do? I wanted to find what version of the source code I had checked out. If I were working on Firefox, it would have burned a build ID into the binary. But I wasn’t.
Long story short, jj’s operation log came to my rescue here. First, I looked at my recording’s timestamp: `
ls -ltr ~/.rr/latest-trace/`. (Yours might be in `~/.local/share/rr` or somewhere. Actually, mine are too, I just have a symlink.) Each entry is associated with a time range, and presumably I had the correct version checked out when I made the recording.I scanned through the operations log to find the operation ID from that moment in time: `
jj op log -T 'id.short(8) ++ " " ++ time ++ " " ++ description ++ "\n"'`. That gave me operation ID `55731d73`.I have two workspaces, and I can’t even remember which one I was using at the time, so I displayed my working copy for both: `
jj log -r 'at_operation(55731d73, working_copies())'`. That gave me two git commit hashes, `3c79c068` and `a1a9d12b`.With my rr replay session running, I tried `
jj edit 3c79c068` and checked where I was. Nope, still floating in whitespace. (Note that I am talking about code here, not my racial background. Leave me alone.) But `jj edit a1a9d12b` did the trick! My checkpoints were in actual code! That I wrote! Incorrectly!Anyway, nothing earth-shattering here. But it made me happy. And perhaps it will be useful to other people with a need for resurrecting their forgotten past.