Re: [PATCH 3/6] Add 'resolve_gitlink_ref()' helper function

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

 



On Tuesday 10 April 2007, Linus Torvalds wrote:
> 
> On Tue, 10 Apr 2007, Alex Riesen wrote:
> >
> > On 4/10/07, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > +int resolve_gitlink_ref(const char *path, const char *refname, unsigned
> > > char *result)
> > > +{
> > > +       int len = strlen(path), retval;
> > > +       char *gitdir;
> > > +
> > > +       while (len && path[len-1] == '/')
> > > +               len--;
> > > +       if (!len)
> > > +               return -1;
> > > +       gitdir = xmalloc(len + MAXREFLEN + 8);
> > > +       memcpy(gitdir, path, len);
> > > +       memcpy(gitdir + len, "/.git/", 7);
> > 
> > Can't a subproject be bare?
> 
> Not when it is checked out, no. That's what "checked out" means ;)
> 
> If a subproject is bare, it never gets resolved, because it's never 
> checked out in a superproject.
> 
> So a subproject *can* be bare, but when it's bare it is just a totally 
> regular independent git project, simply by *definition* of not being 
> checked out inside a superproject.
> 
> But hey, that was just a design decision of mine, and if people can argue 
> for it being wrong, I don't think I'm married to it ;)

It would be nice if a redirection via a "gitdir = ..." line
in .git/link of the subproject (when existing) would be possible.
This was part of the light-weight checkout proposal.

In contrast to contrib/workdir/git-new-workdir, this would allow
for (to be implemented) magic symlinks to stay intact when
moving the submodule directory around.

However, this can be added later.

Josef

PS: I wonder how long it takes to move the official KDE repository over to git ;-)
-
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]