-
Notifications
You must be signed in to change notification settings - Fork 18
[W-367] geordi deploy: move Linear state forward
#240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,23 @@ | |
| LONGDESC | ||
|
|
||
| def commit(*git_args) | ||
| require 'geordi/gitlinear' | ||
| Gitlinear.new.commit(git_args) | ||
| require 'geordi/linear_client' | ||
| require 'geordi/git' | ||
| require 'highline' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check this:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the case. While the entry in the gemspec causes This is a mechanism of bundler, which you need to explicitly call (
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, thanks! PS How did you see this comment :D |
||
|
|
||
| Interaction.warn <<~WARNING unless Git.staged_changes? | ||
| No staged changes. Will create an empty commit. | ||
| WARNING | ||
|
|
||
| linear_client = LinearClient.new | ||
| highline = HighLine.new | ||
|
|
||
| issue = linear_client.issue_from_branch || linear_client.choose_issue | ||
| title = "[#{issue['identifier']}] #{issue['title']}" | ||
| description = "Issue: #{issue['url']}" | ||
| extra = highline.ask("\nAdd an optional message").strip | ||
| title << ' - ' << extra if extra != '' | ||
| Util.run!(['git', 'commit', '--allow-empty', '-m', title, '-m', description, *git_args]) | ||
LisaHader marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Hint.did_you_know [ | ||
| :branch, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| module Geordi | ||
LisaHader marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| class Git | ||
| class << self | ||
| def local_branch_names | ||
| @local_branch_names ||= begin | ||
| branch_list_string = if Util.testing? | ||
| ENV['GEORDI_TESTING_GIT_BRANCHES'].to_s | ||
| else | ||
| `git branch --format="%(refname:short)"` | ||
| end | ||
|
|
||
| branch_list_string.strip.split("\n") | ||
| end | ||
| end | ||
|
|
||
| def current_branch | ||
| if Util.testing? | ||
| default_branch | ||
| else | ||
| `git rev-parse --abbrev-ref HEAD`.strip | ||
| end | ||
| end | ||
|
|
||
| def staged_changes? | ||
| if Util.testing? | ||
| ENV['GEORDI_TESTING_STAGED_CHANGES'] == 'true' | ||
| else | ||
| statuses = `git status --porcelain`.split("\n") | ||
| statuses.any? { |l| /^[A-Z]/i =~ l } | ||
| end | ||
| end | ||
|
|
||
| def default_branch | ||
| default_branch = if Util.testing? | ||
| ENV['GEORDI_TESTING_DEFAULT_BRANCH'] | ||
| else | ||
| head_symref = `git ls-remote --symref origin HEAD` | ||
| head_symref[%r{\Aref: refs/heads/(\S+)\sHEAD}, 1] | ||
| end | ||
|
|
||
| default_branch || 'master' | ||
| end | ||
|
|
||
| def commits_between(source_branch, target_branch) | ||
| return [ENV['GEORDI_TESTING_GIT_COMMIT']] if Util.testing? | ||
|
|
||
| commits = `git --no-pager log --pretty=format:%s origin/#{target_branch}..#{source_branch}` | ||
|
|
||
| commits&.split("\n") | ||
| end | ||
| end | ||
| end | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.