git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Heiko Voigt <hvoigt@hvoigt.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	Jens Lehmann <jens.lehmann@web.de>,
	Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>
Subject: Re: [PATCH 2/5] implement submodule config cache for lookup of submodule names
Date: Sun, 8 Jun 2014 05:04:44 -0400	[thread overview]
Message-ID: <CAPig+cTmXu09QLca4W=VpUS82m0uDSQLch7Gb06U_XeUZ83FrQ@mail.gmail.com> (raw)
In-Reply-To: <20140605060750.GC23874@sandbox-ub>

On Thu, Jun 5, 2014 at 2:07 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> This submodule configuration cache allows us to lazily read .gitmodules
> configurations by commit into a runtime cache which can then be used to
> easily lookup values from it. Currently only the values for path or name
> are stored but it can be extended for any value needed.
>
> [...]
>
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
> ---
> diff --git a/t/t7410-submodule-config.sh b/t/t7410-submodule-config.sh
> new file mode 100755
> index 0000000..ea453c5
> --- /dev/null
> +++ b/t/t7410-submodule-config.sh
> @@ -0,0 +1,73 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2014 Heiko Voigt
> +#
> +
> +test_description='Test submodules config cache infrastructure
> +
> +This test verifies that parsing .gitmodules configuration directly
> +from the database works.
> +'
> +
> +TEST_NO_CREATE_REPO=1
> +. ./test-lib.sh
> +
> +test_expect_success 'submodule config cache setup' '
> +       mkdir submodule &&
> +       (cd submodule &&
> +               git init

Broken &&-chain.

> +               echo a >a &&
> +               git add . &&
> +               git commit -ma
> +       ) &&
> +       mkdir super &&
> +       (cd super &&
> +               git init &&
> +               git submodule add ../submodule &&
> +               git submodule add ../submodule a &&
> +               git commit -m "add as submodule and as a" &&
> +               git mv a b &&
> +               git commit -m "move a to b"
> +       )
> +'
> +
> +cat >super/expect <<EOF
> +Submodule name: 'a' for path 'a'
> +Submodule name: 'a' for path 'b'
> +Submodule name: 'submodule' for path 'submodule'
> +Submodule name: 'submodule' for path 'submodule'
> +EOF
> +
> +test_expect_success 'test parsing of submodule config' '
> +       (cd super &&
> +               test-submodule-config \
> +                       HEAD^ a \
> +                       HEAD b \
> +                       HEAD^ submodule \
> +                       HEAD submodule \
> +                               >actual &&
> +               test_cmp expect actual
> +       )
> +'
> +
> +cat >super/expect_error <<EOF
> +Submodule name: 'a' for path 'b'
> +Submodule name: 'submodule' for path 'submodule'
> +EOF
> +
> +test_expect_success 'error in one submodule config lets continue' '
> +       (cd super &&
> +               cp .gitmodules .gitmodules.bak &&
> +               echo "  value = \"" >>.gitmodules &&
> +               git add .gitmodules &&
> +               mv .gitmodules.bak .gitmodules &&
> +               git commit -m "add error" &&
> +               test-submodule-config \
> +                       HEAD b \
> +                       HEAD submodule \
> +                               >actual &&
> +               test_cmp expect_error actual
> +       )
> +'
> +
> +test_done

  parent reply	other threads:[~2014-06-08  9:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  6:04 [PATCH 0/5] submodule config lookup API Heiko Voigt
2014-06-05  6:06 ` [PATCH 1/5] hashmap: add enum for hashmap free_entries option Heiko Voigt
2014-06-06 17:52   ` Karsten Blees
2014-06-10 10:17     ` Heiko Voigt
2014-06-11  9:12       ` Karsten Blees
2014-06-12 19:12         ` Junio C Hamano
2014-06-17  8:30           ` Karsten Blees
2014-06-17 19:04             ` Heiko Voigt
2014-06-17 22:19               ` Junio C Hamano
2014-06-05  6:07 ` [PATCH 2/5] implement submodule config cache for lookup of submodule names Heiko Voigt
2014-06-05 17:46   ` W. Trevor King
2014-06-06  5:20     ` Heiko Voigt
2014-06-08  9:04   ` Eric Sunshine [this message]
2014-06-10 10:19     ` Heiko Voigt
2014-06-12 21:58   ` Junio C Hamano
2014-06-13 22:37     ` Heiko Voigt
2014-06-05  6:08 ` [PATCH 3/5] extract functions for submodule config set and lookup Heiko Voigt
2014-06-05  6:09 ` [PATCH 4/5] use new config API for worktree configurations of submodules Heiko Voigt
2014-06-05  6:09 ` [PATCH 5/5] do not die on error of parsing fetchrecursesubmodules option Heiko Voigt
2014-06-12 21:59 ` [PATCH 0/5] submodule config lookup API Junio C Hamano
2014-06-13 22:41   ` Heiko Voigt
2014-06-16 17:58     ` Junio C Hamano
2014-06-17 19:00       ` Heiko Voigt
2014-06-12 22:04 ` Junio C Hamano
2014-06-13  7:13   ` Jens Lehmann
2014-06-13 17:50     ` Junio C Hamano

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='CAPig+cTmXu09QLca4W=VpUS82m0uDSQLch7Gb06U_XeUZ83FrQ@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=jens.lehmann@web.de \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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).