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

Re: [PATCH] gitweb: Improve repository verification

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 19, 2012, 19:46 UTC
Message-ID
<201204192146.09853.jnareb@gmail.com>
In-Reply-To
<xmqq397zwp4c.fsf@junio.mtv.corp.google.com>
On Thu, 19 April 2012, Junio C Hamano wrote:
Show 31 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > Bring repository verification in check_export_ok() to standards of
> > is_git_directory function from setup.c (core git), and validate_headref()
> > to standards of the same function in path.c,... and a bit more.
> >
> > validate_headref() replaces check_head_link(); note that the former
> > requires path to HEAD file, while the late latter path to repository.
> >
> > Issues of note:
> > * is_git_directory() in gitweb is a bit stricter: it checks that
> >   "/objects" and "/refs" are directories, and not only 'executable'
> >   permission,
> > * validate_headref() in gitweb is a bit stricter: it checks that
> >   reference symlink or symref points to starts with "refs/heads/",
> >   and not only with "refs/",
> > * calls to check_head_link(), all of which were meant to check if
> >   given directory can be a git repository, were replaced by newly
> >   introduced is_git_directory().
> >
> > This change is preparation for removing "Last change" column from list
> > of projects, which is currently used also for validating repository.
> >
> > Suggested-by: Kacper Kornet <draenog@pld-linux.org>
> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> > ---
> > Here is how such first step could look like...
> 
> Do you mean by "could look like" that this is still an RFC, or is this
> something we want to apply and see how well it makes people's lives in
> the field?
"Here is how such first step could look like" was directed to Kacper... :-)

Kacper Kornet (who started this thread with "[PATCH] gitweb: Option to omit column with time of the last change") wants to have an option to remove "Last Change" column from projects list page, and "Owner" column and field from all gitweb views. This will allow to generate projects list page with 1 call to git command rather than 2*N+1, where N is number of repositories shown...

...but we use the fact that "git --git-dir=$GIT_DIR for-each-ref ..." succeed or fails to verify that given path points to git repository. That is why I proposed this commit to be first patch in hopefully upcoming Kacper's new version of patch series.

But in current gitweb (without Kacper's planned patches) this change
doesn't bring much, as git repositories are verified outside of
is_git_directory() check... well, perhaps with exception of possible
corner case when one is using path_info gitweb URL...
 
> By the way, I wonder (1) if it is worth adding support for the textual
> ".git" file that contains "gitdir: $path", and (2) if so how big a
> change would we need to do so.

I don't think that it would be big changeto add support for "gitlink" files, assuming that 'git --git-dir=<gitlink file> ...' works correctly. I would put that addition in a separate commit, though.

BTW. does core git limit number of redirections, or have some loop detection?

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Jakub Narebski
Message 13 of 23 in “gitweb: Option to omit column with time of the last change”
  1. gitweb: Option to omit column with time of the last changeKacper Kornet, Apr 3, 2012
  2. Jakub NarebskiApr 3, 2012
  3. Kacper KornetApr 4, 2012
  4. Jakub NarebskiApr 4, 2012
  5. Kacper KornetApr 4, 2012
  6. Jakub NarebskiApr 14, 2012
  7. Kacper KornetApr 16, 2012
  8. Jakub NarebskiApr 16, 2012
  9. Kacper KornetApr 16, 2012
  10. Jakub NarebskiApr 17, 2012
  11. gitweb: Improve repository verificationJakub Narebski, Apr 19, 2012
  12. Junio C HamanoApr 19, 2012
  13. Jakub NarebskiApr 19, 2012
  14. Jakub NarebskiApr 21, 2012
  15. 1/2 gitweb: Option to omit column with time of the last changeKacper Kornet, Apr 24, 2012
  16. 2/2 gitweb: Option to not display information about ownerKacper Kornet, Apr 24, 2012
  17. Junio C HamanoApr 26, 2012
  18. Kacper KornetApr 26, 2012
  19. Junio C HamanoApr 26, 2012
  20. Kacper KornetApr 26, 2012
  21. 2/2 gitweb: Option to not display information about ownerKacper Kornet, Apr 26, 2012
  22. Kacper KornetApr 24, 2012
  23. Junio C HamanoApr 4, 2012

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.