Re: hmm, can't we give the "root" a parent?
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Sep 12, 2005, 21:42 UTC
- Message-ID
- <Pine.LNX.4.58.0509121438150.3266@g5.osdl.org>
- In-Reply-To
- <20050912210006.GA32211@vrfy.org>
On Mon, 12 Sep 2005, Kay Sievers wrote:
Show 10 quoted lines
> > Everthing that walk from one commit to another, uses git-rev-list, sure. > But in the commit view, and the commitdiff the "parent" link and the parent > that is passed to diff is read from the commit itself. > > > (So instead of trying to parse the parent info from the header of the > > commit, just do "git-rev-list --pretty --parents" and parse that). > > I need only one parent: > git-rev-list --parents --max-count=1 <id>
Who don't you use that to show the comments too?
So instead of doing
git-cat-file commit <id>
(or whatever you do), just do
git-rev-list --parents --pretty=raw --max-count=1 <id>
That way you don't get any extra fork/exec overhead - you get everything with one program.
Linus