{"thread":{"id":"14507","subject":"[PATCH] Documentation/gitignore.txt: Clarify gitignore vs tracked files","startedAt":"2008-07-17T16:36:32Z","lastAt":"2008-07-18T14:11:07Z","messageCount":4,"participants":["Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83713","messageId":"20080717163622.12592.29919.stgit@localhost","threadId":"14507","inReplyTo":null,"subject":"[PATCH] Documentation/gitignore.txt: Clarify gitignore vs tracked files","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-17T16:36:32Z","receivedAt":"2008-07-17T16:36:32Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Explain more carefully that `.gitignore` concerns only untracked files\nand there is no way to make git ignore local changes in already tracked\nfiles.\n\nThis is currently probably one of the top FAQs at #git and the documentation\ncould be more explicit about this.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/gitignore.txt |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex fc0efd8..ac3c776 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -13,9 +13,12 @@ DESCRIPTION\n -----------\n \n A `gitignore` file specifies intentionally untracked files that\n-git should ignore.  Each line in a `gitignore` file specifies a\n-pattern.\n+git should ignore.\n+Note that all the `gitignore` files really concern only files\n+that are not already tracked by git; there is no direct mechanism\n+to make git ignore your local modifications in already tracked files.\n \n+Each line in a `gitignore` file specifies a pattern.\n When deciding whether to ignore a path, git normally checks\n `gitignore` patterns from multiple sources, with the following\n order of precedence, from highest to lowest (within one level of\n"},{"id":"83731","messageId":"7vabgggyuc.fsf@gitster.siamese.dyndns.org","threadId":"14507","inReplyTo":"20080717163622.12592.29919.stgit@localhost","subject":"Re: [PATCH] Documentation/gitignore.txt: Clarify gitignore vs tracked files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-17T18:16:59Z","receivedAt":"2008-07-17T18:16:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> -git should ignore.  Each line in a `gitignore` file specifies a\n> -pattern.\n> +git should ignore.\n> +Note that all the `gitignore` files really concern only files\n> +that are not already tracked by git; there is no direct mechanism\n> +to make git ignore your local modifications in already tracked files.\n\nThanks.\n\nI'd suggest dropping everything after ';'.\n\n - If you want to keep local changes without ever checking in, you can do\n   so by making partial commits.\n\n - You could mark these paths \"assume unchanged\".\n"},{"id":"83734","messageId":"20080717182619.GG10151@machine.or.cz","threadId":"14507","inReplyTo":"7vabgggyuc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Documentation/gitignore.txt: Clarify gitignore vs tracked files","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-17T18:26:19Z","receivedAt":"2008-07-17T18:26:19Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nOn Thu, Jul 17, 2008 at 11:16:59AM -0700, Junio C Hamano wrote:\n> I'd suggest dropping everything after ';'.\n\n  I think the part after ';' is the main benefit of this patch,\nactually. Without suggesting an alternative, the users are left puzzled\n\"so how do I do that?\"\n\n>  - If you want to keep local changes without ever checking in, you can do\n>    so by making partial commits.\n\n  Yes, that's a rather obvious solution but the user probably wants\nsomething nicer than that if he starts looking already.\n\n>  - You could mark these paths \"assume unchanged\".\n\n  I really think this is worth mentioning in the gitignore manpage;\nit is not _directly_ on-topic, but there is no other obvious place where\nto teach users about it and all the interested people will check the\ngitignore manpage first. Perhaps a small section at the end might be\nacceptable? ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nGNU, n. An animal of South Africa, which in its domesticated state\nresembles a horse, a buffalo and a stag. In its wild condition it is\nsomething like a thunderbolt, an earthquake and a cyclone. -- A. Pierce\n"},{"id":"83878","messageId":"20080718141038.28693.4887.stgit@localhost","threadId":"14507","inReplyTo":"20080717182619.GG10151@machine.or.cz","subject":"[PATCH] Documentation: How to ignore local changes in tracked files","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-18T14:11:07Z","receivedAt":"2008-07-18T14:11:07Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This patch explains more carefully that `.gitignore` concerns only\nuntracked files and refers the reader to\n\n\tgit update-index --assume-unchanged\n\nin the need of ignoring uncommitted changes in already tracked files.\nThe description of this option is lifted to a more \"porcelainish\"\nlevel and explains the caveats of this usecase.\n\nWhether feasible or not, I believe adding this functionality to\nthe porcelain is out of the scope of this patch. (And I personally\nthink that referring to the plumbing in the case of such a special\nusage is fine.)\n\nThis is currently probably one of the top FAQs at #git and the\n--assume-unchanged switch is not widely known; gitignore(5) is the first\nplace where people are likely to look for it.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-update-index.txt |   10 ++++++++++\n Documentation/gitignore.txt        |   11 ++++++++---\n 2 files changed, 18 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex a91fd21..6b930bc 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -88,6 +88,16 @@ OPTIONS\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+You should remember that an explicit 'git add' operation will\n+still cause the file to be refreshed from the working tree.\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+you will need to handle the situation manually.\n \n -g::\n --again::\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex fc0efd8..59321a2 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -13,9 +13,14 @@ DESCRIPTION\n -----------\n \n A `gitignore` file specifies intentionally untracked files that\n-git should ignore.  Each line in a `gitignore` file specifies a\n-pattern.\n-\n+git should ignore.\n+Note that all the `gitignore` files really concern only files\n+that are not already tracked by git;\n+in order to ignore uncommitted changes in already tracked files,\n+please refer to the 'git update-index --assume-unchanged'\n+documentation.\n+\n+Each line in a `gitignore` file specifies a pattern.\n When deciding whether to ignore a path, git normally checks\n `gitignore` patterns from multiple sources, with the following\n order of precedence, from highest to lowest (within one level of\n"}]}