On Fri, Aug 26, 2016 at 03:27:50PM +0300, Jani Nikula wrote: > On Fri, 26 Aug 2016, James Hogan wrote: > > [ Unknown signature status ] > > On Fri, Aug 26, 2016 at 12:42:05PM +0100, James Hogan wrote: > >> On Fri, Aug 26, 2016 at 01:26:35PM +0200, Greg KH wrote: > >> > On Fri, Aug 26, 2016 at 12:46:51AM -0400, Levin, Alexander wrote: > >> > > - Improving tagging for stable. The "version tag" option is broken > >> > > and the "Fixes:" tag is always preferable, how do we get people to > >> > > use that more often? (script it somehow? > >> > > scripts/find-version-it-fixes ?). > >> > > >> > Oh a script like that would be nice, but how would that work in reality? > >> > >> Not all Fixes: tags are suitable for stable though. I've been caught out > >> by patches being applied to stable (4.2 maybe) due to a Fixes tag, > >> without prerequisite patches being applied. > > > > I also find the following alias useful to find the version number a > > commit is first merged in: > > > > vc = "!vc() { for i in `git tag --contains \"$@\" | grep '^v'`; do echo \"$(git log -1 --pretty='%ct' $i) $i\"; done | sort -n | head -n1 | sed 's/^[0-9]* //g'; }; vc" > > > > Its a bit slow and hacky and there's probably better ways, but it picks > > the tag a bit more reliably than "git describe --contains". Maybe that > > could be wrapped in a script that generates a Stable tag automatically > > from a Fixes tag for when the patch is suitable for stable. > > If you can trust your tags to contain versions like in the kernel, I > think you can get away with just: > > git tag --contains | grep ^v | sort -V | head -n 1 Yes. I think the reason I avoided that is because it wouldn't tell me the rc release a commit was merged in (which is sometimes of interest), hence sorting by commit timestamp instead, but for the purposes of a stable tag that is indeed irrelevant: $ git tag --contains v4.7-rc2 | grep ^v | sort -V | head -n 1 v4.7 $ git tag --contains v4.8-rc2 | grep ^v | sort -V | head -n 1 v4.8-rc2 Looking again at the man pages though, the following is even nicer: git tag --contains --sort=taggerdate | grep '^v' | head -n 1 Cheers James