Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:46:24

Hi,

On Tue, 17 Mar 2009, Carlos Rica wrote:
By using strbuf to save the signing-key id, it also imposes no limit
to the length of the string obtained from the config or command-line.
This string is then passed to gpg to sign the tag, when appropriate.

Signed-off-by: Carlos Rica <redacted>
---


QUESTION: Is it safe to remove this limit?
I think so.  GPG should return an error if it thinks it is too large.
quoted hunk ↗ jump to hunk
@@ -164,11 +162,10 @@ static int do_sign(struct strbuf *buffer)
 	int len;
 	int i, j;
 
-	if (!*signingkey) {
-		if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
-				sizeof(signingkey)) > sizeof(signingkey) - 1)
-			return error("committer info too long.");
-		bracket = strchr(signingkey, '>');
+	if (!signingkey->buf[0]) {
It is probably better to ask for !signingkey->len (think of trying to 
understand the code in 6 months from now).

Other than that, very nice!

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help