{"thread":{"id":"26332","subject":"last commit in a directory","startedAt":"2011-01-25T08:29:46Z","lastAt":"2011-01-25T08:50:15Z","messageCount":3,"participants":["Leonid Podolny","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159845","messageId":"4D3E89FA.4080901@gmail.com","threadId":"26332","inReplyTo":null,"subject":"last commit in a directory","fromName":"Leonid Podolny","fromEmail":"leonidp.lists@gmail.com","sentAt":"2011-01-25T08:29:46Z","receivedAt":"2011-01-25T08:29:46Z","isPatch":false,"sender":{"key":"leonidp.lists@gmail.com","avatar":null},"body":"Hi,\nI have a really simple question: how do I find a last commit for the given directory inside the repository? I want to avoid rebuilding the specific part of the project if there were no changes in it since the last build, so I need to find the sha of the last time the directory was changed.\n  Thanks, L.\n"},{"id":"159846","messageId":"4D3E8E0B.2090200@viscovery.net","threadId":"26332","inReplyTo":"4D3E89FA.4080901@gmail.com","subject":"Re: last commit in a directory","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-01-25T08:47:07Z","receivedAt":"2011-01-25T08:47:07Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 1/25/2011 9:29, schrieb Leonid Podolny:\n> I have a really simple question: how do I find a last commit for the given\n> directory inside the repository?\n\ngit log -1 that/directory\n\nBut if you need it in a script, this is preferable:\n\n  lastsha1=$(git rev-list -1 HEAD -- \"$directory\")\n\n-- Hannes\n"},{"id":"159847","messageId":"4D3E8EC7.8000407@gmail.com","threadId":"26332","inReplyTo":"4D3E8E0B.2090200@viscovery.net","subject":"Re: last commit in a directory","fromName":"Leonid Podolny","fromEmail":"leonidp.lists@gmail.com","sentAt":"2011-01-25T08:50:15Z","receivedAt":"2011-01-25T08:50:15Z","isPatch":false,"sender":{"key":"leonidp.lists@gmail.com","avatar":null},"body":"On 01/25/2011 10:47 AM, Johannes Sixt wrote:\n> Am 1/25/2011 9:29, schrieb Leonid Podolny:\n>> I have a really simple question: how do I find a last commit for the given\n>> directory inside the repository?\n>\n> git log -1 that/directory\n>\n> But if you need it in a script, this is preferable:\n>\n>    lastsha1=$(git rev-list -1 HEAD -- \"$directory\")\n>\n\nThanks!\n"}]}