From: "Lars Hjemli" <hjemli@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH] Add basic test-script for git-submodule
Date: Wed, 30 May 2007 08:48:38 +0200 [thread overview]
Message-ID: <8c5c35580705292348q74281f7eu15b3b61f45b2c6f5@mail.gmail.com> (raw)
In-Reply-To: <7v7iqs6r6p.fsf@assigned-by-dhcp.cox.net>
On 5/29/07, Junio C Hamano <junkio@cox.net> wrote:
> Lars Hjemli <hjemli@gmail.com> writes:
>
> > +# create a submodule repository
> > +mkdir lib && cd lib
> > +git-init >/dev/null
> > +echo a >a && git-add a && git-commit -q -m "submodule commit 1"
> > +git-tag -a -m "rev-1" rev-1
> > +rev1=$(git-rev-parse HEAD)
> > +cd ..
> > +
> > +# add submodule and other files to super repo
> > +echo a >a && echo z >z
> > +git-add a lib z && git-commit -q -m "super commit 1"
> > +
> > +# move submodule to another location, register repo url in .gitmodules
> > +mv lib .subrepo
> > +GIT_CONFIG=.gitmodules git-config module.lib.url ./.subrepo
>
> We typically try to catch malfunction even while setting up the test case.
Ok
>
> > +test_expect_success 'status is "missing"' \
> > + 'git-submodule status | grep "^-$rev1"'
> > +
> > +# make sure 'init' will not overwrite a regular file
> > +touch lib
> > +test_expect_failure 'init fails when path is used by a file' \
> > + 'git-submodule init'
>
> I am guilty for introducing "expect-failure", but it is usually
> a mistake to use it unless you are testing something very trivial.
>
> For example, for this case, you would want to make sure the
> command "git-submodule init" exits with non-zero status, but
> also you would want to make sure that it does not disturb the
> existing file "lib".
Would you prefer a patch on top of this version of the test-script or
on top of the later patch which uses .git/config to store submodule
url?
--
larsh
next prev parent reply other threads:[~2007-05-30 6:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-27 20:34 [PATCH] Add basic test-script for git-submodule Lars Hjemli
2007-05-29 7:10 ` Junio C Hamano
2007-05-30 6:48 ` Lars Hjemli [this message]
2007-06-01 3:54 ` Junio C Hamano
2007-06-01 7:10 ` Lars Hjemli
2007-06-01 7:56 ` Johannes Sixt
2007-06-01 8:13 ` Lars Hjemli
2007-06-01 19:50 ` Junio C Hamano
2007-06-02 1:27 ` Lars Hjemli
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=8c5c35580705292348q74281f7eu15b3b61f45b2c6f5@mail.gmail.com \
--to=hjemli@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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.
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).