{"thread":{"id":"42354","subject":"[PATCH v1 0/2] Ignore dirty submodule states during stash","startedAt":"2016-05-17T03:36:32Z","lastAt":"2016-05-17T03:49:29Z","messageCount":4,"participants":["Vasily Titskiy","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"286766","messageId":"20160517033632.GA2782@gmail.com","threadId":"42354","inReplyTo":null,"subject":"[PATCH v1 0/2] Ignore dirty submodule states during stash","fromName":"Vasily Titskiy","fromEmail":"qehgt0@gmail.com","sentAt":"2016-05-17T03:36:32Z","receivedAt":"2016-05-17T03:36:32Z","isPatch":true,"sender":{"key":"qehgt0@gmail.com","avatar":"https://gravatar.com/avatar/a8e2406642cc8b86fc31e7c8858f81d66604cb18719377eaa6afc91e134f34a9?d=mp&s=160"},"body":"Impoved description + added test\n\n git-stash.sh     |  2 +-\n t/t3903-stash.sh | 35 +++++++++++++++++++++++++++++++++++\n 2 files changed, 36 insertions(+), 1 deletion(-)\n"},{"id":"286767","messageId":"20160517034008.GB2782@gmail.com","threadId":"42354","inReplyTo":"20160517033632.GA2782@gmail.com","subject":"Re: [PATCH v1 1/2] Ignore dirty submodule states during stash","fromName":"Vasily Titskiy","fromEmail":"qehgt0@gmail.com","sentAt":"2016-05-17T03:40:08Z","receivedAt":"2016-05-17T03:40:08Z","isPatch":true,"sender":{"key":"qehgt0@gmail.com","avatar":"https://gravatar.com/avatar/a8e2406642cc8b86fc31e7c8858f81d66604cb18719377eaa6afc91e134f34a9?d=mp&s=160"},"body":"As stash does not know how to deal with submodules,\nit should not try to save/restore their states\nas it leads to redundant merge conflicts.\n\nSigned-off-by: Vasily Titskiy <qehgt0@gmail.com>\n---\n git-stash.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex c7c65e2..b500c44 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -116,7 +116,7 @@ create_stash () {\n \t\t\tgit read-tree --index-output=\"$TMPindex\" -m $i_tree &&\n \t\t\tGIT_INDEX_FILE=\"$TMPindex\" &&\n \t\t\texport GIT_INDEX_FILE &&\n-\t\t\tgit diff --name-only -z HEAD -- >\"$TMP-stagenames\" &&\n+\t\t\tgit diff --name-only --ignore-submodules -z HEAD -- >\"$TMP-stagenames\" &&\n \t\t\tgit update-index -z --add --remove --stdin <\"$TMP-stagenames\" &&\n \t\t\tgit write-tree &&\n \t\t\trm -f \"$TMPindex\"\n-- \n2.1.4\n"},{"id":"286768","messageId":"20160517034050.GC2782@gmail.com","threadId":"42354","inReplyTo":"20160517033632.GA2782@gmail.com","subject":"Re: [PATCH v1 2/2] Ignore dirty submodule states during stash","fromName":"Vasily Titskiy","fromEmail":"qehgt0@gmail.com","sentAt":"2016-05-17T03:40:50Z","receivedAt":"2016-05-17T03:40:50Z","isPatch":true,"sender":{"key":"qehgt0@gmail.com","avatar":"https://gravatar.com/avatar/a8e2406642cc8b86fc31e7c8858f81d66604cb18719377eaa6afc91e134f34a9?d=mp&s=160"},"body":"It checks if 'stash pop' does not trigger merge conflics\nin submodules.\n---\n t/t3903-stash.sh | 35 +++++++++++++++++++++++++++++++++++\n 1 file changed, 35 insertions(+)\n\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 2142c1f..e48a5b5 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -731,4 +731,39 @@ test_expect_success 'stash list --cc shows combined diff' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'stash ignores changes in submodules' '\n+\tgit submodule init &&\n+\tgit init sub1 &&\n+\t(\n+\t\tcd sub1 &&\n+\t\techo \"x\" > file1 &&\n+\t\tgit add file1 &&\n+\t\tgit commit -a -m \"initial sub1\"\n+\t) &&\n+\tgit submodule add ./. sub1 &&\n+\techo \"main\" > file1 &&\n+\tgit add file1 &&\n+\tgit commit -a -m \"initial main\" &&\n+\t# make changes in submodule\n+\t(\n+\t\tcd sub1 &&\n+\t\techo \"y\" >> file1 &&\n+\t\tgit commit -a -m \"change y\"\n+\t) &&\n+\tgit commit sub1 -m \"update reference\" &&\n+\t# switch submodule to another revision\n+\t(\n+\t\tcd sub1 &&\n+\t\techo \"z\" >> file1 &&\n+\t\tgit commit -a -m \"change z\"\n+\t) &&\n+\t# everything is prepared, check if changes in submodules are ignored\n+\techo \"local change\" >> file1 &&\n+\tgit stash save &&\n+\tgit checkout HEAD~1 &&\n+\tgit submodule update &&\n+\tgit stash pop\n+'\n+\n+\n test_done\n-- \n2.1.4\n"},{"id":"286771","messageId":"CAPig+cTShM4Qc7sVN5NXSmwP8Cxz22q+ZAbSrW3bHVm66aaCQg@mail.gmail.com","threadId":"42354","inReplyTo":"20160517034050.GC2782@gmail.com","subject":"Re: [PATCH v1 2/2] Ignore dirty submodule states during stash","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-05-17T03:49:29Z","receivedAt":"2016-05-17T03:49:29Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 16, 2016 at 11:40 PM, Vasily Titskiy <qehgt0@gmail.com> wrote:\n> It checks if 'stash pop' does not trigger merge conflics\n> in submodules.\n\nMissing sign-off.\n\nAlso, it would be best to combine these two patches so that the fix\nand patch reside in a single patch.\n\nMore below...\n\n> ---\n> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\n> @@ -731,4 +731,39 @@ test_expect_success 'stash list --cc shows combined diff' '\n> +test_expect_success 'stash ignores changes in submodules' '\n> +       git submodule init &&\n> +       git init sub1 &&\n> +       (\n> +               cd sub1 &&\n> +               echo \"x\" > file1 &&\n\nStyle: Drop space after redirection operator: >file1\n\nDitto below for both '>' and '>>'.\n\n> +               git add file1 &&\n> +               git commit -a -m \"initial sub1\"\n> +       ) &&\n> +       git submodule add ./. sub1 &&\n> +       echo \"main\" > file1 &&\n> +       git add file1 &&\n> +       git commit -a -m \"initial main\" &&\n> +       # make changes in submodule\n> +       (\n> +               cd sub1 &&\n> +               echo \"y\" >> file1 &&\n> +               git commit -a -m \"change y\"\n> +       ) &&\n> +       git commit sub1 -m \"update reference\" &&\n> +       # switch submodule to another revision\n> +       (\n> +               cd sub1 &&\n> +               echo \"z\" >> file1 &&\n> +               git commit -a -m \"change z\"\n> +       ) &&\n> +       # everything is prepared, check if changes in submodules are ignored\n> +       echo \"local change\" >> file1 &&\n> +       git stash save &&\n> +       git checkout HEAD~1 &&\n> +       git submodule update &&\n> +       git stash pop\n> +'\n> +\n> +\n\nStyle: drop extra blank line\n\n>  test_done\n> --\n> 2.1.4\n"}]}