Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know the exact git commit hash, e.g. f3a1ef9cee4812e2d08c855eb373f0d83433e34c.

What is the easiest way to answer the question: What kernel releases so far contain this patch? Bonus points if no local Linux git repository is needed.

(LWM discusses some ideas, but these do require a local repository.)

share|improve this question
up vote 15 down vote accepted

As mentioned on LWN, the easiest is:

git describe --contains f3a1ef9cee4812e2d08c855eb373f0d83433e34c

If you don't want a local clone, gitweb's "plain" formatted commit contains the same info in the X-Git-Tag header. Unfortunately kernel.org switched over to cgit which apparently does not disclose this information. Previously it was possible to find it out like this:


Here, X-Git-Tag is actually missing at the moment because that commit isn't in a tagged release in that repository. But you can look at an earlier commit, like:


Here, you see:

X-Git-Tag: v3.4-rc1~184^2~10

which tells me that the tag "v3.4-rc1" was the first tag to follow my patch, so I'd expect to see it in v3.4.

share|improve this answer
Not sure if this is answer is valid anymore. X-Git-Tag does not appear. – ahmet alp balkan Feb 12 at 19:41
The first sentence is still valid. Finding the answer through gitweb is no longer an option, but that's why this question was edited almost 3 years ago to say just that. – Jim Paris Feb 18 at 18:19

You can see the commit on the github source mirror. I suppose you could correllate the release tags to the commit date (in this case, your commit is five days old, the most recent tagged RC on master is seven), but frankly this is easier to get at if you clone the source locally.

share|improve this answer
Correlating the date won't work since the patch may not be merged into any release yet, or it may have been written originally for a previous release and just not merged until more recently. – psusi Aug 9 '12 at 13:04
Nowadays GitHub shows all tags containing a specific commit just below the commit message, so no need to correlate by date anymore. – Philipp Wendler Apr 13 at 12:32

You can use something like this

git-show f3a1ef9cee4812e2d08c855eb373f0d83433e34c:Makefile \
         | head -4 | awk -vORS='.' '{print $3}' | sed 's/\.*$//'

I hope this is self-explanatory. Of course this requires local git repo.

share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.