Problem/Motivation
Commit are shown in urls like https://www.drupal.org/commitlog/commit/296/e6225a4ae42b3274ca3ee35760ae...
They provide links pointing to the underlying repository viewer in use.
I have been hearing over time that it may be a good idea to skip completely this individual commit view, and instead go directly to the viewer.
Background
The original idea behind those was to provide a UI for the version control system managed in drupal, and later as a way to abstract away the actually used viewer.
Some reference on how that works:
- versioncontrol has an concept of view sets, which are used on the repositories, and the commitlog submodule there uses that for rendering several menu routes, including the one in the example; leveraging views to be able to be extended in a more drupal-friendly way.
- versioncontrol also has a concept of webviewer_url_handler plugins, which provide a way to expose a set of patterns to use on a given repository viewer, and then it can be chosen to be used. This has proven to be useful in the past: originally pointing to gitweb, then to cgit, now to gitlab.
That idea dates back to CVS times in drupal.org, and I think it is still useful, but probably not in all cases, so I think that having an alternative for at least one of the related views, the individual commit view, would be useful for lots of people inspecting commits in the UI.
Steps to reproduce
Go to any commit page, e.g. https://www.drupal.org/commitlog/commit/296/e6225a4ae42b3274ca3ee35760ae...
Proposed resolution
I think the easiest way, but maybe not the best, is to just override the d7 menu route to the individual commit messages view.
The change here attempts to work-around versioncontrol to accomplish the redirect.
Instead, the best way to do this is probably incorporating the idea as a flag inside commitlog submodule, and extend it to work for any commitlog view.
That is probably more effort than the suggested work-around.
Remaining tasks
Write the change.
Review the patch.
Review the changes working on fully running environment.
Decide if it is a good idea.
User interface changes
When looking at a given individual commit view, users will be redirected to the viewer, gitlab.
API changes
N.A.
Data model changes
N.A.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-3162472-3-6.txt | 698 bytes | marvil07 |
| #6 | 3162472-6.patch | 2 KB | marvil07 |
Issue fork drupalorg-3162472
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
marvil07 commentedAn initial change added at the related merge request, I think my first on in d.o!
I have not really tested this, but I think it may do what we want.
Please test!
Also attaching as usual patch just in case.
Comment #4
marvil07 commentedComment #5
drummThis could probably live in https://www.drupal.org/project/versioncontrol_gitlab
Comment #6
marvil07 commentedIndeed, it could live there too.
If it is moved there, I would suggest to provide an option to enable the behavior optionally.
The code added is not really backend-specific, so I thought using drupalorg is better to avoid the extra option.
In the future, this may become a versioncontrol module feature, but again, it is probably more work than this work-around.
I actually started trying to do it there, but stopped after a while to avoid introducing more logic to the already-long
commitlog_operations_page(); so I ended up on a drupalorg module specific approach.Sadly, I do not recall all details now on the why now.
Comment #7
drummWe'll need something to redirect, but I think we might be able to do that in VCL or another layer. Ideally, I'd like to remove the functionality completely, rather than keeping it and adding an additional override to do the redirect.
Comment #8
drummThe most visible use of these commit views on Drupal.org is on issue commit comments, which I’m replacing at #3253540: Skip individual commit view for commit issue comments
I'm thinking for the rest, we’ll entirely disable versioncontrol’s commitlog module and replace with redirects; instead of changing functionality one bit at a time.
Comment #10
drummThis has been deployed.