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

Re: [PATCH 0/3] gitweb: Simplify some gitweb URLs generation

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 2, 2007, 00:18 UTC
Message-ID
<200711020118.44015.jnareb@gmail.com>
In-Reply-To
<7v1wb98twi.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 19 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> This series of patches simplifies some gitweb URLs generation by
>> providing -replay option to href() subroutine, and then using this
>> feature in gitweb code.
>>
>> Shortlog:
>>  gitweb: Easier adding/changing parameters to current URL
>>  gitweb: Use href(-replay=>1, page=>...) to generate pagination links
>>  gitweb: Use href(-replay=>1, action=>...) to generate alternate views
>>
>> Diffstat:
>>  gitweb/gitweb.perl |   82 ++++++++++++++++++++++-----------------------------
>>  1 files changed, 35 insertions(+), 47 deletions(-)
> 
> If this "-replay" is used carelessly, it could add parameters
> that were passed to the page that the original code stripped
> away from passing on purpose.  Have you checked if the
> conversion done with 2/3 and 3/3 are correct (I haven't)?

First, I guess that I should have marked this series of patches as an RFC, but not for the reason you mentioned. This series changes somewhat gitweb behaviour (patches 2/3 and 3/3 to be more exact) in a way that before gitweb passed 'expanded' hashes to page / alternate view links. For example before this series link to second page for shortlog view starting from 'HEAD' passed literal sha1 for 'h' parameter, ans second page started where first page ended. After this patch, if refs have changed between viewing first page and clicking on the link to second page, the resulting view would be second page of _new_ 'HEAD', not of old (shown) 'HEAD'.

Second, you do not need to worry about adding parameters, because in 2/3 and 3/3 -replay is used to change view to the one which differs from current by one parameter. Please take into account that some parameters are just not important.

-- 
Jakub Narebski
Poland
Previous: Junio C Hamano
Message 7 of 7 in “gitweb: Simplify some gitweb URLs generation”
  1. 0/3 gitweb: Simplify some gitweb URLs generationJakub Narebski, Nov 1, 2007
  2. 0/3 gitweb: Simplify some gitweb URLs generationJakub Narebski, Nov 1, 2007
  3. 1/3 gitweb: Easier adding/changing parameters to current URLJakub Narebski, Nov 1, 2007
  4. 2/3 gitweb: Use href(-replay=>1, page=>...) to generate pagination linksJakub Narebski, Nov 1, 2007
  5. 3/3 gitweb: Use href(-replay=>1, action=>...) to generate alternate viewsJakub Narebski, Nov 1, 2007
  6. Junio C HamanoNov 1, 2007
  7. Jakub NarebskiNov 2, 2007

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.