From 0865cfb2b9a37fa297cebf7e1c35e75805192fcc Mon Sep 17 00:00:00 2001 From: othmane399 Date: Fri, 26 Mar 2021 18:53:26 +0100 Subject: [PATCH 1/3] add --gpg-sign option on commits Signed-off-by: othmane399 --- lib/git/lib.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 191b8a74..7e3990e9 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -642,6 +642,7 @@ def remove(path = '.', opts = {}) # :date # :no_verify # :allow_empty_message + # :sign # # @param [String] message the commit message to be used # @param [Hash] opts the commit options to be used @@ -655,6 +656,7 @@ def commit(message, opts = {}) arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String arr_opts << '--no-verify' if opts[:no_verify] arr_opts << '--allow-empty-message' if opts[:allow_empty_message] + arr_opts << "--gpg-sign=#{opts[:sign]}" if opts[:sign] || "--gpg-sign" if opts[:sign]='' command('commit', arr_opts) end From 9bc69adf60ca577c9cba24b44fccf6b52e81f9a6 Mon Sep 17 00:00:00 2001 From: othmane399 Date: Fri, 26 Mar 2021 18:57:56 +0100 Subject: [PATCH 2/3] fx Signed-off-by: othmane399 --- lib/git/lib.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 7e3990e9..031d1e0c 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -656,7 +656,7 @@ def commit(message, opts = {}) arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String arr_opts << '--no-verify' if opts[:no_verify] arr_opts << '--allow-empty-message' if opts[:allow_empty_message] - arr_opts << "--gpg-sign=#{opts[:sign]}" if opts[:sign] || "--gpg-sign" if opts[:sign]='' + arr_opts << '--gpg-sign' if opts[:sign] command('commit', arr_opts) end From a2ba0e5fba15d2474c8f606d60fb7d3e86756c20 Mon Sep 17 00:00:00 2001 From: othmane399 Date: Tue, 27 Apr 2021 18:28:37 +0200 Subject: [PATCH 3/3] improve with key id Signed-off-by: othmane399 --- lib/git/lib.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 031d1e0c..bc7d2ef9 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -642,7 +642,7 @@ def remove(path = '.', opts = {}) # :date # :no_verify # :allow_empty_message - # :sign + # :gpg_sign # # @param [String] message the commit message to be used # @param [Hash] opts the commit options to be used @@ -656,7 +656,7 @@ def commit(message, opts = {}) arr_opts << "--date=#{opts[:date]}" if opts[:date].is_a? String arr_opts << '--no-verify' if opts[:no_verify] arr_opts << '--allow-empty-message' if opts[:allow_empty_message] - arr_opts << '--gpg-sign' if opts[:sign] + arr_opts << '--gpg-sign' if opts[:gpg_sign] == true || "--gpg-sign=#{opts[:gpg_sign]}" if opts[:gpg_sign] command('commit', arr_opts) end