Skip to content

Enable options --signoff, --reset-author for pick, reword, edit

Fabian Ruch git 3 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest27 patches 0 repliesNew
  2. v2 posting 2/223 patches 17 repliesSuperseded
  3. v2 RFC posting 1/219 patches 26 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/27rebase -i: allow replaying commits with empty log messagesgit-rebase--interactive.sh t/t3404-rebase-interactive.sh t/t3412-rebase-root.sh+60 -40 replies
2/27rebase -i: allow squashing empty commits without complaintsgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+79 -30 replies
3/27rebase -i: allow rewording empty commits without complaintsgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+34 -10 replies
4/27fake_editor: leave standard output unchangedt/lib-rebase.sh t/t3404-rebase-interactive.sh+10 -160 replies
5/27rebase -i: hide interactive command messages in verbose modegit-rebase--interactive.sh git-rebase.sh t/t3406-rebase-message.sh+34 -60 replies
6/27rebase -i: discard redundant message when rewording failsgit-rebase--interactive.sh+0 -30 replies
7/27commit: allow disabling pre-commit and commit-msg separatelyDocumentation/git-commit.txt builtin/commit.c t/t7503-pre-commit-hook.sh +2 more+176 -370 replies
8/27rebase -i: verify squash messages using commit-msggit-rebase--interactive.sh t/t3404-rebase-interactive.sh+81 -10 replies
9/27rebase -i: do not verify reworded patches using pre-commitgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+15 -10 replies
10/27rebase -i: teach do_pick the option --editgit-rebase--interactive.sh+43 -00 replies
11/27rebase -i: implement reword in terms of do_pickgit-rebase--interactive.sh+1 -50 replies
12/27rebase -i: log the replay of root commitsgit-rebase--interactive.sh+2 -20 replies
13/27rebase -i: do not use -C when --no-edit is sufficientgit-rebase--interactive.sh+1 -10 replies
14/27rebase -i: commit only once when rewriting picksgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+36 -150 replies
15/27rebase -i: do not die in do_pickgit-rebase--interactive.sh+19 -150 replies
16/27rebase -i: teach do_pick the option --amendgit-rebase--interactive.sh+17 -10 replies
17/27rebase -i: teach do_pick the option --filegit-rebase--interactive.sh+19 -10 replies
18/27rebase -i: remove no-op do_with_author git commit --amendgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+30 -100 replies
19/27rebase -i: prepare for squash in terms of do_pick --amendgit-rebase--interactive.sh+15 -60 replies
20/27rebase -i: implement squash in terms of do_pickgit-rebase--interactive.sh+6 -260 replies
21/27rebase -i: explicitly distinguish replay commands and exec tasksgit-rebase--interactive.sh+28 -140 replies
22/27rebase -i: parse to-do list command line optionsgit-rebase--interactive.sh t/lib-rebase.sh t/t3427-rebase-line-options.sh+114 -270 replies
23/27rebase -i: teach do_pick the option --reset-authorgit-rebase--interactive.sh+22 -40 replies
24/27rebase -i: teach do_pick the option --signoffgit-rebase--interactive.sh+12 -10 replies
25/27rebase -i: do not overwrite user author informationgit-rebase--interactive.sh+10 -90 replies
26/27rebase -i: refuse to commit when resuming with updated headgit-rebase--interactive.sh t/t3404-rebase-interactive.sh+33 -140 replies
27/27rebase -i: enable --signoff, --reset-author for pick, reword, editDocumentation/git-rebase.txt git-rebase--interactive.sh t/t3427-rebase-line-options.sh+240 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/27] Enable options --signoff, --reset-author for pick, reword, edit

Hi,

this is the third reroll of the patch series that makes the well-known commit options --signoff and --reset-author available to be used with the to-do list commands pick, reword and edit.

What follows is a short changelog since the second reroll from almost two weeks ago. The changes were mostly made in response to Thomas' review.

- Merely a commit message comment: The editor.sh wrapper script is still necessary to use output with interactive to-do list commands because the --quiet option does not force all commands to be totally silent.

- git-rebase--interactive.sh now uses the quoting functionality of git-rev-parse when assigning the editor.sh path to the GIT_EDITOR environment variable, in case the path includes double quotes itself.

- The tests dealing with squash commits that violate either commit-msg or pre-commit now test squash and fixup sequences with more than two commits. This is important since the final commit is created on a different code path than the others.

- The fake_editor.sh change that prints the debug output on stderr instead of stdout is now a separate patch so that it can be referred to directly. The change might be considered a hack and needs revision.

- Since whitespace and shell quoting are not supported by line options, the opts variable does not need to be evaluated using eval anymore.

- Malformed to-do command lines either trigger an "unknown command" or an "unknown option" error message but not both.

- A test case that specifies that git rebase --continue only commits staged changes if the user has not committed on top of the last successfully replayed commit in the meantime. The rationale behind this is that git rebase --continue commits using the author information of the commit it tried to replay last. While it perfectly makes sense to assume that this information is correct when HEAD has not changed, it is probable that it is incorrect when the user has created commits herself because the rebase process was interrupted for conflict resolution only and one must know internals to intentionally make git rebase --continue commit changes on top of user-created commits using original author information.

- do_pick did not preserve the authorship of the original commit when it was asked to rewrite the commit, for instance using reword. This was fixed by applying the authorship of the named commit using do_with_author. That doesn't interfere with squash commits because do_with_author is a no-op when used with git commit --amend.

- git rebase --continue did not apply the line options after conflict resolution. This was added by remembering line options the way git-rebase--interactive.sh reminds itself of amending commits.

- The test suite t3427-rebase-line-options.sh is responsible for the specification of to-do lists that use line options.

- The two line options available are now documented both in the git-rebase man page and the to-do list help text.

Thanks for your time,
Fabian

Fabian Ruch (27):
rebase -i: allow replaying commits with empty log messages rebase -i: allow squashing empty commits without complaints rebase -i: allow rewording empty commits without complaints
fake_editor: leave standard output unchanged
rebase -i: hide interactive command messages in verbose mode rebase -i: discard redundant message when rewording fails
commit: allow disabling pre-commit and commit-msg separately rebase -i: verify squash messages using commit-msg rebase -i: do not verify reworded patches using pre-commit rebase -i: teach do_pick the option --edit
rebase -i: implement reword in terms of do_pick
rebase -i: log the replay of root commits
rebase -i: do not use -C when --no-edit is sufficient rebase -i: commit only once when rewriting picks
rebase -i: do not die in do_pick
rebase -i: teach do_pick the option --amend
rebase -i: teach do_pick the option --file
rebase -i: remove no-op do_with_author git commit --amend rebase -i: prepare for squash in terms of do_pick --amend rebase -i: implement squash in terms of do_pick
rebase -i: explicitly distinguish replay commands and exec tasks rebase -i: parse to-do list command line options
rebase -i: teach do_pick the option --reset-author rebase -i: teach do_pick the option --signoff
rebase -i: do not overwrite user author information rebase -i: refuse to commit when resuming with updated head rebase -i: enable --signoff, --reset-author for pick, reword, edit

 Documentation/git-commit.txt   |   8 +-
 Documentation/git-rebase.txt   |  13 ++
 builtin/commit.c               |  32 +++-
 git-rebase--interactive.sh     | 370 ++++++++++++++++++++++++++++++++---------
 git-rebase.sh                  |  13 +-
 t/lib-rebase.sh                |  28 +++-
 t/t3404-rebase-interactive.sh  | 290 ++++++++++++++++++++++++++++++--
 t/t3406-rebase-message.sh      |  18 ++
 t/t3412-rebase-root.sh         |  16 ++
 t/t3427-rebase-line-options.sh | 216 ++++++++++++++++++++++++
 t/t7503-pre-commit-hook.sh     |  65 +++++++-
 t/t7504-commit-msg-hook.sh     |  85 ++++++++--
 t/test-lib-functions.sh        |  23 ++-
 13 files changed, 1044 insertions(+), 133 deletions(-)
 create mode 100755 t/t3427-rebase-line-options.sh
Signature · 1 line
2.0.1