Show all changes made between a range of commits in GitLab UI - gitlab

Say I have 10 commits in my merge request. I'd like to see all changes made between the first commit and the second to last commit. How can I see this in the GitLab UI?

You can view 'Changes' tab to view all changes in merge request
You can also click on individual commits to view what is changed in that particular commit
You can check diff between two arbitrary commits using https://gitlab.com/$USER/$REPO/compare?from=$SHA1&to=$SHA2
Reference:
https://stackoverflow.com/a/50070145/2073920

Use format
https://gitlab.com/$USER/$REPOSITORY/compare?from=commit_hashtag1&to=commit_hashtag2
For example, You use URL like this
https://gitlab.com/Donhu/java_examples/compare?from=7f844e6b&to=1ff5c89c

Related

Gitlab: How to setup squash on merge?

I want to setup the squash on merge policy in GitLab. This gif showcases exactly what I would like to have:
Merge Strategies
I have set the GitLab merge method to "Fast-forward merge" and the squash commits policy is set to mandatory when merging.
Once merge is done, the git log of the main branch is exactly like I want it. The feature branch commits were squashed and the whole feature appears as one commit in the git log.
Here's the problem:
The squashed commit that is now the head of the main branch has the timestamp of the last commit in the feature branch. I would expect it to be the timestamp of when the fast-forward merge happened (squash). Is there a way to set it up in GitLab?
The merge timestamp is important for me since I need to know when the feature made its way into the main branch. However, I want to keep the commit history streamlined and straightforward, so the default option with an additional merge commit for every merge is something I want to avoid.

How to concat commit messages with GitLab MR squash?

I am using GitLab MR to push commits to my project.
I have a certain template in my commit message that I want to keep on my target branch (e.g. master).
for example:
[Notes]:
when pushing several commits in a single MR we get something like this:
Commit 1: [Notes]: Note1
Commit 2: Merge commit (the one I want to get rid of when squashing)
Commit 3: [Notes]: Note2
when squashing with GitLab MR the squashed commit message is the title of the MR, which prevents me to keep my original commits template.
Is there an option in GitLab setting to change the squashed message to be a concat of all commit messages? similar to interactive rebase in git.
wanted behavior:
Squashed Commit: [Notes]: Note1
Merge commit (the one I want to get rid of when squashing)
[Notes]: Note2
GitLab 14.9.2-ee
I managed to find what I was looking for, it is a GitLab feature introduced in the FREE edition since GitLab 14.6.
Open GitLab website -> Settings -> General -> Merge requests -> Squash commit message template.
Then in the textbox add the following flag:
%{all_commits}
The commit messages are shown in the squash message according to their chronological order.
I do have this checkbox (see attached image) in my merge request enabling me to change the Merge Commit Message but I am using: 15.2.1-ee I'm not sure on what version this got introduced. I think there was a similar functionality in previous versions.

How to select merge changes in gitlab

I have a pending merge request and I am attempting to merge 2 branches via gitlab. I can see changes but there is no option for me to accept which change I would like to have:
Could someone clarify to me how do I accept the changes that I want when merging via gitlab?
What you see is probably a diff view, not a merge view.
If there are conflicts, you should see a "Resolve conflict" in the MR page.
That should open a view with a "use this" button for you to chose one side or the other.

How to do a code review for many commits in gitlab?

What is the easiest/best way to review a merge request in gitlab for a branch that has many commits?
Is there a “unified” view I can use somehow or is the only option to click on the “Changes” tab and go through each individual commits one by one?
You do not need to go through each invidividual commit one by one.
You should click on the Merge Request's "Changes" tab, instead of the "Changes" tab of individual commits, so you see the changes between the latest version and the branch you want to merge into, e.g. with Master:
This way, you will see all changes that are proposed within the merge request and you can review them all at once.

Keep Gitlab merge request asignee history

Since the last update of our self-hosted gitlab component, the assignee changes are not logged anymore on any merge request.
Just like so : (taken from Gitlab documentation)
Not only it allows to see the exact workflow but it can also gives informations on the timeline of these changes. All these were very helpfull.
I've searched in the changelog but it dosen't seem to be listed.
Here is my question :
Is it possible go get it back and if so, how ?
Thanks a lot in advance
You have probably hidden the activities. At the beginning of the events, where there are tabs for Discussion, Pipelines, Commits, and Changes, there is a dropdown where you can filter out some activities. You just need to select "Show all activity", or whatever fits you best

Resources