{"thread":{"id":"12976","subject":"File info from SHA ID","startedAt":"2008-04-03T16:58:45Z","lastAt":"2008-04-04T13:55:05Z","messageCount":3,"participants":["Christoph Duelli","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73611","messageId":"47F50CC5.20502@melosgmbh.de","threadId":"12976","inReplyTo":null,"subject":"File info from SHA ID","fromName":"Christoph Duelli","fromEmail":"duelli@melosgmbh.de","sentAt":"2008-04-03T16:58:45Z","receivedAt":"2008-04-03T16:58:45Z","isPatch":false,"sender":{"key":"duelli@melosgmbh.de","avatar":null},"body":"Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible \nto determine the file's name, date of commit etc?\nI'd be most interested in the file path.\n\nBest regards, keep up the good work\n-- \nChristoph Duelli\n"},{"id":"73613","messageId":"alpine.LFD.1.00.0804031009280.14670@woody.linux-foundation.org","threadId":"12976","inReplyTo":"47F50CC5.20502@melosgmbh.de","subject":"Re: File info from SHA ID","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-04-03T17:16:29Z","receivedAt":"2008-04-03T17:16:29Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 3 Apr 2008, Christoph Duelli wrote:\n>\n> Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible to\n> determine the file's name, date of commit etc?\n\nNot directly, no.\n\nBut you can get it indirectly with a number of variations on\n\n\tgit whatchanged --raw --no-abbrev\n\nand then just searching for that SHA1 ID in the result. That will also \nshow you where in the history that SHA1 came to be or went away.\n\nThe SHA1 itself is _purely_ about the actual contents of the file, so it \nhas no bearing on where that file actually exists, and two identical files \nin different places will have the same SHA1. So no SHA1 -> filename \nmapping can exist, but you can figure out where in the tree or history it \nexisted if you just have the full repository.\n\n\t\t\tLinus\n"},{"id":"73652","messageId":"47F63339.3070903@melosgmbh.de","threadId":"12976","inReplyTo":"alpine.LFD.1.00.0804031009280.14670@woody.linux-foundation.org","subject":"Re: File info from SHA ID","fromName":"Christoph Duelli","fromEmail":"duelli@melosgmbh.de","sentAt":"2008-04-04T13:55:05Z","receivedAt":"2008-04-04T13:55:05Z","isPatch":false,"sender":{"key":"duelli@melosgmbh.de","avatar":null},"body":"Linus Torvalds schrieb:\n> \n> On Thu, 3 Apr 2008, Christoph Duelli wrote:\n>> Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible to\n>> determine the file's name, date of commit etc?\n> \n> Not directly, no.\n> \n> But you can get it indirectly with a number of variations on\n> \n> \tgit whatchanged --raw --no-abbrev\n> \n> and then just searching for that SHA1 ID in the result. That will also \n> show you where in the history that SHA1 came to be or went away.\n> \n> The SHA1 itself is _purely_ about the actual contents of the file, so it \n> has no bearing on where that file actually exists, and two identical files \n> in different places will have the same SHA1. So no SHA1 -> filename \n> mapping can exist, but you can figure out where in the tree or history it \n> existed if you just have the full repository.\nOk, thank you. I was able to use the output of \"git whatchanged --raw \n--no-abbrev\" to achieve what I wanted to do.\n\n-- \nChristoph Duelli\n"}]}