Subject: Possible submodule or submodule documentation issue

From: Bill Zaumen <[email-masked]>
Date: Tue, 27 Dec 2011 11:24:19 -0800

For the 'add' command, the man page for get-submodule states

"<repository> is the URL of the new submodule’s origin repository. This
may be either an absolute URL, or (if it begins with ./ or ../), the
location relative to the superproject’s origin repository."

and

"In either case, the given URL is recorded into .gitmodules for use by
subsequent users cloning the superproject. If the URL is given relative
to the superproject’s repository, the presumption is the superproject
and submodule repositories will be kept together in the same relative
location, and only the superproject’s URL needs to be provided:
git-submodule will correctly locate the submodule using the relative URL
in .gitmodules."

Based on that documentation, I tried the following sequence of commands:

git init --bare library.git
git init --bare library-pkg.git
git clone library.git
cd library;
echo hello > hello
git add hello
git commit -m "initial"
git push origin master
cd ..
git clone library-pkg.git
echo goodbye > goodbye
git add goodbye
git submodule add ./library.git src   <FAILS>
git submodule add ../library.git src  <WORKS>
git commit -a -m "initial pkg"
git push origin master

The documentation as written suggests that the first use of 
"git submodule add" is the one that should have worked because
library.git is in the same directory as the origin repository
library-pgk.git .  I didn't try moving the two .git directories
to a server to see if the behavior is the same in that case (my
test was using the local file system).

git --version  reports 1.7.1  (current version for my linux
distribution).