Re: [PATCH 3/3] Teach "git branch" about --new-workdir
- From
Julian Phillips <julian@quantumfyre.co.uk>
- Date
- Jul 22, 2007, 21:50 UTC
- Message-ID
- <Pine.LNX.4.64.0707222234020.5382@reaper.quantumfyre.co.uk>
- In-Reply-To
- <Pine.LNX.4.64.0707222223460.14781@racer.site>
On Sun, 22 Jul 2007, Johannes Schindelin wrote:
Show 20 quoted lines
> Hi, > > On Sun, 22 Jul 2007, Julian Phillips wrote: > >> On Sun, 22 Jul 2007, Johannes Schindelin wrote: >> >>> IMHO this is a better syntax than what is in contrib/, and "git >>> branch" is probably the right place for such a thing, from a >>> user's perspective. >> >> Surely checkout would make more sense than branch? You are effectively >> checking out into a new directory ... also you may want to get an >> existing branch (certainly most of my usage of new-workdir is checking >> out existing branches, e.g. to look at - as in build and play with - an >> interesting branch that someone else has pushed out). > > My rationale here was: > > - to make sure that the user cannot check out the same branch as in the > current repo, _or some other workdir of it_, and
Since you can checkout any branch you like once you have the workdir, this is really an artificial limitation - you are protected when you create the workdir, but not after. This seems more likely to bite someone than just making them aware of the pitfalls before hand. One of the main reasons that I aimed for contrib rather than proper git originally was the ability to do bad things with realising.
If you want to have a workdir for an exisiting branch then you have to create a new one, and then switch it over. That seems like a really big usability wart to me ... certainly it would make the option pretty much useless to me. My original motivation for the new-workdir script was to give me the ability to flatten out branches from a single repo for when I'm working on multiple branches at the same time.
> - to have finer grained lock control, as well as respecting has_symlinks.
Not really sure what this means, since I am too tired to have read the actual patch - is it referring to the fact that checkout is shell rather than C? If so, surely that is not really a good justification for putting the option in the "wrong" command?
--
Julian
---
Thud. Thud. Thud. Splat.
-- (Terry Pratchett & Neil Gaiman, Good Omens)