{"thread":{"id":"24118","subject":"Changled submodule cannot be \"git added\"","startedAt":"2010-06-15T07:25:14Z","lastAt":"2010-06-15T16:05:41Z","messageCount":3,"participants":["Nico -telmich- Schottelius","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"143723","messageId":"20100615072514.GA3260@schottelius.org","threadId":"24118","inReplyTo":null,"subject":"Changled submodule cannot be \"git added\"","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2010-06-15T07:25:14Z","receivedAt":"2010-06-15T07:25:14Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"And another interesting behaviour of git with submodules:\n\n--------------------------------------------------------------------------------\n% git status\n# On branch master\n# Your branch is ahead of 'origin/master' by 8 commits.\n#\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#   (commit or discard the untracked or modified content in submodules)\n#\n#       modified:   modules/tftpd_hpa (modified content)\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       modules/ethz_systems_private/\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n% git add modules/tftpd_hpa\n# On branch master\n# Your branch is ahead of 'origin/master' by 8 commits.\n#\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#   (commit or discard the untracked or modified content in submodules)\n#\n#       modified:   modules/tftpd_hpa (modified content)\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       modules/ethz_systems_private/\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n--------------------------------------------------------------------------------\n\n- Why can modules/tftpd_hpa not be added?\n- Why does git checkout not remove modules/ethz_systems_private/,\n  when switching from the master to the private branch?\n  (the module is only registered in the private branch)\n\nNico\n\n-- \nNew PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0\nPlease resign, if you signed 9885188C or 8D0E27A4.\n\nCurrently moving *.schottelius.org to http://www.nico.schottelius.org/ ...\n"},{"id":"143724","messageId":"20100615073720.GB3260@schottelius.org","threadId":"24118","inReplyTo":"20100615072514.GA3260@schottelius.org","subject":"Re: Changled submodule cannot be \"git added\"","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2010-06-15T07:37:20Z","receivedAt":"2010-06-15T07:37:20Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Nico -telmich- Schottelius [Tue, Jun 15, 2010 at 09:25:14AM +0200]:\n> And another interesting behaviour of git with submodules:\n> \n> --------------------------------------------------------------------------------\n> % git status\n> #       modified:   modules/tftpd_hpa (modified content)\n\nOk, found out that I changed stuff within modules/tftpd_hpa, instead of\nmerging from the source.\n\nImho the git status output is a bit misleading, as I assume that\nI can git add stuff that's modified.\n\nPerhaps git add should print a warning / error if I try to add the\nchanged submodule and not silently ignore it.\n\nRegarding the other problem\n\n> - Why does git checkout not remove modules/ethz_systems_private/,\n>   when switching from the master to the private branch?\n>   (the module is only registered in the private branch)\n\nI'm still not sure what's the reason for that.\n\nNico\n\n-- \nNew PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0\nPlease resign, if you signed 9885188C or 8D0E27A4.\n\nCurrently moving *.schottelius.org to http://www.nico.schottelius.org/ ...\n"},{"id":"143753","messageId":"4C17A4D5.5040100@web.de","threadId":"24118","inReplyTo":"20100615073720.GB3260@schottelius.org","subject":"Re: Changled submodule cannot be \"git added\"","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-06-15T16:05:41Z","receivedAt":"2010-06-15T16:05:41Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 15.06.2010 09:37, schrieb Nico -telmich- Schottelius:\n> Nico -telmich- Schottelius [Tue, Jun 15, 2010 at 09:25:14AM +0200]:\n>> % git status\n>> #       modified:   modules/tftpd_hpa (modified content)\n> \n> Ok, found out that I changed stuff within modules/tftpd_hpa, instead of\n> merging from the source.\n\nTo make such surprises visible is the intent of showing \"(modified\ncontent)\" here.\n\n\n> Imho the git status output is a bit misleading, as I assume that\n> I can git add stuff that's modified.\n\nMaybe you just overlooked this line in the output of \"git status\":\n\"(commit or discard the untracked or modified content in submodules)\"\n\n\n> Regarding the other problem\n> \n>> - Why does git checkout not remove modules/ethz_systems_private/,\n>>   when switching from the master to the private branch?\n>>   (the module is only registered in the private branch)\n> \n> I'm still not sure what's the reason for that.\n\nBecause there might be stuff in there which is not tracked but you\nmight hate loosing by switching a branch.\n"}]}