[go: up one dir, main page]

Skip to content

Compare a single file between two arbitrary git revisions

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

For audit, debugging, or just plain interest purposes, sometimes you need to view the changes in a specific file between two arbitrary revisions in git. Currently, the GitLab UI doesn't give a nice clean way to do this.

Intended users

Engineers, researchers

Further details

You can use the Compare page to see all changes in a revision, but when there are lots of changes, that can be very slow. If you already know the file, it would be better to be able to provide the name upfront.

Git permits you to do this on the command line:

lupine@gitlab-t470p:~/dev/gitlab.com/gitlab-org/gdk-ce/gitlab$ git diff v10.0.0..v11.10.0 -- GITALY_SERVER_VERSION
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index ca75280b09b..7aa332e4163 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-0.38.0
+1.33.0

Proposal

Allow an optional filename to be provided on the current Compare page: https://gitlab.com/gitlab-org/gitlab-ce/compare?from=master&to=master

Add a button to the blob show page: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/GITALY_SERVER_VERSION that takes you to the Compare page with the file and source branch already filled in. This could go by the Blame and History buttons.

Permissions and Security

Nothing new

Documentation

Update https://docs.gitlab.com/ce/user/project/repository/#compare

Testing

Add a feature spec for this

What does success look like, and how can we measure that?

I can easily see what the Gitaly version change to between two arbitrary tags or branches in gitlab without having to resort to the command line.

Links / references

Edited by 🤖 GitLab Bot 🤖