Thread (18 messages) flat view 18 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH 1/2] Prefix submodule names with the path basename

From: Peter Collingbourne <hidden>
Date: 2016-06-15 22:48:33
Subsystem: the rest · Maintainer: Linus Torvalds

We should include some component of the submodule path in the submodule
name to make it possible to identify a particular submodule by its
name.  At the same time we should be conscious of the fact that the
submodule path may change.  Including the entire submodule path in
the submodule name is likely to confuse users if the path changes.
The basename is the component of the path which is least likely
to change, which is a factor in favour of its inclusion in the
submodule name.

Signed-off-by: Peter Collingbourne <redacted>
---
 git-submodule.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index f05ff4e..4f0d7df 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -120,6 +120,9 @@ gen_uid()
 {
 	path="$1"
 
+	pathbase=$(basename "$path")
+	echo -n "$pathbase"-
+
 	(
 	 echo "$path"
 	 echo $$
-- 
1.6.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help