From: Eric Sunshine <sunshine@sunshineco.com>
To: John Keeping <john@keeping.me.uk>
Cc: Git List <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>,
Jens Lehmann <Jens.Lehmann@web.de>,
Heiko Voigt <hvoigt@hvoigt.net>,
Junio C Hamano <gitster@pobox.com>,
Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH v3 2/2] submodule: drop the top-level requirement
Date: Thu, 18 Apr 2013 19:54:24 -0400 [thread overview]
Message-ID: <CAPig+cR7TS-sahgdZPkWkeE2Sy=GimGUVMSekgqtomWKfdiatA@mail.gmail.com> (raw)
In-Reply-To: <6e4122f3eedec3f520028b5598b78e0d59e5d12b.1366314439.git.john@keeping.me.uk>
On Thu, Apr 18, 2013 at 3:50 PM, John Keeping <john@keeping.me.uk> wrote:
> Use the new rev-parse --prefix option to process all paths given to the
> submodule command, dropping the requirement that it be run from the
> top-level of the repository.
>
> Signed-off-by: John Keeping <john@keeping.me.uk>
> ---
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index ff26535..ca0a6ab 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -212,6 +212,24 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
> test_cmp empty untracked
> '
>
> +test_expect_success 'submodule add in subdir' '
A particularly minor nit. Existing subdirectory-related tests in t7400
spell out "subdirectory" fully, so perhaps for consistency:
s/subdir/subdirectory/
> + echo "refs/heads/master" >expect &&
> + >empty &&
> +
> + mkdir addtest/sub &&
> + (
> + cd addtest/sub &&
> + git submodule add "$submodurl" ../realsubmod3 &&
> + git submodule init
> + ) &&
> +
> + rm -f heads head untracked &&
> + inspect addtest/realsubmod3 ../.. &&
> + test_cmp expect heads &&
> + test_cmp expect head &&
> + test_cmp empty untracked
> +'
> +
> test_expect_success 'setup - add an example entry to .gitmodules' '
> GIT_CONFIG=.gitmodules \
> git config submodule.example.url git://example.com/init.git
> @@ -319,6 +337,15 @@ test_expect_success 'status should be "up-to-date" after update' '
> grep "^ $rev1" list
> '
>
> +test_expect_success 'status works correctly from a subdirectory' '
Good: "subdirectory"
> + mkdir sub &&
> + (
> + cd sub &&
> + git submodule status >../list
> + ) &&
> + grep "^ $rev1" list
> +'
> +
> test_expect_success 'status should be "modified" after submodule commit' '
> (
> cd init &&
> diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
> index 30b429e..992b66b 100755
> --- a/t/t7401-submodule-summary.sh
> +++ b/t/t7401-submodule-summary.sh
> @@ -45,6 +45,20 @@ EOF
> test_cmp expected actual
> "
>
> +test_expect_success 'run summary from subdir' '
t7401 does not have any existing subdirectory-related tests, but for
consistency with t7400, perhaps: s/subdir/subdirectory/
> + mkdir sub &&
> + (
> + cd sub &&
> + git submodule summary >../actual
> + ) &&
> + cat >expected <<-EOF &&
> +* ../sm1 0000000...$head1 (2):
> + > Add foo2
> +
> +EOF
> + test_cmp expected actual
> +'
> +
> commit_file sm1 &&
> head2=$(add_file sm1 foo3)
prev parent reply other threads:[~2013-04-18 23:54 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-07 19:55 [RFC/PATCH 0/2] submodule: drop the top-level requirement John Keeping
2013-04-07 19:55 ` [PATCH 1/2] rev-parse: add --filename-prefix option John Keeping
2013-04-07 22:14 ` Jonathan Nieder
2013-04-08 8:31 ` John Keeping
2013-04-08 15:07 ` Junio C Hamano
2013-04-08 17:36 ` John Keeping
2013-04-08 18:11 ` Junio C Hamano
2013-04-07 19:55 ` [PATCH 2/2] submodule: drop the top-level requirement John Keeping
2013-04-07 20:15 ` [RFC/PATCH 0/2] " Jens Lehmann
2013-04-09 20:29 ` [PATCH v2 " John Keeping
2013-04-09 20:29 ` [PATCH v2 1/2] rev-parse: add --filename-prefix option John Keeping
2013-04-09 20:57 ` Junio C Hamano
2013-04-09 21:28 ` John Keeping
2013-04-09 21:33 ` Junio C Hamano
2013-04-18 14:28 ` Ramkumar Ramachandra
2013-04-18 14:42 ` John Keeping
2013-04-09 20:29 ` [PATCH v2 2/2] submodule: drop the top-level requirement John Keeping
2013-04-09 21:00 ` Junio C Hamano
2013-04-09 21:29 ` John Keeping
2013-04-18 14:46 ` Ramkumar Ramachandra
2013-04-18 14:56 ` John Keeping
2013-04-18 19:50 ` [PATCH v3 0/2] " John Keeping
2013-04-18 19:50 ` [PATCH v3 1/2] rev-parse: add --prefix option John Keeping
2013-04-19 9:53 ` Ramkumar Ramachandra
2013-04-19 10:22 ` John Keeping
2013-04-19 11:15 ` Ramkumar Ramachandra
2013-04-19 11:25 ` John Keeping
2013-04-19 11:29 ` Ramkumar Ramachandra
2013-04-18 19:50 ` [PATCH v3 2/2] submodule: drop the top-level requirement John Keeping
2013-04-18 22:40 ` Junio C Hamano
2013-04-19 7:46 ` John Keeping
2013-04-19 16:45 ` Junio C Hamano
2013-04-19 19:23 ` Johannes Sixt
2013-04-19 21:03 ` Junio C Hamano
2013-04-24 8:15 ` [PATCH] submodule: fix quoting in relative_path() John Keeping
2013-04-24 16:21 ` Junio C Hamano
2013-04-24 16:28 ` John Keeping
2013-04-24 19:12 ` Johannes Sixt
2013-04-18 23:54 ` Eric Sunshine [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPig+cR7TS-sahgdZPkWkeE2Sy=GimGUVMSekgqtomWKfdiatA@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=Jens.Lehmann@web.de \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=john@keeping.me.uk \
--cc=jrnieder@gmail.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 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 NNTP newsgroup(s).