git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: "Spencer E. Olson" <olsonse@umich.edu>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] submodule: no [--merge|--rebase] when newly cloned
Date: Thu, 17 Feb 2011 19:34:39 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1102171929200.14950@debian> (raw)
In-Reply-To: <4D5CC9C9.60705@viscovery.net>

On Thu, 17 Feb 2011, Johannes Sixt wrote:

> Am 2/16/2011 20:51, schrieb Junio C Hamano:
> > Here is how to write the above more concisely, efficiently and portably.
> > 
> > 	case "$2;" in
> >         *";$1;"*)
> >         	echo yes ;;
> >         *)
> >         	echo no ;;
> > 	esac
> > 
> > The trailing ';' takes care of the case where cloned_modules has only one
> > element, in which case you have ";name" in "$2".  No need for a loop.
> 
> And while you are here, you could make this:
> 
> list_contains()
> {
> 	case "$2;" in
> 	*";$1;"*)
> 		: yes ;;
> 	*)
> 		! : no ;;
> 	esac
> }
> 
> and test for the exit code of this function rather than its output at the
> call site.

According to Brandon Casey: "Some platforms (IRIX 6.5, Solaris 7) do
not provide the 'yes' utility." See 8648732 (t/test-lib.sh: provide a
shell implementation of the 'yes' utility, 2009-08-28).


/Martin

  reply	other threads:[~2011-02-18  0:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 12:46 [PATCH] submodule: no [--merge|--rebase] when newly cloned Spencer E. Olson
2011-02-16 19:51 ` Junio C Hamano
2011-02-16 20:10   ` Jens Lehmann
2011-02-16 21:41     ` Junio C Hamano
2011-02-17  0:21       ` Spencer E. Olson
2011-02-17  7:10   ` Johannes Sixt
2011-02-18  0:34     ` Martin von Zweigbergk [this message]
2011-02-18  0:48       ` Spencer E. Olson
2011-02-18  0:59         ` Martin von Zweigbergk

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1102171929200.14950@debian \
    --to=martin.von.zweigbergk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=olsonse@umich.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).