git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] pull: warn on --verify-signatures with --rebase

From
Alexander 'z33ky' Hirsch <1zeeky@gmail.com>
Date
May 18, 2016, 10:18 UTC
Message-ID
<20160518101827.GA14475@netblarch>

Previously git-pull silently ignored the --verify-signatures option for --rebase.

Signed-off-by: Alexander 'z33ky' Hirsch <1zeeky@gmail.com>
---

Sorry it took so long for the update. I made git-pull warn instead or error and explained why "the --verify-signatures option does not work for --rebase" in the message.

 builtin/pull.c  |  2 ++
 t/t5520-pull.sh | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)
diff --git a/builtin/pull.c b/builtin/pull.c
index 1d7333c..0eafae7 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -815,6 +815,8 @@ static int run_rebase(const unsigned char *curr_head,
 		argv_array_push(&args, "--no-autostash");
 	else if (opt_autostash == 1)
 		argv_array_push(&args, "--autostash");
+	if (opt_verify_signatures && strcmp(opt_verify_signatures, "--verify-signatures") == 0)
+		warning(_("git-rebase does not support --verify-signatures"));
 
 	argv_array_push(&args, "--onto");
 	argv_array_push(&args, sha1_to_hex(merge_head));
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 739c089..d605450 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -341,6 +341,22 @@ test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
 	test new = "$(git show HEAD:file2)"
 '
 
+test_expect_success "pull --rebase warns on --verify-signatures" '
+	git reset --hard before-rebase &&
+	git pull --rebase --verify-signatures . copy 2>err &&
+	test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
+	test new = "$(git show HEAD:file2)" &&
+	test_i18ngrep "git-rebase does not support --verify-signatures" err
+'
+
+test_expect_success "pull --rebase does not warn on --no-verify-signatures" '
+	git reset --hard before-rebase &&
+	git pull --rebase --no-verify-signatures . copy 2>err &&
+	test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
+	test new = "$(git show HEAD:file2)" &&
+	test_i18ngrep ! "verify-signatures" err
+'
+
 # add a feature branch, keep-merge, that is merged into master, so the
 # test can try preserving the merge commit (or not) with various
 # --rebase flags/pull.rebase settings.
-- 
2.8.2
Next: Junio C Hamano
Message 1 of 4 in “pull: warn on --verify-signatures with --rebase”
  1. pull: warn on --verify-signatures with --rebaseAlexander 'z33ky' Hirsch, May 18, 2016
  2. Junio C HamanoMay 18, 2016
  3. Alexander 'z33ky' HirschMay 19, 2016
  4. Junio C HamanoMay 19, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.