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

Re: [PATCH 2/8] gitweb: We do longer need the --parents flag in rev-list.

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 25, 2006, 22:49 UTC
Message-ID
<empkcf$qp$1@sea.gmane.org>
In-Reply-To
<11669707094097-git-send-email-robfitz@273k.net>
Robert Fitzsimons wrote:
> We only want to know the direct parents of a given commit object,
> these parents are available in the --header output of rev-list.  If
> --parents is supplied with --full-history the output includes merge
> commits that aren't relevant.

Actually --header output gives us original parents. Rewritten parents (available with --parents) include also grafts and shallow clone grafts. For parse_commit we want --parents, for parse_commits we don't want it because --parents affects --full-history.

The problem is that we cannot detect if git-rev-list was called with --parents and commit is root commit (parentless), or we didn't use --parents option.

In few other places we pass options specifying subroutine behavior
as hash after all other requred parameters, e.g. 
  esc_html($line, -nbsp=>1),
  parse_ls_tree_line($line, -z=>1), 
  git_print_log($co{'comment'}, -final_empty_line=> 1, -remove_title => 1);
In this case it wouldn't work (unless we pass reference to array,
via parse_commit_text( [ <$fd> ], -parents=>1);

Perhaps it would be better to use reference to hash of options as _first_ parameter, e.g. parse_commit_text({-parents=>1}, <$fd>);, and use something like if (ref($[0]) == 'HASH') { $opts = shift @_; } to get options.

So for now gitweb might not show what we want in very rare cases of repositories with grafts or shallow clones.

But apart from this small matter, this series is excellent work. Thanks! 
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Robert FitzsimonsNext: Robert Fitzsimons
Message 9 of 10 in “gitweb: Add parse_commits, used to bulk load commit objects.”
  1. 1/8 gitweb: Add parse_commits, used to bulk load commit objects.Robert Fitzsimons, Dec 24, 2006
  2. 2/8 gitweb: We do longer need the --parents flag in rev-list.Robert Fitzsimons, Dec 24, 2006
  3. 3/8 gitweb: Change summary, shortlog actions to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  4. 4/8 gitweb: Change log action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  5. 5/8 gitweb: Change header search action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  6. 6/8 gitweb: Change atom, rss actions to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  7. 7/8 gitweb: Change history action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  8. 8/8 gitweb: Use rev-list --skip option.Robert Fitzsimons, Dec 24, 2006
  9. Jakub NarebskiDec 25, 2006
  10. gitweb: Re-enable rev-list --parents for parse_commit.Robert Fitzsimons, Dec 27, 2006

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.