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: "Spencer E. Olson" <olsonse@umich.edu>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
	Johannes Sixt <j.sixt@viscovery.net>,
	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:59:02 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1102171957350.14950@debian> (raw)
In-Reply-To: <201102171748.15516.olsonse@umich.edu>

On Thu, 17 Feb 2011, Spencer E. Olson wrote:

> We are not actually using the yes utility (think y\ny\ny\ny\ny\ny\n...)
> 
> As far as I understand, in this particular use, "yes" and "no" are just 
> comments.  We could also write
> : I like banannas ;;
> and
> ! : I do not like anchovies ;;

Ah, I'm sure you're right. Need to read up on that colon operator. Thanks.

> 
> On Thursday 17 February 2011 17:34, Martin von Zweigbergk wrote:
> > 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:59 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
2011-02-18  0:48       ` Spencer E. Olson
2011-02-18  0:59         ` Martin von Zweigbergk [this message]

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.1102171957350.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).