From: "Mazo, Andrey" <amazo@checkvideo.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Cc: "Mazo, Andrey" <amazo@checkvideo.com>,
"Luke Diamand" <luke@diamand.org>,
"Eric Sunshine" <sunshine@sunshineco.com>,
"George Vanburgh" <gvanburgh@bloomberg.net>,
"Lars Schneider" <larsxschneider@gmail.com>,
"Miguel Torroja" <miguel.torroja@gmail.com>,
"Romain Merland" <merlorom@yahoo.fr>,
"Vitor Antunes" <vitor.hda@gmail.com>,
"Andrew Oakley" <aoakley@roku.com>,
"SZEDER Gábor" <szeder.dev@gmail.com>,
"Andrey Mazo" <ahippo@yandex.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v3 7/8] git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
Date: Mon, 1 Apr 2019 18:02:35 +0000 [thread overview]
Message-ID: <2bde24b7e4d51e52614aaba1d38489cdf58c1543.1554141338.git.amazo@checkvideo.com> (raw)
In-Reply-To: <cover.1554141338.git.amazo@checkvideo.com>
In preparation for a fix, add a failing test case to test that
git-p4 doesn't exclude files despite being told to
when handling multiple branches.
I.e., it should exclude //depot/branch2/file2 when run with -//depot/branch2/file2,
but doesn't do this right now.
The test is based on 'git p4 clone complex branches' test with the following changes:
* account for file3 moved from branch3 to branch4 in test 'git p4 submit to two branches in a single changelist';
* account for branch6 created in test 'git p4 clone file subset branch';
* file2 is expected to be missing from all branches due to explicit exclude.
Signed-off-by: Andrey Mazo <amazo@checkvideo.com>
---
t/t9801-git-p4-branch.sh | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 4779448b4c..7530d22de2 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -409,10 +409,50 @@ test_expect_failure 'git p4 clone file subset branch' '
test_path_is_missing file2 &&
test_path_is_missing file3
)
'
+# Check that excluded files are omitted during import
+test_expect_failure 'git p4 clone complex branches with excluded files' '
+ test_when_finished cleanup_git &&
+ test_create_repo "$git" &&
+ (
+ cd "$git" &&
+ git config git-p4.branchList branch1:branch2 &&
+ git config --add git-p4.branchList branch1:branch3 &&
+ git config --add git-p4.branchList branch1:branch4 &&
+ git config --add git-p4.branchList branch1:branch5 &&
+ git config --add git-p4.branchList branch1:branch6 &&
+ git p4 clone --dest=. --detect-branches -//depot/branch1/file2 -//depot/branch2/file2 -//depot/branch3/file2 -//depot/branch4/file2 -//depot/branch5/file2 -//depot/branch6/file2 //depot@all &&
+ git log --all --graph --decorate --stat &&
+ git reset --hard p4/depot/branch1 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_file file3 &&
+ git reset --hard p4/depot/branch2 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_missing file3 &&
+ git reset --hard p4/depot/branch3 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_missing file3 &&
+ git reset --hard p4/depot/branch4 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_file file3 &&
+ git reset --hard p4/depot/branch5 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_file file3 &&
+ git reset --hard p4/depot/branch6 &&
+ test_path_is_file file1 &&
+ test_path_is_missing file2 &&
+ test_path_is_missing file3
+ )
+'
+
# From a report in http://stackoverflow.com/questions/11893688
# where --use-client-spec caused branch prefixes not to be removed;
# every file in git appeared into a subdirectory of the branch name.
test_expect_success 'use-client-spec detect-branches setup' '
rm -rf "$cli" &&
--
2.19.2
next prev parent reply other threads:[~2019-04-01 18:02 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-04 17:34 [PATCH 0/5] git-p4: a few assorted fixes for branches, excludes Mazo, Andrey
2019-03-04 17:34 ` [PATCH 1/5] git-p4: detect/prevent infinite loop in gitCommitByP4Change() Mazo, Andrey
2019-03-04 17:34 ` [PATCH 2/5] git-p4: match branches case insensitively if configured Mazo, Andrey
2019-03-04 17:34 ` [PATCH 3/5] git-p4: don't groom exclude path list on every commit Mazo, Andrey
2019-03-04 17:34 ` [PATCH 4/5] git-p4: add failing test for "don't exclude other files with same prefix" Mazo, Andrey
2019-03-04 17:34 ` [PATCH 5/5] git-p4: don't exclude other files with same prefix Mazo, Andrey
2019-03-21 22:32 ` [PATCH v2 0/7] git-p4: a few assorted fixes for branches, excludes Mazo, Andrey
2019-03-21 22:32 ` [PATCH v2 1/7] git-p4: detect/prevent infinite loop in gitCommitByP4Change() Mazo, Andrey
2019-03-21 22:32 ` [PATCH v2 2/7] git-p4: match branches case insensitively if configured Mazo, Andrey
2019-03-23 9:15 ` Luke Diamand
2019-03-25 17:20 ` Mazo, Andrey
2019-03-21 22:32 ` [PATCH v2 3/7] git-p4: don't groom exclude path list on every commit Mazo, Andrey
2019-03-21 22:33 ` [PATCH v2 4/7] git-p4: add failing test for "don't exclude other files with same prefix" Mazo, Andrey
2019-03-21 22:33 ` [PATCH v2 5/7] git-p4: don't exclude other files with same prefix Mazo, Andrey
2019-03-21 22:33 ` [PATCH v2 6/7] git-p4: add failing test for "git-p4: respect excluded paths when detecting branches" Mazo, Andrey
2019-03-21 22:33 ` [PATCH v2 7/7] git-p4: respect excluded paths when detecting branches Mazo, Andrey
2019-03-22 19:54 ` [RFC PATCH 0/2] git-p4: "alien" branches and load changelist info from file Mazo, Andrey
2019-03-22 19:54 ` [RFC PATCH 1/2] git-p4: introduce alien branch mappings Mazo, Andrey
2019-03-23 9:08 ` Luke Diamand
2019-03-26 18:43 ` Mazo, Andrey
2019-03-27 23:08 ` [RFC PATCH 1/1] git-p4: inexact label detection Mazo, Andrey
2019-03-22 19:54 ` [RFC PATCH 2/2] git-p4: support loading changelist descriptions from files Mazo, Andrey
2019-03-23 8:44 ` Luke Diamand
2019-03-25 17:46 ` [RFC PATCH 2/2] git-p4: support loading changelist descriptions Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 0/8] git-p4: a few assorted fixes for branches, excludes Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 1/8] git-p4: detect/prevent infinite loop in gitCommitByP4Change() Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 2/8] git-p4: add failing test for "git-p4: match branches case insensitively if configured" Mazo, Andrey
2019-04-02 12:05 ` SZEDER Gábor
2019-04-02 17:13 ` Mazo, Andrey
2019-04-03 7:10 ` Junio C Hamano
2019-04-01 18:02 ` [PATCH v3 3/8] git-p4: match branches case insensitively if configured Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 4/8] git-p4: don't groom exclude path list on every commit Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 5/8] git-p4: add failing test for "don't exclude other files with same prefix" Mazo, Andrey
2019-04-01 18:02 ` [PATCH v3 6/8] git-p4: don't exclude other files with same prefix Mazo, Andrey
2019-04-01 18:02 ` Mazo, Andrey [this message]
2019-04-01 18:02 ` [PATCH v3 8/8] git-p4: respect excluded paths when detecting branches Mazo, Andrey
2019-04-01 19:54 ` [PATCH v3 0/8] git-p4: a few assorted fixes for branches, excludes Mazo, Andrey
2019-04-02 0:13 ` [RFC PATCH v2 0/2] git-p4: inexact labels and load changelist description from file Mazo, Andrey
2019-04-02 0:13 ` [RFC PATCH v2 1/2] git-p4: inexact label detection Mazo, Andrey
2019-04-02 0:13 ` [RFC PATCH v2 2/2] git-p4: support loading changelist descriptions from files Mazo, Andrey
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=2bde24b7e4d51e52614aaba1d38489cdf58c1543.1554141338.git.amazo@checkvideo.com \
--to=amazo@checkvideo.com \
--cc=ahippo@yandex.com \
--cc=aoakley@roku.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=gvanburgh@bloomberg.net \
--cc=larsxschneider@gmail.com \
--cc=luke@diamand.org \
--cc=merlorom@yahoo.fr \
--cc=miguel.torroja@gmail.com \
--cc=sunshine@sunshineco.com \
--cc=szeder.dev@gmail.com \
--cc=vitor.hda@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.
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).