poll: when you see this message in `git status`:

”Your branch is up to date with 'origin/main’.”

do you know that your branch may not actually be up to date with the `main` branch on the remote?

yes
63.6%
mostly yes
15.7%
no
7.5%
what?
13.3%
Poll ended at .
(i've been wondering if there's a world where it's possible to convince the folks who make git to change that message to add “... as of 5 minutes/3 days/6 years ago”, but I think it might be hard to implement)
@b0rk Seems to me that it might not be hard. There's already a per-branch database in `.git/config` where last-fetched times could be recorded.
@mjd @b0rk Strangely, I was thinking about writing an alias to emit status along with that data, just yesterday! I figured I'd look at the mtime on the head or something. (I wrote zero code.)
@rjbs @mjd @b0rk This information is already recorded in the reflog for the remote-tracking branches, e.g. in .git/logs/refs/remotes/origin/main. You can also see it with `git log --walk-reflogs --date=iso remotes/origin/main`.

@rjbs @mjd @b0rk Here's an incomplete but working patch. https://gist.github.com/tsibley/81d144149812b009e833b9b1a667c2b9

I've thought about this a bit before and have been meaning to look into it for a while... so I got nerdsniped this afternoon. Might try to see this thru to patch submission.

0001-wip-status-show-last-reflog-timestamp-of-tracking-br.patch

GitHub Gist: instantly share code, notes, and snippets.

Gist

@rjbs @mjd @b0rk Oh bah, I see I totally misunderstood and missed this edge case: https://social.jvns.ca/@b0rk/112061735287996245

orz

Apologies.

Julia Evans (@[email protected])

Attached: 1 image @[email protected] the edge case i was worried about is that it looks like it doesn't update the mtime if you push (or fetch) and there were no updates? (which makes sense because it wasn't modified, but the thing I _want_ is to know “we know that this is up to date as of X time” not “this is the last time there were new changes”)

Mastodon

@rjbs @mjd @b0rk Extended the patch to solve that by recording all fetches in the reflog. https://gist.github.com/tsibley/0eb1f9d227b143fb7fe97fc2661eac9a

Not sure that'd fly with the git maintainers or not... but I might try to engage and see!

0001-wip-status-show-when-tracking-branch-was-last-fetche.patch

GitHub Gist: instantly share code, notes, and snippets.

Gist