From: Junio C Hamano <gitster@pobox.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Git Mailing List <git@vger.kernel.org>, Heiko Voigt <hvoigt@hvoigt.net>
Subject: Re: [RFC PATCH 1/2] test that git status works with merge conflict in .gitmodules
Date: Thu, 12 May 2011 22:47:09 -0700 [thread overview]
Message-ID: <7v1v03b19e.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4DCC4AE0.6020902@web.de> (Jens Lehmann's message of "Thu, 12 May 2011 23:02:24 +0200")
Jens Lehmann <Jens.Lehmann@web.de> writes:
> From: Heiko Voigt <hvoigt@hvoigt.net>
>
> For example: Two users independently adding a submodule will result in a
> merge conflict in .gitmodules. Since configuration of the status and
> diff machinery depends on the file being parseable they currently
> fail to produce useable output in case .gitmodules is marked with a
> merge conflict.
>
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
The basic idea (both patches) seems sound.
> diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
> index c8d50a6..3b1806c 100755
> --- a/t/t7506-status-submodule.sh
> +++ b/t/t7506-status-submodule.sh
> @@ -4,17 +4,21 @@ test_description='git status for submodule'
>
> . ./test-lib.sh
>
> -test_expect_success 'setup' '
> - test_create_repo sub &&
> +test_create_repo_with_commit () {
> + test_create_repo $1 &&
> (
> - cd sub &&
> + cd $1 &&
Missing dq, i.e. "$1" (two instances).
> +cat > status_expect << EOF
cat >status_expect <<\EOF
Unless you actively mean the here-text has variables that need to be
substituted, always quote the end-of-here-text delimiter. That would
reduce the mental burden of people who have to read the script, as they
do not have to look for a potential substitution that does not exist.
> +# On branch merge_conflict_gitmodules
> +# Changes to be committed:
> +#
> +# new file: sub1
> +#
> +# Unmerged paths:
> +# (use "git add/rm <file>..." as appropriate to mark resolution)
> +#
> +# both added: .gitmodules
> +#
> +EOF
Is it absolutely necessary to run this test by comparing the output of
human readable version of "git status" output? It makes it impossible to
test under gettext-poison. Can you use "git status -s" output instead?
> ...
> +test_expect_failure 'diff --submodule with merge conflict in .gitmodules' '
> + (
> + cd super &&
> + git diff --submodule > ../diff_submodule_actual 2>&1
> + ) &&
> + test_cmp diff_submodule_actual diff_submodule_expect
> +'
You have too many ">" redirect followed by an unnecessary SP. There are
existing examples in the test, please do not make things worse.
next prev parent reply other threads:[~2011-05-13 5:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 21:01 [RFC PATCH 0/2] better handle .gitmodules merge conflicts Jens Lehmann
2011-05-12 21:02 ` [RFC PATCH 1/2] test that git status works with merge conflict in .gitmodules Jens Lehmann
2011-05-13 5:47 ` Junio C Hamano [this message]
2011-05-12 21:03 ` [RFC PATCH 2/2] Submodules: Don't parse .gitmodules when it contains merge conflicts Jens Lehmann
2011-05-13 6:19 ` Junio C Hamano
2011-05-13 15:01 ` [RFC PATCH 0/2] better handle .gitmodules " Marc Branchaud
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=7v1v03b19e.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=hvoigt@hvoigt.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).