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

Re: [PATCH] gitweb: use common parameter parsing and generation for "o", too.

From
Martin Waitz <tali@admingilde.org>
Date
Aug 18, 2006, 20:20 UTC
Message-ID
<20060818202013.GB30022@admingilde.org>
In-Reply-To
<200608172134.38751.jnareb@gmail.com>
hoi :)
On Thu, Aug 17, 2006 at 09:34:38PM +0200, Jakub Narebski wrote:
Show 7 quoted lines
> > Perhaps we can agree that only the validation should be coupled with the
> > actual user?  E.g. use normal validate_input() for it and then check
> > for actual values inside git_project_list (which is already done now).
> 
> The validate_input() function has too generic name and is too widely used:
> it should be split into validate_ref() and validate_path(); perhaps "o"
> should be validate with $order =~ m/^[a-zA-Z]$/ 
agreed.
> But I was thinking about moving parameter parsing to the "action" functions
> which use them, the opposite of what you want to do...
but only short-term.

I think we both agree on the same target: we need some simple to pass parameters to a function which should only be called if the user clicks on a specific link.

Now lets talk about the interface to do this.

We need one interface for generating the URL (stub in RPC talk) and one for calling the function once the link is clicked (skeleton). We now have the href() function which is not so bad for the stub side. We now need a nice generic skeleton.

Perhaps introduce a new function which is used to access the parameters? This new function could check the URL or CGI->param or whatever and then return the requested value.

Then the action functions could get all parameters they need, validate them themselves and then act on them. This would suit my "break out parameter parsing from actions" and your "validate parameters in the action function". (And I really interpret your sentence in such a way that you only want to move the _validation_, not the actual parsing (which is done inside CGI->param at the moment.)

-- 
Martin Waitz
Previous: Jakub NarebskiNext: Jakub Narebski
Message 20 of 25 in “gitweb: continue consolidation of URL generation.”
  1. gitweb: continue consolidation of URL generation.Martin Waitz, Aug 16, 2006
  2. gitweb: use common parameter parsing and generation for "o", too.Martin Waitz, Aug 16, 2006
  3. gitweb: support for "fp" parameter.Martin Waitz, Aug 16, 2006
  4. gitweb: support for / as home_link.Martin Waitz, Aug 16, 2006
  5. gitweb: fix project list if PATH_INFO=="/".Martin Waitz, Aug 16, 2006
  6. gitweb: use action dispatcher for non-project actions, too.Martin Waitz, Aug 16, 2006
  7. Junio C HamanoAug 17, 2006
  8. Carl WorthAug 17, 2006
  9. Petr BaudisAug 18, 2006
  10. Carl WorthAug 18, 2006
  11. Jakub NarebskiAug 18, 2006
  12. Petr BaudisAug 18, 2006
  13. Martin WaitzAug 17, 2006
  14. Jakub NarebskiAug 17, 2006
  15. Martin WaitzAug 17, 2006
  16. Jakub NarebskiAug 17, 2006
  17. Jakub NarebskiAug 17, 2006
  18. Martin WaitzAug 17, 2006
  19. Jakub NarebskiAug 17, 2006
  20. Martin WaitzAug 18, 2006
  21. Jakub NarebskiAug 19, 2006
  22. Martin WaitzAug 19, 2006
  23. Jakub NarebskiAug 19, 2006
  24. Junio C HamanoAug 17, 2006
  25. Martin WaitzAug 17, 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.