diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-18 21:34:04 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-18 21:34:04 +0300 |
commit | 70ca3370ebc840ce8272c78bd7ff7f5ea0c957b1 (patch) | |
tree | 42b2a99520c33584a1cbfde4d239d69c5b23028b /app/services | |
parent | eba00325520a08939f3cb4b5a71c8beb8b457266 (diff) |
\#to_branch_name now uses the iid as postfix
Given the branch name 'mep-mep' with an iid being 1,
the current way, master's way, would yield a branch name of
1-mep-mep. The problem for larger projects however would be that
a developer might forget what iid the issue was.
When this developer would try to tab complete it would:
- Or result in 20+ branches possibly
- Or start with the wrong digit, try again with digit++
- Would see 20 branches, repeat
Thus the obvious way of solving this is letting the dev tab complete
on the issue title, which is easier to remember.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/build_service.rb | 2 | ||||
-rw-r--r-- | app/services/system_note_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb index fa34753c4fd..6e9152e444e 100644 --- a/app/services/merge_requests/build_service.rb +++ b/app/services/merge_requests/build_service.rb @@ -51,7 +51,7 @@ module MergeRequests # be interpreted as the use wants to close that issue on this project # Pattern example: 112-fix-mep-mep # Will lead to appending `Closes #112` to the description - if match = merge_request.source_branch.match(/\A(\d+)-/) + if match = merge_request.source_branch.match(/-(\d+)\z/) iid = match[1] closes_issue = "Closes ##{iid}" diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index f09b77c4a57..2afcaad4646 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -210,7 +210,7 @@ class SystemNoteService # Called when a branch is created from the 'new branch' button on a issue # Example note text: # - # "Started branch `201-issue-branch-button`" + # "Started branch `issue-branch-button-201`" def self.new_issue_branch(issue, project, author, branch) h = Gitlab::Application.routes.url_helpers link = h.namespace_project_compare_url(project.namespace, project, from: project.default_branch, to: branch) |