I often find myself in the following situation:
- Look at some code in a project (e.g.
string-trim
insubr-x.el
in Emacs) magit-blame
to see which commit added that code- Wonder which tags of the project comes after that commit
- Immediate use case is to find a version of Emacs that contains
string-trim
, so as to specify the dependency in a package header
- Immediate use case is to find a version of Emacs that contains
It's not clear how best to achieve step 3. I can get the commit hash from step 2--then what?
git tag --contains b55aea382c32f4448892265f322a38290ce10305
(that's the commit that addedstring-trim
as per your example). You'll get a list of tags. Since Emacs seems to be very consistent in tag names, you can just sort them and choose the earliest one.