git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning
@ 2016-11-15 20:28 Ramsay Jones
  2016-11-15 20:50 ` Ramsay Jones
  2016-11-16 13:17 ` Duy Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Ramsay Jones @ 2016-11-15 20:28 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, GIT Mailing-list


Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Duy,

If you need to re-roll your 'nd/worktree-move' branch, could you
please squash this into the relevant patch [commit c49e92f5c
("worktree move: refuse to move worktrees with submodules", 12-11-2016)].

Also, one of the new tests introduced by commit 31a8f3066 ("worktree move:
new command", 12-11-2016), fails for me, thus:

  $ ./t2028-worktree-move.sh -i -v
  ...
  --- expected	2016-11-15 20:22:50.647241458 +0000
  +++ actual	2016-11-15 20:22:50.647241458 +0000
  @@ -1,3 +1,3 @@
   worktree /home/ramsay/git/t/trash directory.t2028-worktree-move
  -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
   worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere
  +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
  not ok 12 - move worktree
  #	
  #		git worktree move source destination &&
  #		test_path_is_missing source &&
  #		git worktree list --porcelain | grep "^worktree" >actual &&
  #		cat <<-EOF >expected &&
  #		worktree $TRASH_DIRECTORY
  #		worktree $TRASH_DIRECTORY/destination
  #		worktree $TRASH_DIRECTORY/elsewhere
  #		EOF
  #		test_cmp expected actual &&
  #		git -C destination log --format=%s >actual2 &&
  #		echo init >expected2 &&
  #		test_cmp expected2 actual2
  #	
  $ 

Is there an expectation that the submodules will be listed in
any particular order by 'git worktree list --porcelain' ?

Thanks!

ATB,
Ramsay Jones

 builtin/worktree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/worktree.c b/builtin/worktree.c
index e738142..abdf462 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -526,7 +526,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
 
 static void validate_no_submodules(const struct worktree *wt)
 {
-	struct index_state istate = {0};
+	struct index_state istate = { NULL };
 	int i, found_submodules = 0;
 
 	if (read_index_from(&istate, worktree_git_path(wt, "index")) > 0) {
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning
  2016-11-15 20:28 [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning Ramsay Jones
@ 2016-11-15 20:50 ` Ramsay Jones
  2016-11-16 13:17 ` Duy Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Ramsay Jones @ 2016-11-15 20:50 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, GIT Mailing-list



On 15/11/16 20:28, Ramsay Jones wrote:
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> 
> Hi Duy,
> 
> If you need to re-roll your 'nd/worktree-move' branch, could you
> please squash this into the relevant patch [commit c49e92f5c
> ("worktree move: refuse to move worktrees with submodules", 12-11-2016)].
> 
> Also, one of the new tests introduced by commit 31a8f3066 ("worktree move:
> new command", 12-11-2016), fails for me, thus:
> 
>   $ ./t2028-worktree-move.sh -i -v
>   ...
>   --- expected	2016-11-15 20:22:50.647241458 +0000
>   +++ actual	2016-11-15 20:22:50.647241458 +0000
>   @@ -1,3 +1,3 @@
>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move
>   -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere
>   +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
>   not ok 12 - move worktree
>   #	
>   #		git worktree move source destination &&
>   #		test_path_is_missing source &&
>   #		git worktree list --porcelain | grep "^worktree" >actual &&
>   #		cat <<-EOF >expected &&
>   #		worktree $TRASH_DIRECTORY
>   #		worktree $TRASH_DIRECTORY/destination
>   #		worktree $TRASH_DIRECTORY/elsewhere
>   #		EOF
>   #		test_cmp expected actual &&
>   #		git -C destination log --format=%s >actual2 &&
>   #		echo init >expected2 &&
>   #		test_cmp expected2 actual2
>   #	
>   $ 
> 
> Is there an expectation that the submodules will be listed in

Er, that should read 'worktrees', of course! :(

ATB,
Ramsay Jones


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning
  2016-11-15 20:28 [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning Ramsay Jones
  2016-11-15 20:50 ` Ramsay Jones
@ 2016-11-16 13:17 ` Duy Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Duy Nguyen @ 2016-11-16 13:17 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list

On Wed, Nov 16, 2016 at 3:28 AM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Duy,
>
> If you need to re-roll your 'nd/worktree-move' branch, could you
> please squash this into the relevant patch [commit c49e92f5c
> ("worktree move: refuse to move worktrees with submodules", 12-11-2016)].

Will do, thanks (and it's also "thanks" for your other similar emails,
I just don't want to send a mail with just 'thanks' that adds nothing
else).

> Also, one of the new tests introduced by commit 31a8f3066 ("worktree move:
> new command", 12-11-2016), fails for me, thus:
>
>   $ ./t2028-worktree-move.sh -i -v
>   ...
>   --- expected  2016-11-15 20:22:50.647241458 +0000
>   +++ actual    2016-11-15 20:22:50.647241458 +0000
>   @@ -1,3 +1,3 @@
>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move
>   -worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
>    worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/elsewhere
>   +worktree /home/ramsay/git/t/trash directory.t2028-worktree-move/destination
>   not ok 12 - move worktree
>   #
>   #             git worktree move source destination &&
>   #             test_path_is_missing source &&
>   #             git worktree list --porcelain | grep "^worktree" >actual &&
>   #             cat <<-EOF >expected &&
>   #             worktree $TRASH_DIRECTORY
>   #             worktree $TRASH_DIRECTORY/destination
>   #             worktree $TRASH_DIRECTORY/elsewhere
>   #             EOF
>   #             test_cmp expected actual &&
>   #             git -C destination log --format=%s >actual2 &&
>   #             echo init >expected2 &&
>   #             test_cmp expected2 actual2
>   #
>   $
>
> Is there an expectation that the submodules will be listed in
> any particular order by 'git worktree list --porcelain' ?

I just sent a patch [1] to fix this before reading this mail. The
order so far has been determined by readdir() which is not great.

[1] https://public-inbox.org/git/CACsJy8DOT_4N_48UaoYK61G_8JUaXbEs7N=n24CH2q1GN=++5g@mail.gmail.com/T/#mfcf797219a1a143ed2ac45198015f19e82c70db2
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-16 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 20:28 [PATCH] worktree: fix a sparse 'Using plain integer as NULL pointer' warning Ramsay Jones
2016-11-15 20:50 ` Ramsay Jones
2016-11-16 13:17 ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).