{"thread":{"id":"10089","subject":"[PATCH] rebase: add --signoff option","startedAt":"2007-09-30T16:15:11Z","lastAt":"2007-10-01T08:20:28Z","messageCount":6,"participants":["Steffen Prohaska","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"54415","messageId":"11911689111797-git-send-email-prohaska@zib.de","threadId":"10089","inReplyTo":null,"subject":"[PATCH] rebase: add --signoff option","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-09-30T16:15:11Z","receivedAt":"2007-09-30T16:15:11Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"When preparing a series of commits for upstream you may\nneed to signoff commits if you forgot to do so earlier.\nThis patch teaches git-rebase to signoff during rebase\nif you pass the option --signoff.\n\nNotes\n1) --signoff cannot be used simultaneously with --interactive.\n2) --signoff forces a rebase even if current path is a\n   descendant of <upstream>.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n Documentation/git-rebase.txt |    9 +++++++--\n git-rebase--interactive.sh   |    3 +++\n git-rebase.sh                |   10 ++++++++--\n 3 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex e8e7579..befe337 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -8,8 +8,8 @@ git-rebase - Forward-port local commits to the updated upstream head\n SYNOPSIS\n --------\n [verse]\n-'git-rebase' [-i | --interactive] [-v | --verbose] [-m | --merge]\n-\t[-C<n>] [ --whitespace=<option>] [-p | --preserve-merges]\n+'git-rebase' [-i | --interactive] [-v | --verbose] [-m | --merge] [-C<n>]\n+    [--signoff] [ --whitespace=<option>] [-p | --preserve-merges]\n \t[--onto <newbase>] <upstream> [<branch>]\n 'git-rebase' --continue | --skip | --abort\n \n@@ -201,6 +201,11 @@ OPTIONS\n \tis used instead (`git-merge-recursive` when merging a single\n \thead, `git-merge-octopus` otherwise).  This implies --merge.\n \n+--signoff::\n+\tAdd `Signed-off-by:` line to each commit message, using\n+\tthe committer identity of yourself.\n+\n+\n -v, \\--verbose::\n \tDisplay a diffstat of what changed upstream since the last rebase.\n \ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 8568a4f..29cef17 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -395,6 +395,9 @@ do\n \t-C*)\n \t\tdie \"Interactive rebase uses merge, so $1 does not make sense\"\n \t\t;;\n+\t--si|--sig|--sign|--signo|--signof|--signoff)\n+\t\tdie \"Interactive rebase doesn't support simultaneous signoff.\"\n+\t\t;;\n \t-v|--verbose)\n \t\tVERBOSE=t\n \t\t;;\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1583402..3b06bf4 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -46,6 +46,7 @@ dotest=$GIT_DIR/.dotest-merge\n prec=4\n verbose=\n git_am_opt=\n+opt_signoff=\n \n continue_merge () {\n \ttest -n \"$prev_head\" || die \"prev_head must be defined\"\n@@ -200,7 +201,7 @@ do\n \t\t;;\n \t-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\\\n \t\t--strateg=*|--strategy=*|\\\n-\t-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)\n+\t-s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n \t\t\tstrategy=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'` ;;\n@@ -221,6 +222,10 @@ do\n \t-C*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n \t\t;;\n+\t--si|--sig|--sign|--signo|--signof|--signoff)\n+\t\tgit_am_opt=\"$git_am_opt --signoff\"\n+\t\topt_signoff=t\n+\t\t;;\n \t-*)\n \t\tusage\n \t\t;;\n@@ -302,8 +307,9 @@ branch=$(git rev-parse --verify \"${branch_name}^0\") || exit\n \n # Check if we are already based on $onto with linear history,\n # but this should be done only when upstream and onto are the same.\n+# The check must also be skipped if signoff is requested.\n mb=$(git merge-base \"$onto\" \"$branch\")\n-if test \"$upstream\" = \"$onto\" && test \"$mb\" = \"$onto\" &&\n+if test \"$upstream\" = \"$onto\" && test \"$mb\" = \"$onto\" && test -z \"$opt_signoff\" &&\n \t# linear history?\n \t! git rev-list --parents \"$onto\"..\"$branch\" | grep \" .* \" > /dev/null\n then\n-- \n1.5.3.3.127.g40d17\n"},{"id":"54441","messageId":"Pine.LNX.4.64.0709302229320.28395@racer.site","threadId":"10089","inReplyTo":"11911689111797-git-send-email-prohaska@zib.de","subject":"Re: [PATCH] rebase: add --signoff option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-09-30T21:30:17Z","receivedAt":"2007-09-30T21:30:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 30 Sep 2007, Steffen Prohaska wrote:\n\n> When preparing a series of commits for upstream you may\n> need to signoff commits if you forgot to do so earlier.\n\nWhy not use format-patch's --signoff option for that?\n\nCiao,\nDscho\n"},{"id":"54443","messageId":"C94CC989-096D-43B5-BA16-DBD4D84038C0@zib.de","threadId":"10089","inReplyTo":"Pine.LNX.4.64.0709302229320.28395@racer.site","subject":"Re: [PATCH] rebase: add --signoff option","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-09-30T21:38:27Z","receivedAt":"2007-09-30T21:38:27Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Sep 30, 2007, at 11:30 PM, Johannes Schindelin wrote:\n\n> On Sun, 30 Sep 2007, Steffen Prohaska wrote:\n>\n>> When preparing a series of commits for upstream you may\n>> need to signoff commits if you forgot to do so earlier.\n>\n> Why not use format-patch's --signoff option for that?\n\nformat-patch is fine for mail. But if I either push the commits\nto a shared repo (like msysgit's mob) or ask upstream to pull\nfrom my public repo format-patch doesn't help directly.\n\n\tSteffen\n"},{"id":"54445","messageId":"Pine.LNX.4.64.0709302240450.28395@racer.site","threadId":"10089","inReplyTo":"C94CC989-096D-43B5-BA16-DBD4D84038C0@zib.de","subject":"Re: [PATCH] rebase: add --signoff option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-09-30T21:41:27Z","receivedAt":"2007-09-30T21:41:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 30 Sep 2007, Steffen Prohaska wrote:\n\n> On Sep 30, 2007, at 11:30 PM, Johannes Schindelin wrote:\n> \n> > On Sun, 30 Sep 2007, Steffen Prohaska wrote:\n> > \n> > > When preparing a series of commits for upstream you may need to \n> > > signoff commits if you forgot to do so earlier.\n> > \n> > Why not use format-patch's --signoff option for that?\n> \n> format-patch is fine for mail. But if I either push the commits to a \n> shared repo (like msysgit's mob) or ask upstream to pull from my public \n> repo format-patch doesn't help directly.\n\nFair enough.  But maybe \"rebase --interactive\" is not too difficult, \neither?\n\nCiao,\nDscho\n"},{"id":"54451","messageId":"8135FFD1-D6BB-41FF-9C3A-D02B3D223BF3@zib.de","threadId":"10089","inReplyTo":"Pine.LNX.4.64.0709302240450.28395@racer.site","subject":"Re: [PATCH] rebase: add --signoff option","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-01T04:59:08Z","receivedAt":"2007-10-01T04:59:08Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Sep 30, 2007, at 11:41 PM, Johannes Schindelin wrote:\n\n> On Sun, 30 Sep 2007, Steffen Prohaska wrote:\n>\n>> On Sep 30, 2007, at 11:30 PM, Johannes Schindelin wrote:\n>>\n>>> On Sun, 30 Sep 2007, Steffen Prohaska wrote:\n>>>\n>>>> When preparing a series of commits for upstream you may need to\n>>>> signoff commits if you forgot to do so earlier.\n>>>\n>>> Why not use format-patch's --signoff option for that?\n>>\n>> format-patch is fine for mail. But if I either push the commits to a\n>> shared repo (like msysgit's mob) or ask upstream to pull from my  \n>> public\n>> repo format-patch doesn't help directly.\n>\n> Fair enough.  But maybe \"rebase --interactive\" is not too difficult,\n> either?\n\nBut not too easy either because \"rebase --interactive\" is based on\n\"git merge\" and not \"git am\". You can just use a two step process\ninstead and first \"rebase --interactive\" followed by\n\"rebase --signoff\".\n\n\tSteffen\n"},{"id":"54458","messageId":"7vzlz3s0tv.fsf@gitster.siamese.dyndns.org","threadId":"10089","inReplyTo":"11911689111797-git-send-email-prohaska@zib.de","subject":"Re: [PATCH] rebase: add --signoff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-10-01T08:20:28Z","receivedAt":"2007-10-01T08:20:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> writes:\n\n> When preparing a series of commits for upstream you may\n> need to signoff commits if you forgot to do so earlier.\n> This patch teaches git-rebase to signoff during rebase\n> if you pass the option --signoff.\n>\n> Notes\n> 1) --signoff cannot be used simultaneously with --interactive.\n> 2) --signoff forces a rebase even if current path is a\n>    descendant of <upstream>.\n>\n> Signed-off-by: Steffen Prohaska <prohaska@zib.de>\n\nI do not think it is fatal for --signoff to be incompatible with\nthe \"interactive\" mode is fatal, but lack of mention in the\ndocumentation is.  Also this would need test scripts to prevent\nit from getting broken by future changes by others.  I'd like to\nsee ones that test at least the cases where (1) nobody has\nsign-off, (2) you do not have sign-off but others do, and (3)\nyou already have sign-off at the end.\n\nBut I do like the general concept.\n"}]}