Repository browser with standard Gerrit commit viewer

580 views
Skip to first unread message

Daniel Levin

unread,
Feb 17, 2020, 12:27:56 AM2/17/20
to Repo and Gerrit Discussion
How to browse branches and commit history and view _any_ commit in the Gerrit?

Gerrit has nice web interface to show diff for the changes and even different patch sets, i.e. arbitrary revisions.
I want to use this viewer for _any_ commit, not just the ones changes were created for.
There are lot of cases when project commits are imported from alien sources, and they are not subject for review.

If this is possible, then how, if not then why not?

I would expect to have something like: https://mygerrit/myproject/<branch>/<commit>
Sharing such URL with people would directly open the commit viewer, similar to how change URL behaves.
Maybe even allow to enter comments, but just read only mode would be also good enough.

I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.
Especially when Gerrit is already powered with rich commit viewer out of the box.

David Ostrovsky

unread,
Feb 17, 2020, 12:45:17 AM2/17/20
to Repo and Gerrit Discussion

Am Montag, 17. Februar 2020 06:27:56 UTC+1 schrieb Daniel Levin:
How to browse branches and commit history and view _any_ commit in the Gerrit?

Gerrit has nice web interface to show diff for the changes and even different patch sets, i.e. arbitrary revisions.
I want to use this viewer for _any_ commit, not just the ones changes were created for.
There are lot of cases when project commits are imported from alien sources, and they are not subject for review.


There is a dedicated post-submit workflow in gerrit:
"create gerrit change for merged commit that bypassed review branch"
for this use case:

  $ git push origin sha1:refs/for/master%merged

See slide #5 from the talk that I gave in Palo Alto user conference 2018: [1].



David Pursehouse

unread,
Feb 17, 2020, 12:46:49 AM2/17/20
to Daniel Levin, Repo and Gerrit Discussion
On Mon, Feb 17, 2020 at 2:27 PM Daniel Levin <dend...@gmail.com> wrote:
How to browse branches and commit history and view _any_ commit in the Gerrit?

Gerrit has nice web interface to show diff for the changes and even different patch sets, i.e. arbitrary revisions.
I want to use this viewer for _any_ commit, not just the ones changes were created for.
There are lot of cases when project commits are imported from alien sources, and they are not subject for review.

If this is possible, then how, if not then why not?

No, because the expectation is to use the external browser (gitiles, gitweb, etc).
 

I would expect to have something like: https://mygerrit/myproject/<branch>/<commit>
Sharing such URL with people would directly open the commit viewer, similar to how change URL behaves.
Maybe even allow to enter comments, but just read only mode would be also good enough.

I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.

I'm not sure what you mean here with "dummy interface".

 
Especially when Gerrit is already powered with rich commit viewer out of the box.

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

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/f89ece49-7d34-4b6b-ac4c-8aa341feaf97%40googlegroups.com.

Daniel Levin

unread,
Feb 17, 2020, 12:59:32 AM2/17/20
to Repo and Gerrit Discussion
Thanks David, this is something. But still not quite useful for general case.

There are definitely cases when patches might went into the tree without review, and you still want to discuss them (post factum).

But there are also other cases when patches were imported from alien Git repository.
I have tons of projects when I have to host mirror of some repository developed elsewhere, and use Gerrit for developing internal patches, merging them with the remote mainline periodically.
For sure there is no need to create a change for those patches, but viewing them is absolutely necessary.

Creating an artificial change for such patches might make sense if you want to, lets say, put a comment and discuss with your internal Gerrit team.
But in majority of the cases all you need is read-only viewer, without altering the Gerrit change database.

Daniel Levin

unread,
Feb 17, 2020, 1:15:54 AM2/17/20
to Repo and Gerrit Discussion
If this is possible, then how, if not then why not?

No, because the expectation is to use the external browser (gitiles, gitweb, etc).

That is what my question was about in first place: why this expectation exists?

Gitiles, Gitweb, etc. are generic web viewers for the existing Git repositories, which makes sense if you have absolutely nothing, but still wants to expose the history of your Git repository on the web somehow.

In case of Gerrit this does not make much sense, at lease when it comes to the viewing particular commit.
As I highlighted above, Gerrit has nice diff viewer, including side-by-side, unified layouts, image comparison, etc.
Guess I don't have to explain to Gerrit developers why good diff viewer is important, because that is what they are developing exactly.

I see no real reason why this commit/diff viewer cannot be used for arbitrary commit in read only mode, without having the change.


I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.

I'm not sure what you mean here with "dummy interface".

They are very simple and follow the terminal like look and feel.
Lets take gitiles: it shows plain diff format, no side-by-side, no unified view, no way to see change in-the-middle-of-the-line, no way to show more context lines above/below, no way to skip whitespace, etc etc etc.
Do I really have to explain the advantages of the flexible visual history viewer over the static dump of the console diff?

David Ostrovsky

unread,
Feb 18, 2020, 9:17:28 AM2/18/20
to Repo and Gerrit Discussion

Am Montag, 17. Februar 2020 07:15:54 UTC+1 schrieb Daniel Levin:
If this is possible, then how, if not then why not?

No, because the expectation is to use the external browser (gitiles, gitweb, etc).

That is what my question was about in first place: why this expectation exists?

Gitiles, Gitweb, etc. are generic web viewers for the existing Git repositories, which makes sense if you have absolutely nothing, but still wants to expose the history of your Git repository on the web somehow.

In case of Gerrit this does not make much sense, at lease when it comes to the viewing particular commit.
As I highlighted above, Gerrit has nice diff viewer, including side-by-side, unified layouts, image comparison, etc.
Guess I don't have to explain to Gerrit developers why good diff viewer is important, because that is what they are developing exactly.

I see no real reason why this commit/diff viewer cannot be used for arbitrary commit in read only mode, without having the change.


Even if it is a good idea, to re-use existing frontend and backend Gerrit code to view
arbitrary commits, we are not there yet.


I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.

I'm not sure what you mean here with "dummy interface".

They are very simple and follow the terminal like look and feel.
Lets take gitiles: it shows plain diff format, no side-by-side, no unified view,

Looking at Gitweb: [1], it offers many features you are missing in Gitiles.
 
no way to see change in-the-middle-of-the-line,

This is actually a very good point. LibreOffice developers raised the same concerns:
the ability to see the changes in-the-middle-of-the-line. LibreOffice infra team patched
Gitiles and added that feature: [2]. It would be great, if this patch could be upstreamed.
 
no way to show more context lines above/below, no way to skip whitespace, etc etc etc.

Luca Milanesio

unread,
Feb 18, 2020, 4:14:49 PM2/18/20
to David Ostrovsky, Luca Milanesio, Repo and Gerrit Discussion

On 18 Feb 2020, at 14:17, David Ostrovsky <david.o...@gmail.com> wrote:


Am Montag, 17. Februar 2020 07:15:54 UTC+1 schrieb Daniel Levin:
If this is possible, then how, if not then why not?

No, because the expectation is to use the external browser (gitiles, gitweb, etc).

That is what my question was about in first place: why this expectation exists?

Gitiles, Gitweb, etc. are generic web viewers for the existing Git repositories, which makes sense if you have absolutely nothing, but still wants to expose the history of your Git repository on the web somehow.

In case of Gerrit this does not make much sense, at lease when it comes to the viewing particular commit.
As I highlighted above, Gerrit has nice diff viewer, including side-by-side, unified layouts, image comparison, etc.
Guess I don't have to explain to Gerrit developers why good diff viewer is important, because that is what they are developing exactly.

I see no real reason why this commit/diff viewer cannot be used for arbitrary commit in read only mode, without having the change.


Even if it is a good idea, to re-use existing frontend and backend Gerrit code to view
arbitrary commits, we are not there yet.

The gap has been discussed many times, and the use-case makes a lot of sense to me.
However, during the discussions, the bottom line was always the same: “we have so much work and improvement to make in Gerrit on the code-review user exeperience, that we cannot and should not focus on a generic code / diff viewer, which is a huge effort if you want to make it right”.

I tend to agree with that, even though I would like to have a code-viewer and code-review experience blended in Gerrit.



I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.

I'm not sure what you mean here with "dummy interface".

They are very simple and follow the terminal like look and feel.
Lets take gitiles: it shows plain diff format, no side-by-side, no unified view,

Looking at Gitweb: [1], it offers many features you are missing in Gitiles.

Yes, but it’s a different user-experience and it would be very clunky to jump from one to the other.

 
no way to see change in-the-middle-of-the-line,

This is actually a very good point. LibreOffice developers raised the same concerns:
the ability to see the changes in-the-middle-of-the-line. LibreOffice infra team patched
Gitiles and added that feature: [2]. It would be great, if this patch could be upstreamed.

+1 to that, I did not know about it and it looks a great idea.

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

--- 
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Daniel Levin

unread,
Feb 18, 2020, 4:28:08 PM2/18/20
to Repo and Gerrit Discussion

Looking at Gitweb: [1], it offers many features you are missing in Gitiles.

When coming to the commit viewing there is no big difference, both are merely a plain static output from the console diff.
 
 
no way to see change in-the-middle-of-the-line,

This is actually a very good point. LibreOffice developers raised the same concerns:
the ability to see the changes in-the-middle-of-the-line. LibreOffice infra team patched
Gitiles and added that feature: [2]. It would be great, if this patch could be upstreamed.
 
no way to show more context lines above/below, no way to skip whitespace, etc etc etc.

+1 to add these features to Gitiles.


It is totally make sense to add these small and neat improvements to the Gitiles, because it is standalone web Git browser. So users who use it outside of Gerrit will get immediate improvement.

But in scope of the Gerrit is does not make much sense taking in account existence of the super powerful commit viewer already incorporated into the change viewer. Small improvements into the Gitiles are still microscopic comparing to the Gerrit features.


Even if it is a good idea, to re-use existing frontend and backend Gerrit code to view
arbitrary commits, we are not there yet.

That is fine, what is needed first is to understand the current state and vision of the dev team about this.

Here are the challenges I am facing. We got bunch of projects on the Github, Bitbucket, etc. which totally makes sense to move to the Gerrit, because its review approach is superior. Yet it is huge step backward when it is coming to browsing the existing code base history, comparing to Github, Gitlab, Bitbucket. Ability to share the link pointing to exact file + line number is important as well. Having configurable appearance, syntax highlighting, changing tab size, hiding whitespace, turn on/off blame, etc. all these features cannot be underestimated.

Maybe combining Gitiles with Gerrit commit viewer would be an option, when history browsing is done with Gitiles, but clicking the diff link would open the Gerrit commit page. Just thinking out loud.

Daniel Levin

unread,
Feb 18, 2020, 4:35:16 PM2/18/20
to Repo and Gerrit Discussion
On Tuesday, February 18, 2020 at 1:14:49 PM UTC-8, lucamilanesio wrote:

“we have so much work and improvement to make in Gerrit on the code-review user exeperience, that we cannot and should not focus on a generic code / diff viewer, which is a huge effort if you want to make it right”.


Interesting, from my humble point of view commit viewer is just the same as in change viewer but with stripped features, like adding comments, switching patch sets, editing commit message, etc.

Some simple implementation would be a good start already:
- no diff between arbitrary revisions, simply show diff to the first parent
- show commit message
- show parents as hyperlinks, clicking on which will switch to that commit view

Matthias Sohn

unread,
Feb 18, 2020, 7:11:28 PM2/18/20
to Daniel Levin, Repo and Gerrit Discussion
I agree these would be valuable additions to the existing UI, though we need someone dedicating some time
to work on that otherwise it's just wishful thinking. Hence I propose, if you can spend some time, you write
down a design proposal starting with the most important use cases following [1].


-Matthias 

David Ostrovsky

unread,
Feb 23, 2020, 3:29:55 PM2/23/20
to Repo and Gerrit Discussion

Am Dienstag, 18. Februar 2020 15:17:28 UTC+1 schrieb David Ostrovsky:

Am Montag, 17. Februar 2020 07:15:54 UTC+1 schrieb Daniel Levin:
If this is possible, then how, if not then why not?

No, because the expectation is to use the external browser (gitiles, gitweb, etc).

That is what my question was about in first place: why this expectation exists?

Gitiles, Gitweb, etc. are generic web viewers for the existing Git repositories, which makes sense if you have absolutely nothing, but still wants to expose the history of your Git repository on the web somehow.

In case of Gerrit this does not make much sense, at lease when it comes to the viewing particular commit.
As I highlighted above, Gerrit has nice diff viewer, including side-by-side, unified layouts, image comparison, etc.
Guess I don't have to explain to Gerrit developers why good diff viewer is important, because that is what they are developing exactly.

I see no real reason why this commit/diff viewer cannot be used for arbitrary commit in read only mode, without having the change.


Even if it is a good idea, to re-use existing frontend and backend Gerrit code to view
arbitrary commits, we are not there yet.


I know there is gitiles and other web Git browsers but they all have dummy interface and diff viewers.

I'm not sure what you mean here with "dummy interface".

They are very simple and follow the terminal like look and feel.
Lets take gitiles: it shows plain diff format, no side-by-side, no unified view,

Looking at Gitweb: [1], it offers many features you are missing in Gitiles.
 
no way to see change in-the-middle-of-the-line,

This is actually a very good point. LibreOffice developers raised the same concerns:
the ability to see the changes in-the-middle-of-the-line. LibreOffice infra team patched
Gitiles and added that feature: [2]. It would be great, if this patch could be upstreamed.

Reply all
Reply to author
Forward
0 new messages