All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Sixt <j.sixt@viscovery.net>,
	Carl Worth <cworth@cworth.org>,
	Junio C Hamano <gitster@pobox.com>,
	Keith Packard <keithp@keithp.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Add test case for ls-files --with-head
Date: Wed, 03 Oct 2007 17:52:48 +0200	[thread overview]
Message-ID: <85odfgry9b.fsf@lola.goethe.zz> (raw)
In-Reply-To: <Pine.LNX.4.64.0710031634300.28395@racer.site> (Johannes Schindelin's message of "Wed\, 3 Oct 2007 16\:36\:13 +0100 \(BST\)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Wed, 3 Oct 2007, Johannes Sixt wrote:
>> 
>> seq is not universally available. Can we have that as
>> 
>> for i in 0 1 2 3 4; do
>> 	for j in 0 1 2 3 4 5 6 7 8 9; do
>> 		> sub/file-$i$j
>> 		echo file-$i$j >> expected
>> 	done
>> done
>
> Or as
>
> 	i=1
> 	while test $i -le 50
> 	do
> 		num=$(printf %04d $i)
> 		> sub/file-$num
> 		echo file-$num >> expected
> 		i=$(($i+1))
> 	done
>
> This version should be as portable,

Huh?  It uses the conceivably-not-builtin "test" (something which
_you_ picked as something to complain about in a patch of mine where
it was not used in an inner loop) on every iteration, it uses printf
and it uses $((...))  arithmetic expansion.  Whereas the proposal by
Johannes works fine even on prehistoric shell versions.  So the "as
portable" enough moniker is surely weird.

> with the benefit that it is easier to change for different start and
> end values.

Correct.  But why would we want those here?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2007-10-03 19:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03  5:44 [PATCH] Must not modify the_index.cache as it may be passed to realloc at some point Keith Packard
2007-10-03  5:55 ` Junio C Hamano
2007-10-03  7:03   ` [PATCH] Add test case for ls-files --with-head Carl Worth
2007-10-03 12:09     ` Johannes Sixt
2007-10-03 15:36       ` Johannes Schindelin
2007-10-03 15:52         ` David Kastrup [this message]
2007-10-03 16:06         ` Carl Worth
2007-10-03 16:15           ` David Kastrup
2007-10-03 20:21             ` Jeff King
2007-10-03 21:39               ` Johannes Schindelin
2007-10-03 21:47                 ` Junio C Hamano
2007-10-03 22:11                   ` Jeff King
2007-10-03 19:29           ` Junio C Hamano
2007-10-03 15:50       ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85odfgry9b.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=keithp@keithp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.