git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule: no [--merge|--rebase] when newly cloned

From
Spencer E. Olson <olsonse@umich.edu>
Date
Feb 18, 2011, 00:48 UTC
Message-ID
<201102171748.15516.olsonse@umich.edu>
In-Reply-To
<alpine.DEB.2.00.1102171929200.14950@debian>
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 ;;

On Thursday 17 February 2011 17:34, Martin von Zweigbergk wrote:
Show 39 quoted lines
> 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
Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 8 of 9 in “submodule: no [--merge|--rebase] when newly cloned”
  1. submodule: no [--merge|--rebase] when newly clonedSpencer E. Olson, Feb 16, 2011
  2. Junio C HamanoFeb 16, 2011
  3. Jens LehmannFeb 16, 2011
  4. Junio C HamanoFeb 16, 2011
  5. Spencer E. OlsonFeb 17, 2011
  6. Johannes SixtFeb 17, 2011
  7. Martin von ZweigbergkFeb 18, 2011
  8. Spencer E. OlsonFeb 18, 2011
  9. Martin von ZweigbergkFeb 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.