-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add git_user_name and git_user_email option to match #8550
Add git_user_name and git_user_email option to match #8550
Conversation
If using useConfigOnly option (and global name or email settings is not set) in gitconfig, match fails to commit to git repository Add new two option for name and email and fix it.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
match/lib/match/options.rb
Outdated
@@ -64,6 +64,16 @@ def self.available_options | |||
verify_block: proc do |value| | |||
ENV["FASTLANE_TEAM_ID"] = value.to_s | |||
end), | |||
FastlaneCore::ConfigItem.new(key: :git_user_name, | |||
env_name: "MATCH_GIT_USER_NAME", | |||
description: "git user name to commit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that's just a small detail, but by user name
many people understand the nickname (in my case KrauseFx
), however in git it's recommended to use the full name as far as I know (in my case Felix Krause
). Maybe we should rename the key
, env_name
and description
to clarify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. I understand.
I will replace user name
to full name
and push this.
Hey @kouki-dan, thanks for taking the time to submit this PR, a great change, and I can totally see the use case for this 👍 |
match/lib/match/git_helper.rb
Outdated
commands << "git config user.name \"#{user_name}\"" unless user_name.nil? | ||
commands << "git config user.email \"#{user_email}\"" unless user_email.nil? | ||
|
||
UI.message "Add git user config to local git repo..." unless commands.empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can prepend this with a line that's just
return if commands.empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. That's better I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 🎷
Thanks for your contribution @kouki-dan 👍 |
i think that fixes: #8450 |
Yes, I got a same error as #8450. Thank you for your reviewing and merging. I support Fastlane project 👍 |
Congratulations! 🎉 This was released as part of fastlane 2.21.0 🚀 |
This is an awesome improvement! This problem got me for ages. I had to keep changing my gitconfig back and forth which was error prone. Thank you! However, I'm not sure why, but this isn't working for me. I'm running fastlane Tried: $ fastlane match -a my.app.id --git_full_name 'Fastlane Match' --git_user_email 'match@fastlane.tools' and # Fastfile
match(app_identifier: identifier,
readonly: readonly,
type: type,
shallow_clone: 1,
git_full_name: 'Fastlane Match',
git_user_email: 'match@fastlane.tools') Any idea as to what I'm doing wrong? |
@kylejm that's how you should use it. Can you submit a new issue with the output? Is it not working? |
Hey @KrauseFx, sorry for the slow response. Issue created ☝️. |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validDescription
Add new option to match
git_user_name
andgit_user_email
to set git config to match's git repository.Motivation and Context
If using useConfigOnly option (and global name or email settings is not set) in gitconfig, match fails to commit to git repository
Add new two option for name and email and fix it.
The reason which the git option needs is followed by this page