Re: [PATCH] Add platform-independent .git "symlink"

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

 



Hi,

BTW just to tell you why I am so excited with your patch: I have a patch 
to git-branch in my tree, which implements the git-new-workdir 
functionality (it's a patch to git-branch, not git-checkout, mainly 
because git-checkout is no builtin yet).

Now, git-new-workdir works by having symlinks _in_ .git/, but not for 
everything.  .git/HEAD is specific to the workdir, of course.

But your patch made me realise that this is the wrong way to go about it.  
Sure, you do not need to change core git, and can use a script to make the 
new working directory.  But there is no lock preventing the same ref being 
checked out twice.

Howver, having .git a file pointing to another git directory allows you to 
have locks there.  And they can be actually pretty sensible locks, like

	.git/HEAD.<mangled-path>

actually containing the symbolic ref describing which branch we're on in 
that working directory.  Likewise, .git/index.<mangled-path> needs to hold 
the current index.

Of course, for this to work, you need to use different HEADs and indexes 
only if .git was a file originally.

BTW <mangled-path> could be a hash of the path, and for convenience, we 
could store the path in .git/workdir.<mangled-path>.

Food for thought.

Ciao,
Dscho

-
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