You can use the "gerrit query" SSH command to issue queries using the
same syntax as in the search in the web UI and get results back as
either human-readable text or JSON. You limit the query to e.g. only
cover some gits and/or branches. Example:
ssh -p 29418 first...@hostname.example.com \
gerrit query status:merged project:foo/bar branch:master
Please note that this won't necessarily be equivalent to "git log" as
only commits that have gone through review will be displayed. Commits
pushed straight through to refs/heads/branchname won't appear.
http://gerrit.googlecode.com/svn/documentation/2.1.6/user-search.html
http://gerrit.googlecode.com/svn/documentation/2.1.6/cmd-query.html
--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson
On Wednesday, April 27, 2011 at 09:26 CEST,
Chunlin Zhang <zhangc...@gmail.com> wrote:> Just like "git log" or something else,I want to know those newest
> changes be merged,how can I do this?
> I found a related cmd "gerrit stream-events",but it just do
> monitor,can not view historys.You can use the "gerrit query" SSH command to issue queries using the
same syntax as in the search in the web UI and get results back as
either human-readable text or JSON. You limit the query to e.g. only
cover some gits and/or branches. Example:ssh -p 29418 first...@hostname.example.com \
gerrit query status:merged project:foo/bar branch:master
Please note that this won't necessarily be equivalent to "git log" as
only commits that have gone through review will be displayed. Commits
pushed straight through to refs/heads/branchname won't appear.
> On Wednesday, April 27, 2011 3:47:35 PM UTC+8, Magnus Bäck wrote:
>
> > Please note that this won't necessarily be equivalent to "git log"
> > as only commits that have gone through review will be displayed.
> > Commits pushed straight through to refs/heads/branchname won't
> > appear.
>
> But the "gerrit stream-events" do monitor those commit through "git
> push" bypass gerrit.
Yes, via the ref update event.
> So I can not list those commits bypass review?
No, not without using Git on a cloned repository (or directly on the
server) or the stream-events command.
> But the "gerrit stream-events" do monitor those commit through "git
> push" bypass gerrit.Yes, via the ref update event.
> So I can not list those commits bypass review?
No, not without using Git on a cloned repository (or directly on the
server) or the stream-events command.
> > No, not without using Git on a cloned repository (or directly on the
> > server) or the stream-events command.
>
> I think it is necessary to add a command to show all including those
> bypass review in the future version.
Why? What problem are you trying to solve, and why are the existing
methods not enough?
On Wednesday, April 27, 2011 at 11:55 CEST,
Chunlin Zhang <zhangc...@gmail.com> wrote:> > No, not without using Git on a cloned repository (or directly on the
> > server) or the stream-events command.
>
> I think it is necessary to add a command to show all including those
> bypass review in the future version.Why? What problem are you trying to solve, and why are the existing
methods not enough?
> On Wednesday, April 27, 2011 6:08:25 PM UTC+8, Magnus Bäck wrote:
>
> > Why? What problem are you trying to solve, and why are the existing
> > methods not enough?
>
> Because some patches are submit using git push bypass review in our
> development,and we want to know all of it. "Git log" just limit to a
> project,I want to see log of all project as a whole.
"I want to list all commits" is not a problem, it's a solution to a
problem you're not telling us about.
Git is a distributed version control system where one of the fundamental
ideas is that all clones of a repository keep the full history of the
repository. Why is it so important to ask the server for the history of
a branch? Why is cloning a repository and running "git log" locally not
an option? Or, doing a regular SSH and running "git log"?
ssh somemachine.example.com "cd /path/to/repo && git log <options>"
One thing that could be useful is running "git ls-remote" to find out
the latest commits on each branch (and which branches that exist).
> On Apr 28, 2:58 pm, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
>
> > "I want to list all commits" is not a problem, it's a solution to a
> > problem you're not telling us about.
> >
> > Git is a distributed version control system where one of the
> > fundamental ideas is that all clones of a repository keep the full
> > history of the repository. Why is it so important to ask the server
> > for the history of a branch? Why is cloning a repository and running
> > "git log" locally not an option? Or, doing a regular SSH and running
> > "git log"?
>
> In the case of I want to give a list of modification to QA to test,and
> I want to list them all but some of them are push bypass review so
> that can not listed by gerrit,but if I want to use git log,I have look
> all of the 170+ git projects in android.
> Yes,I can use "repo forall -c git log",but the result is not sorted by
> time as a whole.
>
> I do not care about use server or local method,but just want it as a
> whole.
To be able to give a list of changes to your QA department you need a
base to compare to, right? The base is what you sent to QA last time.
Gerrit can never give you that. Save a manifest full of SHA-1s when
you pass something to QA, and next time you can use "git log" to see
what's new in each git.
What time would you like to sort by, anyway? Git only records two times;
author date and commit date. Neither of these indicate when a particular
change was introduced on a branch (except the commit date of merge
commits created by Gerrit) -- and that's what you're really interested
in, right.
To be able to give a list of changes to your QA department you need a
base to compare to, right? The base is what you sent to QA last time.
Gerrit can never give you that. Save a manifest full of SHA-1s when
you pass something to QA, and next time you can use "git log" to see
what's new in each git.
What time would you like to sort by, anyway? Git only records two times;
author date and commit date. Neither of these indicate when a particular
change was introduced on a branch (except the commit date of merge
commits created by Gerrit) -- and that's what you're really interested
in, right.
> > To be able to give a list of changes to your QA department you need
> > a base to compare to, right? The base is what you sent to QA last
> > time. Gerrit can never give you that. Save a manifest full of
> > SHA-1s when you pass something to QA, and next time you can use "git
> > log" to see what's new in each git.
>
> We do save a manifest to tag when release new version,but how to show
> git log just between two tag? I will be crazy if I should do this one
> by one to all the 170+ git project.
Why would you do this one by one when you can have a computer do it for
you? For example, you can point .repo/manifest.xml to a manifest with
SHA-1s and do
repo forall -c 'git log $REPO_RREV..'
to get the log from $REPO_RREV, i.e. the revision stated in the manifest
file, to HEAD.
> > What time would you like to sort by, anyway? Git only records two
> > times; author date and commit date. Neither of these indicate when a
> > particular change was introduced on a branch (except the commit date
> > of merge commits created by Gerrit) -- and that's what you're really
> > interested in, right.
>
> Yes,I want the commit date time.
Well, you can get the time when each commit object was created but that
will as I said not help you.
Why would you do this one by one when you can have a computer do it for
you? For example, you can point .repo/manifest.xml to a manifest with
SHA-1s and dorepo forall -c 'git log $REPO_RREV..'
to get the log from $REPO_RREV, i.e. the revision stated in the manifest
file, to HEAD.