b0VIM 8.1 ǝ`Su josh Joshs-Mac-mini.local ~josh/Projects/fastlane/fastlane/fastlane/lib/fastlane/helper/git_helper.rb utf-8
3210 #"! U tp X N Y ad J X v u ] W %
R
t #
c
8
^ J z D + * \ '
f ' i a Y X _ @ P def self.git_author # DEPRECATED: Use git_author_email instead. # Get the author email of the last git commit # @deprecated Use git_author_email instead end nil rescue Actions.sh(*command.compact, log: false).chomp command << "--date=#{date_format}" if date_format command << "--pretty=#{pretty_format}" command = %w(git log -1) def self.last_git_commit_formatted_with(pretty_format, date_format = nil) # pretty format String. See the git-log documentation for valid format placeholders # Gets the last git commit information formatted into a String by the provided end } abbreviated_commit_hash: last_git_commit_formatted_with('%h') commit_hash: last_git_commit_formatted_with('%H'), message: last_git_commit_formatted_with('%B'), author_email: last_git_commit_formatted_with('%ae'), author: last_git_commit_formatted_with('%an'), { return nil if last_git_commit_formatted_with('%an').nil? def self.last_git_commit_dict end nil rescue Actions.sh(*command.compact, log: false).chomp command << tag_match_pattern if tag_match_pattern command << '--match' if tag_match_pattern command << hash command << '--tags' if match_lightweight command = %w(git describe) return unless hash # anything reasonably expected. Bail out early. # run and provide some output, although it's definitely not going to be # If hash is nil (command fails), "git describe" command below will still hash = last_git_tag_hash(tag_match_pattern) def self.last_git_tag_name(match_lightweight = true, tag_match_pattern = nil) end nil rescue Actions.sh('git', 'rev-list', "--tags#{tag_pattern_param}", '--max-count=1').chomp tag_pattern_param = tag_match_pattern ? "=#{tag_match_pattern}" : '' def self.last_git_tag_hash(tag_match_pattern = nil) end nil rescue Actions.sh(*command.compact, log: false).chomp command << git_log_merge_commit_filtering_option(merge_commit_filtering) command << '-n' << commit_count.to_s command << '--ancestry-path' if ancestry_path command << "--date=#{date_format}" if date_format command << "--pretty=#{pretty_format}" command = %w(git log) def self.git_log_last_commits(pretty_format, commit_count, merge_commit_filtering, date_format = nil, ancestry_path) end nil rescue Actions.sh(*command.compact, log: false).chomp # will then be individually shell-escaped by Actions.sh. # "*command" syntax expands "command" array into variable arguments, which command << git_log_merge_commit_filtering_option(merge_commit_filtering) command << "#{from}...#{to}" command << '--ancestry-path' if ancestry_path command << "--date=#{date_format}" if date_format command << "--pretty=#{pretty_format}" command = %w(git log) def self.git_log_between(pretty_format, from, to, merge_commit_filtering, date_format = nil, ancestry_path) end end.freeze Helper.test? && branch == "CIRCLE_BRANCH" # Removing because tests break on CircleCI GIT_BRANCH_ENV_VARS = %w(GIT_BRANCH BRANCH_NAME TRAVIS_BRANCH BITRISE_GIT_BRANCH CI_BUILD_REF_NAME CI_COMMIT_REF_NAME WERCKER_GIT_BRANCH BUILDKITE_BRANCH APPCENTER_BRANCH CIRCLE_BRANCH).reject do |branch| module SharedValues GIT_MERGE_COMMIT_FILTERING_OPTIONS = [:include_merges, :exclude_merges, :only_include_merges].freeze module Actions module Fastlane ad
a N T 6 A $
X
3
p C e #
X
N
F
E
@ . | H 3 u * } s k e a W C ! end end end end enenenenenenenenenenenenend end enenenenend end end end end end nil when :include_merges "--merges" when :only_include_merges "--no-merges" when :exclude_merges case merge_commit_filtering def self.git_log_merge_commit_filtering_option(merge_commit_filtering) private_class_method end nil UI.verbose("Error getting git default remote branch: #{err.message}") rescue => err end Actions.sh("variable=$(git remote) && git remote show $variable | grep 'HEAD branch' | sed 's/.*: //'", log: false).chomp # Query git for the current remote head else Actions.sh("git remote show #{remote_name} | grep 'HEAD branch' | sed 's/.*: //'", log: false).chomp if remote_name # Rescues if not a git repo or no remote repo def self.git_remote_branch_name(remote_name) # Returns the default git remote branch name end nil UI.verbose("Error getting git branch: #{err.message}") rescue => err Actions.sh("git rev-parse --abbrev-ref HEAD", log: false).chomp # Rescues if not a git repo or no commits in a git repo def self.git_branch_name_using_HEAD # Returns the checked out git branch name or "HEAD" if you're in detached HEAD state end end self.git_branch_name_using_HEAD ENV.fetch(env_name.to_s) do env_name = SharedValues::GIT_BRANCH_ENV_VARS.find { |env_var| FastlaneCore::Env.truthy?(env_var) } def self.git_branch # Can be replaced using the environment variable `GIT_BRANCH` # Returns the current git branch, or "HEAD" if it's not checked out to any branch end return nil return string unless string.empty? string = last_git_commit_formatted_with(format_specifier).to_s format_specifier = short ? '%h' : '%H' def self.last_git_commit_hash(short) # Get the hash of the last commit end nil return s if s.to_s.length > 0 s = (last_git_commit_formatted_with('%B') || "").strip def self.last_git_commit_message # Returns the unwrapped subject and body of the last commit end last_git_commit_message UI.important('`last_git_commit` is deprecated. Please use `last_git_commit_message` instead.') def self.last_git_commit # DEPRECATED: Use last_git_commit_message instead. # Returns the unwrapped subject and body of the last commit end return nil return s if s.to_s.length > 0 s = last_git_commit_formatted_with('%ae') def self.git_author_email # Get the author email of the last git commit end git_author_email UI.deprecated('`git_author` is deprecated. Please use `git_author_email` instead.')