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

Re: [PATCH] format-patch --signoff

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 31, 2006, 22:42 UTC
Message-ID
<Pine.LNX.4.63.0606010032410.21774@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7v4pz5zvtc.fsf_-_@assigned-by-dhcp.cox.net>
Hi,
On Wed, 31 May 2006, Junio C Hamano wrote:
> This resurrects --signoff option to format-patch.
Sorry; I was in cinema, so I missed all the action.
Show 8 quoted lines
> +			const char *committer = git_committer_info(1);
> +			const char *endpos = strchr(committer, '>');
> +			if (!endpos)
> +				die("bogos committer info %s\n", committer);
> +			add_signoff = xmalloc(endpos - committer + 2);
> +			memcpy(add_signoff, committer, endpos - committer + 1);
> +			add_signoff[endpos - committer + 1] = 0;
> +		}

I don't know, but it may be a good idea to make this more general: Why not build the sign-off line here, so that you could also add more than one sign-off lines ('--signoff="The great committer <ter@mit.com>"'), and maybe even Acked-by's?

Show 11 quoted lines
> +	/* First see if we already have the sign-off by the signer */
> +	while (1) {
> +		cp = strstr(cp, signed_off_by);
> +		if (!cp)
> +			break;
> +		cp += strlen(signed_off_by);
> +		if ((cp + signoff_len < buf + at) &&
> +		    !strncmp(cp, signoff, signoff_len) &&
> +		    isspace(cp[signoff_len]))
> +			return at; /* we already have him */
> +	}

Okay, this would be a little harder with multiple sign-offs. But the check could be easier, i.e. if we say

	rev.add_signoff = xmalloc(enough_room);
	strcpy(rev.add_signoff, "\nSigned-off-by: ");
	strcat(rev.add_signoff, committer_ident);
	strcat(rev.add_signoff, "\n");
then a simple
	p = strstr(commit_buffer, rev.add_signoff);
	if (p)
		return (int)(p - commit_buffer);
would do the trick.
And shouldn't we error out if there is not enough room for a sign-off?
Sorry for all the nit-picking.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 15 in “format-patch signoff argument no longer works”
  1. Geoff RussellMay 31, 2006
  2. Matthias KestenholzMay 31, 2006
  3. Seth FalconMay 31, 2006
  4. Johannes SchindelinMay 31, 2006
  5. Junio C HamanoMay 31, 2006
  6. J. Bruce FieldsMay 31, 2006
  7. Seth FalconMay 31, 2006
  8. format-patch --signoffJunio C Hamano, May 31, 2006
  9. Johannes SchindelinMay 31, 2006
  10. Junio C HamanoMay 31, 2006
  11. Johannes SchindelinMay 31, 2006
  12. Update documentation for git-format-patchDennis Stosberg, May 31, 2006
  13. Johannes SchindelinMay 31, 2006
  14. Jakub NarebskiMay 31, 2006
  15. Dennis StosbergMay 31, 2006

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.