{"thread":{"id":"25059","subject":"[PATCH] builtin/describe.c: ignore untracked changes in submodules","startedAt":"2010-09-09T19:12:19Z","lastAt":"2010-09-14T20:30:09Z","messageCount":14,"participants":["Brandon Casey","Junio C Hamano","Jens Lehmann","yj2133011"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"150391","messageId":"CC-1wlyJRzGfkPwn1Ra8d4Ot7mMnUGxYChGZHdqp-lQ5URlUFhNp4Ilyrh4bGk1dWF6drZXvim0@cipher.nrlssc.navy.mil","threadId":"25059","inReplyTo":null,"subject":"[PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-09-09T19:12:19Z","receivedAt":"2010-09-09T19:12:19Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nSince 'git describe' does not append -dirty to the version string it\nproduces when untracked files exist in the working directory of the main\nrepository, it should not do so for submodules either.\n\nAdd --ignore-submodules=untracked to the call to diff-index which is used\nto decide whether or not the '-dirty' string is necessary.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n builtin/describe.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 43caff2..6c4f15b 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -29,7 +29,8 @@ static const char *dirty;\n \n /* diff-index command arguments to check if working tree is dirty. */\n static const char *diff_index_args[] = {\n-\t\"diff-index\", \"--quiet\", \"HEAD\", \"--\", NULL\n+\t\"diff-index\", \"--quiet\", \"--ignore-submodules=untracked\", \"HEAD\",\n+\t\"--\", NULL\n };\n \n \n-- \n1.7.2.1\n"},{"id":"150421","messageId":"7vy6bajvnd.fsf@alter.siamese.dyndns.org","threadId":"25059","inReplyTo":"CC-1wlyJRzGfkPwn1Ra8d4Ot7mMnUGxYChGZHdqp-lQ5URlUFhNp4Ilyrh4bGk1dWF6drZXvim0@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T00:21:26Z","receivedAt":"2010-09-10T00:21:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> From: Brandon Casey <drafnel@gmail.com>\n>\n> Since 'git describe' does not append -dirty to the version string it\n> produces when untracked files exist in the working directory of the main\n> repository, it should not do so for submodules either.\n>\n> Add --ignore-submodules=untracked to the call to diff-index which is used\n> to decide whether or not the '-dirty' string is necessary.\n>\n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n> ---\n\nHmm, this changes the behaviour in a big way but it probably is for the\nbetter.  At least it is consistent with the recent fixes to the\ninteraction between diff and submodules.\n\nObjections from submodule users?\n\n>  builtin/describe.c |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/builtin/describe.c b/builtin/describe.c\n> index 43caff2..6c4f15b 100644\n> --- a/builtin/describe.c\n> +++ b/builtin/describe.c\n> @@ -29,7 +29,8 @@ static const char *dirty;\n>  \n>  /* diff-index command arguments to check if working tree is dirty. */\n>  static const char *diff_index_args[] = {\n> -\t\"diff-index\", \"--quiet\", \"HEAD\", \"--\", NULL\n> +\t\"diff-index\", \"--quiet\", \"--ignore-submodules=untracked\", \"HEAD\",\n> +\t\"--\", NULL\n>  };\n>  \n>  \n> -- \n> 1.7.2.1\n"},{"id":"150458","messageId":"1094265482.7527324.1284144028114.JavaMail.fmail@mwmweb047","threadId":"25059","inReplyTo":"7vy6bajvnd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-10T18:40:28Z","receivedAt":"2010-09-10T18:40:28Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":">Brandon Casey <casey@nrlssc.navy.mil> writes:\n>\n>> From: Brandon Casey <drafnel@gmail.com>\n>>\n>> Since 'git describe' does not append -dirty to the version string it\n>> produces when untracked files exist in the working directory of the main\n>> repository, it should not do so for submodules either.\n>>\n>> Add --ignore-submodules=untracked to the call to diff-index which is used\n>> to decide whether or not the '-dirty' string is necessary.\n>>\n>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n>> ---\n>\n>Hmm, this changes the behaviour in a big way but it probably is for the\n>better.  At least it is consistent with the recent fixes to the\n>interaction between diff and submodules.\n\nHmm, by default the diff family considers submodules with untracked files as\ndirty unless configured otherwise (and AFAICS the recent fixes to the interaction\nbetween diff and submodule were options to configure your own default).\n\nSo when git status tells you the subodule is modified, e.g. because of an untracked\nfile, I would expect git describe to add '-dirty' to its output when requested. To get rid\nof that I would expect you either fix the .gitignore of the submodule or configure that\nyou don't care about untracked files in submodules at all (either only for this\nsubmodule or in the config).\n\nSo if I didn't misunderstand something here I would rather vote against this change,\ngit describe should append a '-dirty' when git status would show modifications, no?\n"},{"id":"150510","messageId":"1529126586.2758911.1284228699341.JavaMail.fmail@mwmweb045","threadId":"25059","inReplyTo":"1464835923.7527323.1284144028047.JavaMail.fmail@mwmweb047","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-11T18:11:39Z","receivedAt":"2010-09-11T18:11:39Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":">>Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>\n>>> From: Brandon Casey <drafnel@gmail.com>\n>>>\n>>> Since 'git describe' does not append -dirty to the version string it\n>>> produces when untracked files exist in the working directory of the main\n>>> repository, it should not do so for submodules either.\n>>>\n>>> Add --ignore-submodules=untracked to the call to diff-index which is used\n>>> to decide whether or not the '-dirty' string is necessary.\n>>>\n>>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n>>> ---\n>>\n>>Hmm, this changes the behaviour in a big way but it probably is for the\n>>better.  At least it is consistent with the recent fixes to the\n>>interaction between diff and submodules.\n>\n>Hmm, by default the diff family considers submodules with untracked files as\n>dirty unless configured otherwise (and AFAICS the recent fixes to the interaction\n>between diff and submodule were options to configure your own default).\n>\n>So when git status tells you the subodule is modified, e.g. because of an untracked\n>file, I would expect git describe to add '-dirty' to its output when requested. To get rid\n>of that I would expect you either fix the .gitignore of the submodule or configure that\n>you don't care about untracked files in submodules at all (either only for this\n>submodule or in the config).\n>\n>So if I didn't misunderstand something here I would rather vote against this change,\n>git describe should append a '-dirty' when git status would show modifications, no?\n\nAnd maybe we should teach \"git describe\" the \"--ignore-submodules\" option, then\nyou could tell describe what to pass to the diff-index command. Thoughts?\n"},{"id":"150515","messageId":"7v39tgf5zw.fsf@alter.siamese.dyndns.org","threadId":"25059","inReplyTo":"1529126586.2758911.1284228699341.JavaMail.fmail@mwmweb045","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-11T19:13:39Z","receivedAt":"2010-09-11T19:13:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n>>So if I didn't misunderstand something here I would rather vote against this change,\n>>git describe should append a '-dirty' when git status would show modifications, no?\n>\n> And maybe we should teach \"git describe\" the \"--ignore-submodules\" option, then\n> you could tell describe what to pass to the diff-index command. Thoughts?\n\nIt is sensible to add the option, and handle_ignore_submodules_arg() call\nto grab \"diff.ignoresubmodules\" configuration) to the command, perhaps.\n\nBoth \"status\" and \"diff\" are described in the documentation as having\n\"all\" as the default value for --ignore-submodules option, but by default\nneither ignores changes in the submodules.  So it seems consistent for the\ncommand to take submodule changes into account by default.\n"},{"id":"150517","messageId":"1982035721.2791029.1284236591083.JavaMail.fmail@mwmweb045","threadId":"25059","inReplyTo":"7v39tgf5zw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-11T20:23:11Z","receivedAt":"2010-09-11T20:23:11Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":">Jens Lehmann <Jens.Lehmann@web.de> writes:\n>> And maybe we should teach \"git describe\" the \"--ignore-submodules\" option, then\n>> you could tell describe what to pass to the diff-index command. Thoughts?\n>\n>It is sensible to add the option, and handle_ignore_submodules_arg() call\n>to grab \"diff.ignoresubmodules\" configuration) to the command, perhaps.\n\nOk, I'll look into that and prepare a patch.\n"},{"id":"299180","messageId":"1284258140663-5522622.post@n2.nabble.com","threadId":"25059","inReplyTo":"CC-1wlyJRzGfkPwn1Ra8d4Ot7mMnUGxYChGZHdqp-lQ5URlUFhNp4Ilyrh4bGk1dWF6drZXvim0@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"yj2133011","fromEmail":"274040551@qq.com","sentAt":"2010-09-12T02:22:20Z","receivedAt":"2010-09-12T02:22:20Z","isPatch":true,"sender":{"key":"274040551@qq.com","avatar":null},"body":"\nhttp://www.Gucci2u.com/ Gucci Shoes  now produces flavor styles of shoes,\nloafers, clogs, and boots – and now even heels, Gucci Shoes have grown from\nthe chief feature innate supplies and emphasizing durability, comfort, and\nstrong feet, Gucci shoes for men makes men’s and women’s footwear. Having a\ngroup of high responsibility, especially inquiries department, authentic\nGucci Shoes has put huge inquiries time studying how the time, Gucci changed\nby the recurring shock of daily walking and workmanship. Despite some worth\nissues over the person body is fitting a cult desired and is well on the\nperson body. Sometimes mistaken for Birkenstocks, Discount Gucci Shoes will\nbe assured that Gucci delivers the finest in value and operation. The\nself-proclaimed “finest walking shoes in the world”, \nhttp://www.Gucci2u.com/ Gucci Shoes  takes an international success. Gucci\nwomen \nboots are physiological footwear intended.\n\n\n\n\n\n\n\n----------------------------------------------------------------------------------------\n\nVisit our site for reviews, news and information about flight simulator\ngames ,\nhttp://www.tomtop.com/toy-kids-baby/rc-electric-toys/helicopters-accessories/6ch-usb-3d-rc-helicopter-airplane-flight-simulator.html?aid=z\nhelicopter simulator .A \nhttp://www.tomtop.com/mini-spy-car-dv-key-chain-camera-dvr-video-recorder-dc.html?aid=z\nkeychain camera  is a very small and inexpensive digital camera.\n-- \nView this message in context: http://git.661346.n2.nabble.com/PATCH-builtin-describe-c-ignore-untracked-changes-in-submodules-tp5515750p5522622.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"150542","messageId":"7vfwxeeu19.fsf@alter.siamese.dyndns.org","threadId":"25059","inReplyTo":"1982035721.2791029.1284236591083.JavaMail.fmail@mwmweb045","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-12T17:44:18Z","receivedAt":"2010-09-12T17:44:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n>>Jens Lehmann <Jens.Lehmann@web.de> writes:\n>>> And maybe we should teach \"git describe\" the \"--ignore-submodules\" option, then\n>>> you could tell describe what to pass to the diff-index command. Thoughts?\n>>\n>>It is sensible to add the option, and handle_ignore_submodules_arg() call\n>>to grab \"diff.ignoresubmodules\" configuration) to the command, perhaps.\n>\n> Ok, I'll look into that and prepare a patch.\n\nThanks; and thanks for biting my sanity check weatherbaloon ;-)\n"},{"id":"150545","messageId":"AANLkTinMf-_vk2-gRazf-8FNykZoNbVwmu_+c+5ht8rY@mail.gmail.com","threadId":"25059","inReplyTo":"1094265482.7527324.1284144028114.JavaMail.fmail@mwmweb047","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2010-09-12T19:10:00Z","receivedAt":"2010-09-12T19:10:00Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"On Fri, Sep 10, 2010 at 1:40 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>>Brandon Casey <casey@nrlssc.navy.mil> writes:\n>>\n>>> From: Brandon Casey <drafnel@gmail.com>\n>>>\n>>> Since 'git describe' does not append -dirty to the version string it\n>>> produces when untracked files exist in the working directory of the main\n>>> repository, it should not do so for submodules either.\n>>>\n>>> Add --ignore-submodules=untracked to the call to diff-index which is used\n>>> to decide whether or not the '-dirty' string is necessary.\n>>>\n>>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n>>> ---\n>>\n>>Hmm, this changes the behaviour in a big way but it probably is for the\n>>better.  At least it is consistent with the recent fixes to the\n>>interaction between diff and submodules.\n>\n> Hmm, by default the diff family considers submodules with untracked files as\n> dirty unless configured otherwise (and AFAICS the recent fixes to the interaction\n> between diff and submodule were options to configure your own default).\n>\n> So when git status tells you the subodule is modified, e.g. because of an untracked\n> file, I would expect git describe to add '-dirty' to its output when requested.\n\nTriple hmm.  Perhaps a deeper level change is necessary than what I originally\nthought.\n\nIt appears to me now, that the behavior of the entire diff family is\ninconsistent\nwith respect to how untracked content is handled at the super-project level and\nat the submodule level.\n\nAt the super-project level, git only considers as 'modified', changes to\n_tracked_ content.  Any untracked content is ignored by git-describe, git-diff,\nand friends, and git-status places it in its own 'Untracked files' section.\n\nAt the submodule level, all files, tracked and untracked, are considered.\n\n> To get rid\n> of that I would expect you either fix the .gitignore of the submodule or configure that\n> you don't care about untracked files in submodules at all (either only for this\n> submodule or in the config).\n>\n> So if I didn't misunderstand something here I would rather vote against this change,\n> git describe should append a '-dirty' when git status would show modifications, no?\n\nDo you agree that there is an inconsistency between how untracked content is\ntreated at the super-project level and at the submodule level?  Any thoughts\nabout how the behavior should be made to be consistent?\n\nPerhaps the default setting of submodule.<name>.ignore should be 'untracked'?\n\n-Brandon\n"},{"id":"150552","messageId":"7vy6b6d8uj.fsf@alter.siamese.dyndns.org","threadId":"25059","inReplyTo":"7vfwxeeu19.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-12T20:07:16Z","receivedAt":"2010-09-12T20:07:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jens Lehmann <Jens.Lehmann@web.de> writes:\n>\n>>>Jens Lehmann <Jens.Lehmann@web.de> writes:\n>>>> And maybe we should teach \"git describe\" the \"--ignore-submodules\" option, then\n>>>> you could tell describe what to pass to the diff-index command. Thoughts?\n>>>\n>>>It is sensible to add the option, and handle_ignore_submodules_arg() call\n>>>to grab \"diff.ignoresubmodules\" configuration) to the command, perhaps.\n>>\n>> Ok, I'll look into that and prepare a patch.\n\nBy the way, I think that route of action would make the resulting git\ninternally consistent in that everything by default will report submodules\nwith untracked paths in its working tree as dirty, but sidesteps the\noriginal issue Brandon raised, which I think is a valid concern.\n\n - In the \"Untracked\" section of \"git status\" output, we list an untracked\n   path in the superproject (i.e. the one in which \"git status\" was run)\n   to remind the user that the path might be a new file forgotten to be\n   added (unless of course it is ignored).  But it does not make the\n   working tree dirty.\n\n - When you have an untracked path in a submodule:\n\n   - the submodule is listed in the \"Changed but not updated\" section.\n     This also makes the working tree of the superproject dirty, even\n     though the working tree of the submodule is _not_.\n\n   - \"git diff\" output at the superproject level shows that the submodule\n     has modifications (i.e. \"-dirty\" is shown), but when run inside the\n     submodule, there is no change shown.\n\nI think this is a misdesign at the UI level; reporting an untracked and\nunignored path as potential mistake to remind the user is a good thing,\nbut the current way \"status\" and \"diff\" does so does not make much sense\nto me.\n\nIn the \"git status\" output, there are three sections.  The way to view\nthem at the user level has always been:\n\n - \"Changes to be committed\": they are included if you say \"git commit\"\n   without any pathspec nor option (aka \"What you would commit\");\n\n - \"Changed but not updated\": they are included if you say \"git commit -a\"\n   (aka \"What you could commit\");\n\n - \"Untracked files\": they may be paths you forgot to add, and you might\n   want to say \"git add\" on some of them and add ignore patterns to cover\n   the others.\n\nI have a suspicion that the change we made in 1.7.1 to say an untracked\npath in a submodule counts as a \"Changed but not updated\" was a mistake.\nIn a project with submodules, if a \"git commit\" were to be run without any\nother option, with the \"-a\" option, and with the \"-A\" option, shouldn't\nthe above three category behave exactly like how they behave in a project\nwithout submodules?\n\nIOW, for a submodule that is not pristine, shouldn't we be doing this?\n\n - \"Changes to be committed\": show a submodule path for which the\n   superproject index records a commit that is different from what is\n   recorded in the superproject HEAD tree (currently we are doing this\n   correctly);\n\n - \"Changed but not updated\": show a submodule path for which the HEAD in\n   the submodule differs from what is recorded in the superproject HEAD\n   tree (we are contaminating this list with \"untracked content\");\n\n - \"Untracked files\": show a submodule path that is not in the index.\n\nA submodule with untracked files may be worth knowing, but I don't think\nthey should fall into any of the above categories.  Perhaps they should be\nlisted in their own separate section (they may be listed in multiple\nsections just like \"edit F; git add F; edit F\" may result in a path listed\nboth in to-be-committed and not-updated sections)?\n\nI haven't formed an opinion as to what to do with \"git diff\" output that\nadds \"-dirty\" for untracked paths.  c.f.\n\n  8e08b41 (Teach diff that modified submodule directory is dirty, 2010-01-16)\n  721ceec (Teach diff --submodule that modified submodule directory is dirty, 2010-01-24)\n  \n"},{"id":"150605","messageId":"503065167.8606900.1284400767803.JavaMail.fmail@mwmweb047","threadId":"25059","inReplyTo":"AANLkTinMf-_vk2-gRazf-8FNykZoNbVwmu_+c+5ht8rY@mail.gmail.com","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-13T17:59:27Z","receivedAt":"2010-09-13T17:59:27Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":">Do you agree that there is an inconsistency between how untracked content is\n>treated at the super-project level and at the submodule level? \n\nYes, but I - and others included in that discussion some time ago - could not\ncome up with a sane and simple solution to that problem.\n\n\n> Any thoughts\n>about how the behavior should be made to be consistent?\n\nThe core of this issue is that for git a file is either untracked, modified or clean.\nBut submodules can have every combination of all these states - as they consist\nof multiple files - and additionally their HEAD can differ from the commit recorded\nin the superproject. So basically I see two ways to handle that:\na) add new states for an entry to represent all missing combinations of possible\n   states for submodules and tell all porcelain to handle these.\nb) simplify this problem by having a submodule show up as modified when\n   either of these three conditions are met (and enable the user to choose what\n   conditions she wants to see and what not).\n\nObviously a) will complicate all git by a large degree just for the sake of submodules.\nI am arguing for b), because submodules itself can be seen as a bunch of files which\ndon't interest me as single entities until I want to take a closer look. I think the issue\nwe are discussing here is the price we have to pay for this abstraction. I am very\nopen to proposals how to better handle that but so far I haven't seen any.\n\n\n>Perhaps the default setting of submodule.<name>.ignore should be 'untracked'?\n\nI still vote for none. I think the default should be to not have untracked files in\nyour projects (like you should not have warnings when compiling your project).\nIf that is not wanted, just use the configuration options git provides to change it.\n"},{"id":"150608","messageId":"150763691.8130046.1284401891268.JavaMail.fmail@mwmweb048","threadId":"25059","inReplyTo":"1258122337.8606899.1284400767503.JavaMail.fmail@mwmweb047","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-13T18:18:11Z","receivedAt":"2010-09-13T18:18:11Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":">>Perhaps the default setting of submodule.<name>.ignore should be 'untracked'?\n>\n>I still vote for none. I think the default should be to not have untracked files in\n>your projects (like you should not have warnings when compiling your project).\n>If that is not wanted, just use the configuration options git provides to change it.\n\nI forgot to mention: I think untracked files should mark a submodule as modified\nbecause otherwise it is too easy to forget adding new files inside submodules,\nas they won't show up when the 'ignore' setting is 'untracked' .\n"},{"id":"150651","messageId":"7v7hipb5ht.fsf@alter.siamese.dyndns.org","threadId":"25059","inReplyTo":"150763691.8130046.1284401891268.JavaMail.fmail@mwmweb048","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-13T23:14:54Z","receivedAt":"2010-09-13T23:14:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n>>>Perhaps the default setting of submodule.<name>.ignore should be 'untracked'?\n>>\n>>I still vote for none. I think the default should be to not have untracked files in\n>>your projects (like you should not have warnings when compiling your project).\n>>If that is not wanted, just use the configuration options git provides to change it.\n>\n> I forgot to mention: I think untracked files should mark a submodule as modified\n> because otherwise it is too easy to forget adding new files inside submodules,\n> as they won't show up when the 'ignore' setting is 'untracked' .\n\nWhat makes untracked paths in the superproject different from the ones in\na submodule?  \"git diff\" cannot be it as it does not show untracked paths\nin the superproject, so you are talking about \"the user cannot tell from\nthe 'git status' output\", right?\n\nHow about giving a new section in the status output that lists submodules\nwith untracked paths, and do so only when ignore-submodules is set not to\nignore them?\n"},{"id":"150708","messageId":"4C8FDB51.6010009@web.de","threadId":"25059","inReplyTo":"7v7hipb5ht.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-14T20:30:09Z","receivedAt":"2010-09-14T20:30:09Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 14.09.2010 01:14, schrieb Junio C Hamano:\n> What makes untracked paths in the superproject different from the ones in\n> a submodule?\n\nThat you can have a different state for each path inside the superproject\n(modified, untracked etc.) while you can't have that for the paths in the\nsubmodule (when looked at from the superproject): There is only a single\nstate available for the whole submodule, it's either modified or it isn't.\nSo IMO a modified submodule should tell the user: \"There is a change in\nthis submodule so that when you commit/push your superproject now, others\nmight run into problems when fetching it; you want to be sure this is not\nthe case before doing that\". And this is just the same thing you could\nsay about a file in the superproject when it shows up as modified, no?\nAnd for submodules this definition must also include new yet untracked\nfiles, as they are very likely to be missing in every but your work tree.\n\n\n> \"git diff\" cannot be it as it does not show untracked paths\n> in the superproject, so you are talking about \"the user cannot tell from\n> the 'git status' output\", right?\n\nNope, it's \"git diff\" too. The thing that got me started working on this\ntopic was that \"git gui\" and \"gitk\" were quiet about submodules which\nhad modified tracked files and/or new untracked files, which lead to\nreal world problems where I work. And both use diff-index and diff-files\nto get the paths they should display *and* to display the actual changes.\n(And as \"git diff\" uses the same machinery under the hood as \"git status\"\ndoes, everything fell into place pretty easily)\n\nAnd I argue that this is sane behavior, as I'm sure other tools rely on\n\"git diff\" or \"git status\" too to check if there are modifications to the\nwork tree (or they call run_diff_files() or run_diff_index() directly to\ndo that). So all of these should agree on what they are saying about the\nstate of a submodule, or things will get interesting. (Same goes for\ndescribe, it should append the \"-dirty\" when \"git status\" or \"git diff\"\nsay a submodule is modified)\n\nAnd this approach works really well at my dayjob. Since we are using it,\nme and my colleagues are really happy with it, because we can't forget to\ncommit changes inside a submodule anymore. So judging from this real life\nexperience \"ignore=none\" is a very sane default.\n\nBut I admit that this change in behavior can be strange for long time\nsubmodule users when they first encounter it. And if they still don't\nlike the new behavior after some consideration, they can disable it\neasily using the new configuration options. But one of the advantages I\nreally liked when I started using git was that is was not able to forget\nto commit new files anymore. So I suspect ignore=none is especially\nuseful for new users of submodules, because it is on the safe side, and\ntherefore should be the default setting. You can later turn the 'noise'\ndown if you want (just like some users do when using the \"-uno\" option\nto \"git status\" if they don't want to be told about untracked files in\nthe superproject or its submodules).\n"}]}