{"thread":{"id":"4360","subject":"format-patch signoff argument no longer works","startedAt":"2006-05-31T11:11:51Z","lastAt":"2006-05-31T23:31:56Z","messageCount":15,"participants":["Geoff Russell","Matthias Kestenholz","Seth Falcon","Johannes Schindelin","Dennis Stosberg","Jakub Narebski","Junio C Hamano","J. Bruce Fields"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"21002","messageId":"93c3eada0605310411r712dab8au9b1c7d8ecb595a66@mail.gmail.com","threadId":"4360","inReplyTo":"93c3eada0605310332p19241861g466e1516a2aaf0df@mail.gmail.com","subject":"format-patch signoff argument no longer works","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2006-05-31T11:11:51Z","receivedAt":"2006-05-31T11:11:51Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"Hi,\n\nThe --signoff argument no longer works in git-format-patch.  Was this\nintentional?\nIt still appears in the documentation for the command.\n\nIt appears to have got lost when the shell script got converted to C.\n\nCheers,\nGeoff Russell\n"},{"id":"21003","messageId":"20060531112803.GB3877@spinlock.ch","threadId":"4360","inReplyTo":"93c3eada0605310411r712dab8au9b1c7d8ecb595a66@mail.gmail.com","subject":"Re: format-patch signoff argument no longer works","fromName":"Matthias Kestenholz","fromEmail":"lists@spinlock.ch","sentAt":"2006-05-31T11:28:03Z","receivedAt":"2006-05-31T11:28:03Z","isPatch":false,"sender":{"key":"lists@spinlock.ch","avatar":null},"body":"* Geoff Russell (geoffrey.russell@gmail.com) wrote:\n> The --signoff argument no longer works in git-format-patch.  Was this\n> intentional?\n> It still appears in the documentation for the command.\n> \n> It appears to have got lost when the shell script got converted to C.\n> \n\nYes, this was intentional. You should sign off your changes while\ncommitting (git commit -s|--signoff)\n\nThanks,\nMatthias\n"},{"id":"21005","messageId":"m2mzcycn4f.fsf@ziti.fhcrc.org","threadId":"4360","inReplyTo":"20060531112803.GB3877@spinlock.ch","subject":"Re: format-patch signoff argument no longer works","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-05-31T13:58:08Z","receivedAt":"2006-05-31T13:58:08Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"Matthias Kestenholz <lists@spinlock.ch> writes:\n\n> * Geoff Russell (geoffrey.russell@gmail.com) wrote:\n>> It appears to have got lost when the shell script got converted to C.\n>> \n> Yes, this was intentional. You should sign off your changes while\n> committing (git commit -s|--signoff)\n\nWhen should one commit _without_ signoff?  \n\nThe obvious answer is: when one doesn't approve of the changes in the\ncommit... But in my usual workflow, commit means\nworks-for-me-I-think-it-is-good. :-)\n\n\nAlso, here's a trivial patch to the git-format-patch doc.  I recently\nhad the same confusion trying to get git-format-patch to add signoff\nfor me...\n\nRemove reference to signoff option (-s) in git-format-patch\n\nSigned-off-by: Seth Falcon <sethfalcon@gmail.com>\n---\n Documentation/git-format-patch.txt |    6 +-----\n 1 files changed, 1 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 7cc7faf..d13f463 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -9,7 +9,7 @@ git-format-patch - Prepare patches for e\n SYNOPSIS\n --------\n [verse]\n-'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [-s] [-c]\n+'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [-c]\n                 [--diff-options] <his> [<mine>]\n \n DESCRIPTION\n@@ -44,10 +44,6 @@ OPTIONS\n        Do not strip/add '[PATCH]' from the first line of the\n        commit log message.\n \n--s|--signoff::\n-       Add `Signed-off-by:` line to the commit message, using\n-       the committer identity of yourself.\n-\n -c|--check::\n         Display suspicious lines in the patch.  The definition\n         of 'suspicious lines' is currently the lines that has\n-- \n1.3.3.gb931\n"},{"id":"21006","messageId":"Pine.LNX.4.63.0605311607180.19671@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4360","inReplyTo":"m2mzcycn4f.fsf@ziti.fhcrc.org","subject":"Re: format-patch signoff argument no longer works","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-31T14:09:28Z","receivedAt":"2006-05-31T14:09:28Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 31 May 2006, Seth Falcon wrote:\n\n> Matthias Kestenholz <lists@spinlock.ch> writes:\n> \n> > * Geoff Russell (geoffrey.russell@gmail.com) wrote:\n> >> It appears to have got lost when the shell script got converted to C.\n> >> \n> > Yes, this was intentional. You should sign off your changes while\n> > committing (git commit -s|--signoff)\n> \n> When should one commit _without_ signoff?  \n> \n> The obvious answer is: when one doesn't approve of the changes in the\n> commit... But in my usual workflow, commit means\n> works-for-me-I-think-it-is-good. :-)\n\nWell, there are often times when I commit something to a throw-away \nbranch, where I do not want to sign it off.\n\nThat was my original incentive to add this option BTW: I usually clean up \na patch series in a cycle of tests and fixes, and only want to sign off on \nthe final version.\n\nIf people need this option, I'll implement it, so speak up!\n\nCiao,\nDscho\n"},{"id":"21007","messageId":"20060531141408.G366d89c7@leonov.stosberg.net","threadId":"4360","inReplyTo":"20060531112803.GB3877@spinlock.ch","subject":"[PATCH] Update documentation for git-format-patch","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-05-31T14:14:08Z","receivedAt":"2006-05-31T14:14:08Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Signed-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\nThis updates the documentation for git-format-patch to reflect the\nchanges that the built-in version brought.\n\nIn addition to the functional changes, I reworded a few expressions\nwhich sounded suspicious or unclear to me.  However, I'm not a\nnative English speaker, so corrections are welcome.\n\nIs there any \"patch\" program at all that understands git's rename\npatches?\n\nRegards,\nDennis\n\n\n Documentation/git-format-patch.txt |   82 +++++++++++++++---------------------\n 1 files changed, 35 insertions(+), 47 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 7cc7faf..64d3f1e 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -9,70 +9,58 @@ git-format-patch - Prepare patches for e\n SYNOPSIS\n --------\n [verse]\n-'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [-s] [-c]\n-\t\t [--diff-options] <his> [<mine>]\n+'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach]\n+\t           [--diff-options] [--start-number <n>]\n+\t\t   <since>[..<until>]\n \n DESCRIPTION\n -----------\n-Prepare each commit with its patch since <mine> head forked from\n-<his> head, one file per patch formatted to resemble UNIX mailbox\n-format, for e-mail submission or use with gitlink:git-am[1].\n+\n+Prepare each commit between <since> and <until> with its patch in\n+one file per commit, formatted to resemble UNIX mailbox format.\n+If ..<until> is not specified, the head of the current working\n+tree is implied.\n+\n+The output of this command is convenient for e-mail submission or\n+for use with gitlink:git-am[1].\n \n Each output file is numbered sequentially from 1, and uses the\n-first line of the commit message (massaged for pathname safety)\n-as the filename.\n+first line of the commit message (checked for pathname safety) as\n+the filename. The names of the output files are printed to standard\n+output, unless the --stdout option is specified.\n \n-When -o is specified, output files are created in <dir>; otherwise\n-they are created in the current working directory.  This option\n-is ignored if --stdout is specified.\n+If -o is specified, output files are created in <dir>.  Otherwise\n+they are created in the current working directory.\n \n-When -n is specified, instead of \"[PATCH] Subject\", the first\n-line is formatted as \"[PATCH N/M] Subject\", unless you have only\n-one patch.\n+If -n is specified, instead of \"[PATCH] Subject\", the first line\n+is formatted as \"[PATCH n/m] Subject\".\n \n \n OPTIONS\n -------\n -o|--output-directory <dir>::\n \tUse <dir> to store the resulting files, instead of the\n-\tcurrent working directory.\n+\tcurrent working directory. This option is ignored if\n+\t--stdout is specified.\n \n -n|--numbered::\n \tName output in '[PATCH n/m]' format.\n \n+--start-number <n>::\n+\tStart numbering the patches with <n> instead of 1.\n+\n -k|--keep-subject::\n \tDo not strip/add '[PATCH]' from the first line of the\n \tcommit log message.\n \n--s|--signoff::\n-\tAdd `Signed-off-by:` line to the commit message, using\n-\tthe committer identity of yourself.\n-\n--c|--check::\n-        Display suspicious lines in the patch.  The definition\n-        of 'suspicious lines' is currently the lines that has\n-        trailing whitespaces, and the lines whose indentation\n-        has a SP character immediately followed by a TAB\n-        character.\n-\n --stdout::\n-\tThis flag generates the mbox formatted output to the\n-\tstandard output, instead of saving them into a file per\n-\tpatch and implies --mbox.\n+\tPrint all commits to the standard output in mbox format,\n+\tinstead of creating a file for each one.\n \n --attach::\n \tCreate attachments instead of inlining patches.\n \n \n-CONFIGURATION\n--------------\n-You can specify extra mail header lines to be added to each\n-message in the repository configuration as follows:\n-\n-[format]\n-        headers = \"Organization: git-foo\\n\"\n-\n-\n EXAMPLES\n --------\n \n@@ -82,18 +70,18 @@ git-format-patch -k --stdout R1..R2 | gi\n \tcherry-pick them.\n \n git-format-patch origin::\n-\tExtract commits the current branch accumulated since it\n-\tpulled from origin the last time in a patch form for\n-\te-mail submission.\n+\tExtract all commits which are in the current branch but\n+\tnot in the origin branch.  For each commit a separate file\n+\tis created in the current directory.\n \n git-format-patch -M -B origin::\n-\tThe same as the previous one, except detect and handle\n-\trenames and complete rewrites intelligently to produce\n-\trenaming patch.  A renaming patch reduces the amount of\n-\ttext output, and generally makes it easier to review\n-\tit.  Note that the \"patch\" program does not understand\n-\trenaming patch well, so use it only when you know the\n-\trecipient uses git to apply your patch.\n+\tThe same as the previous one.  Additionally, it detects\n+\tand handles renames and complete rewrites intelligently to\n+\tproduce a renaming patch.  A renaming patch reduces the\n+\tamount of text output, and generally makes it easier to\n+\treview it.  Note that the \"patch\" program does not\n+\tunderstand renaming patches, so use it only when you know\n+\tthe recipient uses git to apply your patch.\n \n \n See Also\n-- \n1.3.3+git20060531-dest1\n"},{"id":"21008","messageId":"Pine.LNX.4.63.0605311700240.20016@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4360","inReplyTo":"20060531141408.G366d89c7@leonov.stosberg.net","subject":"Re: [PATCH] Update documentation for git-format-patch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-31T15:00:50Z","receivedAt":"2006-05-31T15:00:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 31 May 2006, Dennis Stosberg wrote:\n\n> Is there any \"patch\" program at all that understands git's rename\n> patches?\n\nWhy, yes: git-apply!\n\nCiao,\nDscho\n"},{"id":"21010","messageId":"e5kcfi$124$1@sea.gmane.org","threadId":"4360","inReplyTo":"20060531141408.G366d89c7@leonov.stosberg.net","subject":"Re: [PATCH] Update documentation for git-format-patch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-05-31T15:24:45Z","receivedAt":"2006-05-31T15:24:45Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Dennis Stosberg wrote:\n\n> --c|--check::\n> -        Display suspicious lines in the patch.  The definition\n> -        of 'suspicious lines' is currently the lines that has\n> -        trailing whitespaces, and the lines whose indentation\n> -        has a SP character immediately followed by a TAB\n> -        character.\n\nSo is this option also lost in built-in git-format-patch?\n\n> -CONFIGURATION\n> --------------\n> -You can specify extra mail header lines to be added to each\n> -message in the repository configuration as follows:\n> -\n> -[format]\n> -        headers = \"Organization: git-foo\\n\"\n\nSo is this configuration option also lost in built-in git-format-patch?\n\n\n-- \nJakub Narebski\nWarsaw, Poland\n"},{"id":"21013","messageId":"20060531172441.G2b322ff2@leonov.stosberg.net","threadId":"4360","inReplyTo":"e5kcfi$124$1@sea.gmane.org","subject":"Re: [PATCH] Update documentation for git-format-patch","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-05-31T17:24:41Z","receivedAt":"2006-05-31T17:24:41Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Jakub Narebski wrote:\n\n> Dennis Stosberg wrote:\n> \n> > -        Display suspicious lines in the patch.  The definition\n> > -        of 'suspicious lines' is currently the lines that has\n> > -        trailing whitespaces, and the lines whose indentation\n> > -        has a SP character immediately followed by a TAB\n> > -        character.\n> \n> So is this option also lost in built-in git-format-patch?\n\nJohannes Schindelin made that one a diff option, so it can be used in\nother ways, too.  I think it should be documented in diff-options.txt.\n\n> > -CONFIGURATION\n> > -You can specify extra mail header lines to be added to each\n> > -message in the repository configuration as follows:\n> > -\n> > -[format]\n> > -        headers = \"Organization: git-foo\\n\"\n> \n> So is this configuration option also lost in built-in git-format-patch?\n\nGrep'ing the sources, I couldn't find any trace of it.\n\nRegards,\nDennis\n"},{"id":"21015","messageId":"7vejyayq46.fsf@assigned-by-dhcp.cox.net","threadId":"4360","inReplyTo":"m2mzcycn4f.fsf@ziti.fhcrc.org","subject":"Re: format-patch signoff argument no longer works","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-31T19:02:33Z","receivedAt":"2006-05-31T19:02:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Seth Falcon <sethfalcon@gmail.com> writes:\n\n> Matthias Kestenholz <lists@spinlock.ch> writes:\n>\n>> * Geoff Russell (geoffrey.russell@gmail.com) wrote:\n>>> It appears to have got lost when the shell script got converted to C.\n>>> \n>> Yes, this was intentional. You should sign off your changes while\n>> committing (git commit -s|--signoff)\n\nA bit on this later, but first to clear one thing up...\n\n> When should one commit _without_ signoff?  \n>\n> The obvious answer is: when one doesn't approve of the changes in the\n> commit... But in my usual workflow, commit means\n> works-for-me-I-think-it-is-good. :-)\n\nPlease, calm down and read Documentation/SubmittingPatches,\nitem (6), to understand what sign-off means.  It does not have\nanything to do with the result of the commit \"working\".  I do\nnot use -s when making commits during my day-job, for example.\n\nWe do not want to make sign-off the default.  It has to be a\nconcious act on the signer's part to add one.  Otherwise it\nwould not carry much weight.\n\nAbout the droppage of \"format-patch -s\", I have come to think of\nit as a mistake (yes, I can change my mind).  Consider:\n\n * You are the leader of a group of people who hack on a part of\n   the kernel, internally in your company.  You and other\n   developers make improvements and make commits, with \"git\n   commit -s\".\n\n * As the in-company integrator, you maintain the canonical\n   \"company tree\" by pulling from others in your group.\n\n * It's time to send good pieces to Linus and/or Andrew and as\n   the group lead you are responsible for sending them out.  The\n   commits would have Sign-off's by the original committers, but\n   as the contact person (representative) of your group, your\n   name is better recognizable in the outside community, and as\n   the leader of your group, it is a good practice for _you_ to\n   vouch for what your group did.\n\nIn that scenario, in addition to what \"commit -s\" gives us, it\nis handy for the person who is sending the patches out via\ne-mail to add his own sign-off.\n\nNow, we could do that by re-adding \"format-patch -s\" option, or\nalternatively we could add that to \"send-email\".  We might want\nto do both ;-)\n"},{"id":"21018","messageId":"20060531191955.GH13682@fieldses.org","threadId":"4360","inReplyTo":"7vejyayq46.fsf@assigned-by-dhcp.cox.net","subject":"Re: format-patch signoff argument no longer works","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-05-31T19:19:55Z","receivedAt":"2006-05-31T19:19:55Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, May 31, 2006 at 12:02:33PM -0700, Junio C Hamano wrote:\n> Now, we could do that by re-adding \"format-patch -s\" option, or\n> alternatively we could add that to \"send-email\".  We might want\n> to do both ;-)\n\nPersonally, just to give myself the best change of catching problems\nwith the outgoing email, I'd prefer to have as much as possible be done\n*before* send-email, so whatever I review is as close to what's sent out\nas possible.\n\n--b.\n"},{"id":"21027","messageId":"m2k6829e0i.fsf@ziti.fhcrc.org","threadId":"4360","inReplyTo":"7vejyayq46.fsf@assigned-by-dhcp.cox.net","subject":"Re: format-patch signoff argument no longer works","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2006-05-31T19:43:09Z","receivedAt":"2006-05-31T19:43:09Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Seth Falcon <sethfalcon@gmail.com> writes:\n>> When should one commit _without_ signoff?  \n>\n> Please, calm down and read Documentation/SubmittingPatches,\n> item (6), to understand what sign-off means.  It does not have\n> anything to do with the result of the commit \"working\".  I do\n> not use -s when making commits during my day-job, for example.\n\nDoh!  In glancing through the Documentation dir I missed the\nSubmittingPatches file. [weak excuse: there are many doc files in that\ndir and most are for the commands themselves.  I expected this to be\nin howto/.]\n\nAnyhow, much calmer now (apologies if I sounded un-calm, that wasn't\nmy intention).  The SubmittingPatches doc was _exactly_ what I was\nlooking for when I posted my original question [*].  My bad for not\nfinding it when it was staring me in the face.  Thanks for bearing\nwith me and pointing me to the fine manual :-)\n\n\n\n[*] http://marc.theaimsgroup.com/?l=git&m=114884854119660&w=2\n"},{"id":"21035","messageId":"7v4pz5zvtc.fsf_-_@assigned-by-dhcp.cox.net","threadId":"4360","inReplyTo":"7vejyayq46.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] format-patch --signoff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-31T22:14:07Z","receivedAt":"2006-05-31T22:14:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This resurrects --signoff option to format-patch.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n builtin-log.c |   18 ++++++++++++++++--\n log-tree.c    |   35 +++++++++++++++++++++++++++++++++++\n revision.h    |    1 +\n 3 files changed, 52 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex db1912a..ac4822d 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -150,6 +150,7 @@ int cmd_format_patch(int argc, const cha\n \tint numbered = 0;\n \tint start_number = -1;\n \tint keep_subject = 0;\n+\tchar *add_signoff = NULL;\n \n \tinit_revisions(&rev);\n \trev.commit_format = CMIT_FMT_EMAIL;\n@@ -179,11 +180,13 @@ int cmd_format_patch(int argc, const cha\n \t\t\tif (i == argc)\n \t\t\t\tdie(\"Need a number for --start-number\");\n \t\t\tstart_number = strtol(argv[i], NULL, 10);\n-\t\t} else if (!strcmp(argv[i], \"-k\") ||\n+\t\t}\n+\t\telse if (!strcmp(argv[i], \"-k\") ||\n \t\t\t\t!strcmp(argv[i], \"--keep-subject\")) {\n \t\t\tkeep_subject = 1;\n \t\t\trev.total = -1;\n-\t\t} else if (!strcmp(argv[i], \"-o\")) {\n+\t\t}\n+\t\telse if (!strcmp(argv[i], \"-o\")) {\n \t\t\tif (argc < 3)\n \t\t\t\tdie (\"Which directory?\");\n \t\t\tif (mkdir(argv[i + 1], 0777) < 0 && errno != EEXIST)\n@@ -192,6 +195,16 @@ int cmd_format_patch(int argc, const cha\n \t\t\toutput_directory = strdup(argv[i + 1]);\n \t\t\ti++;\n \t\t}\n+\t\telse if (!strcmp(argv[i], \"--signoff\") ||\n+\t\t\t !strcmp(argv[i], \"-s\")) {\n+\t\t\tconst char *committer = git_committer_info(1);\n+\t\t\tconst char *endpos = strchr(committer, '>');\n+\t\t\tif (!endpos)\n+\t\t\t\tdie(\"bogos committer info %s\\n\", committer);\n+\t\t\tadd_signoff = xmalloc(endpos - committer + 2);\n+\t\t\tmemcpy(add_signoff, committer, endpos - committer + 1);\n+\t\t\tadd_signoff[endpos - committer + 1] = 0;\n+\t\t}\n \t\telse if (!strcmp(argv[i], \"--attach\"))\n \t\t\trev.mime_boundary = git_version_string;\n \t\telse if (!strncmp(argv[i], \"--attach=\", 9))\n@@ -230,6 +243,7 @@ int cmd_format_patch(int argc, const cha\n \ttotal = nr;\n \tif (numbered)\n \t\trev.total = total + start_number - 1;\n+\trev.add_signoff = add_signoff;\n \twhile (0 <= --nr) {\n \t\tint shown;\n \t\tcommit = list[nr];\ndiff --git a/log-tree.c b/log-tree.c\nindex 58b0163..e86e16b 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -12,6 +12,37 @@ static void show_parents(struct commit *\n \t}\n }\n \n+static int append_signoff(char *buf, int buf_sz, int at, const char *signoff)\n+{\n+\tint signoff_len = strlen(signoff);\n+\tstatic const char signed_off_by[] = \"Signed-off-by: \";\n+\tchar *cp = buf;\n+\n+\t/* Do we have enough space to add it? */\n+\tif (buf_sz - at <= strlen(signed_off_by) + signoff_len + 2)\n+\t\treturn at;\n+\n+\t/* First see if we already have the sign-off by the signer */\n+\twhile (1) {\n+\t\tcp = strstr(cp, signed_off_by);\n+\t\tif (!cp)\n+\t\t\tbreak;\n+\t\tcp += strlen(signed_off_by);\n+\t\tif ((cp + signoff_len < buf + at) &&\n+\t\t    !strncmp(cp, signoff, signoff_len) &&\n+\t\t    isspace(cp[signoff_len]))\n+\t\t\treturn at; /* we already have him */\n+\t}\n+\n+\tstrcpy(buf + at, signed_off_by);\n+\tat += strlen(signed_off_by);\n+\tstrcpy(buf + at, signoff);\n+\tat += signoff_len;\n+\tbuf[at++] = '\\n';\n+\tbuf[at] = 0;\n+\treturn at;\n+}\n+\n void show_log(struct rev_info *opt, struct log_info *log, const char *sep)\n {\n \tstatic char this_header[16384];\n@@ -111,6 +142,10 @@ void show_log(struct rev_info *opt, stru\n \t * And then the pretty-printed message itself\n \t */\n \tlen = pretty_print_commit(opt->commit_format, commit, ~0u, this_header, sizeof(this_header), abbrev, subject, after_subject);\n+\n+\tif (opt->add_signoff)\n+\t\tlen = append_signoff(this_header, sizeof(this_header), len,\n+\t\t\t\t     opt->add_signoff);\n \tprintf(\"%s%s%s\", this_header, extra, sep);\n }\n \ndiff --git a/revision.h b/revision.h\nindex bdbdd23..75796bc 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -60,6 +60,7 @@ struct rev_info {\n \tstruct log_info *loginfo;\n \tint\t\tnr, total;\n \tconst char\t*mime_boundary;\n+\tconst char\t*add_signoff;\n \n \t/* special limits */\n \tint max_count;\n-- \n1.3.3.g1361-dirty\n"},{"id":"21036","messageId":"Pine.LNX.4.63.0606010032410.21774@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4360","inReplyTo":"7v4pz5zvtc.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] format-patch --signoff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-31T22:42:06Z","receivedAt":"2006-05-31T22:42:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 31 May 2006, Junio C Hamano wrote:\n\n> This resurrects --signoff option to format-patch.\n\nSorry; I was in cinema, so I missed all the action.\n\n\n> +\t\t\tconst char *committer = git_committer_info(1);\n> +\t\t\tconst char *endpos = strchr(committer, '>');\n> +\t\t\tif (!endpos)\n> +\t\t\t\tdie(\"bogos committer info %s\\n\", committer);\n> +\t\t\tadd_signoff = xmalloc(endpos - committer + 2);\n> +\t\t\tmemcpy(add_signoff, committer, endpos - committer + 1);\n> +\t\t\tadd_signoff[endpos - committer + 1] = 0;\n> +\t\t}\n\nI don't know, but it may be a good idea to make this more general: Why not \nbuild the sign-off line here, so that you could also add more than one \nsign-off lines ('--signoff=\"The great committer <ter@mit.com>\"'), and \nmaybe even Acked-by's?\n\n> +\t/* First see if we already have the sign-off by the signer */\n> +\twhile (1) {\n> +\t\tcp = strstr(cp, signed_off_by);\n> +\t\tif (!cp)\n> +\t\t\tbreak;\n> +\t\tcp += strlen(signed_off_by);\n> +\t\tif ((cp + signoff_len < buf + at) &&\n> +\t\t    !strncmp(cp, signoff, signoff_len) &&\n> +\t\t    isspace(cp[signoff_len]))\n> +\t\t\treturn at; /* we already have him */\n> +\t}\n\nOkay, this would be a little harder with multiple sign-offs. But the check \ncould be easier, i.e. if we say\n\n\trev.add_signoff = xmalloc(enough_room);\n\tstrcpy(rev.add_signoff, \"\\nSigned-off-by: \");\n\tstrcat(rev.add_signoff, committer_ident);\n\tstrcat(rev.add_signoff, \"\\n\");\n\nthen a simple\n\n\tp = strstr(commit_buffer, rev.add_signoff);\n\tif (p)\n\t\treturn (int)(p - commit_buffer);\n\nwould do the trick.\n\nAnd shouldn't we error out if there is not enough room for a sign-off?\n\nSorry for all the nit-picking.\n\nCiao,\nDscho\n"},{"id":"21039","messageId":"7vlkshyedf.fsf@assigned-by-dhcp.cox.net","threadId":"4360","inReplyTo":"Pine.LNX.4.63.0606010032410.21774@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] format-patch --signoff","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-31T23:16:12Z","receivedAt":"2006-05-31T23:16:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I don't know, but it may be a good idea to make this more general: Why not \n> build the sign-off line here, so that you could also add more than one \n> sign-off lines ('--signoff=\"The great committer <ter@mit.com>\"'), and \n> maybe even Acked-by's?\n\nPerhaps.\n\n> Okay, this would be a little harder with multiple sign-offs. But the check \n> could be easier, i.e. if we say\n>\n> \trev.add_signoff = xmalloc(enough_room);\n> \tstrcpy(rev.add_signoff, \"\\nSigned-off-by: \");\n> \tstrcat(rev.add_signoff, committer_ident);\n> \tstrcat(rev.add_signoff, \"\\n\");\n>\n> then a simple\n>\n> \tp = strstr(commit_buffer, rev.add_signoff);\n> \tif (p)\n> \t\treturn (int)(p - commit_buffer);\n>\n> would do the trick.\n\nDo you mean, by \"multiple sign-offs\", something like this?\n\n\tfor (so_list = rev.add_signoff; so_list; so_list = so_list->next) {\n\t\tif (strstr(commit_buffer, so_list->item))\n                \tcontinue;\n                append_to_commit_buffer(so_list->item);\n\t}\n\treturn tail - commit_buffer;\n\n> And shouldn't we error out if there is not enough room for a sign-off?\n\nI do not think we error out if the commit message is too long\neither, so...\n"},{"id":"21041","messageId":"Pine.LNX.4.63.0606010131010.4002@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4360","inReplyTo":"7vlkshyedf.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] format-patch --signoff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-31T23:31:56Z","receivedAt":"2006-05-31T23:31:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 31 May 2006, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > I don't know, but it may be a good idea to make this more general: Why not \n> > build the sign-off line here, so that you could also add more than one \n> > sign-off lines ('--signoff=\"The great committer <ter@mit.com>\"'), and \n> > maybe even Acked-by's?\n> \n> Perhaps.\n> \n> > Okay, this would be a little harder with multiple sign-offs. But the check \n> > could be easier, i.e. if we say\n> >\n> > \trev.add_signoff = xmalloc(enough_room);\n> > \tstrcpy(rev.add_signoff, \"\\nSigned-off-by: \");\n> > \tstrcat(rev.add_signoff, committer_ident);\n> > \tstrcat(rev.add_signoff, \"\\n\");\n> >\n> > then a simple\n> >\n> > \tp = strstr(commit_buffer, rev.add_signoff);\n> > \tif (p)\n> > \t\treturn (int)(p - commit_buffer);\n> >\n> > would do the trick.\n> \n> Do you mean, by \"multiple sign-offs\", something like this?\n> \n> \tfor (so_list = rev.add_signoff; so_list; so_list = so_list->next) {\n> \t\tif (strstr(commit_buffer, so_list->item))\n>                 \tcontinue;\n>                 append_to_commit_buffer(so_list->item);\n> \t}\n> \treturn tail - commit_buffer;\n\nActually, I did not think of a linked list, but one buffer, but I like \nyour solution better.\n\n> > And shouldn't we error out if there is not enough room for a sign-off?\n> \n> I do not think we error out if the commit message is too long\n> either, so...\n\n... so you could say that should be an error, too.\n\nCiao,\nDscho\n"}]}