git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Horowitz <michael.horowitz@ieee.org>
To: Tor Arvid Lund <torarvid@gmail.com>
Cc: Pete Wyckoff <pw@padd.com>, git@vger.kernel.org
Subject: Re: git-p4 issue
Date: Mon, 18 Apr 2011 23:57:52 -0400	[thread overview]
Message-ID: <BANLkTinJecAsXt+5JzscFYEx_ez2q9DioQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikDDDtyJB992DFNtvgMrGvbWf=rMw@mail.gmail.com>

OK, after some digging, I think I have figured out what is going on,
but I am not sure how to fix it, at least not safely.

There seem to be several different ways of detecting branches, and I
am not exactly sure what they are all used for, or why there are so
many, but the core of the issue I am having is that in importChanges
when it calls splitFilesIntoBranches, it assumes "self.knownBranches"
has all the branches, even though it already has the branches from
"self.p4BranchesInGit".  The exact reason I don't know, but the
results is splitFilesIntoBranches returns an empty array, and so when
the code loops over it, it silently does nothing.

The first fix that would be helpful is to at least report an error if
it can't find the branches, rather than silently doing nothing.  I am
not exactly sure why it needs to look in "self.knownBranches", so I
don't know what the error should report, maybe the error should be
reported earlier?

The other issue is how "self.knownBranches" seems to be populated.  It
looks like form my code path, which decides to "Import from/to
multiple branches", it tries to detect branches by using "p4
branches".  Again, this is odd, since I can see it already has the
names of the branches from "self.p4BranchesInGit".  I am not familiar
enough with the code (and figuring out Python as I go along) to know
why.  The problem with using "p4 branches" is those aren't really
branches, they are aliases to a merge command (integrate in p4 lingo)
which stores the from and to branch.  The branch in Perforce is really
just a directory.  Interestingly enough, it seems this logic also
attempts to detect new branches and automatically import them, but
ironically this doesn't actually work for me.

So, the crux of the problem is that "p4 branches" are not necessary to
have at all.  The reason this suddenly stopped working for me is that
someone had created one of these branch definitions and I didn't know,
so it was accidentally working all this time, but only for 2 of the
branches.  Then the person removed the definition, and it stopped
working.  Now the workaround is to go and create these things for
every branch, but considering these are unnecessary and cumbersome to
create, and the code seems to be able to find the branches already
from the "self.p4BranchesInGit" anyway, I would like to remove the
dependency on that logic.

Now, I could go ahead and hack something that does things differently,
but since I don't really know the intention of these structures or how
it might impact elsewhere in the code, I could use some guidance from
someone who knows this code well.

Thanks,

Mike




On Fri, Apr 15, 2011 at 4:39 PM, Michael Horowitz
<michael.horowitz@ieee.org> wrote:
> I am sure that is a common mistake people make, but not in this case.
> I have been using it successfully for a while now, it just suddenly
> stopped working, not sure what changed.  I am not seeing anything on
> remotes/p4/master either, and I was originally doing rebase and went
> back to sync so I could run "--verbose" and see if it was even
> downloading those changes.  I can clearly see it says it is
> downloading them, but then they just don't end up in git.
>
> Since I don't see an error message about it failing to sync, I am at a
> loss to figure out why it says it succeeded, but it didn't.  Could
> there be one step in the code that is not catching an error condition?
>  I am not all that familiar with Python, but if someone could point me
> where to put some debug messages, I can do some testing.
>
> Thanks,
>
> Mike
>
>
>
> On Fri, Apr 15, 2011 at 4:22 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:
>>
>> On Fri, Apr 15, 2011 at 5:00 AM, Michael Horowitz
>> <michael.horowitz@ieee.org> wrote:
>> > Pete,
>> >
>> > I was hoping you could help me out again.  After using git-p4 for a
>> > while without a problem, it has suddenly stopped working for me.  I am
>> > using the latest master.  I haven't seen any recent changes that I
>> > think could have caused this, but maybe you'll have some insight.
>> >
>> > The issue is that when I do a git-p4 sync on my existing repository,
>> > it reports success, but seems to do nothing.  It does not download the
>> > latest changes from p4.  If I delete my repository and start over, it
>> > will download all the latest changes, even the ones it was not
>> > downloading previously, but if I try to sync again later, it does not
>> > do anything.  I tried running it with the "--verbose" mode, and I see
>> > it says it is loading each of the changes, but they are not ending up
>> > in the git repository, and it is not reporting any errors.
>>
>> Hi, Michael.
>>
>> Is it possible that you expect that 'git p4 sync' should update your
>> working branch and/or working tree? Assuming a simple clone with a
>> local master branch, running 'git-p4 sync' will update the branch
>> remotes/p4/master, but it won't do anything on my working master
>> branch...
>>
>> Maybe you want to call 'git rebase p4/master' afterwards, or use the
>> shorthand 'git p4 rebase' to do a sync+rebase.
>>
>> Regards,
>> Tor Arvid.
>>
>> > Any ideas of what this could be?  Is there anything else I can run to
>> > help debug this?
>> >
>> > Thanks,
>> >
>> > Mike
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe git" in
>> > the body of a message to majordomo@vger.kernel.org
>> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> >
>

  parent reply	other threads:[~2011-04-19  3:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15  3:00 git-p4 issue Michael Horowitz
2011-04-15 20:22 ` Tor Arvid Lund
2011-04-15 20:39   ` Michael Horowitz
2011-04-16 16:01     ` Pete Wyckoff
2011-04-18 12:59       ` Vitor Antunes
2011-04-19  3:57     ` Michael Horowitz [this message]
2011-04-19  9:59       ` Vitor Antunes
2011-04-20  0:31       ` Pete Wyckoff
2011-04-20  2:40         ` Michael Horowitz
2011-04-20 10:51           ` Vitor Antunes
2011-05-06 20:16           ` Michael Horowitz
2011-05-13 14:31             ` Vitor Antunes
2011-12-17  5:52               ` Michael Horowitz
  -- strict thread matches above, loose matches on Subject: below --
2023-03-16 17:28 Brent
     [not found] <AANLkTikXHJqmzZDv6NhujHqjUFva-uCRB3td306vi=WX@mail.gmail.com>
     [not found] ` <AANLkTi=b60kqd6fRXzf39BBepLOeA3ts6EN3AuY0iAp4@mail.gmail.com>
2011-02-24 21:12   ` Michael Horowitz

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=BANLkTinJecAsXt+5JzscFYEx_ez2q9DioQ@mail.gmail.com \
    --to=michael.horowitz@ieee.org \
    --cc=git@vger.kernel.org \
    --cc=pw@padd.com \
    --cc=torarvid@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).