Skip to contentSkip to conversation

rebase: pass --signoff option to git am

PATCH Superseded Giuseppe Bilotta 2 participants 8 messages Jan 21, 2017 – Jan 26, 2017 Documentation

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rebase: pass --signoff option to git am

---
 Documentation/git-rebase.txt | 5 +++++
 git-rebase.sh                | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Documentation/git-rebase.txt +5 -0
index 67d48e6883..e6f0b93337 100644
@@ -385,6 +385,11 @@ have the long commit hash prepended to the format.
 	Recreate merge commits instead of flattening the history by replaying
 	commits a merge commit introduces. Merge conflict resolutions or manual
 	amendments to merge commits are not preserved.
+
+--signoff::
+	This flag is passed to 'git am' to sign off all the rebased
+	commits (see linkgit:git-am[1]).
+
 +
 This uses the `--interactive` machinery internally, but combining it
 with the `--interactive` option explicitly is generally not a good
git-rebase.sh +2 -1
index 48d7c5ded4..e468a061f9 100755
@@ -34,6 +34,7 @@
 autosquash         move commits that begin with squash!/fixup! under -i
 committer-date-is-author-date! passed to 'git am'
 ignore-date!       passed to 'git am'
+signoff!           passed to 'git am'
 whitespace=!       passed to 'git apply'
 ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
@@ -321,7 +322,7 @@ run_pre_rebase_hook ()
 	--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
 		;;
Signature · 1 line
2.11.0.585.g56041942c3.dirty
#1 lore raw
Quoted 5 lines · Giuseppe Bilotta
---
 Documentation/git-rebase.txt | 5 +++++
 git-rebase.sh                | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

Quoted 37 lines
Documentation/git-rebase.txt +5 -0
index 67d48e6883..e6f0b93337 100644
@@ -385,6 +385,11 @@ have the long commit hash prepended to the format.
 	Recreate merge commits instead of flattening the history by replaying
 	commits a merge commit introduces. Merge conflict resolutions or manual
 	amendments to merge commits are not preserved.
+
+--signoff::
+	This flag is passed to 'git am' to sign off all the rebased
+	commits (see linkgit:git-am[1]).
+
 +
 This uses the `--interactive` machinery internally, but combining it
 with the `--interactive` option explicitly is generally not a good
git-rebase.sh +2 -1
index 48d7c5ded4..e468a061f9 100755
@@ -34,6 +34,7 @@
 autosquash         move commits that begin with squash!/fixup! under -i
 committer-date-is-author-date! passed to 'git am'
 ignore-date!       passed to 'git am'
+signoff!           passed to 'git am'
 whitespace=!       passed to 'git apply'
 ignore-whitespace! passed to 'git apply'
 C=!                passed to 'git apply'
@@ -321,7 +322,7 @@ run_pre_rebase_hook ()
 	--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
 		;;
#2 lore raw
Quoted 4 lines · Junio C Hamano

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

AFAIK this is sufficient for both, in the sense that I've used it with git rebase -i and it works.

#3 lore raw
Quoted 8 lines · Giuseppe Bilotta
Quoted 4 lines · Junio C Hamano

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

AFAIK this is sufficient for both, in the sense that I've used it with git rebase -i and it works.

That is a good news and at the same time a bit awkard one ;-)

The mention of "passed to 'git am'" twice in the documentation and help text would lead people to think "rebase -i" would not be affected and (1) would need more work to do so, or (2) the user does not want "rebase -i" to be unaffected for whatever reason, and gets surprised to see that it actually does get affected.

In any case, will queue as-is so that we won't lose the patch while waiting for people to raise their opinions.

Thanks.

#4 lore raw
Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Giuseppe Bilotta
Quoted 4 lines · Junio C Hamano

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

AFAIK this is sufficient for both, in the sense that I've used it with git rebase -i and it works.

Quoted 7 lines

That is a good news and at the same time a bit awkard one ;-)

The mention of "passed to 'git am'" twice in the documentation and help text would lead people to think "rebase -i" would not be affected and (1) would need more work to do so, or (2) the user does not want "rebase -i" to be unaffected for whatever reason, and gets surprised to see that it actually does get affected.

I'm not sure I follow. If the user doesn't want to signoff during a rebase, they can simply not pass --signoff. If they do, they can not pass it. Am I missing something?

Quoted 2 lines

In any case, will queue as-is so that we won't lose the patch while waiting for people to raise their opinions.

Thanks.

Signature · 1 line
Giuseppe "Oblomov" Bilotta
#5 lore raw
Quoted 20 lines · Giuseppe Bilotta
Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Giuseppe Bilotta
Quoted 4 lines · Junio C Hamano

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

AFAIK this is sufficient for both, in the sense that I've used it with git rebase -i and it works.

Quoted 7 lines

That is a good news and at the same time a bit awkard one ;-)

The mention of "passed to 'git am'" twice in the documentation and help text would lead people to think "rebase -i" would not be affected and (1) would need more work to do so, or (2) the user does not want "rebase -i" to be unaffected for whatever reason, and gets surprised to see that it actually does get affected.

Quoted 3 lines

I'm not sure I follow. If the user doesn't want to signoff during a rebase, they can simply not pass --signoff. If they do, they can not pass it. Am I missing something?

alias.

Which also means that there needs to be --no-signoff option that can be given to countermand an earlier --signoff, if a user did

	[alias] rb = rebase --signoff

and wants to disable it one time only with

	$ git rb --no-signoff
Quoted 5 lines
Quoted 3 lines

In any case, will queue as-is so that we won't lose the patch while waiting for people to raise their opinions.

Thanks.

Thanks. The final version would also need tests, so it may be a good time to start thinking about what aspect of this feature wants to be protected against future breakages.

#6 lore raw
Quoted 8 lines · Junio C Hamano
Quoted 4 lines · Giuseppe Bilotta

I'm not sure I follow. If the user doesn't want to signoff during a rebase, they can simply not pass --signoff. If they do, they can not pass it. Am I missing something?

alias.

Quoted 8 lines

Which also means that there needs to be --no-signoff option that can be given to countermand an earlier --signoff, if a user did

        [alias] rb = rebase --signoff

and wants to disable it one time only with

        $ git rb --no-signoff

Oh, right, good point. This should be easy, I'll give this a go.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

In any case, will queue as-is so that we won't lose the patch while waiting for people to raise their opinions.

Thanks.

Thanks. The final version would also need tests, so it may be a good time to start thinking about what aspect of this feature wants to be protected against future breakages.

I have troubles thinking how it could go wrong. The most obvious thing I can think of is it could not be remembered after an interruption+continue. I'll think about this some more.

Signature · 1 line
Giuseppe "Oblomov" Bilotta
#7 lore raw
In reply to Giuseppe Bilotta
Quoted 8 lines · Giuseppe Bilotta
Quoted 4 lines · Junio C Hamano

Should we plan to extend this to the interactive backend that is shared between rebase -i and rebase -m, too? Or is this patch already sufficient to cover them?

AFAIK this is sufficient for both, in the sense that I've used it with git rebase -i and it works.

Hm, something very strange is going on, I've just tested the patch on top of current next and for some reason the signoff line does not get added. The command-line option gets passed to git am, but I get no signoff for some reason, so something is failing down the line, I'll have to investigate.

Signature · 1 line
Giuseppe "Oblomov" Bilotta