{"thread":{"id":"15192","subject":"git-submodule: add \"sync\" command (v2)","startedAt":"2008-08-24T17:21:37Z","lastAt":"2008-08-27T17:39:27Z","messageCount":14,"participants":["David Aguilar","Mark Levedahl","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"88367","messageId":"1219598500-8334-1-git-send-email-davvid@gmail.com","threadId":"15192","inReplyTo":null,"subject":"git-submodule: add \"sync\" command (v2)","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T17:21:37Z","receivedAt":"2008-08-24T17:21:37Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"The following patches rework the \"sync\" command in response to\nJunio's input.\n\nThe first two patches are a simple refactor to move logic for\nfinding the name of the remote, which is not necessarily\n\"origin\", into a standalone function.\n\nThe last patch is the reworked \"git submodule sync\" command.\n"},{"id":"88369","messageId":"e21617f50ffaae98ab73fa364e40440397bcbe33.1219598198.git.davvid@gmail.com","threadId":"15192","inReplyTo":"1219598500-8334-1-git-send-email-davvid@gmail.com","subject":"[PATCH 1/3] git-submodule: add a get_remote function","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T17:21:38Z","receivedAt":"2008-08-24T17:21:38Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"get_remote finds the remote that corresponds to HEAD.\nThis code is duplicated from resolve_relative_url but\nwill be refactored and reused in subsequent commits.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-submodule.sh |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2a3a197..9d2bddb 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -27,6 +27,15 @@ say()\n \tfi\n }\n \n+# Gets the remote corresponding to HEAD\n+get_remote()\n+{\n+\tbranch=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n+\tremote=\"$(git config branch.${branch#refs/heads/}.remote)\"\n+\tremote=\"${remote:-origin}\"\n+\techo \"$remote\"\n+}\n+\n # Resolve relative url by appending to parent's url\n resolve_relative_url ()\n {\n-- \n1.6.0.90.g436ed\n"},{"id":"88368","messageId":"341166c1e31ba26c4e8e48cd7cf9ce12a9f745b9.1219598198.git.davvid@gmail.com","threadId":"15192","inReplyTo":"e21617f50ffaae98ab73fa364e40440397bcbe33.1219598198.git.davvid@gmail.com","subject":"[PATCH 2/3] git-submodule: use get_remote in resolve_relative_url","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T17:21:39Z","receivedAt":"2008-08-24T17:21:39Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"This change removes replaces the remote finding logic in\nresolve_relative_url with the new get_remote function.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-submodule.sh |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 9d2bddb..d2ae835 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -39,9 +39,7 @@ get_remote()\n # Resolve relative url by appending to parent's url\n resolve_relative_url ()\n {\n-\tbranch=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\tremote=\"$(git config branch.${branch#refs/heads/}.remote)\"\n-\tremote=\"${remote:-origin}\"\n+\tremote=$(get_remote)\n \tremoteurl=$(git config \"remote.$remote.url\") ||\n \t\tdie \"remote ($remote) does not have a url defined in .git/config\"\n \turl=\"$1\"\n-- \n1.6.0.90.g436ed\n"},{"id":"88370","messageId":"23327a679798d19dc52a27c55a58c5b8c9ebe945.1219598198.git.davvid@gmail.com","threadId":"15192","inReplyTo":"341166c1e31ba26c4e8e48cd7cf9ce12a9f745b9.1219598198.git.davvid@gmail.com","subject":"[PATCH 3/3] git-submodule: add \"sync\" command","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T17:21:40Z","receivedAt":"2008-08-24T17:21:40Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"When a submodule's URL changes upstream, existing submodules\nwill be out of sync since their remote.\"$origin\".url will still\nbe set to the old value.\n\nThis change adds a \"git submodule sync\" command that reads the\nsubmodule URLs from .gitmodules and updates any existing\nsubmodules accordingly.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n Documentation/git-submodule.txt |    9 +++++++\n git-submodule.sh                |   51 +++++++++++++++++++++++++++++++++++++-\n 2 files changed, 58 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex abbd5b7..babaa9b 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n 'git submodule' [--quiet] update [--init] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n+'git submodule' [--quiet] sync [--] [<path>...]\n \n \n DESCRIPTION\n@@ -139,6 +140,14 @@ foreach::\n As an example, \"git submodule foreach 'echo $path `git rev-parse HEAD`' will\n show the path and currently checked out commit for each submodule.\n \n+sync::\n+\tSynchronizes submodules' remote URL configuration setting\n+\tto the value specified in .gitmodules.  This is useful when\n+\tsubmodule URLs change upstream and you need to update your local\n+\trepositories accordingly.\n++\n+\"git submodule sync\" synchronizes all submodules while\n+\"git submodule sync -- A\" synchronizes submodule \"A\" only.\n \n OPTIONS\n -------\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex d2ae835..2af2ef4 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -6,7 +6,7 @@\n \n USAGE=\"[--quiet] [--cached] \\\n [add <repo> [-b branch] <path>]|[status|init|update [-i|--init]|summary [-n|--summary-limit <n>] [<commit>]] \\\n-[--] [<path>...]|[foreach <command>]\"\n+[--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]\"\n OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n@@ -609,6 +609,53 @@ cmd_status()\n \t\tfi\n \tdone\n }\n+#\n+# Sync remote urls for submodules\n+# This makes the value for remote.$remote.url match the value\n+# specified in .gitmodules.\n+#\n+cmd_sync()\n+{\n+\twhile test $# -ne 0\n+\tdo\n+\t\tcase \"$1\" in\n+\t\t-q|--quiet)\n+\t\t\tquiet=1\n+\t\t\tshift\n+\t\t\t;;\n+\t\t--)\n+\t\t\tshift\n+\t\t\tbreak\n+\t\t\t;;\n+\t\t-*)\n+\t\t\tusage\n+\t\t\t;;\n+\t\t*)\n+\t\t\tbreak\n+\t\t\t;;\n+\t\tesac\n+\tdone\n+\n+\tcd_to_toplevel\n+\ttoplevel=\"$PWD\"\n+\n+\tmodule_list \"$@\" |\n+\twhile read mode sha1 stage path\n+\tdo\n+\t\tname=$(module_name \"$path\")\n+\t\turl=$(git config -f .gitmodules --get submodule.\"$name\".url)\n+\t\tif test -d \"$path\"; then\n+\t\t(\n+\t\t\tunset GIT_DIR\n+\t\t\tcd \"$path\"\n+\t\t\tremote=$(get_remote)\n+\t\t\tsay \"Synchronizing submodule url for '$name'\"\n+\t\t\tgit config remote.\"$remote\".url \"$url\"\n+\t\t\tcd \"$toplevel\"\n+\t\t)\n+\t\tfi\n+\tdone\n+}\n \n # This loop parses the command line arguments to find the\n # subcommand name to dispatch.  Parsing of the subcommand specific\n@@ -619,7 +666,7 @@ cmd_status()\n while test $# != 0 && test -z \"$command\"\n do\n \tcase \"$1\" in\n-\tadd | foreach | init | update | status | summary)\n+\tadd | foreach | init | update | status | summary | sync)\n \t\tcommand=$1\n \t\t;;\n \t-q|--quiet)\n-- \n1.6.0.90.g436ed\n"},{"id":"88378","messageId":"1219603570-516-1-git-send-email-mlevedahl@gmail.com","threadId":"15192","inReplyTo":"e21617f50ffaae98ab73fa364e40440397bcbe33.1219598198.git.davvid@gmail.com","subject":"[PATCH] git-submodule - Use \"get_default_remote\" from git-parse-remote","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-08-24T18:46:10Z","receivedAt":"2008-08-24T18:46:10Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Resolve_relative_url was using its own code for this function, but\nthis is duplication with the best result that this continues to work.\nReplace with the common function provided by git-parse-remote.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n\nI think it makes more sense to use the facility provided elsewhere rather\nthan duplicate. (I've had this patch in my tree for quite a while, never\nreally had a reason to submit it.)\n\n\n git-submodule.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2a3a197..59fe7b3 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -9,6 +9,7 @@ USAGE=\"[--quiet] [--cached] \\\n [--] [<path>...]|[foreach <command>]\"\n OPTIONS_SPEC=\n . git-sh-setup\n+. git-parse-remote\n require_work_tree\n\n command=\n@@ -30,9 +31,7 @@ say()\n # Resolve relative url by appending to parent's url\n resolve_relative_url ()\n {\n-\tbranch=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\tremote=\"$(git config branch.${branch#refs/heads/}.remote)\"\n-\tremote=\"${remote:-origin}\"\n+\tremote=$(get_default_remote)\n \tremoteurl=$(git config \"remote.$remote.url\") ||\n \t\tdie \"remote ($remote) does not have a url defined in .git/config\"\n \turl=\"$1\"\n--\n1.6.0.127.gf1d7c\n"},{"id":"88379","messageId":"7v4p5ansxx.fsf@gitster.siamese.dyndns.org","threadId":"15192","inReplyTo":"341166c1e31ba26c4e8e48cd7cf9ce12a9f745b9.1219598198.git.davvid@gmail.com","subject":"Re: [PATCH 2/3] git-submodule: use get_remote in resolve_relative_url","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-24T18:55:54Z","receivedAt":"2008-08-24T18:55:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> This change removes replaces the remote finding logic in\n> resolve_relative_url with the new get_remote function.\n>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n\nI think these first two patches should be squashed into one, with a title\n\"git-submodule: refactor logic to find the remote from the current branch\".\n\nIf you agree, I'll do that myself -- no need to resend; please just say\nthe word.\n"},{"id":"88380","messageId":"7vwsi6meas.fsf@gitster.siamese.dyndns.org","threadId":"15192","inReplyTo":"23327a679798d19dc52a27c55a58c5b8c9ebe945.1219598198.git.davvid@gmail.com","subject":"Re: [PATCH 3/3] git-submodule: add \"sync\" command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-24T18:57:31Z","receivedAt":"2008-08-24T18:57:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> +#\n> +# Sync remote urls for submodules\n> +# This makes the value for remote.$remote.url match the value\n> +# specified in .gitmodules.\n> +#\n> +cmd_sync()\n> +{\n> +...\n> +\tcd_to_toplevel\n> +\ttoplevel=\"$PWD\"\n\nI do not think you need $toplevel, as you cd around inside a subshell.\n\n> +\tmodule_list \"$@\" |\n> +\twhile read mode sha1 stage path\n> +\tdo\n> +\t\tname=$(module_name \"$path\")\n> +\t\turl=$(git config -f .gitmodules --get submodule.\"$name\".url)\n> +\t\tif test -d \"$path\"; then\n\nI think this test is wrong.\n\nCompare it with how cmd_foreach does this.  The difference is that you\nforce \"sync\" to every submodule that could be cloned and checked out,\nwhile \"foreach\" skips submodules the user has not expressed any interest\nin touching.\n\n> +\t\t(\n> +\t\t\tunset GIT_DIR\n> +\t\t\tcd \"$path\"\n> +\t\t\tremote=$(get_remote)\n> +\t\t\tsay \"Synchronizing submodule url for '$name'\"\n> +\t\t\tgit config remote.\"$remote\".url \"$url\"\n\nI am not sure about the way you determine $remote.  When the HEAD in the\nsubmodule repository is detached by prior \"git submodule update\", this\nwill fall back to the default \"origin\" --- is it a good behaviour?\n\nThis is not an objection; I am merely wondering if that fallback is\nsensible, or if people who are interested in submodules can suggest better\nalternatives.\n\n> +\t\t\tcd \"$toplevel\"\n\nUnneeded (in a subshell).\n\n> +\t\t)\n> +\t\tfi\n> +\tdone\n> +}\n\nOther than the above comments, the patch looks sensible to me.\n"},{"id":"88382","messageId":"7vljymmdto.fsf@gitster.siamese.dyndns.org","threadId":"15192","inReplyTo":"1219603570-516-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] git-submodule - Use \"get_default_remote\" from git-parse-remote","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-24T19:07:47Z","receivedAt":"2008-08-24T19:07:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> writes:\n\n> Resolve_relative_url was using its own code for this function, but\n> this is duplication with the best result that this continues to work.\n> Replace with the common function provided by git-parse-remote.\n>\n> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>\n> ---\n>\n> I think it makes more sense to use the facility provided elsewhere rather\n> than duplicate.\n\nAh, that's true.  Will apply, thanks.\n"},{"id":"88384","messageId":"7v8wummdbw.fsf@gitster.siamese.dyndns.org","threadId":"15192","inReplyTo":"7v4p5ansxx.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] git-submodule: use get_remote in resolve_relative_url","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-24T19:18:27Z","receivedAt":"2008-08-24T19:18:27Z","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> David Aguilar <davvid@gmail.com> writes:\n>\n>> This change removes replaces the remote finding logic in\n>> resolve_relative_url with the new get_remote function.\n>>\n>> Signed-off-by: David Aguilar <davvid@gmail.com>\n>\n> I think these first two patches should be squashed into one, with a title\n> \"git-submodule: refactor logic to find the remote from the current branch\".\n>\n> If you agree, I'll do that myself -- no need to resend; please just say\n> the word.\n\nActually, I took Mark's patch; you can do [3/3] with get_default_remote,\ntoo, right?\n"},{"id":"88386","messageId":"20080824192343.GA22134@gmail.com","threadId":"15192","inReplyTo":"7vwsi6meas.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] git-submodule: add \"sync\" command","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T19:23:44Z","receivedAt":"2008-08-24T19:23:44Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On  0, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n> > +\t\t(\n> > +\t\t\tunset GIT_DIR\n> > +\t\t\tcd \"$path\"\n> > +\t\t\tremote=$(get_remote)\n> > +\t\t\tsay \"Synchronizing submodule url for '$name'\"\n> > +\t\t\tgit config remote.\"$remote\".url \"$url\"\n> \n> I am not sure about the way you determine $remote.  When the HEAD in the\n> submodule repository is detached by prior \"git submodule update\", this\n> will fall back to the default \"origin\" --- is it a good behaviour?\n> \n> This is not an objection; I am merely wondering if that fallback is\n> sensible, or if people who are interested in submodules can suggest better\n> alternatives.\n\n\nThis is true.  I recall there was a lengthy thread a while\nback about how \"origin\" might not always be what you'd want\nwhen cloning a repo.  I'll address your comments, use\nMark's get_default_remote, and resend.  I have a feeling that\naddressing the use of remote names in submodules is beyond\nthe scope of this patch for now since it seems like we'd need\nthat info stored somewhere in a superproject gitfile.\n\n-- \n\n\tDavid\n"},{"id":"88389","messageId":"ebeb5aba6f679e1259a011bcc245bd723c6cf8d1.1219606749.git.davvid@gmail.com","threadId":"15192","inReplyTo":"7vwsi6meas.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v3] git-submodule: add \"sync\" command","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-24T19:43:37Z","receivedAt":"2008-08-24T19:43:37Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"When a submodule's URL changes upstream, existing submodules\nwill be out of sync since their remote.\"$origin\".url will still\nbe set to the old value.\n\nThis adds a \"git submodule sync\" command that reads submodules'\nURLs from .gitmodules and updates them accordingly.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n\nThis uses get_default_remote() per Mark's latest update.\n\n Documentation/git-submodule.txt |    9 +++++++\n git-submodule.sh                |   48 +++++++++++++++++++++++++++++++++++++-\n 2 files changed, 55 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex abbd5b7..babaa9b 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n 'git submodule' [--quiet] update [--init] [--] [<path>...]\n 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]\n 'git submodule' [--quiet] foreach <command>\n+'git submodule' [--quiet] sync [--] [<path>...]\n \n \n DESCRIPTION\n@@ -139,6 +140,14 @@ foreach::\n As an example, \"git submodule foreach 'echo $path `git rev-parse HEAD`' will\n show the path and currently checked out commit for each submodule.\n \n+sync::\n+\tSynchronizes submodules' remote URL configuration setting\n+\tto the value specified in .gitmodules.  This is useful when\n+\tsubmodule URLs change upstream and you need to update your local\n+\trepositories accordingly.\n++\n+\"git submodule sync\" synchronizes all submodules while\n+\"git submodule sync -- A\" synchronizes submodule \"A\" only.\n \n OPTIONS\n -------\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 59fe7b3..4a95035 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -6,7 +6,7 @@\n \n USAGE=\"[--quiet] [--cached] \\\n [add <repo> [-b branch] <path>]|[status|init|update [-i|--init]|summary [-n|--summary-limit <n>] [<commit>]] \\\n-[--] [<path>...]|[foreach <command>]\"\n+[--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]\"\n OPTIONS_SPEC=\n . git-sh-setup\n . git-parse-remote\n@@ -601,6 +601,50 @@ cmd_status()\n \t\tfi\n \tdone\n }\n+#\n+# Sync remote urls for submodules\n+# This makes the value for remote.$remote.url match the value\n+# specified in .gitmodules.\n+#\n+cmd_sync()\n+{\n+\twhile test $# -ne 0\n+\tdo\n+\t\tcase \"$1\" in\n+\t\t-q|--quiet)\n+\t\t\tquiet=1\n+\t\t\tshift\n+\t\t\t;;\n+\t\t--)\n+\t\t\tshift\n+\t\t\tbreak\n+\t\t\t;;\n+\t\t-*)\n+\t\t\tusage\n+\t\t\t;;\n+\t\t*)\n+\t\t\tbreak\n+\t\t\t;;\n+\t\tesac\n+\tdone\n+\tcd_to_toplevel\n+\tmodule_list \"$@\" |\n+\twhile read mode sha1 stage path\n+\tdo\n+\t\tname=$(module_name \"$path\")\n+\t\turl=$(git config -f .gitmodules --get submodule.\"$name\".url)\n+\t\tif test -e \"$path\"/.git\n+\t\tthen\n+\t\t(\n+\t\t\tunset GIT_DIR\n+\t\t\tcd \"$path\"\n+\t\t\tremote=$(get_default_remote)\n+\t\t\tsay \"Synchronizing submodule url for '$name'\"\n+\t\t\tgit config remote.\"$remote\".url \"$url\"\n+\t\t)\n+\t\tfi\n+\tdone\n+}\n \n # This loop parses the command line arguments to find the\n # subcommand name to dispatch.  Parsing of the subcommand specific\n@@ -611,7 +655,7 @@ cmd_status()\n while test $# != 0 && test -z \"$command\"\n do\n \tcase \"$1\" in\n-\tadd | foreach | init | update | status | summary)\n+\tadd | foreach | init | update | status | summary | sync)\n \t\tcommand=$1\n \t\t;;\n \t-q|--quiet)\n-- \n1.6.0.106.gd6096\n"},{"id":"88399","messageId":"48B1D2CC.7000200@gmail.com","threadId":"15192","inReplyTo":"7vwsi6meas.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] git-submodule: add \"sync\" command","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-08-24T21:29:48Z","receivedAt":"2008-08-24T21:29:48Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Junio C Hamano wrote:\n> I am not sure about the way you determine $remote.  When the HEAD in the\n> submodule repository is detached by prior \"git submodule update\", this\n> will fall back to the default \"origin\" --- is it a good behaviour?\n>\n> This is not an objection; I am merely wondering if that fallback is\n> sensible, or if people who are interested in submodules can suggest better\n> alternatives.\n>\n>   \nI think it makes sense to split submodules into two categories, name \nthem what you will, but the discernible difference is whether they are \ndefined using relative or absolute urls.\n\n1) relative url - this should *always* fetch / pull from a url relative \nto the superproject's url. Overriding not possible (except by recording \nan absolute url). The idea is these submodules are closely related to \nthe superproject, and the use of a relative url is a positive \ndeclaration that \"I will maintain this 'forest' of git trees as a unit\".\n2) absolute url - use .gitmodules entry as the initial hint, allow \noverrides in .git/config, such a submodule is maintained separately.\n\nIf we could reach some such agreement as above, we might begin to make \nsome progress on what role the porcelain has in maintaining a 'forest' \nof git projects as a superproject and submodules.\n\nMark\n"},{"id":"88709","messageId":"20080827084302.GB1422@gmail.com","threadId":"15192","inReplyTo":"ebeb5aba6f679e1259a011bcc245bd723c6cf8d1.1219606749.git.davvid@gmail.com","subject":"Re: [PATCH v3] git-submodule: add \"sync\" command","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-08-27T08:43:03Z","receivedAt":"2008-08-27T08:43:03Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"\nHi Junio\nI'm just checking up on the status of this patch:\nhttp://thread.gmane.org/gmane.comp.version-control.git/93535/focus=93557\n\nI believe v3 addressed all of your comments from that thread.\nLet me know if there's anything else I should consider.\n\nThanks,\n\n-- \n\n\tDavid\n"},{"id":"88740","messageId":"7vabeyqrw0.fsf@gitster.siamese.dyndns.org","threadId":"15192","inReplyTo":"20080827084302.GB1422@gmail.com","subject":"Re: [PATCH v3] git-submodule: add \"sync\" command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-27T17:39:27Z","receivedAt":"2008-08-27T17:39:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> I'm just checking up on the status of this patch:\n> http://thread.gmane.org/gmane.comp.version-control.git/93535/focus=93557\n>\n> I believe v3 addressed all of your comments from that thread.\n> Let me know if there's anything else I should consider.\n\nI didn't find anything wrong in there and already have a topic for it, but\nran out of time merging it to even 'pu' last night which was not my git\nday.\n\nWill most likely appear in 'next' by the end of today, but no promises.\n"}]}