Re: [PATCH] Add platform-independent .git "symlink"
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Feb 4, 2008, 22:08 UTC
- Message-ID
- <47A78CF9.6040001@nrlssc.navy.mil>
- In-Reply-To
- <alpine.LSU.1.00.0802042128170.8543@racer.site>
Johannes Schindelin wrote:
> Hi, > > On Mon, 4 Feb 2008, Brandon Casey wrote:
> In my local version of git, you can say "git > branch --new-workdir=../bla new-branch [branch-point]".
Ah, I see, you are creating a new branch too.
>> Have you thought about using git-clone instead? > > Briefly. But this is not about cloning the repository. It is about > having an additional working directory for the current repository.
I think that is true at the low level, but from a high level it feels similar to me.
After your "git branch --new-workdir=..." you have something that acts exactly like a full-fledged repository. It is very much dependent on the original repo, similarly to how a --shared repo is, and it now has new semantics in that operations within the new repo have an effect in the original repo (and vice-versa). Making new repositories from existing repositories is what git-clone does.
git-branch: makes new branches, or generally handles modifying branches. git-checkout: modifies the contents of the working directory. git-clone: makes new repositories from existing repositories.
Also, of the three, git-clone is the only one allowed to operate outside of the repo. The other two are required to be called from within a repo (or have GIT_DIR set), and currently only modify data within that repo. So, allowing them to have an effect outside of the repo would extend their current scope of operation.
Show 6 quoted lines
>> It seems a good fit but would require a new option to specify a branch >> to checkout (which I believe is a requested feature for clone). > > It is an often-requested feature for clone, but we have "clone -n" for > now, and nobody seemed to care deeply enough to actually do something > about it.
I'll probably do it if it is not beyond me.
> I _want_ the original > repository to know that there is another working directory.
Yes, your ideas are much better than simply adding the functionality of the git-new-workdir script (which is what I was planning on doing btw :)
-brandon