From: Paul Smith Date: Thu, 20 Nov 2014 15:41:37 GMT Subject: Re: [PATCH] git-new-workdir: Don't fail if the target directory is empty Message-ID: <1416498097.23953.5.camel@mad-scientist.net> In-Reply-To: On Wed, 2014-11-19 at 09:32 -0800, Junio C Hamano wrote: > Paul Smith writes: > I took a look at this again, and I do not agree with one design > decision it makes, namely: > > >> I split the creation of the directories from the symlinks: see the new > >> loop above. This allows us to avoid the icky dirname stuff. > > which forces those who maintain the script to make sure that these > two loops > kept consistent with each other. If you forget to add frotz to the > upper loop when adding frotz/nitfol to the latter, you are breaking > it. Yes, but this mistake won't live past even a single attempt to run the script, since it will immediately cause a fatal error. So this doesn't bother me. > I find it much more icky than computing what is necessary on the fly. OK, I'll go back to the previous way. > Aversion to turning $cleandir to an absolute path? Why? In some situations switching to absolute can cause unexpected behaviors, where relative paths are no longer where you expect them etc. However in this case it's not a problem: I'll change it. > These uses of --git-dir/--work-tree look somewhat funny. You want > to say "I want to run checkout in that $new_workdir", so say it in a > more direct way, i.e. > > git -C "$new_workdir" checkout -f "$branch" Good idea.