git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Jon Smirl" <jonsmirl@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: gitweb, updating 'last changed' column on the project page
Date: Sat, 10 Nov 2007 14:27:15 +0100	[thread overview]
Message-ID: <200711101427.18215.jnareb@gmail.com> (raw)
In-Reply-To: <9e4733910711100505n78459612xdaa12eaa880773d8@mail.gmail.com>

Jon Smirl wrote:
> On 11/10/07, Jakub Narebski <jnareb@gmail.com> wrote:
>> On Saturday, 10 November 2007, Jon Smirl wrote:
>>> On 11/10/07, Jon Smirl <jonsmirl@gmail.com> wrote:
>>>
>>>> [daedalus]$ 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> 1194585780 -0500
>>>
>>> It appears to be using the first head instead of the most recent date.
>>
>> It appears to not _sort_ the output by committerdate, as it should with
>> '--sort=-committerdate'.
> 
> 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.

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

  reply	other threads:[~2007-11-10 13:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10  1:09 gitweb, updating 'last changed' column on the project page Jon Smirl
2007-11-10  1:58 ` Jakub Narebski
2007-11-10  6:01   ` Jon Smirl
2007-11-10  6:10     ` Jon Smirl
2007-11-10  9:34       ` Jakub Narebski
2007-11-10 13:05         ` Jon Smirl
2007-11-10 13:27           ` Jakub Narebski [this message]
2007-11-10 14:10             ` Jon Smirl
2007-11-10 16:07               ` [PATCH] for-each-ref: fix setup of option-parsing for --sort Lars Hjemli
2007-11-10 16:25                 ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711101427.18215.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jonsmirl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).