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

Re: gitweb, updating 'last changed' column on the project page

From
Jon Smirl <jonsmirl@gmail.com>
Date
Nov 10, 2007, 14:10 UTC
Message-ID
<9e4733910711100610y478c62cend1d9af84e0ecc08b@mail.gmail.com>
In-Reply-To
<200711101427.18215.jnareb@gmail.com>
On 11/10/07, Jakub Narebski <jnareb@gmail.com> wrote:
Show 17 quoted lines
> > It is sorted by committerdate, the sort is ascending. Did you expect
> > it to be descending, pick off the last entry instead of the first?
>
> Excerpts from git-for-each-ref(1):
>
>   git-for-each-ref [--count=<count>]* (...) [--sort=<key>]* (...)
>
>   <count>
>           By  default  the  command  shows all refs that match <pattern>. This
>           option makes it stop after showing that many refs.
>
>    <key>  A field name to sort on. Prefix - to sort in descending order of the
>           value.  When  unspecified,  refname is used. More than one sort keys
>           can be given.
>
> So I expect --sort=-committerdate to sort by date of committing,
> descending, and --count=1 pick first one, which means most recent.
git has a bug, it is not implementing the - prefix. I am using git head.

jonsmirl@terra:~$ cd mpc5200b jonsmirl@terra:~/mpc5200b$ git for-each-ref --format="%(refname):%09%(committer)" --sort=-committerdate refs/heads refs/heads/m24: Jon Smirl <jonsmirl@gmail.com> 1191362799 -0400 refs/heads/m25: Jon Smirl <jonsmirl@gmail.com> 1191472422 -0400 refs/heads/m26: Jon Smirl <jonsmirl@gmail.com> 1194382038 -0500 refs/heads/m28: Jon Smirl <jonsmirl@gmail.com> 1194385071 -0500 refs/heads/m29: Jon Smirl <jonsmirl@gmail.com> 1194674673 -0500 jonsmirl@terra:~/mpc5200b$ git for-each-ref --format="%(refname):%09%(committer)" --sort=committerdate refs/heads refs/heads/m24: Jon Smirl <jonsmirl@gmail.com> 1191362799 -0400 refs/heads/m25: Jon Smirl <jonsmirl@gmail.com> 1191472422 -0400 refs/heads/m26: Jon Smirl <jonsmirl@gmail.com> 1194382038 -0500 refs/heads/m28: Jon Smirl <jonsmirl@gmail.com> 1194385071 -0500 refs/heads/m29: Jon Smirl <jonsmirl@gmail.com> 1194674673 -0500 jonsmirl@terra:~/mpc5200b$ git --version git version 1.5.3.5.1651.g30bf jonsmirl@terra:~/mpc5200b$

Show 13 quoted lines
>
> It looks like "your" gitweb sorts ascending instead... strange...
>
>
> How does git_get_last_activity subroutine in your gitweb.cgi looks like?
> Does it have '--sort=-commiterdate'? If it has, then I think it is some
> strange bug in git, if it doesn't it is strange modification of gitweb.
>
> HTH
> --
> Jakub Narebski
> Poland
>
-- 
Jon Smirl
jonsmirl@gmail.com
Previous: Jakub NarebskiNext: Lars Hjemli
Message 8 of 10 in “gitweb, updating 'last changed' column on the project page”
  1. Jon SmirlNov 10, 2007
  2. Jakub NarebskiNov 10, 2007
  3. Jon SmirlNov 10, 2007
  4. Jon SmirlNov 10, 2007
  5. Jakub NarebskiNov 10, 2007
  6. Jon SmirlNov 10, 2007
  7. Jakub NarebskiNov 10, 2007
  8. Jon SmirlNov 10, 2007
  9. for-each-ref: fix setup of option-parsing for --sortLars Hjemli, Nov 10, 2007
  10. Johannes SchindelinNov 10, 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.