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

Re: hmm, can't we give the "root" a parent?

From
KSKay Sievers <kay.sievers@vrfy.org>
Date
Sep 12, 2005, 21:00 UTC
Message-ID
<20050912210006.GA32211@vrfy.org>
In-Reply-To
<Pine.LNX.4.58.0509121316030.3266@g5.osdl.org>
On Mon, Sep 12, 2005 at 01:21:13PM -0700, Linus Torvalds wrote:
Show 14 quoted lines
> On Mon, 12 Sep 2005, Kay Sievers wrote:
> >
> > And good to know about that, need to fix the "parent" link in gitweb to
> > respect grafts.
> 
> Note that the simplest way to do this is to try to use "git-rev-list" as 
> much as possible. The "--parents" flag makes the output have the parents 
> (automatically _including_ any grafts) on the line that contains the 
> commit ID.
> 
> That's especially true of any tools that use git-rev-list anyway for other
> reasons. Eg "gitk" could parse the parent stuff this way, and didn't need
> to know about the info/grafts file at all. I suspect the same should be
> true of gitweb.

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>

Hmm, it's one more exec, but I don't need to look at the grafts file or whatever will make it into git the next time I will look at it. :)

Thanks, Kay

Previous: Linus TorvaldsNext: Linus Torvalds
Message 5 of 13 in “hmm, can't we give the "root" a parent?”
  1. Kay SieversSep 12, 2005
  2. Linus TorvaldsSep 12, 2005
  3. Kay SieversSep 12, 2005
  4. Linus TorvaldsSep 12, 2005
  5. Kay SieversSep 12, 2005
  6. Linus TorvaldsSep 12, 2005
  7. Kay SieversSep 12, 2005
  8. Linus TorvaldsSep 12, 2005
  9. Linus TorvaldsSep 12, 2005
  10. Kay SieversSep 12, 2005
  11. A Large Angry SCMSep 12, 2005
  12. gitweb search in multi-headed treeTony Luck, Sep 16, 2005
  13. Kay SieversSep 17, 2005

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.