diff options
author | Genki Sky <sky@genki.is> | 2018-02-04 21:08:13 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-07 20:26:46 +0100 |
commit | a6c612b528a22fe9d4cad8807e36d18f2f0fea2c (patch) | |
tree | a520da1c06053fdf5f37f7bb6e55adea3c1e4cbd /git-rebase.sh | |
parent | First batch after 2.16 (diff) | |
download | git-a6c612b528a22fe9d4cad8807e36d18f2f0fea2c.tar.xz git-a6c612b528a22fe9d4cad8807e36d18f2f0fea2c.zip |
rebase: add --allow-empty-message option
This option allows commits with empty commit messages to be rebased,
matching the same option in git-commit and git-cherry-pick. While empty
log messages are frowned upon, sometimes one finds them in older
repositories (e.g. translated from another VCS [0]), or have other
reasons for desiring them. The option is available in git-commit and
git-cherry-pick, so it is natural to make other git tools play nicely
with them. Adding this as an option allows the default to be "give the
user a chance to fix", while not interrupting the user's workflow
otherwise [1].
[0]: https://stackoverflow.com/q/8542304
[1]: https://public-inbox.org/git/7vd33afqjh.fsf@alter.siamese.dyndns.org/
To implement this, add a new --allow-empty-message flag. Then propagate
it to all calls of 'git commit', 'git cherry-pick', and 'git rebase--helper'
within the rebase scripts.
Signed-off-by: Genki Sky <sky@genki.is>
Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-x | git-rebase.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index fd72a35c65..b353c33d41 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -24,6 +24,7 @@ m,merge! use merging strategies to rebase i,interactive! let the user edit the list of commits to rebase x,exec=! add exec lines after each commit of the editable list k,keep-empty preserve empty commits during rebase +allow-empty-message allow rebasing commits with empty messages f,force-rebase! force rebase even if branch is up to date X,strategy-option=! pass the argument through to the merge strategy stat! display a diffstat of what changed upstream @@ -89,6 +90,7 @@ action= preserve_merges= autosquash= keep_empty= +allow_empty_message= test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t case "$(git config --bool commit.gpgsign)" in true) gpg_sign_opt=-S ;; @@ -262,6 +264,9 @@ do --keep-empty) keep_empty=yes ;; + --allow-empty-message) + allow_empty_message=--allow-empty-message + ;; --preserve-merges) preserve_merges=t test -z "$interactive_rebase" && interactive_rebase=implied |