{"thread":{"id":"22696","subject":"Possible bug with git status in 1.7.0","startedAt":"2010-02-17T19:14:28Z","lastAt":"2010-02-20T11:05:02Z","messageCount":7,"participants":["Sergio","Junio C Hamano","Sergio Callegari","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134883","messageId":"loom.20100217T184109-183@post.gmane.org","threadId":"22696","inReplyTo":null,"subject":"Possible bug with git status in 1.7.0","fromName":"Sergio","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-02-17T19:14:28Z","receivedAt":"2010-02-17T19:14:28Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Hi,\n\nif you have a submodule and the submodule contains\nuntracked files, \"git status\" in 1.7.0 keeps showing\nthe module as modified.\n\nBut of of course it is useless to \"git add\" the module\nor to try to \"git  commit -a\", since the index entry is ok\n\nI do not know if this is an intended behavior, but it\nlooks different from 1.6.6.1.\n\nSergio\n"},{"id":"134885","messageId":"7vvddvoegv.fsf@alter.siamese.dyndns.org","threadId":"22696","inReplyTo":"loom.20100217T184109-183@post.gmane.org","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-17T19:21:36Z","receivedAt":"2010-02-17T19:21:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergio <sergio.callegari@gmail.com> writes:\n\n> if you have a submodule and the submodule contains\n> untracked files, \"git status\" in 1.7.0 keeps showing\n> the module as modified.\n>\n> But of of course it is useless to \"git add\" the module\n> or to try to \"git  commit -a\", since the index entry is ok\n\nOf course it is useless to \"git add\" in the superproject, and this is\nan intended bugfix.\n\nYou are getting reminded that you either forgot to \"git add\" that file in\nthe submodule, or you forgot to add that file to .gitignore in the\nsubmodule.\n"},{"id":"134886","messageId":"4B7C490B.8030902@gmail.com","threadId":"22696","inReplyTo":"7vvddvoegv.fsf@alter.siamese.dyndns.org","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-02-17T19:52:43Z","receivedAt":"2010-02-17T19:52:43Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Sergio <sergio.callegari@gmail.com> writes:\n>\n>   \n>> if you have a submodule and the submodule contains\n>> untracked files, \"git status\" in 1.7.0 keeps showing\n>> the module as modified.\n>>\n>> But of of course it is useless to \"git add\" the module\n>> or to try to \"git  commit -a\", since the index entry is ok\n>>     \n>\n> Of course it is useless to \"git add\" in the superproject, and this is\n> an intended bugfix.\n>\n> You are getting reminded that you either forgot to \"git add\" that file in\n> the submodule, or you forgot to add that file to .gitignore in the\n> submodule.\n>   \n\nThanks for the explanation!\n\nThe wording of the reminder is a bit unclear, though.  Suppose that the \nproblem is with submodule \"mod\".\n\nWhat you get from git status is a notice that something is modified but \nnot updated, with the following suggestion\n\n# Changed but not \nupdated:                                                                                      \n\n#   (use \"git add <file>...\" to update what will be committed)\n\nand then the notice about what is in fact modified\n\n#       modified:   mod\n\n\nSo the first problem is that now git status provides a hint that may be \nconfusing.  One gets the idea that he needs to add mod (to store a new \ncommit id in the index) and not to add a file in mod.\n\n\nAs a second issue, note that mod is in fact not really modified being that\n\n1) no tracked file in it has been modified.\n2) no new commit has been made\n\nand the fact is that from git status I cannot recognize anymore if the \nmodule is really changed (the module commit id has changed) or has \nuncommited changes (some tracked file is changed) or is merely polluted \nby untracked files, so now I always need to explore the submodule.\n\nIt is true that this can be solved putting more stuff in .gitignore.\nHowever, it might be a matter of taste, but I do not like putting all \nbyproducts in .gitignore  because not doing so allows me to \ndifferentiate between\n\n- files that are just garbage\n- files that are not tracked but may be still precious\n\nand selectively clean either category using the -x or -X options of git \nclean.\n\n\nSo, it would be nice to improve the feedback of git status for this \nparticular case and possibly have an option to avoid status being so \nwordy about untracked files.\n\n\nSergio\n"},{"id":"134891","messageId":"4B7C5711.8060708@web.de","threadId":"22696","inReplyTo":"4B7C490B.8030902@gmail.com","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-02-17T20:52:33Z","receivedAt":"2010-02-17T20:52:33Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 17.02.2010 20:52, schrieb Sergio Callegari:\n> Junio C Hamano wrote:\n>> You are getting reminded that you either forgot to \"git add\" that file in\n>> the submodule, or you forgot to add that file to .gitignore in the\n>> submodule.\n>>   \n> \n> Thanks for the explanation!\n> \n> The wording of the reminder is a bit unclear, though.  Suppose that the\n> problem is with submodule \"mod\".\n> \n> What you get from git status is a notice that something is modified but\n> not updated, with the following suggestion\n> \n> # Changed but not\n> updated:                                                                                     \n> \n> #   (use \"git add <file>...\" to update what will be committed)\n> \n> and then the notice about what is in fact modified\n> \n> #       modified:   mod\n> \n> \n> So the first problem is that now git status provides a hint that may be\n> confusing.  One gets the idea that he needs to add mod (to store a new\n> commit id in the index) and not to add a file in mod.\n\nThat is a very valid point. I am currently working on git status being\nmore explicit about the type of modification. I just asked for comments\non this issue on February 14th in the thread titled \"[PATCH/RFC] git\ndiff --submodule: Show detailed dirty status of submodules\" (Gmane is\ndown for me right now, so i am sorry: no link today).\n\nThe changes i have in mind for git status would also include giving a\nbetter hint, as you rightfully pointed out.\n\n\n> As a second issue, note that mod is in fact not really modified being that\n> \n> 1) no tracked file in it has been modified.\n> 2) no new commit has been made\n> \n> and the fact is that from git status I cannot recognize anymore if the\n> module is really changed (the module commit id has changed) or has\n> uncommited changes (some tracked file is changed) or is merely polluted\n> by untracked files, so now I always need to explore the submodule.\n> \n> It is true that this can be solved putting more stuff in .gitignore.\n> However, it might be a matter of taste, but I do not like putting all\n> byproducts in .gitignore  because not doing so allows me to\n> differentiate between\n> \n> - files that are just garbage\n> - files that are not tracked but may be still precious\n> \n> and selectively clean either category using the -x or -X options of git\n> clean.\n> \n> \n> So, it would be nice to improve the feedback of git status for this\n> particular case and possibly have an option to avoid status being so\n> wordy about untracked files.\n\nSo i assume that my proposal to explicitly state that a submodule has\nnew commits, modified files and/or untracked files would solve your\nwoes?\n"},{"id":"135093","messageId":"4B7EBF7B.3090703@gmail.com","threadId":"22696","inReplyTo":"4B7C5711.8060708@web.de","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-02-19T16:42:35Z","receivedAt":"2010-02-19T16:42:35Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Jens Lehmann wrote:\n>> The wording of the reminder is a bit unclear, though.  Suppose that the\n>> problem is with submodule \"mod\".\n>>\n>> What you get from git status is a notice that something is modified but\n>> not updated, with the following suggestion\n>>\n>> # Changed but not\n>> updated:                                                                                     \n>>\n>> #   (use \"git add <file>...\" to update what will be committed)\n>>\n>> and then the notice about what is in fact modified\n>>\n>> #       modified:   mod\n>>\n>>\n>> So the first problem is that now git status provides a hint that may be\n>> confusing.  One gets the idea that he needs to add mod (to store a new\n>> commit id in the index) and not to add a file in mod.\n>>     \n>\n> That is a very valid point. I am currently working on git status being\n> more explicit about the type of modification. I just asked for comments\n> on this issue on February 14th in the thread titled \"[PATCH/RFC] git\n> diff --submodule: Show detailed dirty status of submodules\" (Gmane is\n> down for me right now, so i am sorry: no link today).\n>\n> The changes i have in mind for git status would also include giving a\n> better hint, as you rightfully pointed out.\n>   \nMissed that, thanks for pointing out\n>> As a second issue, note that mod is in fact not really modified being that\n>>\n>> 1) no tracked file in it has been modified.\n>> 2) no new commit has been made\n>>\n>> and the fact is that from git status I cannot recognize anymore if the\n>> module is really changed (the module commit id has changed) or has\n>> uncommited changes (some tracked file is changed) or is merely polluted\n>> by untracked files, so now I always need to explore the submodule.\n>>\n>> It is true that this can be solved putting more stuff in .gitignore.\n>> However, it might be a matter of taste, but I do not like putting all\n>> byproducts in .gitignore  because not doing so allows me to\n>> differentiate between\n>>\n>> - files that are just garbage\n>> - files that are not tracked but may be still precious\n>>\n>> and selectively clean either category using the -x or -X options of git\n>> clean.\n>>\n>>\n>> So, it would be nice to improve the feedback of git status for this\n>> particular case and possibly have an option to avoid status being so\n>> wordy about untracked files.\n>>     \n>\n> So i assume that my proposal to explicitly state that a submodule has\n> new commits, modified files and/or untracked files would solve your\n> woes?\n>   \n\nYes! My ideal behavior (if I am not asking too much) would be trying to \nkeep the status as little wordy as possible (1 line per submodule)\n\ne.g. something like\n\n#       modified module (commit id):   mod1\n#       modified module (modified files): mod2\n#\tmodified module (untracked files): mod3\n#       modified module (modified files, untracked files): mod4\n#\tmodified module (commit id, modified files, untracked files): mod5\n\nand with an option to avoid complaining about untracked files in the \nsubmodules\n\ne.g. if option is not selected, entry about mod3 would not be printed at \nall.\n\n\nAnd of course it would be useful to modify the suggestions into \nsomething like\n\n#   (use \"git add <file>/<submodule>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#   (enter modules that have modified/untracked files to perform actions on them) \n\n\nThanks,\n\nSergio\n"},{"id":"135109","messageId":"4B7EFAD8.9040309@web.de","threadId":"22696","inReplyTo":"4B7EBF7B.3090703@gmail.com","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-02-19T20:55:52Z","receivedAt":"2010-02-19T20:55:52Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 19.02.2010 17:42, schrieb Sergio Callegari:\n> Yes! My ideal behavior (if I am not asking too much) would be trying to\n> keep the status as little wordy as possible (1 line per submodule)\n> \n> e.g. something like\n> \n> #       modified module (commit id):   mod1\n> #       modified module (modified files): mod2\n> #    modified module (untracked files): mod3\n> #       modified module (modified files, untracked files): mod4\n> #    modified module (commit id, modified files, untracked files): mod5\n\nYup, one line per submodule should be enough. But maybe it's nicer to\nhave the details /after/ the submodule name:\n\n#\tmodified:   mod1 (Submodule has new commit(s), modified content, untracked content)\n\nThen it fits more nicely with the output for files, no?\n\nWe could drop the \"Submodule has \" if people see it as a waste of screen\nestate. Also i have no strong feelings about \"content\", i just happen to\nthink it is more appropriate as submodules can contain not only files but\nother submodules too. Opinions?\n\nWill send a patch for discussion as soon as i have something to show ...\n"},{"id":"135153","messageId":"4B7FC1DE.2020802@gmail.com","threadId":"22696","inReplyTo":"4B7EFAD8.9040309@web.de","subject":"Re: Possible bug with git status in 1.7.0","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-02-20T11:05:02Z","receivedAt":"2010-02-20T11:05:02Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Jens Lehmann wrote:\n> Yup, one line per submodule should be enough. But maybe it's nicer to\n> have the details /after/ the submodule name:\n>\n> #\tmodified:   mod1 (Submodule has new commit(s), modified content, untracked content)\n>\n> Then it fits more nicely with the output for files, no?\n>\n> We could drop the \"Submodule has \" if people see it as a waste of screen\n> estate. Also i have no strong feelings about \"content\", i just happen to\n> think it is more appropriate as submodules can contain not only files but\n> other submodules too. Opinions?\n>\n> Will send a patch for discussion as soon as i have something to show ...\n>   \nHow about\n\n#\tmodified:   mod1 (submodule: new commit(s), modified content, untracked content)\n\ntrying to assure that what comes after the \":\" is a list of comma \nseparated properties.\n\nThis can make the thing easier to parse.  I know that there is a \"git \nstatus ---porcelain\" but from my understanding it will not be possible \nto get this kind of information from that command since its output \nformat is frozen and not extensible, so many could resort to try to \nparse the \"normal\" git status output to get all the info about \nsubmodules at once.\n\nEven better would be to have a \"--interface_level 2\" to go with \n---porcelain, to be able to pass this info even there.\n\nBTW... about the --porcelain option, I wonder if considering an alias to \n--parseable could be on the list.  The plumbing/porcelain metaphor is \nreally nice, but a --porcelain option can probably be a bit confusing \nfor the beginner getting a\n\nusage: git status [options] [--] <filepattern>...\n\n    -v, --verbose         be verbose\n    -s, --short           show status concisely\n    --porcelain           show porcelain output format\n    -z, --null            terminate entries with NUL\n    -u, --untracked-files[=<mode>]\n                          show untracked files, optional modes: all, \nnormal, no. (Default: all)\n\nconsidering that status is probably the first command the beginner may \ncome into.\n\nSergio\n"}]}