I can do HEAD@{30d} to get where my HEAD was 30d ago. But this is based on the local reflog. It won't contain commits that I never checked out and may contain other branches that I switched to even if they were never merged into current HEAD.
Is there a way to do something similar but following the commit ancestry instead? I'm thinking something like HEAD~{30d} which would be interpreted as "walk the first parents of HEAD and return the first commit with a committed date older than 30 days old.
I want this because I frequently use git bisect to track down a problem, and often I don't know exactly when it started. So I want do something like git bisect HEAD HEAD~{30d} to look for a change in the last 30 days. Right now I am working around this by using git log to select the commit.
git bisect start HEAD $(git log -n1 --pretty=format:%H --before '30 days ago')
This works but is much less convenient. It seems surprising that there isn't a syntax for what seems like a common query.
You can do much better.
and if you're doing it a lot you can make an alias, with some use of the option syntax flexibility,
then
git bef 30daysprints it.You might want to add
--first-parentto avoid getting disoriented in thickly-branched ancestry.