From: Pete Wyckoff <pw@padd•com>
To: Vitor Antunes <vitor.hda@gmail•com>
Cc: git@vger•kernel.org, Luke Diamand <luke@diamand•org>
Subject: Re: [PATCH 2/2] git-p4: Verify detection of "empty" branch creation
Date: Wed, 23 May 2012 21:13:38 -0400 [thread overview]
Message-ID: <20120524011338.GB26443@padd.com> (raw)
In-Reply-To: <1337729891-27648-3-git-send-email-vitor.hda@gmail.com>
vitor.hda@gmail•com wrote on Wed, 23 May 2012 00:38 +0100:
> Current implementation of new branch parent detection works on the
> principle that the new branch is a complete integration, with no
> changes, of the original files.
> This test shows this deficiency in the particular case when the new
> branch is created from a subset of the original files.
>
> Signed-off-by: Vitor Antunes <vitor.hda@gmail•com>
> ---
> t/t9801-git-p4-branch.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 56 insertions(+), 0 deletions(-)
>
> diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
> index 89d8c59..c8e4d86 100755
> --- a/t/t9801-git-p4-branch.sh
> +++ b/t/t9801-git-p4-branch.sh
> @@ -360,6 +360,62 @@ test_expect_success 'git p4 sync changes to two branches in the same changelist'
> )
> '
>
> +# Create a branch by integrating a single file
> +test_expect_success 'git p4 file subset branch' '
> + test_when_finished cleanup_git &&
> + test_create_repo "$git" &&
Ditto; no need for git here.
> + (
> + cd "$cli" &&
> + p4 integrate //depot/branch1/file1 //depot/branch6/file1 &&
> + p4 submit -d "Integrate file1 alone from branch1 to branch6"
> + )
> +'
> +
> +# Check if git -p4 creates a new branch containing a single file,
Stray "-" -------^
> +# instead of keeping the old files from the original branch
> +test_expect_failure 'git p4 clone file subset branch' '
> + 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 &&
> + "$GITP4" clone --dest=. --detect-branches //depot@all &&
Rebase error? It fails because this should be "git p4".
> + git log --all --graph --decorate --stat &&
> + git reset --hard p4/depot/branch1 &&
> + test_path_is_file file1 &&
> + test_path_is_file file2 &&
> + test_path_is_file file3 &&
> + grep update file2 &&
> + git reset --hard p4/depot/branch2 &&
> + test_path_is_file file1 &&
> + test_path_is_file file2 &&
> + test_path_is_missing file3 &&
> + ! grep update file2 &&
> + git reset --hard p4/depot/branch3 &&
> + test_path_is_file file1 &&
> + test_path_is_file file2 &&
> + test_path_is_missing file3 &&
> + grep update file2 &&
> + git reset --hard p4/depot/branch4 &&
> + test_path_is_file file1 &&
> + test_path_is_file file2 &&
> + test_path_is_file file3 &&
> + ! grep update file2 &&
> + git reset --hard p4/depot/branch5 &&
> + test_path_is_file file1 &&
> + test_path_is_file file2 &&
> + test_path_is_file file3 &&
> + ! grep update file2 &&
> + git reset --hard p4/depot/branch6 &&
> + test_path_is_file file1 &&
> + ! test_path_is_file file2 &&
But then it fails here too because the code is indeed buggy.
Nice to have this test too, to document the problem and maybe
prod someone to fix it someday.
> + ! test_path_is_file file3
Do use "test_path_is_missing" for these non-existant file
tests, though, please.
-- Pete
> + )
> +'
> test_expect_success 'kill p4d' '
> kill_p4d
> '
> --
> 1.7.7.rc2.14.g5e044.dirty
>
prev parent reply other threads:[~2012-05-24 1:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 23:38 [PATCH 0/2] git-p4: New test cases for branch detection Vitor Antunes
2012-05-22 23:38 ` [PATCH 1/2] git-p4: Test changelists touching two branches Vitor Antunes
2012-05-24 1:08 ` Pete Wyckoff
2012-05-24 22:42 ` Vitor Antunes
2012-05-25 0:02 ` Junio C Hamano
2012-05-25 8:32 ` Vitor Antunes
2012-05-22 23:38 ` [PATCH 2/2] git-p4: Verify detection of "empty" branch creation Vitor Antunes
2012-05-24 1:13 ` Pete Wyckoff [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=20120524011338.GB26443@padd.com \
--to=pw@padd$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=luke@diamand$(echo .)org \
--cc=vitor.hda@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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