Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
Prevent gpg signing of commits (fixes qw3rtman#30)
Browse files Browse the repository at this point in the history
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 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.
  • Loading branch information
tkw1536 committed Aug 27, 2017
1 parent d72b68e commit 0754681
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion git-fire
Original file line number Diff line number Diff line change
Expand Up @@ -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
nosignflag="--no-gpg-sign"
else
nosignflag=""
fi

git commit -m "$message" --no-verify $nosignflag

for remote in $(git remote); do
git push --set-upstream "${remote}" "$(current_branch)" || true
Expand Down

0 comments on commit 0754681

Please sign in to comment.