git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 8/8] rebase: implement --[no-]autostash and rebase.autostash

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 10, 2013, 14:41 UTC
Message-ID
<CAPig+cQuWTfDqoF4G_Sk5_9VWKffpqmGC2WxXeF9DCyDxLx16A@mail.gmail.com>
In-Reply-To
<1368196005-5354-9-git-send-email-artagnon@gmail.com>

On Fri, May 10, 2013 at 10:26 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 29 quoted lines
> diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
> new file mode 100755
> index 0000000..8386998
> --- /dev/null
> +++ b/t/t3420-rebase-autostash.sh
> @@ -0,0 +1,148 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2013 Ramkumar Ramachandra
> +#
> +
> +test_description='git rebase --autostash tests'
> +. ./test-lib.sh
> +
> +test_expect_success setup '
> +       echo hello-world >file0 &&
> +       git add . &&
> +       test_tick &&
> +       git commit -m "initial commit" &&
> +       git checkout -b feature-branch &&
> +       echo another-hello >file1 &&
> +       echo goodbye >file2 &&
> +       git add . &&
> +       test_tick &&
> +       git commit -m "second commit" &&
> +       echo final-goodbye >file3 &&
> +       git add . &&
> +       test_tick &&
> +       git commit -m "third commit"
Broken &&-chain.
Show 5 quoted lines
> +       git checkout -b unrelated-onto-branch master &&
> +       echo unrelated >file4 &&
> +       git add . &&
> +       test_tick &&
> +       git commit -m "unrelated commit"
Broken &&-chain.
Show 28 quoted lines
> +       git checkout -b related-onto-branch master &&
> +       echo conflicting-change >file2 &&
> +       git add . &&
> +       test_tick &&
> +       git commit -m "related commit"
> +'
> +
> +testrebase() {
> +       type=$1
> +       dotest=$2
> +
> +       test_expect_success "rebase$type: dirty worktree, non-conflicting rebase" '
> +               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 &&
> +               echo dirty >>file3 &&
> +               git rebase$type unrelated-onto-branch &&
> +               grep unrelated file4 &&
> +               grep dirty file3 &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: dirty index, non-conflicting rebase" '
> +               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
Broken &&-chain.
Show 92 quoted lines
> +               echo dirty >>file3 &&
> +               git add file3 &&
> +               git rebase$type unrelated-onto-branch &&
> +               grep unrelated file4 &&
> +               grep dirty file3 &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: conflicting rebase" '
> +               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 &&
> +               echo dirty >>file3 &&
> +               test_must_fail git rebase$type related-onto-branch &&
> +               test_path_is_file $dotest/autostash &&
> +               ! grep dirty file3 &&
> +               rm -rf $dotest &&
> +               git reset --hard &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: --continue" '
> +               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 &&
> +               echo dirty >>file3 &&
> +               test_must_fail git rebase$type related-onto-branch &&
> +               test_path_is_file $dotest/autostash &&
> +               ! grep dirty file3 &&
> +               echo "conflicting-plus-goodbye" >file2 &&
> +               git add file2 &&
> +               git rebase --continue &&
> +               test_path_is_missing $dotest/autostash &&
> +               grep dirty file3 &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: --skip" '
> +               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 &&
> +               echo dirty >>file3 &&
> +               test_must_fail git rebase$type related-onto-branch &&
> +               test_path_is_file $dotest/autostash &&
> +               ! grep dirty file3 &&
> +               git rebase --skip &&
> +               test_path_is_missing $dotest/autostash &&
> +               grep dirty file3 &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: --abort" '
> +               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 &&
> +               echo dirty >>file3 &&
> +               test_must_fail git rebase$type related-onto-branch &&
> +               test_path_is_file $dotest/autostash &&
> +               ! grep dirty file3 &&
> +               git rebase --abort &&
> +               test_path_is_missing $dotest/autostash &&
> +               grep dirty file3 &&
> +               git checkout feature-branch
> +       '
> +
> +       test_expect_success "rebase$type: non-conflicting rebase, conflicting stash" '
> +               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 &&
> +               echo dirty >file4 &&
> +               git add file4 &&
> +               git rebase$type unrelated-onto-branch &&
> +               test_path_is_missing $dotest &&
> +               git reset --hard &&
> +               grep unrelated file4 &&
> +               ! grep dirty file4 &&
> +               git checkout feature-branch &&
> +               git stash pop &&
> +               grep dirty file4
> +       '
> +}
> +
> +testrebase "" .git/rebase-apply
> +testrebase " --merge" .git/rebase-merge
> +testrebase " --interactive" .git/rebase-merge
> +
> +test_done
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 17 of 18 in “rebase.autostash completed”
  1. 0/8 rebase.autostash completedRamkumar Ramachandra, May 10, 2013
  2. 1/8 am: suppress error output from a conditionalRamkumar Ramachandra, May 10, 2013
  3. Junio C HamanoMay 10, 2013
  4. Ramkumar RamachandraMay 11, 2013
  5. Junio C HamanoMay 12, 2013
  6. 2/8 rebase -i: don't error out if $state_dir already existsRamkumar Ramachandra, May 10, 2013
  7. 3/8 am: tighten a conditional that checks for $dotestRamkumar Ramachandra, May 10, 2013
  8. 4/8 rebase: prepare to do generic housekeepingRamkumar Ramachandra, May 10, 2013
  9. Eric SunshineMay 10, 2013
  10. Junio C HamanoMay 10, 2013
  11. Junio C HamanoMay 10, 2013
  12. Ramkumar RamachandraMay 10, 2013
  13. 5/8 am: return control to caller, for housekeepingRamkumar Ramachandra, May 10, 2013
  14. 6/8 rebase -i: return control to caller, for housekeepingRamkumar Ramachandra, May 10, 2013
  15. 7/8 rebase --merge: return control to caller, for housekeepingRamkumar Ramachandra, May 10, 2013
  16. 8/8 rebase: implement --[no-]autostash and rebase.autostashRamkumar Ramachandra, May 10, 2013
  17. Eric SunshineMay 10, 2013
  18. Junio C HamanoMay 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.