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

Re: [PATCH] gitweb: Show '...' links in "summary" view only if there are more items

From
RFRobert Fitzsimons <robfitz@273k.net>
Date
Dec 19, 2006, 12:41 UTC
Message-ID
<20061219124133.GB16429@localhost>
In-Reply-To
<200612191328.08928.jnareb@gmail.com>
Show 8 quoted lines
> Junio usually puts such comments in brackets (I don't know if it is
> always used, i.e. if it is some 'convention'), e.g.:
> 
>   Also perform the same "..." link logic to the forks list.
> 
>   [rf: Modified patch from Jakub to to apply cleanly to master]
> 
> or something like that. Just a nitpick.
No problem, I tried to find the approreati convention.
Show 9 quoted lines
> > -	my @taglist  = git_get_tags_list(15);
> > -	my @headlist = git_get_heads_list(15);
> > +	# we need to request one more than 16 (0..15) to check if those 16 are all
> > +	my @taglist  = git_get_tags_list(16);
> > +	my @headlist = git_get_heads_list(16);
> 
> It needs to be 17, not 16, otherwise we never would get "...". By default
> we show _16_ items, from 0 to 15 inclusive, so we must get _17_ items
> to check if there are more than 16.

That was a copy error on my part. Though looking at the code git_get_tags_list and git_get_heads_list already adds one to the limit value, so if you pass in 17 they will return 18 items.

Robert
Previous: Jakub NarebskiNext: Jakub Narebski
Message 9 of 11 in “Small optimizations to gitweb”
  1. Small optimizations to gitwebRobert Fitzsimons, Dec 18, 2006
  2. Jakub NarebskiDec 18, 2006
  3. Junio C HamanoDec 18, 2006
  4. Jakub NarebskiDec 19, 2006
  5. Junio C HamanoDec 19, 2006
  6. gitweb: Show '...' links in "summary" view only if there are more itemsJakub Narebski, Dec 19, 2006
  7. gitweb: Show '...' links in "summary" view only if there are more itemsRobert Fitzsimons, Dec 19, 2006
  8. Jakub NarebskiDec 19, 2006
  9. Robert FitzsimonsDec 19, 2006
  10. Jakub NarebskiDec 19, 2006
  11. Junio C HamanoDec 19, 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.