{"thread":{"id":"14245","subject":"[PATCH] better git-submodule status output","startedAt":"2008-07-01T15:01:19Z","lastAt":"2008-07-09T18:48:38Z","messageCount":34,"participants":["Sylvain Joyeux","Junio C Hamano","Johannes Schindelin","Mark Levedahl","Avery Pennarun","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"81880","messageId":"20080701150119.GE5852@joyeux","threadId":"14245","inReplyTo":null,"subject":"[PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-01T15:01:19Z","receivedAt":"2008-07-01T15:01:19Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"Oups.. sorry for the patch-as-attachment in the previous mail\n\nThis patch makes the output of git-submodule more useful to handle the\nmanagement of a repository using multiple submodules. Namely, it\ndisplays informations about how the current checked out version relates\nto the registered one (i.e. direct parent, direct child, \"just\ndifferent\", registered revision does not exist), and displays if the\nsubmodules contain uncommitted changes.\n\nThis (among other things) allows to do git-submodule update while\nknowing exactly what will happen.\n--\nSylvain\n\n>From 16553a9b210a956b0af961d55a9cf06f1b9b8114 Mon Sep 17 00:00:00 2001\nFrom: Sylvain Joyeux <sylvain.joyeux@dfki.de>\nDate: Tue, 1 Jul 2008 16:01:01 +0200\nSubject: [PATCH] more information in git-submodule status output\n\nThis commit adds more information in the 'status' output of\ngit-submodule. More specifically, it displays different flags if the\nsubmodule and the registered revision are direct parents (> and <,\ndepending on which is the ancestor), if they are not direct parents (+)\nor if the registered revision cannot be found (i.e. if submodule update\nwould fail, '!')\n\nFinally, it shows if the submodule contains uncommitted changes (M flag)\n\nSigned-off-by: Sylvain Joyeux <sylvain.joyeux@dfki.de>\n---\n Documentation/git-submodule.txt |   23 ++++++++++++++++++-----\n git-submodule.sh                |   32 ++++++++++++++++++++++++++++----\n t/t7400-submodule-basic.sh      |   20 +++++++++++++-------\n 3 files changed, 59 insertions(+), 16 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 441ae14..3820002 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -33,10 +33,23 @@ status::\n \tShow the status of the submodules. This will print the SHA-1 of the\n \tcurrently checked out commit for each submodule, along with the\n \tsubmodule path and the output of linkgit:git-describe[1] for the\n-\tSHA-1. Each SHA-1 will be prefixed with `-` if the submodule is not\n-\tinitialized and `+` if the currently checked out submodule commit\n-\tdoes not match the SHA-1 found in the index of the containing\n-\trepository. This command is the default command for git-submodule.\n+\tSHA-1. Each SHA-1 will be prefixed with the following codes:\n+\t* `-` if the submodule is not initialized\n+\t* `<` if the current submodule HEAD is a direct ancestor of the\n+\t    revision registered in the containing repository.  I.e. a `git\n+\t    submodule update` would lead to a fast forward.\n+\t* `>` if the current submodule HEAD is a direct ancestor of the\n+\t    revision registered in the containing repository.\n+\t* `+` if the current submodule HEAD and the revision registered in\n+\t    the containing repository do not match, and there is no direct\n+\t    relationship between the two commits.\n+\t* `!` if the SHA-1 found in the index of the containing repository is\n+\t    not present in the the currently checked out submodule commit,\n+\t    nor be fetched from the associated remote.\n+\t\n+\tAdditionally, a 'M' is displayed if the currently checked out\n+\tsubmodule contains uncommitted changes.\n+\tThis command is the default command for git-submodule.\n \n init::\n \tInitialize the submodules, i.e. register in .git/config each submodule\n@@ -97,7 +110,7 @@ for details.\n \n AUTHOR\n ------\n-Written by Lars Hjemli <hjemli@gmail.com>\n+Written by Lars Hjemli <hjemli@gmail.com> and Sylvain Joyeux <sylvain.joyeux@m4x.org>\n \n GIT\n ---\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 3eb78cc..e2b91f6 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -522,7 +522,11 @@ cmd_summary() {\n #\n # List all submodules, prefixed with:\n #  - submodule not initialized\n-#  + different revision checked out\n+#  > the checked out version is in advance with the current version (fast-forward)\n+#  < the checked out version is late w.r.t the current version (fast-forward)\n+#  + different revisions checked out, no fast-forward relationship\n+#  ! the checked out version does not exist and cannot be fetched\n+#  M submodule contains uncommitted changes\n #\n # If --cached was specified the revision in the index will be printed\n # instead of the currently checked out revision.\n@@ -562,20 +566,40 @@ cmd_status()\n \t\turl=$(git config submodule.\"$name\".url)\n \t\tif test -z \"$url\" || ! test -d \"$path\"/.git -o -f \"$path\"/.git\n \t\tthen\n-\t\t\tsay \"-$sha1 $path\"\n+\t\t\tsay \"-  $sha1 $path\"\n \t\t\tcontinue;\n \t\tfi\n+                unclean=\" \"\n+                if ! ( unset GIT_DIR; cd \"$path\" && git diff --quiet HEAD ); then\n+                    unclean=\"M\"\n+                fi\n \t\tset_name_rev \"$path\" \"$sha1\"\n \t\tif git diff-files --quiet -- \"$path\"\n \t\tthen\n-\t\t\tsay \" $sha1 $path$revname\"\n+\t\t\tsay \" $unclean $sha1 $path$revname\"\n \t\telse\n+                        head=$(unset GIT_DIR; cd \"$path\" && git rev-parse --verify HEAD)\n+                        common=$(unset GIT_DIR; cd \"$path\" && git merge-base HEAD $sha1)\n+                        if test -z \"$common\"; then\n+                            common=$(unset GIT_DIR; cd \"$path\" && git-fetch -q &&\n+                                    git merge-base HEAD $sha1)\n+                        fi\n+                        if test \"$common\" = \"$sha1\"; then\n+                            modflag=\">\"\n+                        elif test \"$common\" = \"$head\"; then\n+                            modflag=\"<\"\n+                        elif test \"$common\" = \"\"; then\n+                            modflag=\"!\"\n+                        else\n+                            modflag=\"+\"\n+                        fi\n+\n \t\t\tif test -z \"$cached\"\n \t\t\tthen\n \t\t\t\tsha1=$(unset GIT_DIR; cd \"$path\" && git rev-parse --verify HEAD)\n \t\t\t\tset_name_rev \"$path\" \"$sha1\"\n \t\t\tfi\n-\t\t\tsay \"+$sha1 $path$revname\"\n+\t\t\tsay \"$modflag$unclean $sha1 $path$revname\"\n \t\tfi\n \tdone\n }\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex 6c7b902..ffaa932 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -65,7 +65,7 @@ test_expect_success 'status should only print one line' '\n '\n \n test_expect_success 'status should initially be \"missing\"' '\n-\tgit-submodule status | grep \"^-$rev1\"\n+\tgit-submodule status | grep \"^-  $rev1\"\n '\n \n test_expect_success 'init should register submodule url in .git/config' '\n@@ -130,13 +130,19 @@ test_expect_success 'update should work when path is an empty dir' '\n '\n \n test_expect_success 'status should be \"up-to-date\" after update' '\n-\tgit-submodule status | grep \"^ $rev1\"\n+\tgit-submodule status | grep \"^   $rev1\"\n '\n \n-test_expect_success 'status should be \"modified\" after submodule commit' '\n+test_expect_success 'status should be \"modified\" after submodule change' '\n \tcd init &&\n \techo b >b &&\n-\tgit add b &&\n+        git add b &&\n+        cd .. &&\n+\tgit-submodule status | grep \"^ M $rev1\"\n+'\n+\n+test_expect_success 'status should be \"in advance\" after submodule commit' '\n+\tcd init &&\n \tgit-commit -m \"submodule commit 2\" &&\n \trev2=$(git rev-parse HEAD) &&\n \tcd .. &&\n@@ -145,11 +151,11 @@ test_expect_success 'status should be \"modified\" after submodule commit' '\n \t\techo \"[OOPS] submodule git rev-parse returned nothing\"\n \t\tfalse\n \tfi &&\n-\tgit-submodule status | grep \"^+$rev2\"\n+\tgit-submodule status | grep \"^>  $rev2\"\n '\n \n test_expect_success 'the --cached sha1 should be rev1' '\n-\tgit-submodule --cached status | grep \"^+$rev1\"\n+\tgit-submodule --cached status | grep \"^>  $rev1\"\n '\n \n test_expect_success 'git diff should report the SHA1 of the new submodule commit' '\n@@ -171,7 +177,7 @@ test_expect_success 'update should checkout rev1' '\n '\n \n test_expect_success 'status should be \"up-to-date\" after update' '\n-\tgit-submodule status | grep \"^ $rev1\"\n+\tgit-submodule status | grep \"^   $rev1\"\n '\n \n test_expect_success 'checkout superproject with subproject already present' '\n-- \n1.5.6\n"},{"id":"82339","messageId":"7vhcb3o7q3.fsf@gitster.siamese.dyndns.org","threadId":"14245","inReplyTo":"20080701150119.GE5852@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-06T06:19:16Z","receivedAt":"2008-07-06T06:19:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n\n> This patch makes the output of git-submodule more useful to handle the\n> management of a repository using multiple submodules. Namely, it\n> displays informations about how the current checked out version relates\n> to the registered one (i.e. direct parent, direct child, \"just\n> different\", registered revision does not exist), and displays if the\n> submodules contain uncommitted changes.\n>\n> This (among other things) allows to do git-submodule update while\n> knowing exactly what will happen.\n> --\n> Sylvain\n>\n>>From 16553a9b210a956b0af961d55a9cf06f1b9b8114 Mon Sep 17 00:00:00 2001\n> From: Sylvain Joyeux <sylvain.joyeux@dfki.de>\n> Date: Tue, 1 Jul 2008 16:01:01 +0200\n> Subject: [PATCH] more information in git-submodule status output\n>\n> This commit adds more information in the 'status' output of\n> git-submodule. More specifically, it displays different flags if the\n> submodule and the registered revision are direct parents (> and <,\n> depending on which is the ancestor), if they are not direct parents (+)\n> or if the registered revision cannot be found (i.e. if submodule update\n> would fail, '!')\n>\n> Finally, it shows if the submodule contains uncommitted changes (M flag)\n\nWhich one is the commit message ;-)?\n\nPeople who rely on working submodule support, do you have any feedback on\nthis patch?  I do not use submodule myself, so it is hard for me to judge\nhow much value (if any) this patch is adding to the real world use of the\nstatus subcommand.\n\n> @@ -97,7 +110,7 @@ for details.\n>  \n>  AUTHOR\n>  ------\n> -Written by Lars Hjemli <hjemli@gmail.com>\n> +Written by Lars Hjemli <hjemli@gmail.com> and Sylvain Joyeux <sylvain.joyeux@m4x.org>\n\nThat is somehow inconsistent with what\n\n\tgit-shortlog -s -n -e --no-merges git-submodule.sh \n\ntells me.\n\nHonestly, I'd prefer (1) drop these \"AUTHOR\" lines, or (2) only list the\nprimary author or two.\n\n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 3eb78cc..e2b91f6 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -562,20 +566,40 @@ cmd_status()\n> ...\n>  \t\tif git diff-files --quiet -- \"$path\"\n>  \t\tthen\n> -\t\t\tsay \" $sha1 $path$revname\"\n> +\t\t\tsay \" $unclean $sha1 $path$revname\"\n>  \t\telse\n> +                        head=$(unset GIT_DIR; cd \"$path\" && git rev-parse --verify HEAD)\n> +                        common=$(unset GIT_DIR; cd \"$path\" && git merge-base HEAD $sha1)\n> +                        if test -z \"$common\"; then\n> +                            common=$(unset GIT_DIR; cd \"$path\" && git-fetch -q &&\n> +                                    git merge-base HEAD $sha1)\n> +                        fi\n\nThis \"fetch\" feels very wrong.  The user did not ask you to change the\nstate of the repository, but this will silently change the remote tracking\nbranches.  The repository after all might be unreachable.\n"},{"id":"82365","messageId":"alpine.LSU.1.00.0807061456100.3486@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14245","inReplyTo":"7vhcb3o7q3.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-06T12:57:00Z","receivedAt":"2008-07-06T12:57:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 5 Jul 2008, Junio C Hamano wrote:\n\n> Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n> \n> > This patch makes the output of git-submodule more useful to handle the\n> > management of a repository using multiple submodules. Namely, it\n> > displays informations about how the current checked out version relates\n> > to the registered one (i.e. direct parent, direct child, \"just\n> > different\", registered revision does not exist), and displays if the\n> > submodules contain uncommitted changes.\n> >\n> > This (among other things) allows to do git-submodule update while\n> > knowing exactly what will happen.\n> > --\n> > Sylvain\n> >\n> >>>From 16553a9b210a956b0af961d55a9cf06f1b9b8114 Mon Sep 17 00:00:00 2001\n> > From: Sylvain Joyeux <sylvain.joyeux@dfki.de>\n> > Date: Tue, 1 Jul 2008 16:01:01 +0200\n> > Subject: [PATCH] more information in git-submodule status output\n> >\n> > This commit adds more information in the 'status' output of\n> > git-submodule. More specifically, it displays different flags if the\n> > submodule and the registered revision are direct parents (> and <,\n> > depending on which is the ancestor), if they are not direct parents (+)\n> > or if the registered revision cannot be found (i.e. if submodule update\n> > would fail, '!')\n> >\n> > Finally, it shows if the submodule contains uncommitted changes (M flag)\n> \n> Which one is the commit message ;-)?\n\nI think it is clear that Sylvain has not read \nDocumentation/SubmittingPatches yet.\n\n> People who rely on working submodule support, do you have any feedback \n> on this patch?\n\nNot yet.  Will test/comment when the spurious \"fetch\" is fixed.\n\nCiao,\nDscho\n"},{"id":"82366","messageId":"4870C527.8070108@gmail.com","threadId":"14245","inReplyTo":"7vhcb3o7q3.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-07-06T13:14:15Z","receivedAt":"2008-07-06T13:14:15Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Junio C Hamano wrote:\n> Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n>\n> People who rely on working submodule support, do you have any feedback on\n> this patch?  I do not use submodule myself, so it is hard for me to judge\n> how much value (if any) this patch is adding to the real world use of the\n> status subcommand.\n>\n\nThe new format is changed from the old in an incompatible way (anything that \nparses the old output will break), and the new output is very cryptic. I do not \nthink that I would remember the various symbols in use here (+-<>!M). While the \ninformation may be useful, I would think a better way would be to append a more \ndescriptive annotation (similar to that provided after a checkout), probably on \na separate status line, definitely controlled by a \"-v\" option.\n\n> \n> This \"fetch\" feels very wrong.  The user did not ask you to change the\n> state of the repository, but this will silently change the remote tracking\n> branches.  The repository after all might be unreachable.\n\nStatus is a local operation, it must not try to access the net (which for me \nwill frequently fail). Status changing the remote branches is a definite no-no.\n\nMark\n"},{"id":"82379","messageId":"20080706160758.GA23385@jhaampe.org","threadId":"14245","inReplyTo":"alpine.LSU.1.00.0807061456100.3486@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-06T16:07:59Z","receivedAt":"2008-07-06T16:07:59Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> > Which one is the commit message ;-)?\n> \n> I think it is clear that Sylvain has not read \n> Documentation/SubmittingPatches yet.\n\nSylvain *has* read SubmittingPatches but has not understood every detail of this\nvery long document.\n\nIf you could enlighten me on what is wrong ...\n\n> > People who rely on working submodule support, do you have any feedback \n> > on this patch?\n> \n> Not yet.  Will test/comment when the spurious \"fetch\" is fixed.\nI thought that the only thing that 'fetch' does is update FETCH_HEAD. My problem\nis that doing the fetch is the only way to know what is the status of the\nsubmodule w.r.t. the registered commit. If you have a better way to get that\ninformation, I'm all ears :P\n\n--\nSylvain\n"},{"id":"82377","messageId":"alpine.DEB.1.00.0807061821340.7342@eeepc-johanness","threadId":"14245","inReplyTo":"20080706160758.GA23385@jhaampe.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-06T16:29:23Z","receivedAt":"2008-07-06T16:29:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 6 Jul 2008, Sylvain Joyeux wrote:\n\n> > > Which one is the commit message ;-)?\n> > \n> > I think it is clear that Sylvain has not read \n> > Documentation/SubmittingPatches yet.\n> \n> Sylvain *has* read SubmittingPatches but has not understood every detail \n> of this very long document.\n\nOh.  But you should have already seen on this list that almost everybody \nputs the oneline as subject, the commit message as first part of the mail \nbody, then a \"--\", optionally some personal stuff that should not go into\nthe commit message, and then the diffstat and all the rest.\n\nIOW the mail body should look like the output of format-patch, optionally \nsome comments between \"--\" and the diffstat.\n\nWrite a patch for SubmittingPatches.\n \n> > If you could enlighten me on what is wrong ...\n> \n> > > People who rely on working submodule support, do you have any \n> > > feedback on this patch?\n> > \n> > Not yet.  Will test/comment when the spurious \"fetch\" is fixed.\n>\n> I thought that the only thing that 'fetch' does is update FETCH_HEAD.\n\nUhoh.  'fetch' fetches.  Which means it does not only update something.\n\n> My problem is that doing the fetch is the only way to know what is the \n> status of the submodule w.r.t. the registered commit. If you have a \n> better way to get that information, I'm all ears :P\n\nAre you sure that you understand the submodule thing enough to patch \ngit-submodule?\n\nThere are three states that are interesting:\n\n- the committed submodule state:\n\n  You get this in the superproject by \"git ls-tree HEAD -- <dir>\"\n\n- the local HEAD of the submodule:\n\n  (cd \"<dir>\" && git rev-parse --verify HEAD)\n\n- the HEAD of the default branch of the upstream repository of the \n  submodule:\n\n  (cd \"<dir>\" && git ls-remote origin HEAD)\n\n  NOTE: this does not have to do _anything_ with the submodule: you can \n  easily have two independent branches (see \"html\" and \"next\" in git.git), \n  and the submodule is free to be pinned to whatever commit is available\n  in the upstream repository.\n\n  It is even possible that it is pinned to a commit that is only reachable \n  from a tag, not from a branch.\n\nHth,\nDscho\n"},{"id":"82421","messageId":"20080707062142.GA5506@jhaampe.org","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807061821340.7342@eeepc-johanness","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-07T06:21:49Z","receivedAt":"2008-07-07T06:21:49Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> IOW the mail body should look like the output of format-patch, optionally \n> some comments between \"--\" and the diffstat.\n> \n> Write a patch for SubmittingPatches.\nI shall do that :)\n\n> > > Not yet.  Will test/comment when the spurious \"fetch\" is fixed.\n> >\n> > I thought that the only thing that 'fetch' does is update FETCH_HEAD.\n> \n> Uhoh.  'fetch' fetches.  Which means it does not only update something.\n\nYes, it fetches objects (admittedly, it updates something on the current\npartition), but AFAIK does not change the state of the repository. So I thought\nthat it could be considered as a no-op from the repo point of view. The idea\nbehind the 'fetch' thing was to get the latest objects from the repository,\ntherefore being able to know the relationship between the currently committed\nsubmodule state \n\n> There are three states that are interesting:\n> \n> - the committed submodule state:\n> \n>   You get this in the superproject by \"git ls-tree HEAD -- <dir>\"\n> \n> - the local HEAD of the submodule:\n> \n>   (cd \"<dir>\" && git rev-parse --verify HEAD)\n> \n> - the HEAD of the default branch of the upstream repository of the \n>   submodule:\n> \n>   (cd \"<dir>\" && git ls-remote origin HEAD)\n>   NOTE: this does not have to do _anything_ with the submodule: you can \n>   easily have two independent branches (see \"html\" and \"next\" in git.git), \n>   and the submodule is free to be pinned to whatever commit is available\n>   in the upstream repository.\n>\n>   It is even possible that it is pinned to a commit that is only reachable \n>   from a tag, not from a branch.\nThen when you initialize your submodules it will be unable to fetch the commit\nobject, isn't it ? Since git-submodule clones origin/HEAD, the submodule state\ncommitted in the repository must be reachable from origin/HEAD.\n\nOr the third interesting state is not \"the default branch of the upstream\nrepository of the submodule\", i.e.  origin/HEAD, but the\nmost-probably-interesting-branch, i.e. the branch configured in .git/config as\nbeing fetched for the current branch of the local submodule HEAD.\n\nThat is the point of this patch. It make clear, *for all registered submodules*,\nwhat is the current relationship between the current submodule state committed\nin the repository and the current submodule HEAD. The \"fetch\" is there to take\ninto account the fact that the submodule state may not yet be available locally.\n\nBest,\n--\nSylvain\n"},{"id":"82450","messageId":"32541b130807070725p6fa4d0dfne9f04bc857920dc7@mail.gmail.com","threadId":"14245","inReplyTo":"20080707062142.GA5506@jhaampe.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-07T14:25:07Z","receivedAt":"2008-07-07T14:25:07Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/7/08, Sylvain Joyeux <sylvain.joyeux@dfki.de> wrote:\n> Yes, it fetches objects (admittedly, it updates something on the current\n>  partition), but AFAIK does not change the state of the repository. So I thought\n>  that it could be considered as a no-op from the repo point of view. The idea\n>  behind the 'fetch' thing was to get the latest objects from the repository,\n>  therefore being able to know the relationship between the currently committed\n>  submodule state\n\nI haven't looked at your patch, so I don't know if you're calling\nfetch in such a way that it doesn't update any refs.  Anyway, fetching\nis definitely not a no-op as far as the user is concerned.  For\nexample, if I'm on my laptop outside my company's LAN and I try to\nfetch, it might take 30+ seconds for fetch to time out waiting for our\nserver.  So it's not okay to fetch unless I specifically ask for a\nfetch.\n\nThe trick here, I think, is that there's only one time the submodule\nshould be linked to a commit you don't actually have.  It should only\nhappen if your parent module (supermodule) has been updated, but you\nhaven't recently done a fetch in the submodule.  Thus, I'd say the\nbest fix would be to find a way to have \"git pull\" or \"git fetch\" in\nthe supermodule also do a fetch in the submodule.  I think it's fair\nto expect \"fetchy\" operations like fetch and pull to perhaps do some\nextra fetches, but not fair to expect \"status\" to do extra work like\nthat.\n\nAlso note that \"your supermodule links to a commit that you haven't\nfetched yet\" is a perfectly okay state to report to the user.  I might\nuse a \"?\" or something to indicate that.\n\nHave fun,\n\nAvery\n"},{"id":"82453","messageId":"alpine.DEB.1.00.0807071533240.18205@racer","threadId":"14245","inReplyTo":"32541b130807070725p6fa4d0dfne9f04bc857920dc7@mail.gmail.com","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T14:34:32Z","receivedAt":"2008-07-07T14:34:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Avery Pennarun wrote:\n\n> The trick here, I think, is that there's only one time the submodule \n> should be linked to a commit you don't actually have.  It should only \n> happen if your parent module (supermodule) has been updated, but you \n> haven't recently done a fetch in the submodule.\n\nNoooooo!\n\nIf I am actively working on the submodule, the supermodule has _no \nbusiness_ trying to wreck my state.\n\nHth,\nDscho\n"},{"id":"82454","messageId":"alpine.DEB.1.00.0807071537070.18205@racer","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071533240.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T14:37:38Z","receivedAt":"2008-07-07T14:37:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Johannes Schindelin wrote:\n\n> On Mon, 7 Jul 2008, Avery Pennarun wrote:\n> \n> > The trick here, I think, is that there's only one time the submodule \n> > should be linked to a commit you don't actually have.  It should only \n> > happen if your parent module (supermodule) has been updated, but you \n> > haven't recently done a fetch in the submodule.\n> \n> Noooooo!\n> \n> If I am actively working on the submodule, the supermodule has _no \n> business_ trying to wreck my state.\n\nOoops.  The part I should have quoted was this:\n\n> Thus, I'd say the best fix would be to find a way to have \"git pull\" or \n> \"git fetch\" in the supermodule also do a fetch in the submodule.\n\nNow you will understand my objection, hopefully,\nDscho\n"},{"id":"82457","messageId":"20080707145726.GI3696@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071537070.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-07T14:57:26Z","receivedAt":"2008-07-07T14:57:26Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> > Thus, I'd say the best fix would be to find a way to have \"git pull\" or \n> > \"git fetch\" in the supermodule also do a fetch in the submodule.\n> If I am actively working on the submodule, the supermodule has _no \n> business_ trying to wreck my state.\n\nIs it possible to make 'fetch' only .. well .. fetch objects, without\nupdating any refs ? In that case it would wreck no state as no state\nwould be updated.\n-- \n=======================================================================\nDr. Ing. Sylvain Joyeux                          sylvain.joyeux@dfki.de\nResearcher\nDFKI Robotik Lab -- Bremen                   http://www.dfki.de/robotik\nTel: 0049 421 218 64136\n=======================================================================\n"},{"id":"82458","messageId":"32541b130807070757s4ba03e28tf4701f479e27b687@mail.gmail.com","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071533240.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-07T14:57:39Z","receivedAt":"2008-07-07T14:57:39Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/7/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>  On Mon, 7 Jul 2008, Avery Pennarun wrote:\n> > Thus, I'd say the best fix would be to find a way to have \"git pull\" or\n> > \"git fetch\" in the supermodule also do a fetch in the submodule.\n>\n> Noooooo!\n>\n>  If I am actively working on the submodule, the supermodule has _no\n>  business_ trying to wreck my state.\n\nHmm... how does doing a fetch wreck your state?  I thought fetch was\nsupposed to be a pretty harmless operation.  We're not talking about\ndoing a \"git submodule update\" automatically (which would be deadly,\nalbeit only because \"git submodule update\" is so destructive at\npresent).\n\nAll I'm suggesting is, when doing a \"git fetch\" in the supermodule,\nsimply do a \"cd submodule && git fetch\" automatically.  Probably\nshould be optional, but seems like it could make sense for most uses,\nand avoids the (probably much more common) annoyance of fetching in\nthe supermodule and taking my laptop on the road, only to find out\nthat I don't actually have all the objects I need.\n\nOn the other hand, for my own workflow I'm shifting increasingly\ntoward having all my \"submodules\" share a single repo anyway, in which\ncase fetching in the supermodule *would* automatically fetch all my\nrelevant submodule objects too.\n\nHave fun,\n\nAvery\n"},{"id":"82459","messageId":"20080707150023.GJ3696@joyeux","threadId":"14245","inReplyTo":"32541b130807070725p6fa4d0dfne9f04bc857920dc7@mail.gmail.com","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-07T15:00:23Z","receivedAt":"2008-07-07T15:00:23Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> I haven't looked at your patch, so I don't know if you're calling\n> fetch in such a way that it doesn't update any refs.\nFrankly, I don't know either. But since the question is more on a design\nlevel, it does not matter for now.\n\n> Thus, I'd say the\n> best fix would be to find a way to have \"git pull\" or \"git fetch\" in\n> the supermodule also do a fetch in the submodule.  I think it's fair\n> to expect \"fetchy\" operations like fetch and pull to perhaps do some\n> extra fetches, but not fair to expect \"status\" to do extra work like\n> that.\nI do agree on the principle, it is just that I don't know where to do it\notherwise. Would the involved people be fine with a new \"git submodule\nfetch\" command ?\n\n> Also note that \"your supermodule links to a commit that you haven't\n> fetched yet\" is a perfectly okay state to report to the user.  I might\n> use a \"?\" or something to indicate that.\nFor now, my patch shows '!' ... But I'm open to other suggestions.\n\nSylvain\n"},{"id":"82462","messageId":"alpine.DEB.1.00.0807071620030.18205@racer","threadId":"14245","inReplyTo":"20080707145726.GI3696@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T15:21:00Z","receivedAt":"2008-07-07T15:21:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Sylvain Joyeux wrote:\n\n> > > Thus, I'd say the best fix would be to find a way to have \"git pull\" or \n> > > \"git fetch\" in the supermodule also do a fetch in the submodule.\n> > If I am actively working on the submodule, the supermodule has _no \n> > business_ trying to wreck my state.\n> \n> Is it possible to make 'fetch' only .. well .. fetch objects, without \n> updating any refs ? In that case it would wreck no state as no state \n> would be updated.\n\nYou have no business sneaking a fetch into an operation that does not need \none.  Period.\n\nIf that is _still_ not enough to convince you: think about sitting in a \nplane, high above the clouds.  Yes, we try to support that mode of \noperation.\n\nHthf,\nDscho\n"},{"id":"82463","messageId":"alpine.DEB.1.00.0807071621300.18205@racer","threadId":"14245","inReplyTo":"32541b130807070757s4ba03e28tf4701f479e27b687@mail.gmail.com","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T15:23:02Z","receivedAt":"2008-07-07T15:23:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Avery Pennarun wrote:\n\n> On 7/7/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> >  On Mon, 7 Jul 2008, Avery Pennarun wrote:\n> > > Thus, I'd say the best fix would be to find a way to have \"git pull\" or\n> > > \"git fetch\" in the supermodule also do a fetch in the submodule.\n> >\n> > Noooooo!\n> >\n> >  If I am actively working on the submodule, the supermodule has _no\n> >  business_ trying to wreck my state.\n> \n> Hmm... how does doing a fetch wreck your state?\n\nIt updates the tracking branches.  And guess what I use the tracking \nbranches for?  Yes, to track other people's changes.\n\nIt would wreck my state.\n\nAnyway, fetch is wrong, wrong, wrong, if all you want to do is see the \n_state_ of your submodule.\n\nIf that state is that the superproject has a commit that the submodule \nknows nothing about, then that is _exactly_ what needs to be reported.\n\nDon't play cute games,\nDscho\n"},{"id":"82465","messageId":"32541b130807070836n5c6efadu184114f7ed1476e0@mail.gmail.com","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071621300.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-07T15:36:12Z","receivedAt":"2008-07-07T15:36:12Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/7/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>  On Mon, 7 Jul 2008, Avery Pennarun wrote:\n>  > Hmm... how does doing a fetch wreck your state?\n>\n> It updates the tracking branches.  And guess what I use the tracking\n>  branches for?  Yes, to track other people's changes.\n>\n>  It would wreck my state.\n>\n>  Anyway, fetch is wrong, wrong, wrong, if all you want to do is see the\n>  _state_ of your submodule.\n>\n>  If that state is that the superproject has a commit that the submodule\n>  knows nothing about, then that is _exactly_ what needs to be reported.\n>\n>  Don't play cute games,\n\nHmm, somehow we're not understanding each other here.\n\nI think we have already agreed that \"git status\" and/or \"git submodule\nstatus\" are obviously not good times to be fetching things.  And a\nperfectly valid \"submodule status\" is that your submodule can't be\nupdated because you're missing some objects and should fetch.\n\nWhat I suggested was to recursively do \"git fetch\" in submodules at\nthe time of doing fetch or pull operations on the supermodule, in\norder to help ensure that all necessary objects have been fetched.  To\nreference an earlier email of yours, this would *improve* git's\nusability for people who try to use it on a plane, by reducing the\nnumber of cases where they have forgotten to fetch.\n\n(1) Do you think fetching missing submodule objects when fetching the\nsupermodule is a bad idea, or a good one?  (2) On top of that, do you\nthink updating the submodule's refs when I do \"git fetch\" in the\nsupermodule is a good one (it seems you think it don't)?  (3) And on\ntop of that, if either of those is a good idea, should it be a config\noption?  (4) And should that option default on or off?\n\nIn case anyone cares about my preferences, I think (1) makes sense,\n(2) is probably too dangerous, (3) should be yes, or perhaps people\nshould be taught to run \"git submodule fetch\" to fetch submodules and\nleave \"git fetch\" alone, and (4) if it's configurable, it should do it\nby default, because in 99% of situations I can imagine, fetching a\nsupermodule and not fetching its referenced submodule commit will not\nbe useful behaviour.\n\nThanks,\n\nAvery\n"},{"id":"82466","messageId":"20080707154251.GK3696@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071620030.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-07T15:42:51Z","receivedAt":"2008-07-07T15:42:51Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"On Mon, Jul 07, 2008 at 04:21:00PM +0100, Johannes Schindelin wrote:\n> > > > Thus, I'd say the best fix would be to find a way to have \"git pull\" or \n> > > > \"git fetch\" in the supermodule also do a fetch in the submodule.\n> > > If I am actively working on the submodule, the supermodule has _no \n> > > business_ trying to wreck my state.\n> > \n> > Is it possible to make 'fetch' only .. well .. fetch objects, without \n> > updating any refs ? In that case it would wreck no state as no state \n> > would be updated.\n> \n> You have no business sneaking a fetch into an operation that does not need \n> one.  Period.\nWell. Given that yourself were replying to having \"git fetch\" fetching\nsubmodules as well, maybe you could tell me how \"git fetch\" is an\noperation that does not need fetching[1].\n\nMoreover, on the \"need\" point, I do think that git-submodule (or git in\ngeneral) needs a way to fetch (or to git remote update) all submodules\nin one operation. Otherwise, managing submodules becomes hell very\nquickly.\n\nSylvain\n\n[1] I know, it sounds like a smurf talking.\n"},{"id":"82467","messageId":"20080707155238.GL3696@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807071621300.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-07T15:52:39Z","receivedAt":"2008-07-07T15:52:39Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"On Mon, Jul 07, 2008 at 04:23:02PM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 7 Jul 2008, Avery Pennarun wrote:\n> \n> > On 7/7/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > >  On Mon, 7 Jul 2008, Avery Pennarun wrote:\n> > > > Thus, I'd say the best fix would be to find a way to have \"git pull\" or\n> > > > \"git fetch\" in the supermodule also do a fetch in the submodule.\n> > >\n> > > Noooooo!\n> > >\n> > >  If I am actively working on the submodule, the supermodule has _no\n> > >  business_ trying to wreck my state.\n> > \n> > Hmm... how does doing a fetch wreck your state?\n> \n> It updates the tracking branches.  And guess what I use the tracking \n> branches for?  Yes, to track other people's changes.\n\nAnd ... I'll ask the same question again, then maybe you will be so nice\nas to give me the information that you do not want to share with the\nearthling that I am.\n\nIs there no way to fetch only objects without updating no refs ?\n\n> Anyway, fetch is wrong, wrong, wrong, if all you want to do is see the \n> _state_ of your submodule.\nAgreed. Now, can we move on and discuss Avery's point which was to have\na SEPARATE operation which fetches all submodules in one command ?\n\n> Don't play cute games,\nOK. Maybe you're god in the small world of git-submodule or whatever,\nbut could you at least *try* to explain things to people which are\ntrying to understand what is SOOOOOOOOOOOOOOO\nHOOORRRRRRRIIIIBBBBLLLLLLLLYYYYYYYYY BAD when the only information they\nhave is:\n\n  THIS IS HORRIBLY BAD, GO AWAY\n\nSylvain\n"},{"id":"82468","messageId":"alpine.DEB.1.00.0807071710140.18205@racer","threadId":"14245","inReplyTo":"32541b130807070836n5c6efadu184114f7ed1476e0@mail.gmail.com","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T16:10:45Z","receivedAt":"2008-07-07T16:10:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Avery Pennarun wrote:\n\n> What I suggested was to recursively do \"git fetch\" in submodules at\n> the time of doing fetch or pull operations on the supermodule, in\n> order to help ensure that all necessary objects have been fetched.\n\nIMO \"git submodule update\" is just good enough.\n\nCiao,\nDscho\n"},{"id":"82477","messageId":"7v8wwd4kvb.fsf@gitster.siamese.dyndns.org","threadId":"14245","inReplyTo":"20080707145726.GI3696@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-07T18:20:08Z","receivedAt":"2008-07-07T18:20:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n\n> Is it possible to make 'fetch' only .. well .. fetch objects, without\n> updating any refs?\n\nNot very easily, and that is very deliberate.  The objects fetched will\nbecome dangling if you allowed such a mode of operation, and will\nimmediately become subject to gc.\n\nAs Avery said, when the user asks \"what's the status\" in the superproject,\n\"the superproject binds a commit you do not have locally at these paths\"\nis a perfectly valid answer, and as Dscho argues, it is not good to avoid\ngiving that answer by running fetch behind the user's back.\n\nAnd the thing is, if you do the \"without updating refs\" fetch, I think you\nwould make things even worse.  The superproject status will then may say\nthat you have everything you need, but the commit is not anchored with any\nref in the subproject repository and can be gc'ed at any time.  The answer\nyou gave to the \"status\" request cannot be trusted anymore.\n\nBy honestly saying \"The superproject binds a commit you do not have\nlocally at these paths\", the user *can* choose *when* to go there and\nupdate, or have \"git submodule update\" command to that for him.\n"},{"id":"82478","messageId":"32541b130807071129m218059eaw8837681c0d705cd@mail.gmail.com","threadId":"14245","inReplyTo":"7v8wwd4kvb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-07T18:29:30Z","receivedAt":"2008-07-07T18:29:30Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/7/08, Junio C Hamano <gitster@pobox.com> wrote:\n> Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n>  > Is it possible to make 'fetch' only .. well .. fetch objects, without\n>  > updating any refs?\n>\n> Not very easily, and that is very deliberate.  The objects fetched will\n>  become dangling if you allowed such a mode of operation, and will\n>  immediately become subject to gc.\n\nIs this really desirable?  I could imagine dropping an entry (or\nseveral entries, or whatever) into the reflog after each fetch, to\nprevent such fetched objects from being deleted right away.\n\nAvery\n"},{"id":"82483","messageId":"7viqvh322c.fsf@gitster.siamese.dyndns.org","threadId":"14245","inReplyTo":"32541b130807071129m218059eaw8837681c0d705cd@mail.gmail.com","subject":"Re: [PATCH] better git-submodule status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-07T19:51:39Z","receivedAt":"2008-07-07T19:51:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Avery Pennarun\" <apenwarr@gmail.com> writes:\n\n> Is this really desirable?\n\nYes.\n\nAfter \"git fetch $random_place master && git log ..FETCH_HEAD\" to inspect\nwhat the other guy is up to, if you do not like what you see, you do want\nthe objects that are only reachable from FETCH_HEAD to go away (note that\nit is not counted as the root of fsck traversal for this exact reason).\n"},{"id":"82568","messageId":"20080708080042.GB3628@joyeux","threadId":"14245","inReplyTo":"7v8wwd4kvb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-08T08:00:42Z","receivedAt":"2008-07-08T08:00:42Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"On Mon, Jul 07, 2008 at 11:20:08AM -0700, Junio C Hamano wrote:\n> > Is it possible to make 'fetch' only .. well .. fetch objects, without\n> > updating any refs?\n> \n> By honestly saying \"The superproject binds a commit you do not have\n> locally at these paths\", the user *can* choose *when* to go there and\n> update, or have \"git submodule update\" command to that for him.\nAgreed. The problem is that git submodule update does not only fetches\nthe new refs but *also* checks out the commit currently registered in\nthe superproject. Therefore git-submodule status *and* git-submodule\nsummary cannot tell you anything after a git-submodule update.\n\nWhat I was missing is, given the current discussion, a git-submodule\nfetch alike to what Avery was proposing, which fetches all submodules in\none command. Having to do the fetch/update manually for each submodule\nis really cumbersome -- I have around 30 modules in the superproject.\n\nSylvain\n"},{"id":"82587","messageId":"alpine.DEB.1.00.0807081320220.4319@eeepc-johanness","threadId":"14245","inReplyTo":"20080708080042.GB3628@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-08T11:21:00Z","receivedAt":"2008-07-08T11:21:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 8 Jul 2008, Sylvain Joyeux wrote:\n\n> What I was missing is, given the current discussion, a git-submodule \n> fetch alike to what Avery was proposing, which fetches all submodules in \n> one command. Having to do the fetch/update manually for each submodule \n> is really cumbersome -- I have around 30 modules in the superproject.\n\nDid I not suggest \"git submodule update\" earlier?  AFAIR this updates all \nsubmodules that have been initialized.\n\nHth,\nDscho\n"},{"id":"82594","messageId":"20080708122244.GE14794@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807081320220.4319@eeepc-johanness","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-08T12:22:44Z","receivedAt":"2008-07-08T12:22:44Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> > What I was missing is, given the current discussion, a git-submodule \n> > fetch alike to what Avery was proposing, which fetches all submodules in \n> > one command. Having to do the fetch/update manually for each submodule \n> > is really cumbersome -- I have around 30 modules in the superproject.\n> \n> Did I not suggest \"git submodule update\" earlier?  AFAIR this updates all \n> submodules that have been initialized.\n\n... and checkouts the commit registered in the superproject. Therefore\nneither git-submodule status nor git-submodule summary can give an idea\nof \"what's new in submodules\"\n\nSylvain\n"},{"id":"82597","messageId":"alpine.DEB.1.00.0807081358481.18205@racer","threadId":"14245","inReplyTo":"20080708122244.GE14794@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-08T13:00:07Z","receivedAt":"2008-07-08T13:00:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 8 Jul 2008, Sylvain Joyeux wrote:\n\n> [somebody wrote]\n>\n> > [somebody else wrote]\n> >\n> > > What I was missing is, given the current discussion, a git-submodule \n> > > fetch alike to what Avery was proposing, which fetches all \n> > > submodules in one command. Having to do the fetch/update manually \n> > > for each submodule is really cumbersome -- I have around 30 modules \n> > > in the superproject.\n> > \n> > Did I not suggest \"git submodule update\" earlier?  AFAIR this updates \n> > all submodules that have been initialized.\n> \n> ... and checkouts the commit registered in the superproject. Therefore \n> neither git-submodule status nor git-submodule summary can give an idea \n> of \"what's new in submodules\"\n\nYeah, now I get what you are saying.  So you want a \"git submodule peek\" \nor some such.\n\nCiao,\nDscho\n"},{"id":"82598","messageId":"20080708131220.GF14794@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807081358481.18205@racer","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-08T13:12:20Z","receivedAt":"2008-07-08T13:12:20Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> > ... and checkouts the commit registered in the superproject. Therefore \n> > neither git-submodule status nor git-submodule summary can give an idea \n> > of \"what's new in submodules\"\n> \n> Yeah, now I get what you are saying.  So you want a \"git submodule peek\" \n> or some such.\n\nThat is exactly the idea.\n\nSylvain\n"},{"id":"82701","messageId":"20080709101330.GA3525@joyeux","threadId":"14245","inReplyTo":"20080701150119.GE5852@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-09T10:13:30Z","receivedAt":"2008-07-09T10:13:30Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"Here is a (tentative) summary of the whole discussion:\n\n* doing fetch in status is EVIL. Therefore, status should only report\n  whatever information is available.\n* nonetheless, having a \"peek\" mode seem to be accepted as a useful\n  feature not only by me.\n* changing the output format of git-submodules is not right either,\n  because it would break existing tools which parses it at the moment.\n\nProposal\n- remove fetch from status, and make the new output enabled when\n  --verbose is set (can also be set in the config file I guess).\n\n  On the symbols side, I propose:\n    > submodule commit is a direct descendant of the commit in the\n      superproject\n    < submodule commit is a direct ancestor of the commit in the\n      superproject\n    + no direct relation between submodule commit and commit in the\n      superproject\n    ? the commit in the superproject cannot be found in the submodule\n      (replaces the initial '!' in my patch)\n\n  A 'M' is appended if the submodule has uncommitted changes\n\n- define a git-submodule 'fetch' subcommand which call fetch in each\n  submodule and runs the verbose mode of git-status (can be disabled by\n  a --quiet option).\n\nComments ? (I'm sure there are some ...)\n\nSylvain\n"},{"id":"82704","messageId":"48749215.6070307@op5.se","threadId":"14245","inReplyTo":"20080709101330.GA3525@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-07-09T10:25:25Z","receivedAt":"2008-07-09T10:25:25Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Sylvain Joyeux wrote:\n> Here is a (tentative) summary of the whole discussion:\n> \n> * doing fetch in status is EVIL. Therefore, status should only report\n>   whatever information is available.\n> * nonetheless, having a \"peek\" mode seem to be accepted as a useful\n>   feature not only by me.\n> * changing the output format of git-submodules is not right either,\n>   because it would break existing tools which parses it at the moment.\n> \n> Proposal\n> - remove fetch from status, and make the new output enabled when\n>   --verbose is set (can also be set in the config file I guess).\n> \n>   On the symbols side, I propose:\n>     > submodule commit is a direct descendant of the commit in the\n>       superproject\n>     < submodule commit is a direct ancestor of the commit in the\n>       superproject\n>     + no direct relation between submodule commit and commit in the\n>       superproject\n>     ? the commit in the superproject cannot be found in the submodule\n>       (replaces the initial '!' in my patch)\n> \n>   A 'M' is appended if the submodule has uncommitted changes\n> \n> - define a git-submodule 'fetch' subcommand which call fetch in each\n>   submodule and runs the verbose mode of git-status (can be disabled by\n>   a --quiet option).\n> \n> Comments ? (I'm sure there are some ...)\n> \n\nRe-use the existing symbolism from fetch status output. Using '+' to\ndenote \"no direct relation\" in a tool that shows patches half the\ntime is just plain horrible.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"82706","messageId":"20080709110154.GC3525@joyeux","threadId":"14245","inReplyTo":"48749215.6070307@op5.se","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-09T11:01:54Z","receivedAt":"2008-07-09T11:01:54Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"On Wed, Jul 09, 2008 at 12:25:25PM +0200, Andreas Ericsson wrote:\n> Sylvain Joyeux wrote:\n>> Here is a (tentative) summary of the whole discussion:\n>>\n>> * doing fetch in status is EVIL. Therefore, status should only report\n>>   whatever information is available.\n>> * nonetheless, having a \"peek\" mode seem to be accepted as a useful\n>>   feature not only by me.\n>> * changing the output format of git-submodules is not right either,\n>>   because it would break existing tools which parses it at the moment.\n>>\n>> Proposal\n>> - remove fetch from status, and make the new output enabled when\n>>   --verbose is set (can also be set in the config file I guess).\n>>\n>>   On the symbols side, I propose:\n>>     > submodule commit is a direct descendant of the commit in the\n>>       superproject\n>>     < submodule commit is a direct ancestor of the commit in the\n>>       superproject\n>>     + no direct relation between submodule commit and commit in the\n>>       superproject\n>>     ? the commit in the superproject cannot be found in the submodule\n>>       (replaces the initial '!' in my patch)\n>>\n>>   A 'M' is appended if the submodule has uncommitted changes\n>>\n>> - define a git-submodule 'fetch' subcommand which call fetch in each\n>>   submodule and runs the verbose mode of git-status (can be disabled by\n>>   a --quiet option).\n>>\n>> Comments ? (I'm sure there are some ...)\n>>\n>\n> Re-use the existing symbolism from fetch status output. Using '+' to\n> denote \"no direct relation\" in a tool that shows patches half the\n> time is just plain horrible.\nCould you be more specific ? AFAIK, 'fetch' symbolism is based on files,\nthe one I need is comparing commits.\n\nAnd I don't like the '+' either. I chose it because it is the current\nsymbol to show that there is a difference between\nsuperproject/submodule.\n-- \n=======================================================================\nDr. Ing. Sylvain Joyeux                          sylvain.joyeux@dfki.de\nResearcher\nDFKI Robotik Lab -- Bremen                   http://www.dfki.de/robotik\nTel: 0049 421 218 64136\n=======================================================================\n"},{"id":"82716","messageId":"alpine.DEB.1.00.0807091427270.5277@eeepc-johanness","threadId":"14245","inReplyTo":"20080709101330.GA3525@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-09T12:31:31Z","receivedAt":"2008-07-09T12:31:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Jul 2008, Sylvain Joyeux wrote:\n\n>   On the symbols side, I propose:\n>     > submodule commit is a direct descendant of the commit in the\n>       superproject\n>     < submodule commit is a direct ancestor of the commit in the\n>       superproject\n>     + no direct relation between submodule commit and commit in the\n>       superproject\n>     ? the commit in the superproject cannot be found in the submodule\n>       (replaces the initial '!' in my patch)\n\nI like the output of \"git checkout\" when your local branch is not agreeing \nwith the tracked branch.  Maybe it would be more user-friendly to have \nsubmodule use that type of message, instead of cryptic single letter?\n\nOn a related note, the long commit name has been a constant nuisance for \nme.  A short commit name is perfectly enough, methinks.\n\n> - define a git-submodule 'fetch' subcommand which call fetch in each\n>   submodule and runs the verbose mode of git-status (can be disabled by\n>   a --quiet option).\n\nI like it.\n\nYou probably can refactor the code for \"update\" to do that nicely.\n\nCiao,\nDscho\n"},{"id":"82721","messageId":"20080709134629.GA3848@joyeux","threadId":"14245","inReplyTo":"alpine.DEB.1.00.0807091427270.5277@eeepc-johanness","subject":"Re: [PATCH] better git-submodule status output","fromName":"Sylvain Joyeux","fromEmail":"sylvain.joyeux@dfki.de","sentAt":"2008-07-09T13:46:29Z","receivedAt":"2008-07-09T13:46:29Z","isPatch":true,"sender":{"key":"sylvain.joyeux@dfki.de","avatar":null},"body":"> >   On the symbols side, I propose:\n> >     > submodule commit is a direct descendant of the commit in the\n> >       superproject\n> >     < submodule commit is a direct ancestor of the commit in the\n> >       superproject\n> >     + no direct relation between submodule commit and commit in the\n> >       superproject\n> >     ? the commit in the superproject cannot be found in the submodule\n> >       (replaces the initial '!' in my patch)\n> \n> I like the output of \"git checkout\" when your local branch is not agreeing \n> with the tracked branch.  Maybe it would be more user-friendly to have \n> submodule use that type of message, instead of cryptic single letter?\nMmmm ... Yes that could be a great idea. I'll try it.\n \n> On a related note, the long commit name has been a constant nuisance for \n> me.  A short commit name is perfectly enough, methinks.\nI also think so. The commit ID is completely useless for humans.\nNonetheless, that would change the git-submodules output which\n(according to someone-that-I-dont-remember) would be a Bad Thing(tm).\n\n> > - define a git-submodule 'fetch' subcommand which call fetch in each\n> >   submodule and runs the verbose mode of git-status (can be disabled by\n> >   a --quiet option).\n> \n> I like it.\n> \n> You probably can refactor the code for \"update\" to do that nicely.\nOK\n\nSylvain\n"},{"id":"82722","messageId":"alpine.DEB.1.00.0807091453010.18205@racer","threadId":"14245","inReplyTo":"20080709134629.GA3848@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-09T13:54:05Z","receivedAt":"2008-07-09T13:54:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Jul 2008, Sylvain Joyeux wrote:\n\n> [Sylvain quoted somebody, but found it funny to let the reader guess]\n>\n> > On a related note, the long commit name has been a constant nuisance \n> > for me.  A short commit name is perfectly enough, methinks.\n>\n> I also think so. The commit ID is completely useless for humans. \n> Nonetheless, that would change the git-submodules output which \n> (according to someone-that-I-dont-remember) would be a Bad Thing(tm).\n\nIs git-submodule supposed to be plumbing?  I don't think so.\n\nCiao,\nDscho\n"},{"id":"82745","messageId":"7vvdzeki61.fsf@gitster.siamese.dyndns.org","threadId":"14245","inReplyTo":"20080709101330.GA3525@joyeux","subject":"Re: [PATCH] better git-submodule status output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-09T18:48:38Z","receivedAt":"2008-07-09T18:48:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:\n\n> * changing the output format of git-submodules is not right either,\n>   because it would break existing tools which parses it at the moment.\n\nOn other two points I do agree with people who objected, but I do not\nthink this one is particularly bad.  If 'git submodule status' is similar\nin spirit to 'git status', then it is more important to make it useful for\nhuman consumption than to keep the wording of the output set in stone.\n"}]}