Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-17 Thread Jonathan Nieder
Jens Lehmann wrote: In commit 0656781fa git mv learned to update the submodule path in the .gitmodules file when moving a submodule in the work tree. But since that commit update_path_in_gitmodules() gets called no matter if we moved a submodule or a regular file, which is wrong and leads to

Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-14 Thread Matthieu Moy
Jonathan Nieder jrnie...@gmail.com writes: Matthieu Moy wrote: Jens Lehmann jens.lehm...@web.de writes: static struct lock_file lock_file; +#define SUBMODULE_WITH_GITDIR ((const char *)1) I don't like very much hardcoded addresses like this. Are you 100% sure address 1 will never be

[PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-13 Thread Jens Lehmann
In commit 0656781fa git mv learned to update the submodule path in the .gitmodules file when moving a submodule in the work tree. But since that commit update_path_in_gitmodules() gets called no matter if we moved a submodule or a regular file, which is wrong and leads to a bogus warning when

Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-13 Thread Matthieu Moy
Jens Lehmann jens.lehm...@web.de writes: static struct lock_file lock_file; +#define SUBMODULE_WITH_GITDIR ((const char *)1) I don't like very much hardcoded addresses like this. Are you 100% sure address 1 will never be returned by xstrdup on any platform? The risk is small if not

Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-13 Thread Jens Lehmann
Am 13.10.2013 17:05, schrieb Matthieu Moy: Jens Lehmann jens.lehm...@web.de writes: static struct lock_file lock_file; +#define SUBMODULE_WITH_GITDIR ((const char *)1) I don't like very much hardcoded addresses like this. Are you 100% sure address 1 will never be returned by xstrdup on

Re: [PATCH] mv: Fix spurious warning when moving a file in presence of submodules

2013-10-13 Thread Jonathan Nieder
Matthieu Moy wrote: Jens Lehmann jens.lehm...@web.de writes: static struct lock_file lock_file; +#define SUBMODULE_WITH_GITDIR ((const char *)1) I don't like very much hardcoded addresses like this. Are you 100% sure address 1 will never be returned by xstrdup on any platform? The risk is