I know that there is some kind of format that looks like master@{"1 day ago"}
but I can't figure out how to use something to (in a friendly way) filter the output of git reflog
to just the last X amount of time.
I tried git reflog --since="2 days ago"
but it is definitely not giving me the results that I expect (as it produces 3 results all related to the current branch I'm on, and the first 36 entries in git reflog
are from today).
Mainly I just need a list of all the (potentially orphaned) commits that I had a hand in creating from today. Because some shit went down, and I need to view all of the commits that have failed to get labeled with branch pointers, because I may or may not have rebased stuff wrong.
Meanwhile the only way to do it that I came up with is with a manual workflow something like this:
git reflog --date=relative | head -n 36 | cut -d' ' -f 1 | uniq | tr '\n' ' '
This produces a one line space separated set of commit hashes which should contain all the commits I touched today, and I found out through trial and error that if I just pass this over to my fancy git log --graph
alias that it will helpfully inject them in the graph where they belong, and I can regain some sanity that way.
As with any reasonably recyclable git related capability that I discover, I like to try to generalize in a script or at least some StackOverflow breadcrumbs so I can better learn how to do it quickly the next time that this happens.
A handy alias that lets me run my typical git log --graph <lots of config>
but with the addition of also viewing all orphaned commits inside that graph would be amazing. But I definitely want to limit that to only show me such commits from the last one day.