{"thread":{"id":"38130","subject":"[PATCH v2] doc: make clear --assume-unchanged's user contract","startedAt":"2014-12-06T15:04:29Z","lastAt":"2014-12-11T15:13:10Z","messageCount":11,"participants":["Philip Oakley","Sérgio Basto","Michael J Gruber","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"253246","messageId":"1417878270-4364-1-git-send-email-philipoakley@iee.org","threadId":"38130","inReplyTo":null,"subject":"[PATCH v2] Improve --assume-unchanged in the git update-index man page","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-06T15:04:29Z","receivedAt":"2014-12-06T15:04:29Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"This version 2 patch squashes in Junio's comments ($gmane/260915) and tidies up\nthe commit message. Previous series at $gmane/260901.\n\nIn $gmane/260837 the --assume-unchanged flag was reported as buggy because\nof a misunderstanding about what it is being promised.\n\nThis clarifies the current situation, rather than change the code as proposed\nby Duy in $gmane/260865.\n\nPhilip Oakley (1):\n  doc: make clear --assume-unchanged's user contract\n\n Documentation/git-update-index.txt | 18 ++++++++----------\n 1 file changed, 8 insertions(+), 10 deletions(-)\n\n-- \n1.9.4.msysgit.0\n"},{"id":"253245","messageId":"1417878270-4364-2-git-send-email-philipoakley@iee.org","threadId":"38130","inReplyTo":"1417878270-4364-1-git-send-email-philipoakley@iee.org","subject":"[PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2014-12-06T15:04:30Z","receivedAt":"2014-12-06T15:04:30Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Many users misunderstand the --assume-unchanged contract, believing\nit means Git won't look at the flagged file.\n\nBe explicit that the --assume-unchanged contract is by the user that\nthey will NOT change the file so that Git does not need to look (and\nexpend, for example, lstat(2) cycles)\n\nMentioning \"Git stops checking\" does not help the reader, as it is\nonly one possible consequence of what that assumption allows Git to\ndo, but\n\n   (1) there are things other than \"stop checking\" that Git can do\n       based on that assumption; and\n   (2) Git is not obliged to stop checking; it merely is allowed to.\n\nAlso, this is a single flag bit, correct the plural to singular, and\nthe verb, accordingly.\n\nDrop the stale and incorrect information about \"poor-man's ignore\",\nwhich is not what this flag bit is about at all.\n\nSigned-off-by: Philip Oakley <philipoakley@iee.org>\n---\n Documentation/git-update-index.txt | 18 ++++++++----------\n 1 file changed, 8 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex e0a8702..da1ccbc 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -78,20 +78,18 @@ OPTIONS\n         Set the execute permissions on the updated files.\n \n --[no-]assume-unchanged::\n-\tWhen these flags are specified, the object names recorded\n-\tfor the paths are not updated.  Instead, these options\n-\tset and unset the \"assume unchanged\" bit for the\n-\tpaths.  When the \"assume unchanged\" bit is on, Git stops\n-\tchecking the working tree files for possible\n-\tmodifications, so you need to manually unset the bit to\n-\ttell Git when you change the working tree file. This is\n+\tWhen this flag is specified, the object names recorded\n+\tfor the paths are not updated.  Instead, this option\n+\tsets/unsets the \"assume unchanged\" bit for the\n+\tpaths.  When the \"assume unchanged\" bit is on, the user\n+\tpromises not to change the file and allows Git to assume\n+\tthat the working tree file matches what is recorded in\n+\tthe index.  If you want to change the working tree file,\n+\tyou need to unset the bit to tell Git.  This is\n \tsometimes helpful when working with a big project on a\n \tfilesystem that has very slow lstat(2) system call\n \t(e.g. cifs).\n +\n-This option can be also used as a coarse file-level mechanism\n-to ignore uncommitted changes in tracked files (akin to what\n-`.gitignore` does for untracked files).\n Git will fail (gracefully) in case it needs to modify this file\n in the index e.g. when merging in a commit;\n thus, in case the assumed-untracked file is changed upstream,\n-- \n1.9.4.msysgit.0\n"},{"id":"253397","messageId":"1418096636.19104.31.camel@segulix","threadId":"38130","inReplyTo":"1417878270-4364-2-git-send-email-philipoakley@iee.org","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Sérgio Basto","fromEmail":"sergio@serjux.com","sentAt":"2014-12-09T03:43:56Z","receivedAt":"2014-12-09T03:43:56Z","isPatch":true,"sender":{"key":"sergio@serjux.com","avatar":"https://gravatar.com/avatar/cb1e1c02b91fca7534374ad3e77409014e4c30c6de47356f36099793f08cc1de?d=mp&s=160"},"body":"On Sáb, 2014-12-06 at 15:04 +0000, Philip Oakley wrote: \n> Many users misunderstand the --assume-unchanged contract, believing\n> it means Git won't look at the flagged file.\n> \n> Be explicit that the --assume-unchanged contract is by the user that\n> they will NOT change the file so that Git does not need to look (and\n> expend, for example, lstat(2) cycles)\n> \n> Mentioning \"Git stops checking\" does not help the reader, as it is\n> only one possible consequence of what that assumption allows Git to\n> do, but\n> \n>    (1) there are things other than \"stop checking\" that Git can do\n>        based on that assumption; and\n>    (2) Git is not obliged to stop checking; it merely is allowed to.\n> \n> Also, this is a single flag bit, correct the plural to singular, and\n> the verb, accordingly.\n> \n> Drop the stale and incorrect information about \"poor-man's ignore\",\n> which is not what this flag bit is about at all.\n> \n> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n> ---\n>  Documentation/git-update-index.txt | 18 ++++++++----------\n>  1 file changed, 8 insertions(+), 10 deletions(-)\n> \n> diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\n> index e0a8702..da1ccbc 100644\n> --- a/Documentation/git-update-index.txt\n> +++ b/Documentation/git-update-index.txt\n> @@ -78,20 +78,18 @@ OPTIONS\n>          Set the execute permissions on the updated files.\n>  \n>  --[no-]assume-unchanged::\n> -\tWhen these flags are specified, the object names recorded\n> -\tfor the paths are not updated.  Instead, these options\n> -\tset and unset the \"assume unchanged\" bit for the\n> -\tpaths.  When the \"assume unchanged\" bit is on, Git stops\n> -\tchecking the working tree files for possible\n> -\tmodifications, so you need to manually unset the bit to\n> -\ttell Git when you change the working tree file. This is\n> +\tWhen this flag is specified, the object names recorded\n> +\tfor the paths are not updated.  Instead, this option\n> +\tsets/unsets the \"assume unchanged\" bit for the\n> +\tpaths.  When the \"assume unchanged\" bit is on, the user\n> +\tpromises not to change the file and allows Git to assume\n> +\tthat the working tree file matches what is recorded in\n> +\tthe index.  If you want to change the working tree file,\n> +\tyou need to unset the bit to tell Git.  This is\n>  \tsometimes helpful when working with a big project on a\n>  \tfilesystem that has very slow lstat(2) system call\n>  \t(e.g. cifs).\n>  +\n> -This option can be also used as a coarse file-level mechanism\n> -to ignore uncommitted changes in tracked files (akin to what\n> -`.gitignore` does for untracked files).\n>  Git will fail (gracefully) in case it needs to modify this file\n>  in the index e.g. when merging in a commit;\n>  thus, in case the assumed-untracked file is changed upstream,\n\nI don't understand why you insist that we have a contract, \nwhen : \n\"git diff .\", \"git diff -a\" and \"git commit -a\" have a different\nbehavior of \"git commit .\" , this is not about any contract this is\nabout coherency and be user friendly . \n\nAt least if you want keep things like that, wrote in doc, clearly, that\nassume-unchanged flag *is not*, to git ignoring changes in tracked files\nand currently not ignore files for git commit <path> and may not work in\nother cases . \n\nAlso don't understand why --assumed-untracked shouldn't deal with\nchanged files instead fallback in \"the user promises not to change the\nfile\" and sometimes works others not. \n\nAlso if this is the contract when a file is different from commit,\nshould warning the user that is not in contract (modify files that are\nassumed-untracked ) \n\n\nThanks, \n-- \nSérgio M. B.\n"},{"id":"253403","messageId":"39592B1FCE234EA58078EBFB34171859@PhilipOakley","threadId":"38130","inReplyTo":"1418096636.19104.31.camel@segulix","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-09T05:04:35Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Sérgio Basto\" <sergio@serjux.com>\n> On Sáb, 2014-12-06 at 15:04 +0000, Philip Oakley wrote:\n>> Many users misunderstand the --assume-unchanged contract, believing\n>> it means Git won't look at the flagged file.\n>>\n>> Be explicit that the --assume-unchanged contract is by the user that\n>> they will NOT change the file so that Git does not need to look (and\n>> expend, for example, lstat(2) cycles)\n>>\n>> Mentioning \"Git stops checking\" does not help the reader, as it is\n>> only one possible consequence of what that assumption allows Git to\n>> do, but\n>>\n>>    (1) there are things other than \"stop checking\" that Git can do\n>>        based on that assumption; and\n>>    (2) Git is not obliged to stop checking; it merely is allowed to.\n>>\n>> Also, this is a single flag bit, correct the plural to singular, and\n>> the verb, accordingly.\n>>\n>> Drop the stale and incorrect information about \"poor-man's ignore\",\n>> which is not what this flag bit is about at all.\n>>\n>> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n>> ---\n>>  Documentation/git-update-index.txt | 18 ++++++++----------\n>>  1 file changed, 8 insertions(+), 10 deletions(-)\n>>\n>> diff --git a/Documentation/git-update-index.txt \n>> b/Documentation/git-update-index.txt\n>> index e0a8702..da1ccbc 100644\n>> --- a/Documentation/git-update-index.txt\n>> +++ b/Documentation/git-update-index.txt\n>> @@ -78,20 +78,18 @@ OPTIONS\n>>          Set the execute permissions on the updated files.\n>>\n>>  --[no-]assume-unchanged::\n>> - When these flags are specified, the object names recorded\n>> - for the paths are not updated.  Instead, these options\n>> - set and unset the \"assume unchanged\" bit for the\n>> - paths.  When the \"assume unchanged\" bit is on, Git stops\n>> - checking the working tree files for possible\n>> - modifications, so you need to manually unset the bit to\n>> - tell Git when you change the working tree file. This is\n>> + When this flag is specified, the object names recorded\n>> + for the paths are not updated.  Instead, this option\n>> + sets/unsets the \"assume unchanged\" bit for the\n>> + paths.  When the \"assume unchanged\" bit is on, the user\n>> + promises not to change the file and allows Git to assume\n>> + that the working tree file matches what is recorded in\n>> + the index.  If you want to change the working tree file,\n>> + you need to unset the bit to tell Git.  This is\n>>  sometimes helpful when working with a big project on a\n>>  filesystem that has very slow lstat(2) system call\n>>  (e.g. cifs).\n>>  +\n>> -This option can be also used as a coarse file-level mechanism\n>> -to ignore uncommitted changes in tracked files (akin to what\n>> -`.gitignore` does for untracked files).\n>>  Git will fail (gracefully) in case it needs to modify this file\n>>  in the index e.g. when merging in a commit;\n>>  thus, in case the assumed-untracked file is changed upstream,\n>\n> I don't understand why you insist that we have a contract,\n\nThe misunderstanding (which even I had until recently), was the same as \nyour misunderstanding, and is also repeated (wrongly) in the \ndocumentation that the flag is about ignoring changes to files.\n\nThat is completely wrong, and not why the flag was invented (as I \nunderstand it).\n\nThe flag was invented because Git bran very slowly on some file systems \n(e.g. cifs lstat(2) system calls) to the point that it was deemed \nunacceptable. The solution was to tell git to stop doing those lstat \ncalls because the user had flagged it's unchanged nature.\n\nThe problem was then that, as a side effect, in the main, Git wouldn't \nnotice any changes to such marked files (but some commands do notice;-) \nso some people used it as a \"poor man's ignore\" flag, and that \nmisinformation stuck. Unfortunately you have been caught in that trap.\n\nWhile many seek code (change) based solutions, I see clearer \ndocumentation (especially for the intermediate rather than expert users) \nas a good first step. People do read the documentation, though often in \nretrospect, so my patch seeks to clarify the existing situation. That is \n\"please git, update the index, you can assume these files are \nunchanged\".\n\nAnother thread has pointed out that the misunderstanding as also \nrepeated on another page, so I'll need to see if a patch is forthcoming \nfor that!\n\n> when :\n> \"git diff .\", \"git diff -a\" and \"git commit -a\" have a different\n> behavior of \"git commit .\" , this is not about any contract this is\n> about coherency and be user friendly .\n>\n> At least if you want keep things like that, wrote in doc, clearly, \n> that\n> assume-unchanged flag *is not*, to git ignoring changes in tracked \n> files\n> and currently not ignore files for git commit <path> and may not work \n> in\n> other cases .\n>\n> Also don't understand why --assumed-untracked shouldn't deal with\n> changed files instead fallback in \"the user promises not to change the\n> file\" and sometimes works others not.\n>\n> Also if this is the contract when a file is different from commit,\n> should warning the user that is not in contract (modify files that are\n> assumed-untracked )\n>\nI hope my explanation helps in explaining how we have come to this \nperhaps unhelpful situation.\n--\nPhilip \n"},{"id":"253404","messageId":"CD806F4871C843B399611747A4B57035@PhilipOakley","threadId":"38130","inReplyTo":"39592B1FCE234EA58078EBFB34171859@PhilipOakley","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2014-12-09T05:04:35Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Philip Oakley\" <philipoakley@iee.org>\n> From: \"Sérgio Basto\" <sergio@serjux.com>\n>> On Sáb, 2014-12-06 at 15:04 +0000, Philip Oakley wrote:\n>>> Many users misunderstand the --assume-unchanged contract, believing\n>>> it means Git won't look at the flagged file.\n[...]\n> retrospect, so my patch seeks to clarify the existing situation. That \n> is \"please git, update the index, you can assume these files are \n> unchanged ... \".\n... and if you don't  trust me, then you can even go and check \n[Honestly,  you can trust me I'm a developer]\"\n--\nthe extra bit.\nPhilip\n"},{"id":"253405","messageId":"5486B342.8090800@drmicha.warpmail.net","threadId":"38130","inReplyTo":"1418096636.19104.31.camel@segulix","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-09T08:30:58Z","receivedAt":"2014-12-09T08:30:58Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Sérgio Basto schrieb am 09.12.2014 um 04:43:\n> On Sáb, 2014-12-06 at 15:04 +0000, Philip Oakley wrote: \n>> Many users misunderstand the --assume-unchanged contract, believing\n>> it means Git won't look at the flagged file.\n>>\n>> Be explicit that the --assume-unchanged contract is by the user that\n>> they will NOT change the file so that Git does not need to look (and\n>> expend, for example, lstat(2) cycles)\n>>\n>> Mentioning \"Git stops checking\" does not help the reader, as it is\n>> only one possible consequence of what that assumption allows Git to\n>> do, but\n>>\n>>    (1) there are things other than \"stop checking\" that Git can do\n>>        based on that assumption; and\n>>    (2) Git is not obliged to stop checking; it merely is allowed to.\n>>\n>> Also, this is a single flag bit, correct the plural to singular, and\n>> the verb, accordingly.\n>>\n>> Drop the stale and incorrect information about \"poor-man's ignore\",\n>> which is not what this flag bit is about at all.\n>>\n>> Signed-off-by: Philip Oakley <philipoakley@iee.org>\n>> ---\n>>  Documentation/git-update-index.txt | 18 ++++++++----------\n>>  1 file changed, 8 insertions(+), 10 deletions(-)\n>>\n>> diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\n>> index e0a8702..da1ccbc 100644\n>> --- a/Documentation/git-update-index.txt\n>> +++ b/Documentation/git-update-index.txt\n>> @@ -78,20 +78,18 @@ OPTIONS\n>>          Set the execute permissions on the updated files.\n>>  \n>>  --[no-]assume-unchanged::\n>> -\tWhen these flags are specified, the object names recorded\n>> -\tfor the paths are not updated.  Instead, these options\n>> -\tset and unset the \"assume unchanged\" bit for the\n>> -\tpaths.  When the \"assume unchanged\" bit is on, Git stops\n>> -\tchecking the working tree files for possible\n>> -\tmodifications, so you need to manually unset the bit to\n>> -\ttell Git when you change the working tree file. This is\n>> +\tWhen this flag is specified, the object names recorded\n>> +\tfor the paths are not updated.  Instead, this option\n>> +\tsets/unsets the \"assume unchanged\" bit for the\n>> +\tpaths.  When the \"assume unchanged\" bit is on, the user\n>> +\tpromises not to change the file and allows Git to assume\n>> +\tthat the working tree file matches what is recorded in\n>> +\tthe index.  If you want to change the working tree file,\n>> +\tyou need to unset the bit to tell Git.  This is\n>>  \tsometimes helpful when working with a big project on a\n>>  \tfilesystem that has very slow lstat(2) system call\n>>  \t(e.g. cifs).\n>>  +\n>> -This option can be also used as a coarse file-level mechanism\n>> -to ignore uncommitted changes in tracked files (akin to what\n>> -`.gitignore` does for untracked files).\n>>  Git will fail (gracefully) in case it needs to modify this file\n>>  in the index e.g. when merging in a commit;\n>>  thus, in case the assumed-untracked file is changed upstream,\n> \n> I don't understand why you insist that we have a contract, \n\nBuy setting the bit, you are making the promise to Git: \"You can assume\nthe file is unchanged without even checking.\"\n\n> when : \n> \"git diff .\", \"git diff -a\" and \"git commit -a\" have a different\n> behavior of \"git commit .\" , this is not about any contract this is\n> about coherency and be user friendly . \n\nGit does not make the promise that it will not check.\n\n> At least if you want keep things like that, wrote in doc, clearly, that\n> assume-unchanged flag *is not*, to git ignoring changes in tracked files\n> and currently not ignore files for git commit <path> and may not work in\n> other cases . \n> \n> Also don't understand why --assumed-untracked shouldn't deal with\n> changed files instead fallback in \"the user promises not to change the\n> file\" and sometimes works others not. \n> \n> Also if this is the contract when a file is different from commit,\n> should warning the user that is not in contract (modify files that are\n> assumed-untracked ) \n> \n> \n> Thanks, \n> \n\ngit update-index is a plumbing command, not a user frontend. If you use\nit and bring workdir/index into an inconsistent state it's simply the\nwrong use of a plumbing tool. Things tend to break when you use a\nplumbing tool incorrectly ;)\n\nThat being said, there is some wrong advice in gitignore.txt that we\nshould remove.\n\nIn git-update-index.txt, we could try and spell this out even more clearly:\n\n..allows Git to assume... in the index; nonetheless Git may check the\nworking tree file under some circumstances.\n\nAnd maybe we could specify in all man pages the category of a command,\nor a warning for plumbing commands (\"plumbing - use at own risk\").\n\nMichael\n"},{"id":"253409","messageId":"fe381f27dd50afd44d451577e2315ed5580e3034.1418123458.git.git@drmicha.warpmail.net","threadId":"38130","inReplyTo":"5486B342.8090800@drmicha.warpmail.net","subject":"[PATCH] gitignore.txt: do not suggest assume-unchanged","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-09T11:13:00Z","receivedAt":"2014-12-09T11:13:00Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git-update-index --assume-unchanged was never meant to ignore changes\nto tracked files (only to spare some stats). So do not suggest it\nas a means to achieve that.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/gitignore.txt | 4 ----\n 1 file changed, 4 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 09e82c3..4fd0442 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -138,9 +138,6 @@ NOTES\n The purpose of gitignore files is to ensure that certain files\n not tracked by Git remain untracked.\n \n-To ignore uncommitted changes in a file that is already tracked,\n-use 'git update-index {litdd}assume-unchanged'.\n-\n To stop tracking a file that is currently tracked, use\n 'git rm --cached'.\n \n@@ -203,7 +200,6 @@ everything within `foo/bar`):\n SEE ALSO\n --------\n linkgit:git-rm[1],\n-linkgit:git-update-index[1],\n linkgit:gitrepository-layout[5],\n linkgit:git-check-ignore[1]\n \n-- \n2.2.0.345.g7041aac\n"},{"id":"253472","messageId":"xmqqoarcjpv3.fsf@gitster.dls.corp.google.com","threadId":"38130","inReplyTo":"1418096636.19104.31.camel@segulix","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-10T00:44:00Z","receivedAt":"2014-12-10T00:44:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sérgio Basto <sergio@serjux.com> writes:\n\n> Also don't understand why --assumed-untracked shouldn't deal with\n> changed files instead fallback in \"the user promises not to change the\n> file\" and sometimes works others not. \n>\n> Also if this is the contract when a file is different from commit,\n> should warning the user that is not in contract (modify files that are\n> assumed-untracked ) \n\nUnfortunately, that is not even possible in the case where\nassume-untracked is meant to be used without breaking the use case\nit was invented to support.  The user flips the bit so that Git does\nnot have to traverse the working tree to run lstat(2) on all of them\nin order to see if some have changes relative to the index.\n\nIf we cannot trust that bit and need to verify, how would we do\nthat?\n\nThink.\n\nYes, by running lstat(2) on these files that the user promised not\nto touch.  That just defeats the sole objective the feature was\ninvented for in the first place.\n\nHaving said all that, I know what you wish to have, and I am not\nfundamentally opposed to a change to add a new feature to order Git\nto pretend that changes that may exist in the working tree are not\nthere.  It's just that assume-unchanged bit is not that.  It is a\nway to allow Git that it can assume the files in the working tree\nare not changed.  It is a permission, not a command.\n\nThis is a tangent, but somebody may want to check the \"Git will fail\n(gracefully)\" bit in the documentation Philip's documentation patch\ndid not remove.  Such a detection is not absolutely necessary, and\nthe paragraph may be describing a wishful thinking by somebody who\nmisunderstood --assume-unchanged with a cursory observation of what\nhappened for limited test cases back when the documentation was\nadded, in which case that paragraph may also want to go.\n"},{"id":"253473","messageId":"20141210010658.GD16345@google.com","threadId":"38130","inReplyTo":"fe381f27dd50afd44d451577e2315ed5580e3034.1418123458.git.git@drmicha.warpmail.net","subject":"Re: [PATCH] gitignore.txt: do not suggest assume-unchanged","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-12-10T01:06:58Z","receivedAt":"2014-12-10T01:06:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Michael J Gruber wrote:\n\n> git-update-index --assume-unchanged was never meant to ignore changes\n> to tracked files (only to spare some stats). So do not suggest it\n> as a means to achieve that.\n[...]\n> +++ b/Documentation/gitignore.txt\n> @@ -138,9 +138,6 @@ NOTES\n>  The purpose of gitignore files is to ensure that certain files\n>  not tracked by Git remain untracked.\n>  \n> -To ignore uncommitted changes in a file that is already tracked,\n> -use 'git update-index {litdd}assume-unchanged'.\n> -\n>  To stop tracking a file that is currently tracked, use\n>  'git rm --cached'.\n\nMakes sense.\n\nBut we need some advice to replace the paragraph you are deleting.  Is\nthe idea something like\n\n\tGit will not ignore uncommitted changes in a file that is already tracked.\n\tIf you have time to work on that, please contact git@vger.kernel.org.\n\n(perhaps without that second line)?\n\nThanks,\nJonathan\n"},{"id":"253474","messageId":"1418176152.8290.9.camel@segulix","threadId":"38130","inReplyTo":"xmqqoarcjpv3.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] doc: make clear --assume-unchanged's user contract","fromName":"Sérgio Basto","fromEmail":"sergio@serjux.com","sentAt":"2014-12-10T01:49:12Z","receivedAt":"2014-12-10T01:49:12Z","isPatch":true,"sender":{"key":"sergio@serjux.com","avatar":"https://gravatar.com/avatar/cb1e1c02b91fca7534374ad3e77409014e4c30c6de47356f36099793f08cc1de?d=mp&s=160"},"body":"On Ter, 2014-12-09 at 16:44 -0800, Junio C Hamano wrote: \n> Sérgio Basto <sergio@serjux.com> writes:\n> \n> > Also don't understand why --assumed-untracked shouldn't deal with\n> > changed files instead fallback in \"the user promises not to change the\n> > file\" and sometimes works others not. \n> >\n> > Also if this is the contract when a file is different from commit,\n> > should warning the user that is not in contract (modify files that are\n> > assumed-untracked ) \n> \n> Unfortunately, that is not even possible in the case where\n> assume-untracked is meant to be used without breaking the use case\n> it was invented to support. \n\nOK, but when we do: git --assumed-untracked <file> and file is already\nmodified. we could do an warning .\n\nMay also should mention in documentation that --assumed-untracked  is\nnot to deal with \"local versions of tracked config files in git\" (if you\ndon't) \n\nMeanwhile I read https://gist.github.com/canton7/1423106 \nI adopt\nhttps://gist.github.com/canton7/1423106#if-you-cant-modify-your-application \nitem 1 \n\nThanks for your patience\n\n\n>  The user flips the bit so that Git does\n> not have to traverse the working tree to run lstat(2) on all of them\n> in order to see if some have changes relative to the index.\n> \n> If we cannot trust that bit and need to verify, how would we do\n> that?\n> \n> Think.\n> \n> Yes, by running lstat(2) on these files that the user promised not\n> to touch.  That just defeats the sole objective the feature was\n> invented for in the first place.\n> \n> Having said all that, I know what you wish to have, and I am not\n> fundamentally opposed to a change to add a new feature to order Git\n> to pretend that changes that may exist in the working tree are not\n> there. \n> It's just that assume-unchanged bit is not that.  It is a\n> way to allow Git that it can assume the files in the working tree\n> are not changed.  It is a permission, not a command.\n> \n> This is a tangent, but somebody may want to check the \"Git will fail\n> (gracefully)\" bit in the documentation Philip's documentation patch\n> did not remove.  Such a detection is not absolutely necessary, and\n> the paragraph may be describing a wishful thinking by somebody who\n> misunderstood --assume-unchanged with a cursory observation of what\n> happened for limited test cases back when the documentation was\n> added, in which case that paragraph may also want to go.\n> \n> \n> \n> \n> \n> \n\n-- \nSérgio M. B.\n"},{"id":"253567","messageId":"5489B486.6060608@drmicha.warpmail.net","threadId":"38130","inReplyTo":"20141210010658.GD16345@google.com","subject":"Re: [PATCH] gitignore.txt: do not suggest assume-unchanged","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-11T15:13:10Z","receivedAt":"2014-12-11T15:13:10Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jonathan Nieder schrieb am 10.12.2014 um 02:06:\n> Michael J Gruber wrote:\n> \n>> git-update-index --assume-unchanged was never meant to ignore changes\n>> to tracked files (only to spare some stats). So do not suggest it\n>> as a means to achieve that.\n> [...]\n>> +++ b/Documentation/gitignore.txt\n>> @@ -138,9 +138,6 @@ NOTES\n>>  The purpose of gitignore files is to ensure that certain files\n>>  not tracked by Git remain untracked.\n>>  \n>> -To ignore uncommitted changes in a file that is already tracked,\n>> -use 'git update-index {litdd}assume-unchanged'.\n>> -\n>>  To stop tracking a file that is currently tracked, use\n>>  'git rm --cached'.\n> \n> Makes sense.\n> \n> But we need some advice to replace the paragraph you are deleting.  Is\n> the idea something like\n> \n> \tGit will not ignore uncommitted changes in a file that is already tracked.\n> \tIf you have time to work on that, please contact git@vger.kernel.org.\n> \n> (perhaps without that second line)?\n> \n> Thanks,\n> Jonathan\n\nI seems you're missing that info only because you know what used to be\nthere.\n\nIf you reread - trying to read only what is there now - you will see\nthat the text clearly says: gitignore files are about ignoring untracked\nfiles to ensure that they remain untracked.\n\nBut maybe I'm somewhat professionally preoccupied :)\n\nThat is: Even if it clearly says it is about untracked files, it doesn't\nhurt to say what it is not about (namely tracked files). It's just that\nit is not about many other things either.\n\nMichael\n"}]}