On Thu, 2014-11-20 at 09:13 -0800, Junio C Hamano wrote:
Paul Smith p...@mad-scientist.net writes:
+# don't recreate a workdir over an existing directory, unless it's empty
+if test -d $new_workdir
then
- die destination directory '$new_workdir' already exists.
+ if test $(ls -a1
Paul Smith p...@mad-scientist.net writes:
Why these changes? I thought you are making sure $cleandir is
absolute so that you do not have to do this and can just cd into
the new working tree, the same way the user would do once it is set
up.
I made cleandir absolute mainly because you asked
On Wed, 2014-11-19 at 09:32 -0800, Junio C Hamano wrote:
Paul Smith p...@mad-scientist.net 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
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 p...@mad-scientist.net
---
contrib/workdir/git-new-workdir | 54 +++--
1 file changed, 36
Paul Smith p...@mad-scientist.net 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 p...@mad-scientist.net
---
contrib/workdir/git-new-workdir | 54
Paul Smith p...@mad-scientist.net 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 p...@mad-scientist.net
---
Getting rid of ls/wc was not as simple as I'd hoped, due to
Junio C Hamano gits...@pobox.com writes:
Paul Smith p...@mad-scientist.net writes:
No need to resend only to correct the above, even though there may
be comments on the patch itself from me or others that may make you
want to reroll this patch, in which case I'd like to see these nits
gone.
Paul Smith p...@mad-scientist.net writes:
+ if test $(ls -a1 $new_workdir/. | wc -l) -ne 2
I wonder if this check is portable for all platforms we care about,
but that is OK, as it should be so for the ones I think of and care
about ;-)
Do you mean . and .. representing an empty
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 p...@mad-scientist.net
---
Getting rid of ls/wc was not as simple as I'd hoped, due to glob
pathname expansion (can't rely on nullglob
Paul Smith p...@mad-scientist.net writes:
Getting rid of ls/wc was not as simple as I'd hoped,
I didn't say ls/wc was not portable. Assuming that a directory for
which the output from ls -a has two entries is empty may be.
--
To unsubscribe from this list: send the line unsubscribe git in
the
On Tue, 2014-11-18 at 12:15 -0800, Junio C Hamano wrote:
Paul Smith p...@mad-scientist.net writes:
Getting rid of ls/wc was not as simple as I'd hoped,
I didn't say ls/wc was not portable. Assuming that a directory for
which the output from ls -a has two entries is empty may be.
Yes, I
Paul Smith p...@mad-scientist.net writes:
I can't find a clear statement that both are required and that ls -a
must show them. I've used a wide range of UNIX-en and filesystems for
30 years or so and never seen one that didn't provide them. It seems
like it would break quite a few scripts,
On Tue, 2014-11-18 at 12:58 -0800, Junio C Hamano wrote:
Doesn't the description of the -A option I quoted upthread hint a
simpler and clearer solution? I.e. test $(ls -A | wc -l) = 0?
Yes, but unfortunately for us the -A flag was added to POSIX Issue 7.
It's not present in the previous
OK, thanks for digging. Let's go with this version, then.
On Tue, Nov 18, 2014 at 2:25 PM, Paul Smith p...@mad-scientist.net wrote:
On Tue, 2014-11-18 at 12:58 -0800, Junio C Hamano wrote:
Doesn't the description of the -A option I quoted upthread hint a
simpler and clearer solution? I.e.
On Tue, 2014-11-18 at 14:51 -0800, Junio C Hamano wrote:
OK, thanks for digging. Let's go with this version, then.
Thanks for your attention, Junio!
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at
Paul Smith p...@mad-scientist.net writes:
From 545c0d526eaa41f9306b567275a7d53799987482 Mon Sep 17 00:00:00 2001
From: Paul Smith p...@mad-scientist.net
Date: Fri, 14 Nov 2014 17:11:19 -0500
Subject: [PATCH] git-new-workdir: Don't fail if the target directory is empty
Please do not paste
From 545c0d526eaa41f9306b567275a7d53799987482 Mon Sep 17 00:00:00 2001
From: Paul Smith p...@mad-scientist.net
Date: Fri, 14 Nov 2014 17:11:19 -0500
Subject: [PATCH] git-new-workdir: Don't fail if the target directory is empty
Also provide more error checking and clean up on failure.
Signed-off
17 matches
Mail list logo