{"thread":{"id":"44490","subject":"[PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning","startedAt":"2016-11-15T20:28:58Z","lastAt":"2016-11-16T13:18:10Z","messageCount":3,"participants":["Ramsay Jones","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"305981","messageId":"5b7d7d0b-8a6c-d516-4eb9-4e4ea13dce73@ramsayjones.plus.com","threadId":"44490","inReplyTo":null,"subject":"[PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-11-15T20:28:47Z","receivedAt":"2016-11-15T20:28:58Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Duy,\n\nIf you need to re-roll your 'nd/worktree-move' branch, could you\nplease squash this into the relevant patch [commit c49e92f5c\n(\"worktree move: refuse to move worktrees with submodules\", 12-11-2016)].\n\nAlso, one of the new tests introduced by commit 31a8f3066 (\"worktree move:\nnew command\", 12-11-2016), fails for me, thus:\n\n  $ ./t2028-worktree-move.sh -i -v\n  ...\n  --- expected\t2016-11-15 20:22:50.647241458 +0000\n  +++ actual\t2016-11-15 20:22:50.647241458 +0000\n  @@ -1,3 +1,3 @@\n   worktree /home/ramsay/git/t/trash directory.t2028-worktree-move\n  -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n   worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere\n  +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n  not ok 12 - move worktree\n  #\t\n  #\t\tgit worktree move source destination &&\n  #\t\ttest_path_is_missing source &&\n  #\t\tgit worktree list --porcelain | grep \"^worktree\" >actual &&\n  #\t\tcat <<-EOF >expected &&\n  #\t\tworktree $TRASH_DIRECTORY\n  #\t\tworktree $TRASH_DIRECTORY/destination\n  #\t\tworktree $TRASH_DIRECTORY/elsewhere\n  #\t\tEOF\n  #\t\ttest_cmp expected actual &&\n  #\t\tgit -C destination log --format=%s >actual2 &&\n  #\t\techo init >expected2 &&\n  #\t\ttest_cmp expected2 actual2\n  #\t\n  $ \n\nIs there an expectation that the submodules will be listed in\nany particular order by 'git worktree list --porcelain' ?\n\nThanks!\n\nATB,\nRamsay Jones\n\n builtin/worktree.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/worktree.c b/builtin/worktree.c\nindex e738142..abdf462 100644\n--- a/builtin/worktree.c\n+++ b/builtin/worktree.c\n@@ -526,7 +526,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)\n \n static void validate_no_submodules(const struct worktree *wt)\n {\n-\tstruct index_state istate = {0};\n+\tstruct index_state istate = { NULL };\n \tint i, found_submodules = 0;\n \n \tif (read_index_from(&istate, worktree_git_path(wt, \"index\")) > 0) {\n-- \n2.10.0\n"},{"id":"305983","messageId":"2bfa7559-7448-39a7-8da8-a539c7397d74@ramsayjones.plus.com","threadId":"44490","inReplyTo":"5b7d7d0b-8a6c-d516-4eb9-4e4ea13dce73@ramsayjones.plus.com","subject":"Re: [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-11-15T20:50:43Z","receivedAt":"2016-11-15T20:50:53Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 15/11/16 20:28, Ramsay Jones wrote:\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> \n> Hi Duy,\n> \n> If you need to re-roll your 'nd/worktree-move' branch, could you\n> please squash this into the relevant patch [commit c49e92f5c\n> (\"worktree move: refuse to move worktrees with submodules\", 12-11-2016)].\n> \n> Also, one of the new tests introduced by commit 31a8f3066 (\"worktree move:\n> new command\", 12-11-2016), fails for me, thus:\n> \n>   $ ./t2028-worktree-move.sh -i -v\n>   ...\n>   --- expected\t2016-11-15 20:22:50.647241458 +0000\n>   +++ actual\t2016-11-15 20:22:50.647241458 +0000\n>   @@ -1,3 +1,3 @@\n>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move\n>   -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere\n>   +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n>   not ok 12 - move worktree\n>   #\t\n>   #\t\tgit worktree move source destination &&\n>   #\t\ttest_path_is_missing source &&\n>   #\t\tgit worktree list --porcelain | grep \"^worktree\" >actual &&\n>   #\t\tcat <<-EOF >expected &&\n>   #\t\tworktree $TRASH_DIRECTORY\n>   #\t\tworktree $TRASH_DIRECTORY/destination\n>   #\t\tworktree $TRASH_DIRECTORY/elsewhere\n>   #\t\tEOF\n>   #\t\ttest_cmp expected actual &&\n>   #\t\tgit -C destination log --format=%s >actual2 &&\n>   #\t\techo init >expected2 &&\n>   #\t\ttest_cmp expected2 actual2\n>   #\t\n>   $ \n> \n> Is there an expectation that the submodules will be listed in\n\nEr, that should read 'worktrees', of course! :(\n\nATB,\nRamsay Jones\n\n"},{"id":"306044","messageId":"CACsJy8BD4YVjrrxz2a0gduaK6QFroHaa7t3_hQWaJ8feM4ZXqA@mail.gmail.com","threadId":"44490","inReplyTo":"5b7d7d0b-8a6c-d516-4eb9-4e4ea13dce73@ramsayjones.plus.com","subject":"Re: [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-11-16T13:17:35Z","receivedAt":"2016-11-16T13:18:10Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 16, 2016 at 3:28 AM, Ramsay Jones\n<ramsay@ramsayjones.plus.com> wrote:\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>\n> Hi Duy,\n>\n> If you need to re-roll your 'nd/worktree-move' branch, could you\n> please squash this into the relevant patch [commit c49e92f5c\n> (\"worktree move: refuse to move worktrees with submodules\", 12-11-2016)].\n\nWill do, thanks (and it's also \"thanks\" for your other similar emails,\nI just don't want to send a mail with just 'thanks' that adds nothing\nelse).\n\n> Also, one of the new tests introduced by commit 31a8f3066 (\"worktree move:\n> new command\", 12-11-2016), fails for me, thus:\n>\n>   $ ./t2028-worktree-move.sh -i -v\n>   ...\n>   --- expected  2016-11-15 20:22:50.647241458 +0000\n>   +++ actual    2016-11-15 20:22:50.647241458 +0000\n>   @@ -1,3 +1,3 @@\n>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move\n>   -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere\n>   +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination\n>   not ok 12 - move worktree\n>   #\n>   #             git worktree move source destination &&\n>   #             test_path_is_missing source &&\n>   #             git worktree list --porcelain | grep \"^worktree\" >actual &&\n>   #             cat <<-EOF >expected &&\n>   #             worktree $TRASH_DIRECTORY\n>   #             worktree $TRASH_DIRECTORY/destination\n>   #             worktree $TRASH_DIRECTORY/elsewhere\n>   #             EOF\n>   #             test_cmp expected actual &&\n>   #             git -C destination log --format=%s >actual2 &&\n>   #             echo init >expected2 &&\n>   #             test_cmp expected2 actual2\n>   #\n>   $\n>\n> Is there an expectation that the submodules will be listed in\n> any particular order by 'git worktree list --porcelain' ?\n\nI just sent a patch [1] to fix this before reading this mail. The\norder so far has been determined by readdir() which is not great.\n\n[1] https://public-inbox.org/git/CACsJy8DOT_4N_48UaoYK61G_8JUaXbEs7N=n24CH2q1GN=++5g@mail.gmail.com/T/#mfcf797219a1a143ed2ac45198015f19e82c70db2\n-- \nDuy\n"}]}