> That will recurse any subdirectories, possibly wasting time, but since
> the point is that we expect it to be empty, that's probably OK.
One caveat involves invocations of `test_must_fail test_dir_is_empty`,
wherein we _don't_ actually expect the directory to be empty. It looks
like there might
On Mon, Aug 6, 2018 at 9:02 AM Jeff King wrote:
> On Sun, Aug 05, 2018 at 04:52:31PM -0400, Jeff King wrote:
> > Perhaps even simpler:
> >
> > test "$1" = "$(find "$1")"
>
> Actually, I guess it needs to add "-print", since IIRC that is not the
> default on some old versions of "find".
You reca
On Sun, Aug 05, 2018 at 04:52:31PM -0400, Jeff King wrote:
> On Sun, Aug 05, 2018 at 01:23:05AM -0400, Eric Sunshine wrote:
>
> > A simpler approach, without the portability concerns of -A, would be
> > to remove the "." and ".." lines from the top of the listing:
> >
> > ls -f1 "$1" | sed '
On Sun, Aug 05, 2018 at 01:23:05AM -0400, Eric Sunshine wrote:
> A simpler approach, without the portability concerns of -A, would be
> to remove the "." and ".." lines from the top of the listing:
>
> ls -f1 "$1" | sed '1,2d'
>
> If we're worried about -f not being sufficiently portable, th
William Chargin wrote:
> Jonathan Nieder wrote:
>> This subject line will appear out of context in "git shortlog" output,
>> so it's useful to pack in enough information to briefly summarize what
>> the change does.
>
> I'm happy to do so. I think that "simplify" is misleading, because this
> is a
Hi,
Junio C Hamano wrote:
> Jonathan Nieder writes:
>> but $'' is too recent of a shell feature to count on (e.g., dash doesn't
>> support it). See t/t3600-rm.sh for an example of a portable way to do
>
> Is that "too recent"? I thought it was bashism, not even in POSIX,
> but I may be mistake
Jonathan Nieder writes:
> but $'' is too recent of a shell feature to count on (e.g., dash doesn't
> support it). See t/t3600-rm.sh for an example of a portable way to do
Is that "too recent"? I thought it was bashism, not even in POSIX,
but I may be mistaken.
Quite honestly, our tests are st
Hi,
> This subject line will appear out of context in "git shortlog" output,
> so it's useful to pack in enough information to briefly summarize what
> the change does.
I'm happy to do so. I think that "simplify" is misleading, because this
is a bug fix, not a refactoring. I like your first sugge
On Sun, Aug 5, 2018 at 12:20 AM Jonathan Nieder wrote:
> William Chargin wrote:
> > test_dir_is_empty () {
> > test_path_is_dir "$1" &&
> > - if test -n "$(ls -a1 "$1" | egrep -v '^\.\.?$')"
> > + if test "$(ls -A1 "$1" | wc -c)" != 0
>
> Another portability gotcha: wc output includ
Hi,
William Chargin wrote:
> Subject: t/test-lib: make `test_dir_is_empty` more robust
This subject line will appear out of context in "git shortlog" output,
so it's useful to pack in enough information to briefly summarize what
the change does. How about something like
test_dir_is_emp
The previous behavior could incorrectly pass given a directory with a
filename containing a newline. This patch changes the implementation to
use `ls -A`, which is specified by POSIX. The output should be empty
exactly if the directory is empty.
The newly added unit test fails before this change a
11 matches
Mail list logo