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