From 619e3604288ab54c3694e99746661caf0f2df961 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Thu, 10 Sep 2015 23:30:51 +0100 Subject: rebase: support --no-autostash This is documented as an option but we don't actually accept it. Support it so that it is possible to override the "rebase.autostash" config variable. Reported-by: Daniel Hahler Signed-off-by: John Keeping Signed-off-by: Junio C Hamano diff --git a/git-rebase.sh b/git-rebase.sh index 55da9db..95a4593 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -14,7 +14,7 @@ git-rebase --continue | --abort | --skip | --edit-todo Available options are v,verbose! display a diffstat of what changed upstream q,quiet! be quiet. implies --no-stat -autostash! automatically stash/stash pop before and after +autostash automatically stash/stash pop before and after fork-point use 'merge-base --fork-point' to refine upstream onto=! rebase onto given branch instead of upstream p,preserve-merges! try to recreate merges instead of ignoring them @@ -292,6 +292,9 @@ do --autostash) autostash=true ;; + --no-autostash) + autostash=false + ;; --verbose) verbose=t diffstat=t diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index d783f03..944154b 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -37,6 +37,16 @@ testrebase() { type=$1 dotest=$2 + test_expect_success "rebase$type: dirty worktree, --no-autostash" ' + test_config rebase.autostash true && + git reset --hard && + git checkout -b rebased-feature-branch feature-branch && + test_when_finished git branch -D rebased-feature-branch && + test_when_finished git checkout feature-branch && + echo dirty >>file3 && + test_must_fail git rebase$type --no-autostash unrelated-onto-branch + ' + test_expect_success "rebase$type: dirty worktree, non-conflicting rebase" ' test_config rebase.autostash true && git reset --hard && -- cgit v0.10.2-6-g49f6 From 82e0668cde032379095b0581609c73646e9eb92a Mon Sep 17 00:00:00 2001 From: John Keeping Date: Thu, 10 Sep 2015 23:30:52 +0100 Subject: Documentation/git-rebase: fix --no-autostash formatting All of the other "--option" and "--no-option" pairs in this file are formatted as separate options. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 924827d..73cba04 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -417,7 +417,8 @@ If the '--autosquash' option is enabled by default using the configuration variable `rebase.autosquash`, this option can be used to override and disable this setting. ---[no-]autostash:: +--autostash:: +--no-autostash:: Automatically create a temporary stash before the operation begins, and apply it after the operation ends. This means that you can run rebase on a dirty worktree. However, use -- cgit v0.10.2-6-g49f6