We recently migrated from using Subversion and Trac to Git and GitLab. We successfully migrated all of our old data.
I'm still trying to learn GitLab and generally like it better than Trac, but one thing I don't like as much is that when you reference a GitLab Issue in the git commit, it adds a reference and link to that commit under the issue, but you have to browse to the commit itself to see the associated Git commit message.
In Trac, we had it configured such that the Subversion commit messages were all displayed in the Trac ticket with the commit link, so it was easier to view all the relevant information for that ticket in one place.
Is there a way to configure GitLab to display the Git commit message with the Git commit link that shows up under Issues? The message does show up in the commit list, but not on a referenced Issue.
I thought about trying to use a server hook to generate a note with the Git commit message when a commit is made, but just wondering if there is an easier/better way to accomplish this?
There is no built-in way to show the commit message of a crosslinked commit in the issue log. After all, commits are handled the same way as any other mentions: in the issue's history/mention log.
While the example in GitLab's documentation unfortunately misses the opportunity to show an example of a mention in the commit, here's an issue from GitLab itself with a mention. This commit also shows how mentions often get used within commits—with keywords:
Merge branch '65375-broken-master-gitlab-svg-path-test-failing' into 'master'
Update failing jest snapshot
Closes #13186
See merge request gitlab-org/gitlab-ee!14933
These kind of commits close the specific issue and don't require any further user action. Adding that kind of noise to the discussion/comment section of an issue is, in my opinion, only cluttering the discussion between actual humans*. However, the commit still shows up in the log and is clickable and hoverable.
To get back to your question:
Is there a way to configure GitLab to display the Git commit message with the Git commit link that shows up under Issues?
If you hover over the linked commit, then you'll get the commit's subject. There's nothing more that can be achieved within GitLab itself.
I thought about trying to use a server hook to generate a note with the Git commit message when a commit is made, but just wondering if there is an easier/better way to accomplish this?
If you follow the usual commit/merge message based issue closing and use [Closes?|Fix(es)?] #issue in your commit message, you may end up with more noise in the comments than you would like too.
* well, except for some bots
Related
in my new project I can't close Gitlab issue's automatically via commit. this is what I try to do:
git add .
git commit -m "close #32"
git push origin develop
in my previous project when I try this codes, issue closed automatically in Gitlab.
what should I do?
First, make sure the commit closing the issue is not the very first commit.
As documented in gitlab-org/gitlab-foss issue 54722, it would not work. By design.
Check if another new commit, with the same comment, works better.
If not, check the GitLab server log for any error mentioning a failure to process the commit comments.
Possibly the feature is disabled from GitLab for certain reason.
Go to GitLab -> Your Project -> Settings -> Repository and see the below screenshot. As seen, the checkbox needs to be enabled in order to avail the auto close functionality based on the reference in the commit message.
How to do git commit, push and pull in builder?
I have not found any way to graphically do this through the IDE Builder.
Not possible yet. There is a feature request, and the Roadmap mentions the "Git Perspective":
We would like an additional “Git” perspective that can be used to
manage various source control aspects. You might use this to stage
files for commit. You might use it to browse your projects history
including searching for a previous commit to inspect it.
git GUI might help you or you have comes in the terminal no choice.
Is there a way to find out who pushed a particular commit to gitlab - In the commit log (I see the author set via the git client config) , I instead want to see which gitlab user's authentication was used to PUSH that code ?
PS: There are multiple git specific questions asked and there was no solution provided in the previous questions - want to see if gitlab has some specific implementation to solve this ?
2018: I answered "no" 5 years ago, but GitLab offers audit logs of its own: As mentioned here HTTP and SSH requests are logged in different files:
HTTP: nginx/gitlab_access.log
SSH: gitlab-shell.log
However, that won't give you the SHA1(s) pushed, only the push event date and IP: you still need to cross-reference that with a commit date, to get an idea of who did push a given commit.
GitLab 14.9 (March 2022) seems to include push events (but for Premium/Ultimate editions only):
New audit events
The GitLab 14.9 release adds support for auditing the following activities:
Creating a new merge request approval rule.
Deleting a merge request approval rule.
Approving a merge request. (Supported as streaming audit events only.)
Creating, deleting, or revoking a project or group deploy token.
Failed attempts to create a project or group deploy token.
Authenticated git push or git pull commands to a private repository performed over either SSH or HTTPS (Supported as streaming audit events only.)
See Documentation and Issue.
Only commit status can be known. But person who actually pushed cannot be known.
because of the confusing nature of your question, I am only able to provide simple answers.
If what you are asking is to see what authentication a particular user has used to PUSH a commit then you should be able to find it based on the remote URL for the repo.
If you are looking to find out who did a specific commit, you can search for it in the Web UI.
Hope this helps, reach out if you have additional questions.
I would like to integrate Redmine with SVN in a manner that the commit message automatically gets posted in the Redmine Ticket ID. Kindly let me know if there are any plugins or hooks up which can be used for me to achieve the same
Such functionality is built in.
Go to Admin | Settings click on Repositories tab, and there you will see following section:
Referencing and fixing issues in commit messages
Referencing keywords
By default, there are:
refs,references,IssueID
So when you perform svn commit, and say
refs #23
such change will be displayed on issue no=23, once you refresh repositories and visit issue again.
There is also way to automate it, so svn or git, post-commit hook refreshes repositores for you...
Full doc here: http://www.redmine.org/projects/redmine/wiki/HowTo_setup_automatic_refresh_of_repositories_in_Redmine_on_commit
Such way if you track changes, you can see all code that was changed, regarding some issue...
For example:
And you can click on (diff) to see that particular code...
Then, furthermore, you can copy URL's when you click diff, so you can discuss code with your peers...
Cheers :)
I noticed that in my developpment team, sometimes someone forgets to commit a file that must go with an other to keep the site working. this causes problemes and waste of time...
The question is : Is it possible to tell SVN tortoise : if someone tries to commit a file A without files (A1, A2,...An) ask them if they are sure they don't need to commit them too?
You need to have look at hooks.hook is nothing but a program triggered by some repository event.You can write whatever set of activities(alert in your case) inside hooks.use pre hooks for running the hooks before any task take place.
EDIT:
Refer commit monitor.CommitMonitor is a small tool to monitor Apache™ Subversion® repositories for new commits.