[PATCH] submodule: configure submodule.<name>.path on add and init

Subsystems: the rest

DORMANTno replies

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] submodule: configure submodule.<name>.path on add and init

From: Orgad Shaneh <hidden>
Date: 2016-06-15 22:54:51

In order to read diff options for a submodule, its path must be configured
---
 git-submodule.sh |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..f97bb62 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
 			esac
 		) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
 	fi
+	git config submodule."$sm_path".path "$sm_path"
 	git config submodule."$sm_path".url "$realrepo"
 
 	git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
 				url=$(resolve_relative_url "$url") || exit
 				;;
 			esac
+			git config submodule."$name".path "$name" ||
 			git config submodule."$name".url "$url" ||
 			die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
 
-- 
1.7.10.4

Re: [PATCH] submodule: configure submodule.<name>.path on add and init

From: Orgad Shaneh <hidden>
Date: 2016-06-15 22:54:51

On Mon, Sep 24, 2012 at 9:30 PM, Orgad Shaneh [off-list ref] wrote:
quoted hunk
In order to read diff options for a submodule, its path must be configured
---
 git-submodule.sh |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..f97bb62 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
                        esac
                ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
        fi
+       git config submodule."$sm_path".path "$sm_path"
        git config submodule."$sm_path".url "$realrepo"

        git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
                                url=$(resolve_relative_url "$url") || exit
                                ;;
                        esac
+                       git config submodule."$name".path "$name" ||
                        git config submodule."$name".url "$url" ||
                        die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"

--
1.7.10.4
Oops, || should have been &&

- Orgad

Re: [PATCH] submodule: configure submodule.<name>.path on add and init

From: Jens Lehmann <hidden>
Date: 2016-06-15 22:54:51

Am 24.09.2012 21:30, schrieb Orgad Shaneh:
quoted hunk
In order to read diff options for a submodule, its path must be configured
---
 git-submodule.sh |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..f97bb62 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
 			esac
 		) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
 	fi
+	git config submodule."$sm_path".path "$sm_path"
 	git config submodule."$sm_path".url "$realrepo"
 
 	git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
 				url=$(resolve_relative_url "$url") || exit
 				;;
 			esac
+			git config submodule."$name".path "$name" ||
 			git config submodule."$name".url "$url" ||
 			die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
Nack. The path must only be configured in .gitmodules or we'll
never be able to rename the submodule directory.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help