From: Linus Torvalds Date: Wed, 27 Apr 2005 19:15:10 GMT Subject: Re: A shortcoming of the git repo format Message-ID: In-Reply-To: <20050427183239.GE19011@redhat.com> On Wed, 27 Apr 2005, Dave Jones wrote: > > That actually broke one of my first git scripts when one of the > changelog texts started a line with 'tree '. I hacked around it > by making my script only grep in the 'head -n4' lines, but this > seems somewhat fragile having to make assumptions that the field > I want to see is in the first 4 lines. It's not an assumption. IT'S THE LAW. The speed of light is not "an assumption". It is. The tree is in the first line of a commit. You don't even need to parse it, you do tree=$(cat-file commit $head | sed 's/tree //;q') and that's it. No parsing. Git doesn't guess. Git knows. Linus