Skip to content
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

Prevent gpg signing of commits (fixes #30) #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tkw1536
Copy link

@tkw1536 tkw1536 commented Aug 27, 2017

When using git 2.x and the commit.gpgsign option is enabled, each commit is automatically signed with gpg. As noted in #30 this usually means that the user has to enter a password, or unlock the gpg key using some other method. This is a problem when having to leave the building because of fire.

This commit solves the problem by adding the --no-gpg-sign flag to the git commit invocation if the git version being used starts with a "2". This is achieved by checking the output of git version and using grep to match the version number.

When using git 2.x and the `commit.gpgsign` option is enabled, each
commit is automatically signed with gpg. As noted by @johnp this usally
means that the user has to enter a password, or unlock the gpg key using
some other method. This is a problem when having to leave the building
because of fire.

This commit solves the problem by adding the --no-gpg-sign flag to the
`git commit` invocation if the git version being used starts with a "2".
This is achieved by checking the output of `git version` and using grep
to match the version number.
@tkw1536
Copy link
Author

tkw1536 commented Aug 27, 2017

/cc @johnp this implements your suggestion

git-fire Outdated
@@ -42,7 +42,14 @@ fire() {
message="$*"
fi

git commit -m "$message" --no-verify
# for git >= 2.x add the --no-gpg-sign flag
if (git version | grep \\s2\.) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subshell is not necessary, but need ; before then then.

When checking that the git version is 2.x, do not use a subshell and
redirect output to /dev/null.
@tkw1536
Copy link
Author

tkw1536 commented Aug 28, 2017

I have updated the pull request after a comment from @glensc.
I am no longer using a sub-shell to check the git version, and am also silencing output from the version check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants