Re: [PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-12-10 Thread Paul Smith
On Wed, 2014-11-26 at 15:16 -0800, Junio C Hamano wrote: > Paul Smith writes: > > > This is what happens for a file: > > > > $ rm -f foo > > > > $ touch foo > > > > $ ./src/git/contrib/workdir/git-new-workdir src/git foo master > > mkdir: cannot create directory ‘foo’: Not a directory > > unable

Re: [PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-11-28 Thread Paul Smith
On Wed, 2014-11-26 at 15:16 -0800, Junio C Hamano wrote: > > $ ./src/git/contrib/workdir/git-new-workdir src/git foo master > > mkdir: cannot create directory ‘foo’: Not a directory > > unable to create new workdir "foo"! > > ;-) That comes from mkdir || fail which is indeed sufficient. Right.

Re: [PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-11-26 Thread Junio C Hamano
Paul Smith writes: > This is what happens for a file: > > $ rm -f foo > > $ touch foo > > $ ./src/git/contrib/workdir/git-new-workdir src/git foo master > mkdir: cannot create directory ‘foo’: Not a directory > unable to create new workdir "foo"! ;-) That comes from mkdir || fail which is indee

Re: [PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-11-26 Thread Paul Smith
On Wed, 2014-11-26 at 13:55 -0800, Junio C Hamano wrote: > The comment in the original is somewhat misleading, but "test -e" > was "test -e" and not "test -d" to stop when an existing file was > given by mistake as $new_workdir, I think. I do not know what > happens in the new code in that case.

Re: [PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-11-26 Thread Junio C Hamano
Paul Smith writes: > Allow new workdirs to be created in an empty directory (similar to "git > clone"). Provide more error checking and clean up on failure. > > Signed-off-by: Paul Smith > --- > > Hopefully this doesn't contain unwanted stylistic changes. ;-) Unwanted, no, but unrelated yes.

[PATCH v4] git-new-workdir: Don't fail if the target directory is empty

2014-11-26 Thread Paul Smith
Allow new workdirs to be created in an empty directory (similar to "git clone"). Provide more error checking and clean up on failure. Signed-off-by: Paul Smith --- Hopefully this doesn't contain unwanted stylistic changes. There's a kind of gross thing about the behavior here: because we cd mu