Creating MRs from Issues breaks git if title is too long
Summary
When the issue title is too long and creating a merge request with the button in the issue, it e.g. creates a branch name like
329-5-as-developer-i-want-the-saving-toggling-closing-of-edin-interrupting-actions-behaviour-like-the-saving-of-text-questions-in-quizzes-and-submitting-trello-1607
when doing a git pull
on my linux machine I get an error telling me, the ref could not be locked as the file name is too long
Steps to reproduce
- creata a long issue title
- click button "create merge request from issue" or "create branch"
- do a git pull on your computer
Example Project
Using this on a self hosted version, sorry, no example project, but above is a pretty clear example
I am using the newest version of gitlab as it is available:
GitLab 9.2.5
GitLab Shell 5.0.4
GitLab Workhorse v2.0.0
GitLab API v4
Git 2.11.1
Ruby 2.3.3p222
Rails 4.2.8
postgresql 9.6.1
What is the current bug behavior?
See in summary.
What is the expected correct behavior?
i want no super long branch names when creating branches from issues. should be cut after a few characters.
Relevant logs and/or screenshots
error: cannot lock ref 'refs/remotes/origin/329-5-as-developer-i-want-the-saving-toggling-closing-of-edin-interrupting-actions-behaviour-like-the-saving-of-text-questions-in-quizzes-and-submitting-trello-1607': unable to resolve reference refs/remotes/origin/329-5-as-developer-i-want-the-saving-toggling-closing-of-edin-interrupting-actions-behaviour-like-the-saving-of-text-questions-in-quizzes-and-submitting-trello-1607: File name too long
From ****.*****.de:******/app
! [new branch] 329-5-as-developer-i-want-the-saving-toggling-closing-of-edin-interrupting-actions-behaviour-like-the-saving-of-text-questions-in-quizzes-and-submitting-trello-1607 -> origin/329-5-as-developer-i-want-the-saving-toggling-closing-of-edin-interrupting-actions-behaviour-like-the-saving-of-text-questions-in-quizzes-and-submitting-trello-1607 (unable to update local ref)
Output of checks
i don't think this is necessary as gitlab has no "error" but produces a branch with an error on my computer
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:5.0.0GitLab information Version: 9.2.5 Revision: 6f2e590 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git.bl****** HTTP Clone URL: https://git.bl******/some-group/some-project.git SSH Clone URL: git@git.bl******:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.0.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Possible fixes
shorten the branch name when creating a branch from an issue or ask what the name should be.
/label ~bug