{"thread":{"id":"38170","subject":"[PATCH] core.ignoreStat is affected by --assume-unchanged misunderstandings","startedAt":"2014-12-11T23:48:52Z","lastAt":"2014-12-13T19:30:21Z","messageCount":4,"participants":["Philip Oakley","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"253595","messageId":"1418341733-1656-1-git-send-email-philipoakley@iee.org","threadId":"38170","inReplyTo":null,"subject":"[PATCH] core.ignoreStat is affected by --assume-unchanged misunderstandings","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-11T23:48:52Z","receivedAt":"2014-12-11T23:48:52Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"A recent thread on the Msysgit mailing list \nhttps://groups.google.com/forum/#!topic/msysgit/d9CltDxx11g noted the\nconfig core.ignoreStat flag as a solution to slow performance on\nWindows 8.1 for their system.\n\nThis config flag uses the --assume-unchanged flag to speed up systems\nwith slow lstat(2) calls. Just like the regular --assume-changed\ndocumentation, this need some tweaking to be clear that it is not a\n\"poor man's .gitignore\".\n\nPhilip Oakley (1):\n  doc: core.ignoreStat clarify the --assume-unchanged effect\n\n Documentation/config.txt | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\n-- \n1.9.4.msysgit.0\n"},{"id":"253596","messageId":"1418341733-1656-2-git-send-email-philipoakley@iee.org","threadId":"38170","inReplyTo":"1418341733-1656-1-git-send-email-philipoakley@iee.org","subject":"[PATCH] doc: core.ignoreStat clarify the --assume-unchanged effect","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-11T23:48:53Z","receivedAt":"2014-12-11T23:48:53Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"The assume-unchanged bit can be misunderstood. Be assertive about\nthe expectation that file changes should update that flag.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n Documentation/config.txt | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c26a7c8..81570b7 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -354,10 +354,11 @@ proxy use, while defaulting to a common proxy for external domains.\n core.ignoreStat::\n \tIf true, commands which modify both the working tree and the index\n \twill mark the updated paths with the \"assume unchanged\" bit in the\n-\tindex. These marked files are then assumed to stay unchanged in the\n-\tworking tree, until you mark them otherwise manually - Git will not\n-\tdetect the file changes\tby lstat() calls. This is useful on systems\n-\twhere those are very slow, such as Microsoft Windows.\n+\tindex. These marked files are then expected to stay unchanged in the\n+\tworking tree. If you change them you should mark their update manually.\n+\tGit will normally not detect the file changes by lstat() calls.\n+\tThis is useful on systems where those calls are very slow, such as\n+\tcifs/Microsoft Windows.\n \tSee linkgit:git-update-index[1].\n \tFalse by default.\n \n-- \n1.9.4.msysgit.0\n"},{"id":"253635","messageId":"alpine.DEB.1.00.1412121149040.13845@s15462909.onlinehome-server.info","threadId":"38170","inReplyTo":"1418341733-1656-2-git-send-email-philipoakley@iee.org","subject":"Re: [PATCH] doc: core.ignoreStat clarify the --assume-unchanged effect","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2014-12-12T10:56:28Z","receivedAt":"2014-12-12T10:56:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philip,\n\nOn Thu, 11 Dec 2014, Philip Oakley wrote:\n\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index c26a7c8..81570b7 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -354,10 +354,11 @@ proxy use, while defaulting to a common proxy for external domains.\n>  core.ignoreStat::\n>  \tIf true, commands which modify both the working tree and the index\n>  \twill mark the updated paths with the \"assume unchanged\" bit in the\n> -\tindex. These marked files are then assumed to stay unchanged in the\n> -\tworking tree, until you mark them otherwise manually - Git will not\n> -\tdetect the file changes\tby lstat() calls. This is useful on systems\n> -\twhere those are very slow, such as Microsoft Windows.\n> +\tindex. These marked files are then expected to stay unchanged in the\n> +\tworking tree. If you change them you should mark their update manually.\n> +\tGit will normally not detect the file changes by lstat() calls.\n> +\tThis is useful on systems where those calls are very slow, such as\n> +\tcifs/Microsoft Windows.\n>  \tSee linkgit:git-update-index[1].\n>  \tFalse by default.\n\nI think that the new wording is better, but still can be misunderstood.\nHow about this instead:\n\n-- snip --\ncore.ignoreStat::\n\tIf true, Git will not try to detect when files were modified.\n\tWhen Git commands are used to modify files, Git will know that\n\tthey were modified, but when files are modified outside of Git,\n\tthe user will need to stage the modified files explicitly; they\n\twill not be reported as changed e.g. by linkgit:git-status[1].\n+\nThis is useful on systems where lstat() calls are very slow, such as\nCIFS/Microsoft Windows.\nSee linkgit:git-update-index[1].\nFalse by default.\n-- snap --\n\nIn other words, I would try to skip the \"assume unchanged\" flag\naltogether, it is prone to confuse readers unfamiliar with the inner\nworkings of the index.\n\nCiao,\nDscho\n"},{"id":"253680","messageId":"C25BE5AA16BF46468ABC6814549D3134@PhilipOakley","threadId":"38170","inReplyTo":"alpine.DEB.1.00.1412121149040.13845@s15462909.onlinehome-server.info","subject":"Re: [PATCH] doc: core.ignoreStat clarify the --assume-unchanged effect","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-13T19:30:21Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Johannes Schindelin\" <Johannes.Schindelin@gmx.de>  Friday, \nDecember 12, 2014 10:56 AM\n> Hi Philip,\n>\n> On Thu, 11 Dec 2014, Philip Oakley wrote:\n>\n>> diff --git a/Documentation/config.txt b/Documentation/config.txt\n>> index c26a7c8..81570b7 100644\n>> --- a/Documentation/config.txt\n>> +++ b/Documentation/config.txt\n>> @@ -354,10 +354,11 @@ proxy use, while defaulting to a common proxy \n>> for external domains.\n>>  core.ignoreStat::\n>>  If true, commands which modify both the working tree and the index\n>>  will mark the updated paths with the \"assume unchanged\" bit in the\n>> - index. These marked files are then assumed to stay unchanged in the\n>> - working tree, until you mark them otherwise manually - Git will not\n>> - detect the file changes by lstat() calls. This is useful on systems\n>> - where those are very slow, such as Microsoft Windows.\n>> + index. These marked files are then expected to stay unchanged in \n>> the\n>> + working tree. If you change them you should mark their update \n>> manually.\n>> + Git will normally not detect the file changes by lstat() calls.\n>> + This is useful on systems where those calls are very slow, such as\n>> + cifs/Microsoft Windows.\n>>  See linkgit:git-update-index[1].\n>>  False by default.\n>\n> I think that the new wording is better, but still can be \n> misunderstood.\n> How about this instead:\n>\n> -- snip --\n> core.ignoreStat::\n> If true, Git will not try to detect when files were modified.\n \"not _normally_ try\"? - is there a guarantee that ignoreStat will \nswitch off ALL checks?\nIs there a list of those commands which will, implicitly, check?\n\n> When Git commands are used to modify files, Git will know that\n> they were modified, but when files are modified outside of Git,\n+ e.g. by the user, external SDK or other tools,\n> the user will need to stage the modified files explicitly; they\n> will not be reported as changed e.g. by linkgit:git-status[1].\nThe git-status man page give no indication either way as to the effect \nof this ignoreStat or the --assume-unchanged flags (or --skip-worktree). \nUser expectations can go either way.\n\nI was thinking I'd need to reference 'git update-index --really-refresh \n<file>' (but filenames beginning with . are discarded, so no '--all' \nequivalence !)\n\n> +\n> This is useful on systems where lstat() calls are very slow, such as\n> CIFS/Microsoft Windows.\n> See linkgit:git-update-index[1].\n> False by default.\n> -- snap --\n>\n> In other words, I would try to skip the \"assume unchanged\" flag\n> altogether, it is prone to confuse readers unfamiliar with the inner\n> workings of the index.\nIt's certainly confused many, to the point that the false information \nhas become the accepted truth.\n\n\nI'll take on board most of the suggestions.\n\nThis documenation clarification problem (users asking \"how to \ntemporarily mark files such that git will ignore their changes\" getting \nconfused) has grown arms and legs. In Duy's code fix, I see a repeated \npattern that should have a macro; If only there was a good name for what \nit means (ce->ce_flags & (CE_VALID | CE_SKIP_WORKTREE)), which extends \nce_skip_worktree(ce).\n\nLonger term I'm also looking for a method for the situation that would \nindicate that the local repo)doesn't even have a copy of 'that sha1' \nblob or tree (in the same way as a submodule sha1s) so that one can do a \nnarrow clone/fetch for privacy/security reasons.\n\n--\nPhilip\n"}]}