No fchmod() under msygit - Was: Re: [PATCH 00/14] Add submodule test harness
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Jul 9, 2014, 06:39 UTC
- Message-ID
- <53BCE3A7.8070600@web.de>
- In-Reply-To
- <53BC53C3.1010304@ramsay1.demon.co.uk>
On 07/08/2014 10:25 PM, Ramsay Jones wrote:
Show 51 quoted lines
> On 08/07/14 20:34, Jens Lehmann wrote:
>> Am 07.07.2014 21:40, schrieb Torsten Bögershausen:
>>> On 2014-07-07 19.05, Junio C Hamano wrote:
>>>> Jens Lehmann <Jens.Lehmann@web.de> writes:
>>>>
>>>>> Junio, do you want me to resend 02/14 without the non-portable "echo -n"
>>>>> or could you just squash the following diff in?
>>>> Amended locally here already; thanks, both.
>>> There seems to be some other trouble under Mac OS, not yet fully tracked down,
>>> (may be related to the "diff -r")
>> Torsten sees failures of this kind under Mac OS:
>>
>> diff -r .git/modules/sub1/config sub1/.git/config
>> 6d5
>> < worktree = ../../../sub1
>> 8a8
>>> worktree = ../../../sub1
>> So the config contains the same content, but the worktree setting moved
>> to a different line. This seems to be the result of setting core.worktree
>> in the test_git_directory_is_unchanged function just before the "diff -r",
>> but only under Mac OS.
>>
>>> And Msysgit complains
>>> error: fchmod on c:/xxxt/trash directory.t7613-merge-submodule/submodule_update_repo/.git/modules/sub1/config.lock failed: Function not implemented
>> I'm not sure what this is about, seems to happen during the "cp -R" of
>> the repo under .git/modules into the submodule.
> I haven't looked into this at all, but from the above message, and
> noting that fchmod() is not implemented in mingw (see compat/mingw.h
> line 91), and the following:
>
> $ git grep -n fchmodcommit daa22c6f8da466bd7a438f1bc27375fd737ffcf3
> Author: Eric Wong <normalperson@yhbt.net>
> Date: Tue May 6 00:17:14 2014 +0000
>
> config: preserve config file permissions on edits
>
>
> compat/mingw.h:91:static inline int fchmod(int fildes, mode_t mode)
> config.c:1639: if (fchmod(fd, st.st_mode & 07777) < 0) {
> config.c:1640: error("fchmod on %s failed: %s",
> config.c:1818: if (fchmod(out_fd, st.st_mode & 07777) < 0) {
> config.c:1819: ret = error("fchmod on %s failed: %s",
> $
>
> [I happen to be on the pu branch at the moment, so YMMV!]
>
> Both calls to fchmod() above are on config lock files, one
> in git_config_set_multivar_in_file() and the other in
> git_config_rename_section_in_file().
>
>commit daa22c6f8da466bd7a438f1bc27375fd737ffcf3 Author: Eric Wong <normalperson@yhbt.net> Date: Tue May 6 00:17:14 2014 +0000
config: preserve config file permissions on edits
(And why is it "& 07777" and not "& 0777") Can we avoid the fchmod() all together ?