Re: Intricacies of submodules

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

 



On Thu, Apr 10, 2008 at 1:53 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>  The original discussion that led to the current implementation dates back
>  in May-June timeframe of 2007.  I would not be surprised if not all of the
>  good ideas were incorporated in the current implementation.  For example,
>  one thing that we may want to do is to record what contents we've seen in
>  the .gitmodules file in order to prime each entry in .git/config, so that
>  we can give users a chance to adjust what is in .git/config when we notice
>  the entry in .gitmodules has changed.
>
>  For example, consider that .gitmodules said the submodule should be taken
>  from repository URL git://A.xz/project.git when you cloned.  You may have
>  used the given URL as-is to prime your .git/config, or you may have chosen
>  to use http://A.xz/project.git/ for networking reasons.
>
>  After working with the project for a while (i.e. you pull and perhaps push
>  back or send patches upstream), .gitmodules file changes and it now says
>  the repository resides at host B.xz because the project relocated.  You
>  would want the next "git submodule update" to notice that your .git/config
>  records a URL you derived from git://A.xz/project.git/, and that you have
>  not seen this new URL git://B.xz/project.git/, and give you a chance to
>  make adjustments if needed.

I think this should be done if "git submodule update" fails. The
reason it fails may be different, such as newest commits not pushed
out and the subproject relocated etc. So it can only given some hints
with "maybe".

However, how to detect the url has changed in .gitmodules? Compare the
latest two version of .gitmodules?

And if only the protocol or domain changes of the submodule between
$GIT_CONFIG/config and .gitmodules, i think the
"url.<usethis>.insteadof = <otherurl>" form introduced in v1.5.5 is
more helpful.

>
>  After that happens, if you seeked to an old version (perhaps you wanted to
>  work on an old bug), .gitmodules file that is checked out of that old
>  version may say the "upstream" is at A.xz, but the entry in .git/config
>  may already be based on B.xz.  But because you have already seen this old
>  URL in .gitmodules, you may not want to get asked about adjusting the
>  entry in .git/config merely because you checked out an old version.  What
>  this means is that it is not enough to just record "What the current URL
>  you chose to use is" in .git/config (which is obvious), and it is also not
>  enough to record "what URL .gitmodules had when you made that choice", but
>  you would also need to record "What URLs you have _seen_ when making that
>  choice".
>

When bug happens, i only care the commit in the index of submodule and
wheter i can check out the old submodule commit. However, does it
really matter that what the url of the submodule is?


-- 
Ping Yin
--
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]

  Powered by Linux