Re: git-p4 cannot use perforce client created by p4java — "Expected view key View1 missing"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 31, 2020, 18:15 UTC
- Message-ID
- <xmqqa763bigj.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAE5ih79xWfjLC48y=mSLhdG2zVR5d-XeAbJJFV2SPTew5FGf+Q@mail.gmail.com>
Luke Diamand <luke@diamand.org> writes:
Show 13 quoted lines
> On Fri, 31 Jan 2020 at 13:43, Ivan Selin <ivan.selin@toptal.com> wrote: >> >> Yes, that's exactly the way that I've tried it and it worked for me. >> Can we have that integrated into git-p4? What can I do to make it >> happen? > > A patch would be very welcome! > > See Documentation/SubmittingPatches for details, but it's likely > enough to just make the change, and then use git format-patch and git > send-email. > > Please ensure you add a "Signed-off-by" (git commit -s).
Thanks for helping. Another area a new person struggles is to propose a good commit log message. I'd expect this change to be explained something like this:
Subject: git-p4: tighten detection of view names
The current "git p4" code expects that all keys starting with
"View" are view names (i.e. "View0", "View1", etc.), but a
Perforce client created using p4java gets an extra key
"ViewDepotType", which is not something we want to be treated as
a view key. Tighten the filter of keys to accept only string "View" followed
by nothing but digits. Helped-by: Luke Diamand <luke@diamand.org>
Signed-off-by: ...Note that I am not a Perforce person, so the phrase "view names" I used in the above may totally be wrong as P4-lingo, in which case please replace them with what is acceptable by our Perforce friends ;-)
Thanks.
>> ... >> > is_view = re.compile(r'^View\d+$') >> > view_keys = [ k for k in entry.keys() if is_view.match(k) ]