Age range in gerrit query

1,446 views
Skip to first unread message

Pravin

unread,
Oct 13, 2011, 8:36:32 AM10/13/11
to Repo and Gerrit Discussion
Hi,

I am trying to get all the commits which were made within last 2 hours
using Gerrit Query command line option.

e.g. if I specify 'ssh -p 29418 server gerrit query age:2h', it
returns all the changes which have not been updated for 2 hours or
more.

Is there a way to get the changes which have not been updated for 2
hours or less?

Thanks

Jean-Baptiste Queru

unread,
Oct 13, 2011, 8:43:55 AM10/13/11
to Repo and Gerrit Discussion
How about "-age:2h" ?

JBQ

> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Pravin

unread,
Oct 13, 2011, 8:53:58 AM10/13/11
to Repo and Gerrit Discussion
It says fatal: "-age:2h" is not a valid option.

Any other ideas?

On Oct 13, 5:43 pm, Jean-Baptiste Queru <j...@android.com> wrote:
> How about "-age:2h" ?
>
> JBQ
>
>
>
>
>
>
>
>
>
> On Thu, Oct 13, 2011 at 5:36 AM, Pravin <prav...@nvidia.com> wrote:
> > Hi,
>
> > I am trying to get all the commits which were made within last 2 hours
> > using Gerrit Query command line option.
>
> > e.g. if I specify 'ssh -p 29418 server gerrit query age:2h', it
> > returns all the changes which have not been updated for 2 hours or
> > more.
>
> > Is there a way to get the changes which have not been updated for 2
> > hours or less?
>
> > Thanks
>
> > --
> > To unsubscribe, email repo-discuss...@googlegroups.com
> > More info athttp://groups.google.com/group/repo-discuss?hl=en

Shawn Pearce

unread,
Oct 28, 2011, 10:13:58 PM10/28/11
to Pravin, Repo and Gerrit Discussion
On Thu, Oct 13, 2011 at 05:53, Pravin <pra...@nvidia.com> wrote:
> It says fatal: "-age:2h" is not a valid option.
>
> Any other ideas?

Ick. Its parsing that as a command line option, not a query operator.
Try instead:

ssh -p 29418 server gerrit query -- -age:2h

The -- before the query will break the option list and make all
remaining arguments actual arguments. That said, this is probably not
the most efficient way to find things updated in the last 2 hours. I
don't think we have a good operator for this type of query, but its
been a long time since I dug around how the age: operator is mapped
onto the sort_key column for a range scan.

Reply all
Reply to author
Forward
0 new messages