git clone --recursive should run git submodule update with flag --remote

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Consider two repositories, A and B.

Repo A is embedded into B by using submodule:

  git submodule add -b master <url-to-A> sub-a

So, submodule sub-a is set to track master branch of the repo A.

Running git submodule update --remote inside repo B will automatically
update and checkout submodule sub-a to the latest master commit (as expected).

However, when using git clone --recursive <url-to-B>, repo B will be cloned
with submodule A checkouted to the commmit which was recorded on git
submodule add command, not the master commit.

Expected behaviour is to automatically update checkout commit pointed by
branch, that was specified by -b flag in the git submodule add invocation.

Reason for this behaviour is that line:

  https://github.com/git/git/blob/master/builtin/clone.c#L99

I guess, it should be changed to include --remote flag.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]