# [PATCH] rebase: pass --signoff option to git am

8 messages from 2010-11-27 to 2010-12-06. Participants: Giuseppe Bilotta, Sverre Rabbelier, Martin von Zweigbergk, Kevin Ballard, Jonathan Nieder.
Thread: https://gitlist.dev/t/25851

## Giuseppe Bilotta, 2010-11-27 11:15

Subject: [PATCH] rebase: pass --signoff option to git am
Message-ID: <1290856542-6070-1-git-send-email-giuseppe.bilotta@gmail.com>
URL: https://gitlist.dev/e/1290856542-6070-1-git-send-email-giuseppe.bilotta%40gmail.com

```
This allows people (like me) that forget to sign off their commits to do
a single rebase pass e.g. while preparing the patchset for submission.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
 Documentation/git-rebase.txt |    6 ++++++
 git-rebase.sh                |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 30e5c0e..d513e42 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -320,6 +320,12 @@ link:howto/revert-a-faulty-merge.txt[revert-a-faulty-merge How-To] for details).
 -p::
 --preserve-merges::
 	Instead of ignoring merges, try to recreate them.
+
+--signoff::
+	This flag is passed to 'git am' to sign off all the rebased
+	commits (see linkgit:git-am[1]).
+	Incompatible with the --interactive option.
+
 +
 This uses the `--interactive` machinery internally, but combining it
 with the `--interactive` option explicitly is generally not a good
diff --git a/git-rebase.sh b/git-rebase.sh
index 0e9d52a..9de03ee 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -354,7 +354,7 @@ do
 	--ignore-whitespace)
 		git_am_opt="$git_am_opt $1"
 		;;
-	--committer-date-is-author-date|--ignore-date)
+	--committer-date-is-author-date|--ignore-date|--signoff)
 		git_am_opt="$git_am_opt $1"
 		force_rebase=t
 		;;
-- 
1.7.3.2.184.gecaee

```

## Martin von Zweigbergk, 2010-11-27 19:05

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <alpine.DEB.1.10.1011272002090.26955@debian>
URL: https://gitlist.dev/e/alpine.DEB.1.10.1011272002090.26955%40debian
In-Reply-To: <AANLkTi=qAus_w18sYXP7m+jtQOGtgkNrsxgiNcbHevC7@mail.gmail.com>

```

On Sun, 28 Nov 2010, Sverre Rabbelier wrote:

> Heya,
> 
> On Sat, Nov 27, 2010 at 12:15, Giuseppe Bilotta
> <giuseppe.bilotta@gmail.com> wrote:
> >  -p::
> >  --preserve-merges::
> >        Instead of ignoring merges, try to recreate them.
> > +
> > +--signoff::
> > +       This flag is passed to 'git am' to sign off all the rebased
> > +       commits (see linkgit:git-am[1]).
> > +       Incompatible with the --interactive option.
> 
> The one above that does have a shorthand (-p), why should we (not?)
> give --signoff it's customary -s shorthand here?

The '-s' flag is unfortunately already taken. It is used for
specifying a merge strategy.

/Martin

```

## Sverre Rabbelier, 2010-11-28 00:32

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <AANLkTi=qAus_w18sYXP7m+jtQOGtgkNrsxgiNcbHevC7@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DqAus_w18sYXP7m%2BjtQOGtgkNrsxgiNcbHevC7%40mail.gmail.com
In-Reply-To: <1290856542-6070-1-git-send-email-giuseppe.bilotta@gmail.com>

```
Heya,

On Sat, Nov 27, 2010 at 12:15, Giuseppe Bilotta
<giuseppe.bilotta@gmail.com> wrote:
>  -p::
>  --preserve-merges::
>        Instead of ignoring merges, try to recreate them.
> +
> +--signoff::
> +       This flag is passed to 'git am' to sign off all the rebased
> +       commits (see linkgit:git-am[1]).
> +       Incompatible with the --interactive option.

The one above that does have a shorthand (-p), why should we (not?)
give --signoff it's customary -s shorthand here?

-- 
Cheers,

Sverre Rabbelier

```

## Giuseppe Bilotta, 2010-11-28 08:00

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <AANLkTim+vJuZ9bJnROqbzN8O-K8NVyi8zHYokDNqOjqa@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim%2BvJuZ9bJnROqbzN8O-K8NVyi8zHYokDNqOjqa%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.10.1011272002090.26955@debian>

```
On Sat, Nov 27, 2010 at 8:05 PM, Martin von Zweigbergk
<martin.von.zweigbergk@gmail.com> wrote:
>
> On Sun, 28 Nov 2010, Sverre Rabbelier wrote:
>
>> Heya,
>>
>> On Sat, Nov 27, 2010 at 12:15, Giuseppe Bilotta
>> <giuseppe.bilotta@gmail.com> wrote:
>> >  -p::
>> >  --preserve-merges::
>> >        Instead of ignoring merges, try to recreate them.
>> > +
>> > +--signoff::
>> > +       This flag is passed to 'git am' to sign off all the rebased
>> > +       commits (see linkgit:git-am[1]).
>> > +       Incompatible with the --interactive option.
>>
>> The one above that does have a shorthand (-p), why should we (not?)
>> give --signoff it's customary -s shorthand here?
>
> The '-s' flag is unfortunately already taken. It is used for
> specifying a merge strategy.

In fact, this is why I was a little skeptical myself about submitting
this patch. What if people start remembering that rebase supports
--signoff and implicity assume that -s is also a valid shortcut? Funky
errors. (I've been bittem myself by similar situations for whitespace
support. Can I pass -b or not? Will it mean --ignore-whitespace?)

-- 
Giuseppe "Oblomov" Bilotta

```

## Kevin Ballard, 2010-11-29 22:57

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <ADC46761-DFF5-486D-B604-05BA8C8631EB@sb.org>
URL: https://gitlist.dev/e/ADC46761-DFF5-486D-B604-05BA8C8631EB%40sb.org
In-Reply-To: <1290856542-6070-1-git-send-email-giuseppe.bilotta@gmail.com>

```
On Nov 27, 2010, at 3:15 AM, Giuseppe Bilotta wrote:

> This allows people (like me) that forget to sign off their commits to do
> a single rebase pass e.g. while preparing the patchset for submission.

You're probably already aware, but git format-patch supports the -s/--signoff
flags to sign off commits as they're prepared. There's even a config var
you can set to make this the default (format.signoff = true).

-Kevin Ballard

```

## Giuseppe Bilotta, 2010-11-30 08:09

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <AANLkTindvz=7OmYaL6AL_oAj50U9PLnRrbSpjgR92z7C@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTindvz%3D7OmYaL6AL_oAj50U9PLnRrbSpjgR92z7C%40mail.gmail.com
In-Reply-To: <ADC46761-DFF5-486D-B604-05BA8C8631EB@sb.org>

```
On Mon, Nov 29, 2010 at 11:57 PM, Kevin Ballard <kevin@sb.org> wrote:
> On Nov 27, 2010, at 3:15 AM, Giuseppe Bilotta wrote:
>
>> This allows people (like me) that forget to sign off their commits to do
>> a single rebase pass e.g. while preparing the patchset for submission.
>
> You're probably already aware, but git format-patch supports the -s/--signoff
> flags to sign off commits as they're prepared. There's even a config var
> you can set to make this the default (format.signoff = true).

That works if you're sharing your patches with format-patch, but not
for example when asking for a pull. Maybe I should extend the commit
message to include this case.

-- 
Giuseppe "Oblomov" Bilotta

```

## Giuseppe Bilotta, 2010-12-06 10:41

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <AANLkTinnn_QnBJ8AZT9ZB+ZHVRDZV0tDret=YQeyfa01@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinnn_QnBJ8AZT9ZB%2BZHVRDZV0tDret%3DYQeyfa01%40mail.gmail.com
In-Reply-To: <AANLkTindvz=7OmYaL6AL_oAj50U9PLnRrbSpjgR92z7C@mail.gmail.com>

```
On Tue, Nov 30, 2010 at 9:09 AM, Giuseppe Bilotta
<giuseppe.bilotta@gmail.com> wrote:
> On Mon, Nov 29, 2010 at 11:57 PM, Kevin Ballard <kevin@sb.org> wrote:
>> On Nov 27, 2010, at 3:15 AM, Giuseppe Bilotta wrote:
>>
>>> This allows people (like me) that forget to sign off their commits to do
>>> a single rebase pass e.g. while preparing the patchset for submission.
>>
>> You're probably already aware, but git format-patch supports the -s/--signoff
>> flags to sign off commits as they're prepared. There's even a config var
>> you can set to make this the default (format.signoff = true).
>
> That works if you're sharing your patches with format-patch, but not
> for example when asking for a pull. Maybe I should extend the commit
> message to include this case.

For what it's worth, somebody on #git just asked how to signoff a
bunch of patches. The answer was to rebase -i and sign off each one of
them. This is exactly the kind of usage that my patch would simplify.
Any chance of it getting merged?

-- 
Giuseppe "Oblomov" Bilotta

```

## Jonathan Nieder, 2010-12-06 17:28

Subject: Re: [PATCH] rebase: pass --signoff option to git am
Message-ID: <20101206172847.GA6272@burratino>
URL: https://gitlist.dev/e/20101206172847.GA6272%40burratino
In-Reply-To: <AANLkTinnn_QnBJ8AZT9ZB+ZHVRDZV0tDret=YQeyfa01@mail.gmail.com>

```
Giuseppe Bilotta wrote:

> For what it's worth, somebody on #git just asked how to signoff a
> bunch of patches. The answer was to rebase -i and sign off each one of
> them.

How I would do it in existing git:

	git branch oldhead
	git reset --keep base
	git log --oneline --graph HEAD..oldhead;	# the right patches?
	git cherry-pick -s HEAD..oldhead
	git diff oldhead

Or without multiple-cherry-pick, maybe:

	git branch oldhead
	git reset --keep base
	git format-patch -k --stdout HEAD..oldhead >series
	git am -s -3 -i series;	# the right patches?
	git diff oldhead

No opinion on the automatic-signoff-in-rebase here.

```
