All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Miller <aaronkmiller@gmail.com>
To: Luke Diamand <luke@diamand.org>
Cc: Git Users <git@vger.kernel.org>
Subject: Re: git-p4: Clone p4 path with bidirectional integrations
Date: Tue, 20 Aug 2019 15:52:15 -0700	[thread overview]
Message-ID: <CALSvhyagGHY+JOaygd5++-GbNYskd3ys9ZQH3ha1pkeJaKQp1Q@mail.gmail.com> (raw)
In-Reply-To: <CAE5ih78UOor3XT_hDofanoGUPLD1BC2y=pCbzF-Edm2mpRvjyQ@mail.gmail.com>

Hi Luke,

> It's possible that running with "-v" might give a bit more information.

Here's the output from that. I've set git-p4.branchUser in this test
to avoid needlessly cluttering the output since I have a huge amount
of branches in my Perforce repo, but otherwise I used the exact script
which I've included later in this email:

Importing from //depot/testing/...@all into .
Reinitialized existing Git repository in
/home/amiller/Code/git-migration/repos/testing/.git/
Reading pipe: ['git', 'config', '--bool', 'git-p4.useclientspec']
Reading pipe: ['git', 'config', 'git-p4.branchUser']
Reading pipe: ['git', 'config', 'git-p4.user']
Reading pipe: ['git', 'config', 'git-p4.password']
Reading pipe: ['git', 'config', 'git-p4.port']
Reading pipe: ['git', 'config', 'git-p4.host']
Reading pipe: ['git', 'config', 'git-p4.client']
Reading pipe: ['git', 'config', '--int', 'git-p4.retries']
Reading pipe: ['git', 'config', '--int', 'git-p4.retries']
Opening pipe: ['p4', '-r', '3', '-G', 'login', '-s']
Opening pipe: p4 -r 3 -G branches -u amiller
Reading pipe: ['git', 'config', '--get-all', 'git-p4.branchList']
p4-git branches: []
initial parents: {}
Getting p4 changes for //depot/testing/...
Opening pipe: ['p4', '-r', '3', '-G', 'changes', '-m', '1']
Opening pipe: ['p4', '-r', '3', '-G', 'changes',
'//depot/testing/...@1,1048577']
Opening pipe: ['p4', '-r', '3', '-G', 'changes',
'//depot/testing/...@1048578,1206544']
Opening pipe: ['p4', '-r', '3', '-G', 'describe', '-s', '1206099']
Importing revision 1206099 (25%)Reading pipe: ['git', 'config',
'--bool', 'core.ignorecase']
branch is master

    Importing new branch testing/master
Opening pipe: ['p4', '-r', '3', '-G', 'changes',
'//depot/testing/master/...@1,1048577']
Opening pipe: ['p4', '-r', '3', '-G', 'changes',
'//depot/testing/master/...@1048578,1206098']

    Resuming with change 1206099
parent determined through known branches: staging
looking for initial parent for refs/remotes/p4/testing/master; current
parent is refs/remotes/p4/testing/staging
Creating temporary branch: refs/git-p4-tmp/1206099
commit into refs/git-p4-tmp/1206099
Reading pipe: ['git', 'config', '--bool', 'git-p4.keepEmptyCommits']
Opening pipe: ['p4', '-r', '3', '-G', '-x', '-', 'print']
//depot/testing/master/test1 --> test1 (0 MB)
checkpoint finished: progress checkpoint

Reading pipe: ['git', 'rev-list', '--reverse', '--no-merges',
'refs/remotes/p4/testing/staging']
fatal: ambiguous argument 'refs/remotes/p4/testing/staging': unknown
revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Traceback (most recent call last):
  File "/home/amiller/.bin/git-p4.py", line 4173, in <module>
    main()
  File "/home/amiller/.bin/git-p4.py", line 4167, in main
    if not cmd.run(args):
  File "/home/amiller/.bin/git-p4.py", line 3923, in run
    if not P4Sync.run(self, depotPaths):
  File "/home/amiller/.bin/git-p4.py", line 3790, in run
    self.importChanges(changes)
  File "/home/amiller/.bin/git-p4.py", line 3451, in importChanges
    blob = self.searchParent(parent, branch, tempBranch)
  File "/home/amiller/.bin/git-p4.py", line 3374, in searchParent
    "--no-merges", parent]):
  File "/home/amiller/.bin/git-p4.py", line 237, in read_pipe_lines
    die('Command failed: %s' % str(c))
  File "/home/amiller/.bin/git-p4.py", line 165, in die
    raise Exception(msg)
Exception: Command failed: ['git', 'rev-list', '--reverse',
'--no-merges', 'refs/remotes/p4/testing/staging']


> Can you write a test case, or even just a shell script, that might
> help figure out what's going on.

No problem:

#!/bin/bash

# perforce setup - assumes PWD is mapped to //depot/...
mkdir -p testing/master
touch testing/master/test1
p4 add testing/master/test1
p4 submit -d 'test changelist 1'

p4 integrate //depot/testing/master/... //depot/testing/staging/...
p4 submit -d 'test changelist 2'

touch testing/staging/test2
p4 add testing/staging/test2
p4 submit -d 'test changelist 3'

p4 integrate //depot/testing/staging/... //depot/testing/master/...
p4 submit -d 'test changelist 4'

# clone with git-p4:
git init p4_git_test
cd p4_git_test
git config git-p4.branchList master:staging
git config --add git-p4.branchList staging:master
git p4 clone //depot/testing/...@all --detect-branches --verbose .


Thanks,
Aaron

  reply	other threads:[~2019-08-20 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 17:29 git-p4: Clone p4 path with bidirectional integrations Aaron Miller
2019-08-19 20:23 ` Luke Diamand
2019-08-20 22:52   ` Aaron Miller [this message]
2019-08-20  2:14 ` Andrey
2019-08-20 23:45   ` Aaron Miller
2019-08-23  3:06     ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALSvhyagGHY+JOaygd5++-GbNYskd3ys9ZQH3ha1pkeJaKQp1Q@mail.gmail.com \
    --to=aaronkmiller@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=luke@diamand.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.