Re: [PATCH] init: don't reset core.filemode on git-new-workdirs.

3 messages, 3 authors, 2021-06-18 · open the first message on its own page

Re: [PATCH] init: don't reset core.filemode on git-new-workdirs.

From: Junio C Hamano <hidden>
Date: 2021-03-23 06:40:05

Madhu [off-list ref] writes:
Avoiding the filemode check completely during reinit is ok with me
because it gave me wrong results.  I can't speak for the original
author of the code - if his intention was to do it explicitly as part
of "reinitialization".
As the original author of the code, I know I meant filemode check to
be done and redone upon reinitialization in 4f629539 (init-db: check
template and repository format., 2005-11-25).

But then when 75d24499 (git-init: autodetect core.symlinks,
2007-08-31) started to autodetect symbolic link support, I somehow
ended up doing it only upon the repository creation.  Later,
2455406a (git-init: autodetect core.ignorecase, 2008-05-11) imitated
to check case sensitivity in the same block, doing it only once.

Either of these two commits would have been a good chance for us to
realize that filemode check should be done the same way, but somehow
nobody noticed X-<.

Re: [PATCH] init: don't reset core.filemode on git-new-workdirs.

From: Torsten Bögershausen <hidden>
Date: 2021-03-23 16:54:42

On Mon, Mar 22, 2021 at 11:39:31PM -0700, Junio C Hamano wrote:
Madhu [off-list ref] writes:
quoted
Avoiding the filemode check completely during reinit is ok with me
because it gave me wrong results.  I can't speak for the original
author of the code - if his intention was to do it explicitly as part
of "reinitialization".
As the original author of the code, I know I meant filemode check to
be done and redone upon reinitialization in 4f629539 (init-db: check
template and repository format., 2005-11-25).

But then when 75d24499 (git-init: autodetect core.symlinks,
2007-08-31) started to autodetect symbolic link support, I somehow
ended up doing it only upon the repository creation.  Later,
2455406a (git-init: autodetect core.ignorecase, 2008-05-11) imitated
to check case sensitivity in the same block, doing it only once.

Either of these two commits would have been a good chance for us to
realize that filemode check should be done the same way, but somehow
nobody noticed X-<.
In the very long run, there may be room for improvements:
While core.filemode works for a loal repo on a local disk,
there are lots of cases where I whish a better handling.

Exporting a git repo from e.g.
Linux/ext4 to MacOs : Linux sees the execute-bit as is, MacOs has it always on
Linux/ext4 to Windows : Linux sees the execute-bit as is, MacOs has it always off

Visiting the same repo under Git-for-Windows and cygwin:
cygwin supports the executable bit, Git-for-Windows does not.

And now we have the worktree (which may cross filesytem borders)

Today there are many use cases, where a single config variable is not ideal.

If there is a chance to have a "core.filemode=auto", which does probe the
filemode for this very OS/filesytem/worktree combination:
I would be happy to test/review/mentor such a code change.

Re: [PATCH] init: don't reset core.filemode on git-new-workdirs.

From: Madhu <hidden>
Date: 2021-06-18 04:25:37

I don't think this got any further attention?  I notice git-2.32 still
has the problem - in which case I re-commend my original patch.
Regards ---Madhu

*  Junio C Hamano [off-list ref] <xmqqr1k64bmk.fsf@gitster.g>
Wrote on Mon, 22 Mar 2021 23:39:31 -0700
Madhu [off-list ref] writes:
quoted
Avoiding the filemode check completely during reinit is ok with me
because it gave me wrong results.  I can't speak for the original
author of the code - if his intention was to do it explicitly as part
of "reinitialization".
As the original author of the code, I know I meant filemode check to
be done and redone upon reinitialization in 4f629539 (init-db: check
template and repository format., 2005-11-25).

But then when 75d24499 (git-init: autodetect core.symlinks,
2007-08-31) started to autodetect symbolic link support, I somehow
ended up doing it only upon the repository creation.  Later,
2455406a (git-init: autodetect core.ignorecase, 2008-05-11) imitated
to check case sensitivity in the same block, doing it only once.

Either of these two commits would have been a good chance for us to
realize that filemode check should be done the same way, but somehow
nobody noticed X-<.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help