git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Brandon Richardson <brandon1024.br@gmail.com>
To: git@vger.kernel.org
Cc: Brandon Richardson <brandon1024.br@gmail.com>
Subject: [PATCH] Allow usage of --gpg-sign flag in commit-tree builtin.
Date: Thu, 17 Jan 2019 15:29:09 -0400	[thread overview]
Message-ID: <20190117192909.26064-1-brandon1024.br@gmail.com> (raw)
In-Reply-To: <y>

Signed-off-by: Brandon Richardson <brandon1024.br@gmail.com>
---
Hi,

This is my first contribution, so please bear with me. All feedback
is appreciated.

Ran into this issue while writing a signed commit object manually.
Here are the steps I followed to replicate the issue:

mkdir test && cd test
git init
echo 'test' > test.txt
git hash-object -w test.txt
git update-index --add --cacheinfo 100644 <blob hash> test.txt
git write-tree
git commit-tree --gpg-sign -m 'test commit msg' <tree obj hash>

Thanks,
Brandon

 builtin/commit-tree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 9ec36a82b..9a06594f6 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -66,7 +66,9 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (skip_prefix(arg, "-S", &sign_commit))
+		if (skip_prefix(arg, "-S", &sign_commit) ||
+			skip_prefix(arg, "--gpg-sign=", &sign_commit) ||
+			skip_prefix(arg, "--gpg-sign", &sign_commit))
 			continue;
 
 		if (!strcmp(arg, "--no-gpg-sign")) {
-- 
2.20.1


             reply	other threads:[~2019-01-17 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 19:29 Brandon Richardson [this message]
2019-01-17 20:24 ` [PATCH] Allow usage of --gpg-sign flag in commit-tree builtin Martin Ågren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190117192909.26064-1-brandon1024.br@gmail.com \
    --to=brandon1024.br@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).