{"thread":{"id":"31729","subject":"Ignore on commit","startedAt":"2012-10-04T16:45:50Z","lastAt":"2012-10-05T13:30:05Z","messageCount":12,"participants":["Marco Craveiro","Pascal Obry","Andrew Wong","Andrew Ardill","demerphq","Sitaram Chamarty","Junio C Hamano","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200529","messageId":"CAKRNd4w4Z-LS9O5ffkbTSZ0Guv4KCmWR=AtW3EpxQ2sSgazG=Q@mail.gmail.com","threadId":"31729","inReplyTo":null,"subject":"Ignore on commit","fromName":"Marco Craveiro","fromEmail":"marco.craveiro@gmail.com","sentAt":"2012-10-04T16:45:50Z","receivedAt":"2012-10-04T16:45:50Z","isPatch":false,"sender":{"key":"marco.craveiro@gmail.com","avatar":"https://gravatar.com/avatar/f1f16a357cdadd1fbd105373497f8b4bb776220f4c6dd75d4bd44d04ae0027b0?d=mp&s=160"},"body":"Hello gitters,\n\nOne of the very (very) few features I miss in svn is \"ignore on\ncommit\" (or, more generally, changelists). I'm not sure if this has\nbeen discussed in the past - google failed me a bit due to spurious\nmatches - but I personally find it quite useful. The feature is\ndescribed here [1] (and graphically, here [2]).\n\nThe gist of it is, one can mark certain files as \"ignore on commit\"\nand they get placed on a \"special list\" which shows up on status.\nThese lists are effectively a sub-division of modified (but not\nstaged). Up till now I have found the staging area to be quite\nsufficient, but recently I hit a use case where I was modifying a\nlarge number of files; some modifications were hacks required to get\nthe build to work but were not meant to ever get checked in, most\nother files had real work. In cases like this its really useful to\nmark the hacked files as \"ignore on commit\", so that a) we don't lose\ntrack of them (as one would with git ignore, or with [4]) but b) we\nwon't check them in by mistake.\n\nI found some tips on how to survive without change lists ([3], [4])\nbut they are a bit more cumbersome. Has this feature been discussed?\n\nThanks a lot for an amazing piece of software, and thanks for your time.\n\nCheers\n\nMarco\n-- \nSo young, and already so unknown -- Pauli\n\nblog: http://mcraveiro.blogspot.com\n\n[1] http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.changelist.html\n[2] http://blog.baljeetsingh.net/2009/02/tips-tricks-svn-ignore-on-commit.html\n[3] http://stackoverflow.com/questions/10606809/git-equivalence-of-svn-changelist\n[4] http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html\n"},{"id":"200548","messageId":"506DEC50.7090402@obry.net","threadId":"31729","inReplyTo":"CAKRNd4w4Z-LS9O5ffkbTSZ0Guv4KCmWR=AtW3EpxQ2sSgazG=Q@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2012-10-04T20:06:40Z","receivedAt":"2012-10-04T20:06:40Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"\nI'm not sure to follow everything... But looks like:\n\n   $ git add -p\n\nor\n\n   $ git add -i\n\nshould do what you want, no?\n\nYou select the hunks to commit, let over the \"hacks\" and then\n\n   $ git commit\n\n-- \n\n  Pascal Obry /  Magny Les Hameaux (78)\n\n  The best way to travel is by means of imagination\n\n  http://v2p.fr.eu.org\n  http://www.obry.net\n\n  gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"200543","messageId":"CAKRNd4wbT_boRyFOOL_95FBW4ws8Zzz2ubVCfXuRSevzPdhW9g@mail.gmail.com","threadId":"31729","inReplyTo":"506DEC50.7090402@obry.net","subject":"Re: Ignore on commit","fromName":"Marco Craveiro","fromEmail":"marco.craveiro@gmail.com","sentAt":"2012-10-04T21:20:53Z","receivedAt":"2012-10-04T21:20:53Z","isPatch":false,"sender":{"key":"marco.craveiro@gmail.com","avatar":"https://gravatar.com/avatar/f1f16a357cdadd1fbd105373497f8b4bb776220f4c6dd75d4bd44d04ae0027b0?d=mp&s=160"},"body":"<ignore on commit>\n> I'm not sure to follow everything... But looks like:\n>\n>    $ git add -p\n>\n> or\n>\n>    $ git add -i\n>\n> should do what you want, no?\n>\n> You select the hunks to commit, let over the \"hacks\" and then\n>\n>    $ git commit\n\nSimilar but not quite; the idea is that you know that there is some\ncode (I'm just talking about files here, so lets ignore hunks for the\nmoment) which is normally checked in but for a period of time you want\nit ignored. So you don't want it git ignored but at the same time you\ndon't want to see these files in the list of modified files. The\nchangelist concept allows you to \"move\" the files out of the way from\nthe main modified section until you are ready to commit them. Perhaps\nan imaginary git status would help:\n\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#\tmodified:   some_staged_file.h\n#\n# Changes not staged for commit:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n#\tmodified:   some_modified_file.h\n#\n# Changes ignored on commit:\n#\n#\tmodified:   some_other_modified_file.h\n\nSuch that if you now did a git add -A, some_modified_file.h would then\nbe staged but some_other_modified_file.h would stay put. Of course the\nname \"ignored on commit\" makes little sense in git terms, but I'm\nusing it here as its the svn term. Its a \"modified but temporarily\nignored\" or something.\n\nCheers\n\nMarco\n-- \nSo young, and already so unknown -- Pauli\n\nblog: http://mcraveiro.blogspot.com\n"},{"id":"200574","messageId":"506E158A.2020903@gmail.com","threadId":"31729","inReplyTo":"CAKRNd4wbT_boRyFOOL_95FBW4ws8Zzz2ubVCfXuRSevzPdhW9g@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Andrew Wong","fromEmail":"andrew.kw.w@gmail.com","sentAt":"2012-10-04T23:02:34Z","receivedAt":"2012-10-04T23:02:34Z","isPatch":false,"sender":{"key":"andrew.kw.w@gmail.com","avatar":"https://avatars.githubusercontent.com/u/489311?v=4"},"body":"On 10/04/2012 05:20 PM, Marco Craveiro wrote:\n> Similar but not quite; the idea is that you know that there is some\n> code (I'm just talking about files here, so lets ignore hunks for the\n> moment) which is normally checked in but for a period of time you want\n> it ignored. So you don't want it git ignored but at the same time you\n> don't want to see these files in the list of modified files.\nThe way I usually handle this scenario is by actually making a temporary \ncommit with those temporary changes. And whenever I make a permanent \ncommit, I'll use \"rebase -i\" to rearrange the commits so that all my \npermanent commits go before my temporary commits. So when I need to \npush, I'll just push up till before my temporary commits.\n\nThis way I also get to make permanent changes in files that I have \ntemporary changes.\n"},{"id":"200579","messageId":"CAH5451mpJw4+noUF+FkZJS+Y2oq2ThFeG7wSOCdbVaMQPNgUJA@mail.gmail.com","threadId":"31729","inReplyTo":"CAKRNd4wbT_boRyFOOL_95FBW4ws8Zzz2ubVCfXuRSevzPdhW9g@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Andrew Ardill","fromEmail":"andrew.ardill@gmail.com","sentAt":"2012-10-05T01:00:01Z","receivedAt":"2012-10-05T01:00:01Z","isPatch":false,"sender":{"key":"andrew.ardill@gmail.com","avatar":"https://gravatar.com/avatar/da14cb7c091dd44dc6c63a4d3361b149acaf25226dc78eb4131a17b93d9b0993?d=mp&s=160"},"body":"On 5 October 2012 07:20, Marco Craveiro <marco.craveiro@gmail.com> wrote:\n> ...\n> Similar but not quite; the idea is that you know that there is some\n> code (I'm just talking about files here, so lets ignore hunks for the\n> moment) which is normally checked in but for a period of time you want\n> it ignored. So you don't want it git ignored but at the same time you\n> don't want to see these files in the list of modified files.\n\nWhat is the reason git ignore is no good in this case? Is it simply\nthat you can't see the ignored files in git status, or is it that\nadding and removing entries to .gitignore is too cumbersome? If it's\nthe latter you could probably put together a simple shell wrapper to\nautomate the task, as otherwise it seems like git ignore does what you\nneed.\n\nRegards,\n\nAndrew Ardill\n"},{"id":"200582","messageId":"CANgJU+XSYWObCsGVnWwaaSB9iZQnfU_y095uzEm5-YXMaUoU_w@mail.gmail.com","threadId":"31729","inReplyTo":"CAH5451mpJw4+noUF+FkZJS+Y2oq2ThFeG7wSOCdbVaMQPNgUJA@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2012-10-05T01:35:14Z","receivedAt":"2012-10-05T01:35:14Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 5 October 2012 03:00, Andrew Ardill <andrew.ardill@gmail.com> wrote:\n> On 5 October 2012 07:20, Marco Craveiro <marco.craveiro@gmail.com> wrote:\n>> ...\n>> Similar but not quite; the idea is that you know that there is some\n>> code (I'm just talking about files here, so lets ignore hunks for the\n>> moment) which is normally checked in but for a period of time you want\n>> it ignored. So you don't want it git ignored but at the same time you\n>> don't want to see these files in the list of modified files.\n>\n> What is the reason git ignore is no good in this case? Is it simply\n> that you can't see the ignored files in git status, or is it that\n> adding and removing entries to .gitignore is too cumbersome? If it's\n> the latter you could probably put together a simple shell wrapper to\n> automate the task, as otherwise it seems like git ignore does what you\n> need.\n\nGit ignore doesn't ignore tracked files.\n\nYves\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"200583","messageId":"CAMK1S_jfdW3BepELgPPoUf3qWwmU-o3o8OpMVimdfkERUJkymQ@mail.gmail.com","threadId":"31729","inReplyTo":"CANgJU+XSYWObCsGVnWwaaSB9iZQnfU_y095uzEm5-YXMaUoU_w@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-10-05T02:20:11Z","receivedAt":"2012-10-05T02:20:11Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Fri, Oct 5, 2012 at 7:05 AM, demerphq <demerphq@gmail.com> wrote:\n> On 5 October 2012 03:00, Andrew Ardill <andrew.ardill@gmail.com> wrote:\n>> On 5 October 2012 07:20, Marco Craveiro <marco.craveiro@gmail.com> wrote:\n>>> ...\n>>> Similar but not quite; the idea is that you know that there is some\n>>> code (I'm just talking about files here, so lets ignore hunks for the\n>>> moment) which is normally checked in but for a period of time you want\n>>> it ignored. So you don't want it git ignored but at the same time you\n>>> don't want to see these files in the list of modified files.\n>>\n>> What is the reason git ignore is no good in this case? Is it simply\n>> that you can't see the ignored files in git status, or is it that\n>> adding and removing entries to .gitignore is too cumbersome? If it's\n>> the latter you could probably put together a simple shell wrapper to\n>> automate the task, as otherwise it seems like git ignore does what you\n>> need.\n>\n> Git ignore doesn't ignore tracked files.\n\nwould 'git update-index --assume-unchanged' work in this case?  Didn't\nsee it mentioned in any of the replies so far (but I have never used\nit myself)\n"},{"id":"200584","messageId":"7vwqz5vdrb.fsf@alter.siamese.dyndns.org","threadId":"31729","inReplyTo":"CAMK1S_jfdW3BepELgPPoUf3qWwmU-o3o8OpMVimdfkERUJkymQ@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-05T02:44:40Z","receivedAt":"2012-10-05T02:44:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n>> Git ignore doesn't ignore tracked files.\n>\n> would 'git update-index --assume-unchanged' work in this case?  Didn't\n> see it mentioned in any of the replies so far (but I have never used\n> it myself)\n\nThe assume-unchanged bit is *not* an instruction to tell Git to\nignore changes.  It is your *promise* that you will not change it,\nand tells Git that it is free to use the contents from the working\ntree and the contents in the index interchangeably, taking whichever\nis more convenient for Git to handle.\n\nSo, no, it might appear to work in some cases, but you are playing\nwith an undefined behaviour.\n"},{"id":"200585","messageId":"CAH5451ki_JFntWZwxcUqvWKwZn62Vfg=MkF3xwiX1p3ARULQfA@mail.gmail.com","threadId":"31729","inReplyTo":"CAMK1S_jfdW3BepELgPPoUf3qWwmU-o3o8OpMVimdfkERUJkymQ@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Andrew Ardill","fromEmail":"andrew.ardill@gmail.com","sentAt":"2012-10-05T02:44:48Z","receivedAt":"2012-10-05T02:44:48Z","isPatch":false,"sender":{"key":"andrew.ardill@gmail.com","avatar":"https://gravatar.com/avatar/da14cb7c091dd44dc6c63a4d3361b149acaf25226dc78eb4131a17b93d9b0993?d=mp&s=160"},"body":"On 5 October 2012 12:20, Sitaram Chamarty <sitaramc@gmail.com> wrote:\n> On Fri, Oct 5, 2012 at 7:05 AM, demerphq <demerphq@gmail.com> wrote:\n>> On 5 October 2012 03:00, Andrew Ardill <andrew.ardill@gmail.com> wrote:\n>>> On 5 October 2012 07:20, Marco Craveiro <marco.craveiro@gmail.com> wrote:\n>>>> ...\n>>>> Similar but not quite; the idea is that you know that there is some\n>>>> code (I'm just talking about files here, so lets ignore hunks for the\n>>>> moment) which is normally checked in but for a period of time you want\n>>>> it ignored. So you don't want it git ignored but at the same time you\n>>>> don't want to see these files in the list of modified files.\n>>>\n>>> What is the reason git ignore is no good in this case? Is it simply\n>>> that you can't see the ignored files in git status, or is it that\n>>> adding and removing entries to .gitignore is too cumbersome? If it's\n>>> the latter you could probably put together a simple shell wrapper to\n>>> automate the task, as otherwise it seems like git ignore does what you\n>>> need.\n>>\n>> Git ignore doesn't ignore tracked files.\n>\n> would 'git update-index --assume-unchanged' work in this case?  Didn't\n> see it mentioned in any of the replies so far (but I have never used\n> it myself)\n\n>From the help page:\n\n--assume-unchanged, --no-assume-unchanged\n    ...\n\n    This option can be also used as a coarse file-level mechanism to\nignore uncommitted changes in tracked files (akin to what .gitignore\n    does for untracked files).\n\nSeems like it does everything required. I tested and it correctly\nhides changes that I want hidden. The only thing I can't see how to do\nis get git status to show files with the assume unchanged  bit set. I\nthink there is no way currently, but that might be a nice addition to\nmake the initial request feature complete. It could show either all\nfiles with the bit set, or files with the bit set that have been\nchanged (or this could be configurable).\n\nRegards,\n\nAndrew Ardill\n"},{"id":"200596","messageId":"CAKRNd4w1LPEBxhfRNzSwwFDQen_Sif+EYQXcAxnJPP6GU-Q5nw@mail.gmail.com","threadId":"31729","inReplyTo":"CAH5451ki_JFntWZwxcUqvWKwZn62Vfg=MkF3xwiX1p3ARULQfA@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Marco Craveiro","fromEmail":"marco.craveiro@gmail.com","sentAt":"2012-10-05T06:09:05Z","receivedAt":"2012-10-05T06:09:05Z","isPatch":false,"sender":{"key":"marco.craveiro@gmail.com","avatar":"https://gravatar.com/avatar/f1f16a357cdadd1fbd105373497f8b4bb776220f4c6dd75d4bd44d04ae0027b0?d=mp&s=160"},"body":"<git update-index --assume-unchanged>\n> From the help page:\n>\n> --assume-unchanged, --no-assume-unchanged\n>     ...\n>\n>     This option can be also used as a coarse file-level mechanism to\n> ignore uncommitted changes in tracked files (akin to what .gitignore\n>     does for untracked files).\n>\n> Seems like it does everything required. I tested and it correctly\n> hides changes that I want hidden. The only thing I can't see how to do\n> is get git status to show files with the assume unchanged  bit set. I\n> think there is no way currently, but that might be a nice addition to\n> make the initial request feature complete. It could show either all\n> files with the bit set, or files with the bit set that have been\n> changed (or this could be configurable).\n\nThis is indeed the solution outlined in [4] on my original post:\n\nhttp://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html\n\nThe presence in git status is quite important or else one has to\nchange the regular workflow with a second status command.\n\nCheers\n\nMarco\n-- \nSo young, and already so unknown -- Pauli\n\nblog: http://mcraveiro.blogspot.com\n"},{"id":"200595","messageId":"5DB4E90436854A219805224B2C375CC9@PhilipOakley","threadId":"31729","inReplyTo":"CAH5451mpJw4+noUF+FkZJS+Y2oq2ThFeG7wSOCdbVaMQPNgUJA@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2012-10-05T07:00:12Z","receivedAt":"2012-10-05T07:00:12Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Andrew Ardill\" <andrew.ardill@gmail.com>\n> On 5 October 2012 07:20, Marco Craveiro <marco.craveiro@gmail.com> \n> wrote:\n>> ...\n>> Similar but not quite; the idea is that you know that there is some\n>> code (I'm just talking about files here, so lets ignore hunks for the\n>> moment) which is normally checked in but for a period of time you \n>> want\n>> it ignored. So you don't want it git ignored but at the same time you\n>> don't want to see these files in the list of modified files.\n>\n> What is the reason git ignore is no good in this case? Is it simply\n> that you can't see the ignored files in git status, or is it that\n> adding and removing entries to .gitignore is too cumbersome? If it's\n> the latter you could probably put together a simple shell wrapper to\n> automate the task, as otherwise it seems like git ignore does what you\n> need.\n>\n\nIIUC the files are already tracked, and a variant of ' git \nupdate-index --assume-unchanged' is being requested, so that the command \ndoesn't need to be repeated if they checkuout / swap branches (which \nassumes I've understood the effect of such an index change correctly)\n\n> Regards,\n>\n> Andrew Ardill\n> --\n"},{"id":"200623","messageId":"506EE0DD.6080504@obry.net","threadId":"31729","inReplyTo":"CAKRNd4wbT_boRyFOOL_95FBW4ws8Zzz2ubVCfXuRSevzPdhW9g@mail.gmail.com","subject":"Re: Ignore on commit","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2012-10-05T13:30:05Z","receivedAt":"2012-10-05T13:30:05Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"\nMarco,\n\n> Similar but not quite; the idea is that you know that there is some\n> code (I'm just talking about files here, so lets ignore hunks for the\n> moment) which is normally checked in but for a period of time you want\n> it ignored. \n\nGot it thanks! Would be useful some time indeed.\n\n-- \n\n  Pascal Obry /  Magny Les Hameaux (78)\n\n  The best way to travel is by means of imagination\n\n  http://v2p.fr.eu.org\n  http://www.obry.net\n\n  gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"}]}