git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Finding a commit based on the diff index line?

From
Philip Oakley <philipoakley@iee.org>
Date
Sep 17, 2016, 14:33 UTC
Message-ID
<3C23ED270E0C486EB2063BC5AEC25678@PhilipOakley>
Hi,

I'm curating some of my old patch series (i.e. doing some tidying up) and I'm trying to determine the commits that generated some of my patches so that I can see if I still have them after they were rebased (a 'name that dangling branch' problem).

Is there an easy way of finding the commit sha1 that contains the given diff index line.

For example. index fa05269..57033dd 100755 or index 8ebcded..d9ab360 100644

which both should get back to Jeff King's 36d6792 (t0006: test various date formats, 2016-06-20).

It feels like it is something that should already possible without a mini-script. We have the rev range which should limit the range to a single commit, though if random blob revs were given the commit range would be 'scattered'.

Is there a simple quick way of achieving this?

-- Philip

Next: Philip Oakley
Message 1 of 3 in “Finding a commit based on the diff index line?”
  1. Philip OakleySep 17, 2016
  2. Philip OakleySep 17, 2016
  3. Philip OakleySep 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.