git-p4, and python2 EOL

2019-08-28 Thread Luke Diamand
We're coming up on when Python2 is end-of-lifed - we have until January 1st 2020. git-p4 uses python2, and doesn't work under python3 at all. The problem is the conversions between Python3 unicode strings and git (utf-8) and p4 (utf-8, except when it isn't). I had a go at fixing this here: http

Re: [PATCH v2 1/1] git-p4: auto-delete named temporary file

2019-08-28 Thread Luke Diamand
On Tue, 27 Aug 2019 at 23:31, Junio C Hamano wrote: > > Andrey Mazo writes: > > > From: "Philip.McGraw" > > > > Avoid double-open exceptions on Windows platform when > > calculating for lfs compressed size threshold > > (git-p4.largeFileCompressedThreshold) comparisons. > > > > Take new approach

Re: git-p4: Clone p4 path with bidirectional integrations

2019-08-19 Thread Luke Diamand
On Mon, 19 Aug 2019 at 18:30, Aaron Miller wrote: > > Hi all, > > Is it possible to `git p4 clone --detect-branches` from a Perforce > path which contains bidirectional integrations? > > I've tried a bunch of things to get this to work, but here's an > example which hopefully illustrates what I'm

Re: What's cooking in git.git (Jun 2019, #05; Wed, 19)

2019-07-11 Thread Luke Diamand
On Fri, 12 Jul 2019 at 03:20, Andrey wrote: > > 25.06.2019, 13:44, "Junio C Hamano" : > > Andrey writes: > > > >>> Thanks. When I ask "Is this ready", I am asking for opinion(s) from > >>> third-party, not self nomination ;-) > >> > >> Ah, ok, sorry. :) > >> I just haven't seen any related co

Re: [PATCH] git-p4: Allow unshelving of branched files

2019-05-21 Thread Luke Diamand
On Tue, 21 May 2019 at 23:50, Simon Williams wrote: > > When unshelving a changelist, git-p4 tries to work out the appropriate > parent commit in a given branch (default: HEAD). To do this, it looks > at the state of any pre-existing files in the target Perforce branch, > omiting files added in t

Re: [PATCH 1/2] t9822: skip tests if file names cannot be ISO-8895-1 encoded

2019-04-13 Thread Luke Diamand
On Fri, 12 Apr 2019 at 12:39, Johannes Schindelin via GitGitGadget wrote: > > From: Johannes Schindelin > > Most notably, it seems that macOS' APFS does not allow that. Did you mean in the subject "ISO-8895-1" encoded or "ISO-8859-1" encoded? It seems reasonable other than that! > > Signed-off

Re: [PATCH v2 2/7] git-p4: match branches case insensitively if configured

2019-03-23 Thread Luke Diamand
On Thu, 21 Mar 2019 at 22:32, Mazo, Andrey wrote: > > git-p4 knows how to handle case insensitivity in file paths > if core.ignorecase is set. > However, when determining a branch for a file, > it still does a case-sensitive prefix match. > This may result in some file changes to be lost on import

Re: [RFC PATCH 1/2] git-p4: introduce alien branch mappings

2019-03-23 Thread Luke Diamand
On Fri, 22 Mar 2019 at 19:54, Mazo, Andrey wrote: > > Labels in Perforce are not global, but can be placed on a particular > view/subdirectory. > This might pose difficulties when importing only parts of Perforce depot into > a git repository. > For example: > 1. Depot layout is as follows: >

Re: [RFC PATCH 2/2] git-p4: support loading changelist descriptions from files

2019-03-23 Thread Luke Diamand
On Fri, 22 Mar 2019 at 19:54, Mazo, Andrey wrote: > > Our Perforce server experienced some kind of database corruption a few years > ago. > While the file data and revision history are mostly intact, > some metadata for several changesets got lost. I think it's not unheard of for P4 databases to

Re: Occasional git p4 test failures because of stray fast-import processes

2019-02-27 Thread Luke Diamand
On Wed, 27 Feb 2019 at 09:49, SZEDER Gábor wrote: > > Hi Luke, > > I saw rare failures in test 6 'git p4 sync uninitialized repo' in > 't9800-git-p4-basic.sh' on Travis CI, because the 'cleanup_git' > function failed to do its job. The (redacted) trace looks like this: Thanks for the *very* deta

Re: [PATCHv2] git-p4: ticket expiry test: use a fake p4 to avoid use of 'sleep'

2019-02-09 Thread Luke Diamand
On Sat, 9 Feb 2019 at 18:06, Junio C Hamano wrote: > > SZEDER Gábor writes: > > > On Fri, Feb 08, 2019 at 07:02:31PM +0000, Luke Diamand wrote: > >> +# create a fake version of "p4" which returns a TicketExpiration based > >> +# on $EXPIRY, for te

Re: [PATCH] unpack-trees.c: fix writing "link" index ext with null base oid

2019-02-09 Thread Luke Diamand
update-index --no-split-index" when base_oid in > the index file is null. In this case we will not load > istate->split_index->base but we dereference it anyway and are rewarded > with a segfault. This should not happen anymore, but it's still wrong to > dereference a potenti

Re: could not freshen shared index ..../sharedindex.0000000000000000000000000000000000000000'

2019-02-09 Thread Luke Diamand
On Sat, 9 Feb 2019 at 05:01, Duy Nguyen wrote: > > On Fri, Feb 8, 2019 at 11:39 PM Luke Diamand wrote: > > > > On Fri, 8 Feb 2019 at 10:02, Duy Nguyen wrote: > > > > > > On Wed, Feb 06, 2019 at 10:25:25AM +, Luke Diamand wrote: > > > > I'

[PATCHv2] git-p4: ticket expiry test: use a fake p4 to avoid use of 'sleep'

2019-02-08 Thread Luke Diamand
From: Luke Diamand This tests for p4 ticket expiry by creating a ticket, and then waiting long enough for the ticket to nearly expire. However, this is unreliable. Instead, create a 'fake' p4 which returns expiry times under the control of the test script, and forwards other comma

Re: could not freshen shared index ..../sharedindex.0000000000000000000000000000000000000000'

2019-02-08 Thread Luke Diamand
On Fri, 8 Feb 2019 at 10:02, Duy Nguyen wrote: > > On Wed, Feb 06, 2019 at 10:25:25AM +, Luke Diamand wrote: > > I've recently started seeing a lot of this message when doing a rebase: > > > >warning: could not freshen shared index > > '/home/ldiama

Re: [PATCH 0/1] git-p4: remove ticket expiration test

2019-02-07 Thread Luke Diamand
On Thu, 7 Feb 2019 13:45:18 +0100 (STD) Johannes Schindelin wrote: > Hi Luke, > > On Wed, 6 Feb 2019, Luke Diamand wrote: > > > As per thread here, this removes the git-p4 ticket expiration > > test, since it isn't really that useful. > > > > https

Re: [PATCH 1/1] git-p4: recover from inconsistent perforce history

2019-02-07 Thread Luke Diamand
dir/file && > + rm -rf add_dir_add_file_del_file add_dir_add_file_del_dir && > + touch add_dir_add_file_del_file add_dir_add_file_del_dir && > + p4 add add_dir_add_file_del_file add_dir_add_file_del_dir && > + p4 submit -d "add conflicting" && > + > + p4 delete -k add_file_add_dir_del_file && > + p4 delete -k add_file_add_dir_del_dir/file && > + p4 delete -k add_dir_add_file_del_file && > + p4 delete -k add_dir_add_file_del_dir/file && > + p4 submit -d "delete conflicting" > + ) > +' > + > +test_expect_success 'clone with git-p4' ' > + git p4 clone --dest="$git" //depot/@all > +' > + > +test_expect_success 'check final contents' ' > + test_path_is_dir "$git/add_file_add_dir_del_file" && > + test_path_is_file "$git/add_file_add_dir_del_dir" && > + test_path_is_dir "$git/add_dir_add_file_del_file" && > + test_path_is_file "$git/add_dir_add_file_del_dir" > +' > + > +test_expect_success 'kill p4d' ' > + kill_p4d > +' > + > +test_done > -- > 2.19.2 > -- Luke Diamand

[PATCH] git-p4: remove ticket expiry test

2019-02-06 Thread Luke Diamand
r expiry results the test requires. Ideally git-p4 would look at the expiry time before starting any long operations, and cleanup gracefully if there is not enough time left. But that's quite hard to do. Signed-off-by: Luke Diamand --- t/t9833-errors.sh | 27 ---

[PATCH 0/1] git-p4: remove ticket expiration test

2019-02-06 Thread Luke Diamand
As per thread here, this removes the git-p4 ticket expiration test, since it isn't really that useful. https://marc.info/?l=git&m=154946136416003&w=2 Luke Diamand (1): git-p4: remove ticket expiry test t/t9833-errors.sh | 27 --- 1 file changed,

Re: Weird (seemingly flakey) p4 breakage in t9833

2019-02-06 Thread Luke Diamand
On Wed, 6 Feb 2019 at 11:11, SZEDER Gábor wrote: > > On Wed, Feb 06, 2019 at 11:33:21AM +0100, Johannes Schindelin wrote: > > Hi Luke, > > > > in a private Azure Pipeline (sorry...) I noticed an intermittent problem > > in the p4 tests on osx-gcc. > > > > I would point you to a public log, but the

could not freshen shared index ..../sharedindex.0000000000000000000000000000000000000000'

2019-02-06 Thread Luke Diamand
I've recently started seeing a lot of this message when doing a rebase: warning: could not freshen shared index '/home/ldiamand/git/dev_full/.git/worktrees/gcc8-take-2/sharedindex.' (There's a repo called dev_full, and I've got a worktree where I'm worki

Re: Partial clone - bad pack header?

2019-02-05 Thread Luke Diamand
On Mon, 4 Feb 2019 at 23:28, Jeff King wrote: > > On Mon, Feb 04, 2019 at 01:45:35PM +, Luke Diamand wrote: > > > I tried to do a partial clone, but it gave me a "bad pack header". Is > > there anything I can do to debug this? > > > > I did "gi

Partial clone - bad pack header?

2019-02-04 Thread Luke Diamand
I tried to do a partial clone, but it gave me a "bad pack header". Is there anything I can do to debug this? I did "git config uploadpack.allowfilter true" in my repo. Then I went to a scratch directory and did: $ git clone --filter=blob:limit=10M ssh://localhost/~/git/my_big_repo remote: Enumerat

[PATCHv3 2/2] git-p4: handle update of moved/copied files when updating a shelve

2019-01-18 Thread Luke Diamand
Perforce requires a complete list of files being operated on. If git is updating an existing shelved changelist, then any files which are moved or copied were not being added to this list. Signed-off-by: Luke Diamand Acked-by: Andrey Mazo --- git-p4.py| 2 ++ t/t9807-git-p4

[PATCHv3 1/2] git-p4: add failing test for shelved CL update involving move/copy

2019-01-18 Thread Luke Diamand
errors from Perforce such as: //depot/src - needs tofile //depot/dst Submit aborted -- fix problems then use 'p4 submit -c 1234' Signed-off-by: Luke Diamand Acked-by: Andrey Mazo --- t/t9807-git-p4-submit.sh | 57 +--- 1 file changed, 54 insert

[PATCHv3 0/2] git-p4: shelved change update with move/copy

2019-01-18 Thread Luke Diamand
This updates the patchset to support copy, as suggested by Andrey. Luke Diamand (2): git-p4: add failing test for shelved CL update involving move/copy git-p4: handle update of moved/copied files when updating a shelve git-p4.py| 2 ++ t/t9807-git-p4-submit.sh | 57

[PATCHv2 2/2] git-p4: handle update of moved files when updating a shelve

2019-01-14 Thread Luke Diamand
Perforce requires a complete list of files being operated on. If git is updating an existing shelved changelist, then any files which are moved were not being added to this list. Signed-off-by: Luke Diamand --- git-p4.py| 1 + t/t9807-git-p4-submit.sh | 2 +- 2 files changed, 2

[PATCHv2 0/2] git-p4: handle moved files when updating a P4 shelve

2019-01-14 Thread Luke Diamand
Updated as per comments from Junio, Eric. https://public-inbox.org/git/20190113135815.11286-1-l...@diamand.org/ Luke Diamand (2): git-p4: add failing test for shelved CL update involving move git-p4: handle update of moved files when updating a shelve git-p4.py| 1 + t

[PATCHv2 1/2] git-p4: add failing test for shelved CL update involving move

2019-01-14 Thread Luke Diamand
from Perforce such as: //depot/src - needs tofile //depot/dst Submit aborted -- fix problems then use 'p4 submit -c 1234' Signed-off-by: Luke Diamand --- t/t9807-git-p4-submit.sh | 51 +--- 1 file changed, 48 insertions(+), 3 deletions(-) diff

[PATCH 0/2] git-p4: handle moved files when updating a P4 shelve

2019-01-13 Thread Luke Diamand
I found this bug recently in git-p4 - updating a shelved changelist where files are being moved doesn't work. The destination of any moves needs to be added to the list of files passed to P4. Luke Diamand (2): git-p4: add failing test for shelved CL update involving move git-p4: handle u

[PATCH 2/2] git-p4: handle update of moved files when updating a shelve

2019-01-13 Thread Luke Diamand
Perforce requires a complete list of files being operated on. If git is updating an existing shelved changelist, then any files which are moved were not being added to this list. Signed-off-by: Luke Diamand --- git-p4.py| 1 + t/t9807-git-p4-submit.sh | 2 +- 2 files changed, 2

[PATCH 1/2] git-p4: add failing test for shelved CL update involving move

2019-01-13 Thread Luke Diamand
Updating a shelved P4 changelist where one or more of the files have been moved does not work. Add a test for this. Signed-off-by: Luke Diamand --- t/t9807-git-p4-submit.sh | 53 +--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/t/t9807-git

Re: [PATCH] git-p4: fix problem when p4 login is not necessary

2019-01-07 Thread Luke Diamand
On Mon, 7 Jan 2019 at 20:51, Peter Osterlund wrote: > > In a perforce setup where login is not required, communication fails > because p4_check_access does not understand the response from the p4 > client. Fixed by detecting and ignoring the "info" response. This is caused by my earlier change in

git-p4: default behavior for handling moves?

2019-01-07 Thread Luke Diamand
git-p4 can map a "git move" operation to a Perforce "move" operation. But by default this is disabled. You then end up with a P4 commit where the file is deleted, and a fresh file is created with the same contents at the new location at revision #1. Rename detection gets enabled either with the "-

Re: "git p4" fails when perforce login not needed

2019-01-07 Thread Luke Diamand
On Sun, 6 Jan 2019 at 22:48, Peter Osterlund wrote: > > Hi, > > When I use "git p4 sync" to update a git repository from a perforce depot, > the operation fails with error message: > > failure accessing depot: unknown error code info > > When I run "p4 login -s" from a shell it reports: > >

Re: [ANNOUNCE] Git Merge Contributor's Summit Jan 31, 2019, Brussels

2018-11-14 Thread Luke Diamand
On Fri, 9 Nov 2018 at 10:48, Jeff King wrote: > > On Fri, Nov 09, 2018 at 10:44:10AM +, Luca Milanesio wrote: > > > > On 9 Nov 2018, at 10:42, Jeff King wrote: > > > > > > Git Merge 2019 is happening on February 1st. There will be a > > > Contributor's Summit the day before. Here are the deta

Re: [PATCHv2 0/3] git-p4: improved unshelving - small fixes

2018-10-24 Thread Luke Diamand
On Tue, 16 Oct 2018 at 05:27, Junio C Hamano wrote: > > Luke Diamand writes: > > > This is the same as my earlier patch other than fixing the > > documentation to reflect the change to the destination branch, > > as noticed by Junio. > > Also you set up when-fi

Re: [PATCH v2 09/13] git-p4: use `test_atexit` to kill the daemon

2018-10-15 Thread Luke Diamand
On Mon, 15 Oct 2018 at 16:02, Johannes Schindelin wrote: > > Hi Luke, > > On Mon, 15 Oct 2018, Luke Diamand wrote: > > > On Mon, 15 Oct 2018 at 11:12, Johannes Schindelin via GitGitGadget > > wrote: > > > > > > From: Johannes Schindelin > > &g

[PATCHv2 2/3] git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved

2018-10-15 Thread Luke Diamand
The branch detection code looks for branches under refs/remotes/p4/... and can end up getting confused if there are unshelved changes in there as well. This happens in the function p4BranchesInGit(). Instead, put the unshelved changes into refs/remotes/p4-unshelved/. Signed-off-by: Luke Diamand

[PATCHv2 3/3] git-p4: fully support unshelving changelists

2018-10-15 Thread Luke Diamand
tas. The user might still need to use the --origin option though - there is no way for git-p4 to work out the versions of all of the other *unchanged* files in the shelve, since this information is not recorded by Perforce. Additionally this fixes handling of shelved 'move' operatio

[PATCHv2 1/3] git-p4: do not fail in verbose mode for missing 'fileSize' key

2018-10-15 Thread Luke Diamand
igned-off-by: Luke Diamand --- git-p4.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index 7fab255584..5701bad06a 100755 --- a/git-p4.py +++ b/git-p4.py @@ -2775,7 +2775,10 @@ def streamOneP4File(self, file, contents): relPath = self.stripRep

[PATCHv2 0/3] git-p4: improved unshelving - small fixes

2018-10-15 Thread Luke Diamand
This is the same as my earlier patch other than fixing the documentation to reflect the change to the destination branch, as noticed by Junio. Luke Diamand (3): git-p4: do not fail in verbose mode for missing 'fileSize' key git-p4: unshelve into refs/remotes/p4-unshelved, not re

Re: [PATCHv1 2/3] git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved

2018-10-15 Thread Luke Diamand
On Fri, 12 Oct 2018 at 19:19, Luke Diamand wrote: > > On Fri, 12 Oct 2018 at 14:45, Junio C Hamano wrote: > > > > Luke Diamand writes: > > > > > The branch detection code looks for branches under refs/remotes/p4/... > > > and can end up getting

Re: [PATCH v2 09/13] git-p4: use `test_atexit` to kill the daemon

2018-10-15 Thread Luke Diamand
On Mon, 15 Oct 2018 at 11:12, Johannes Schindelin via GitGitGadget wrote: > > From: Johannes Schindelin > > This should be more reliable than the current method, and prepares the > test suite for a consistent way to clean up before re-running the tests > with different options. > I'm finding tha

Re: [PATCHv1 2/3] git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved

2018-10-12 Thread Luke Diamand
On Fri, 12 Oct 2018 at 14:45, Junio C Hamano wrote: > > Luke Diamand writes: > > > The branch detection code looks for branches under refs/remotes/p4/... > > and can end up getting confused if there are unshelved changes in > > there as well. This happens in t

[PATCHv1 3/3] git-p4: fully support unshelving changelists

2018-10-11 Thread Luke Diamand
tas. The user might still need to use the --origin option though - there is no way for git-p4 to work out the versions of all of the other *unchanged* files in the shelve, since this information is not recorded by Perforce. Additionally this fixes handling of shelved 'move' operatio

[PATCHv1 0/3] git-p4: improved unshelving

2018-10-11 Thread Luke Diamand
being that it no longer unshelves into refs/remotes/p4/master/unshelved, but instead into refs/remotes/p4-unshelved. That's because the git-p4 branch detection gets confused by branches appearing in refs/remotes/p4. Luke Diamand (3): git-p4: do not fail in verbose mode for missing 'fi

[PATCHv1 1/3] git-p4: do not fail in verbose mode for missing 'fileSize' key

2018-10-11 Thread Luke Diamand
igned-off-by: Luke Diamand --- git-p4.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index 7fab255584..5701bad06a 100755 --- a/git-p4.py +++ b/git-p4.py @@ -2775,7 +2775,10 @@ def streamOneP4File(self, file, contents): relPath = self.stripRep

[PATCHv1 2/3] git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved

2018-10-11 Thread Luke Diamand
The branch detection code looks for branches under refs/remotes/p4/... and can end up getting confused if there are unshelved changes in there as well. This happens in the function p4BranchesInGit(). Instead, put the unshelved changes into refs/remotes/p4-unshelved/. Signed-off-by: Luke Diamand

Re: [PATCH 7/9] tests: include detailed trace logs with --write-junit-xml upon failure

2018-09-05 Thread Luke Diamand
On 5 September 2018 at 13:39, Johannes Schindelin wrote: > Hi Luke, > > On Wed, 5 Sep 2018, Luke Diamand wrote: > >> On 4 September 2018 at 12:09, Johannes Schindelin >> wrote: >> > >> > On Tue, 4 Sep 2018, Eric Sunshine wrote: >> > >>

Re: [PATCH 7/9] tests: include detailed trace logs with --write-junit-xml upon failure

2018-09-04 Thread Luke Diamand
On 4 September 2018 at 12:09, Johannes Schindelin wrote: > Hi Eric, > > On Tue, 4 Sep 2018, Eric Sunshine wrote: > >> On Mon, Sep 3, 2018 at 5:10 PM Johannes Schindelin via GitGitGadget >> wrote: >> > So let's do something different in VSTS: let's run all the tests with >> > `--quiet` first, and

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-31 Thread Luke Diamand
On 31 July 2018 at 16:40, Junio C Hamano wrote: > Luke Diamand writes: > >> I think there is an error in the test harness. >> >> On 31 July 2018 at 10:46, SZEDER Gábor wrote: >>>> + test_must_fail git-p4 submit --dry-run >errs 2>&1 &

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-31 Thread Luke Diamand
I think there is an error in the test harness. On 31 July 2018 at 10:46, SZEDER Gábor wrote: >> + test_must_fail git-p4 submit --dry-run >errs 2>&1 &&> >> + ! grep "Would apply" err It writes to the file "errs" but then looks for the message in "err". Luke

Re: [PATCH 1/1] Add the `p4-pre-submit` hook

2018-07-30 Thread Luke Diamand
On 30 July 2018 at 20:07, Junio C Hamano wrote: > Chen Bin writes: > >> The `p4-pre-submit` hook is executed before git-p4 submits code. >> If the hook exits with non-zero value, submit process not start. >> >> Signed-off-by: Chen Bin >> --- > > Luke, does this version look good to you? > Yes,

Re: [PATCH 1/1] add hook pre-p4-submit

2018-07-26 Thread Luke Diamand
On 26 July 2018 at 10:21, Eric Sunshine wrote: > On Wed, Jul 25, 2018 at 10:08 PM chen bin wrote: >> The hook does not receive any information or input from git. The >> original requirement >> comes from my colleague. He want to run unit test automatically before >> submitting code >> to remote r

Re: [PATCH 1/1] add hook pre-p4-submit

2018-07-25 Thread Luke Diamand
On 23 July 2018 at 12:27, Chen Bin wrote: > Hook pre-p4-submit is executed before git-p4 actually submits code. > If the hook exits with non-zero value, submit process will abort. Looks good to me - could you add some documentation please (Documentation/git-p4.txt). Thanks! Luke > > Signed-of

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Luke Diamand
On 26 June 2018 at 08:29, Eric Sunshine wrote: > These tests intentionally break the &&-chain to manually check the exit > code of invoked commands which they expect to fail, and invert that > local expected failure into a successful exit code for the test overall. > Such manual exit code manipula

[PATCH 5/6] git-p4: python3: use print() function

2018-06-19 Thread Luke Diamand
Replace calls to print ... with the function form, print(...), to allow use with python3 as well as python2.x. Converted using 2to3 (and some hand-editing). Signed-off-by: Luke Diamand --- git-p4.py | 248 +++--- 1 file changed, 124 insertions

[PATCH 2/6] git-p4: python3: replace dict.has_key(k) with "k in dict"

2018-06-19 Thread Luke Diamand
Python3 does not have the dict.has_key() function, so replace all such calls with "k in dict". This will still work with python2.6 and python2.7. Converted using 2to3 (plus some hand-editing) Signed-off-by: Luke Diamand --- git-

[PATCH 4/6] git-p4: python3: basestring workaround

2018-06-19 Thread Luke Diamand
In Python3, basestring no longer exists, so use this workaround. Signed-off-by: Luke Diamand --- git-p4.py | 16 1 file changed, 16 insertions(+) diff --git a/git-p4.py b/git-p4.py index 67865d14aa..f127ebce27 100755 --- a/git-p4.py +++ b/git-p4.py @@ -27,6 +27,22 @@ import

[PATCH 1/6] git-p4: python3: replace <> with !=

2018-06-19 Thread Luke Diamand
The <> string inequality operator (which doesn't seem to be even documented) no longer exists in python3. Replace with !=. This still works with python2. Signed-off-by: Luke Diamand --- git-p4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-p4.py b/git-

[PATCH 0/6] git-p4: small step towards Python3 support

2018-06-19 Thread Luke Diamand
that is quite a bit harder (but not impossible). I have some further changes to address this, but they are quite a bit more invasive, and not actually working yet. It's based very loosely on the "polystr()" suggestion from Eric on this list. It still works fine with Python2.7

[PATCH 6/6] git-p4: python3: fix octal constants

2018-06-19 Thread Luke Diamand
See PEP3127. Works fine with python2 as well. Signed-off-by: Luke Diamand --- git-p4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4.py index 714e442d7c..b449db1cc9 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1841,7 +1841,7 @@ def applyCommit(self, id

[PATCH 3/6] git-p4: python3: remove backticks

2018-06-19 Thread Luke Diamand
Backticks around a variable are a deprecated alias for repr(). This has been removed in python3, so just use the string representation instead, which is equivalent. Signed-off-by: Luke Diamand --- git-p4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-p4.py b/git-p4

Re: Re :Re: [PATCHv3 0/1] git-p4 unshelve

2018-06-18 Thread Luke Diamand
On 16 June 2018 at 10:58, merlo...@yahoo.fr wrote: > Yes Luke, my colleagues and I, we care ! Our repository is p4 (choice of the > high management, sigh...). Some of us are working natively on p4, but others > like me are working on git through git-p4. We often want to share pieces of > codes to

Re: [PATCHv3 0/1] git-p4 unshelve

2018-06-15 Thread Luke Diamand
On 15 May 2018 at 11:01, Luke Diamand wrote: > This is a git-p4 unshelve command which detects when extra > changes are going to be included, and refuses to unhshelve. > > As in my earlier unshelve change, this uses git fast-import > to do the actual delta generation, but now che

Re: [PATCHv2 0/6] git-p4: some small fixes updated

2018-06-12 Thread Luke Diamand
On 12 June 2018 at 22:53, Eric Sunshine wrote: > On Tue, Jun 12, 2018 at 5:49 PM, Luke Diamand wrote: >> Thanks. While on the subject of git-p4, I thought I should mention >> that I've been looking at getting git-p4 to work with Python3. >> >> I've got

Re: [PATCHv2 0/6] git-p4: some small fixes updated

2018-06-12 Thread Luke Diamand
On 12 June 2018 at 22:35, Junio C Hamano wrote: > Luke Diamand writes: > >> On 12 June 2018 at 18:10, Junio C Hamano wrote: >>> Luke Diamand writes: >>> >>>> This is an updated version of the set of changes I posted recently, >>>> follo

Re: [PATCHv2 0/6] git-p4: some small fixes updated

2018-06-12 Thread Luke Diamand
On 12 June 2018 at 18:10, Junio C Hamano wrote: > Luke Diamand writes: > >> This is an updated version of the set of changes I posted recently, >> following comments on the list: >> >> disable automatic sync after git-p4 submit: >> https://marc.info/?l=gi

[PATCHv2 0/6] git-p4: some small fixes updated

2018-06-08 Thread Luke Diamand
93815326&w=2 adapt the block size automatically on git-p4 submit: https://marc.info/?l=git&m=152819004315688&w=2 - Spelling corrections (Eric) - Improved comments (Eric) - Exception class hierarchy fix (Merland) - test simplification (Eric) Luke Diamand (6): git-p4: disable-rebase

[PATCHv2 6/6] git-p4: auto-size the block

2018-06-08 Thread Luke Diamand
ize, and then let it automatically drop down to a value that works without error, while still failing correctly if some other error occurs. Signed-off-by: Luke Diamand --- git-p4.py | 27 +-- t/t9818-git-p4-block.sh | 8 2 files changed, 29 insert

[PATCHv2 3/6] git-p4: better error reporting when p4 fails

2018-06-08 Thread Luke Diamand
attempted, and tries to print a meaningful error message if it fails. Signed-off-by: Luke Diamand --- git-p4.py | 55 + t/t9833-errors.sh | 78 +++ 2 files changed, 133 insertions(+) create mode 100755 t/t9833

[PATCHv2 4/6] git-p4: raise exceptions from p4CmdList based on error from p4 server

2018-06-08 Thread Luke Diamand
), P4ServerException (the server sent us an error code) and P4RequestSizeException (we requested too many rows/results from the server database). This makes the code that handles the errors a bit easier. The default behavior is unchanged; the new code is enabled with a flag. Signed-off-by: Luke

[PATCHv2 2/6] git-p4: add option to disable syncing of p4/master with p4

2018-06-08 Thread Luke Diamand
x27;t useful. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt | 8 git-p4.py| 31 --- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index 3d83842e47..f0de3b891b 100644

[PATCHv2 1/6] git-p4: disable-rebase: allow setting this via configuration

2018-06-08 Thread Luke Diamand
This just lets you set the --disable-rebase option with the git configuration options git-p4.disableRebase. If you're using this option, you probably want to set it all the time for a given repo. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt | 5 - git-p4.py

[PATCHv2 5/6] git-p4: narrow the scope of exceptions caught when parsing an int

2018-06-08 Thread Luke Diamand
The current code traps all exceptions around some code which parses an integer, and then talks to Perforce. That can result in errors from Perforce being ignored. Change the code to only catch the integer conversion exceptions. Signed-off-by: Luke Diamand --- git-p4.py | 2 +- 1 file changed

Re: [PATCHv1 1/3] git-p4: raise exceptions from p4CmdList based on error from p4 server

2018-06-08 Thread Luke Diamand
>> >>> ErrorId MsgDb::MaxResults = { ErrorOf( ES_DB, 32, >>> E_FAILED, EV_ADMIN, 1 ), "Request too large (over %maxResults%); see >>> 'p4 help maxresults'." } ;//NOTRANS >>> ErrorId MsgDb::MaxScanRows = { ErrorOf( ES_DB, 61, >>> E_FAILED, EV_ADMIN, 1 ), "Too many ro

Re: [PATCHv1 1/3] git-p4: raise exceptions from p4CmdList based on error from p4 server

2018-06-05 Thread Luke Diamand
On 5 June 2018 at 20:41, Eric Sunshine wrote: > On Tue, Jun 5, 2018 at 6:56 AM Luke Diamand wrote: >> On 5 June 2018 at 10:54, Eric Sunshine wrote: >> > On Tue, Jun 5, 2018 at 5:14 AM Luke Diamand wrote: >> >> +m = re.search('Too

Re: [PATCHv1 1/1] git-p4: better error reporting when p4 fails

2018-06-05 Thread Luke Diamand
On 5 June 2018 at 11:49, Merland Romain wrote: > >> @@ -91,6 +93,13 @@ def p4_build_cmd(cmd): >> real_cmd = ' '.join(real_cmd) + ' ' + cmd >> else: >> real_cmd += cmd >> + >> +# now check that we can actually talk to the server >> +global p4_access_checked >> +if no

Re: [PATCHv1 1/3] git-p4: raise exceptions from p4CmdList based on error from p4 server

2018-06-05 Thread Luke Diamand
On 5 June 2018 at 10:54, Eric Sunshine wrote: > On Tue, Jun 5, 2018 at 5:14 AM Luke Diamand wrote: >> This change lays some groundwork for better handling of rowcount errors >> from the server, where it fails to send us results because we requested >> too many. >&

[PATCHv1 2/3] git-p4: narrow the scope of exceptions caught when parsing an int

2018-06-05 Thread Luke Diamand
The current code traps all exceptions around some code which parses an integer, and then talks to Perforce. That can result in errors from Perforce being ignored. Change the code to only catch the integer conversion exceptions. Signed-off-by: Luke Diamand --- git-p4.py | 2 +- 1 file changed

[PATCHv1 0/3] git-p4: improvements to p4 "blocking"

2018-06-05 Thread Luke Diamand
ange ~~~ The function p4CmdList() has been taught to raise an exception when it gets an error, and in particular, to notice and report the two "too many results" errors. The code that does the blocking can now start out with a nice large block size, and then reduce it if it se

[PATCHv1 3/3] git-p4: auto-size the block

2018-06-05 Thread Luke Diamand
ize, and then let it automatically drop down to a value that works without error, while still failing correctly if some other error occurs. Signed-off-by: Luke Diamand --- git-p4.py | 26 +- t/t9818-git-p4-block.sh | 11 +++ 2 files changed, 32 insert

[PATCHv1 1/3] git-p4: raise exceptions from p4CmdList based on error from p4 server

2018-06-05 Thread Luke Diamand
), P4ServerException (the server sent us an error code) and P4RequestSizeException (we requested too many rows/results from the server database). This makes makes the code that handles the errors a bit easier. The default behavior is unchanged; the new code is enabled with a flag. Signed-off-by: Luke

[PATCHv1 0/1] git-p4: better error reporting

2018-06-05 Thread Luke Diamand
would be nice to also check for ticket expiration during long Perforce operations, but this change does not attempt to do that. Luke Diamand (1): git-p4: better error reporting when p4 fails git-p4.py | 55 + t/t9833-errors.sh | 78

[PATCHv1 1/1] git-p4: better error reporting when p4 fails

2018-06-05 Thread Luke Diamand
attempted, and tries to print a meaningful error message if it fails. Signed-off-by: Luke Diamand --- git-p4.py | 55 + t/t9833-errors.sh | 78 +++ 2 files changed, 133 insertions(+) create mode 100755 t/t9833

[PATCHv1 2/2] git-p4: add option to disable syncing of p4/master with p4

2018-06-05 Thread Luke Diamand
x27;t useful. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt | 8 git-p4.py| 31 --- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index 3d83842e47..8f6a7543fd 100644

[PATCHv1 0/2] git-p4: disable sync after submit

2018-06-05 Thread Luke Diamand
h the sync. I imagine other people with large git-p4 projects do something similar and have the same problem. This also updates Merland's recent submit-selection change so that both options can be set via configuration rather than being set on the command line. Luke Diamand (2): git-p

[PATCHv1 1/2] git-p4: disable-rebase: allow setting this via configuration

2018-06-05 Thread Luke Diamand
This just lets you set the --disable-rebase option with the git configuration options git-p4.disableRebase. If you're using this option, you probably want to set it all the time for a given repo. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt | 5 - git-p4.py

Re: What's cooking in git.git (Jun 2018, #02; Mon, 4)

2018-06-04 Thread Luke Diamand
On 4 June 2018 at 14:57, Junio C Hamano wrote: > Here are the topics that have been cooking. Commits prefixed with > '-' are only in 'pu' (proposed updates) while commits prefixed with > '+' are in 'next'. The ones marked with '.' do not appear in any of > the integration branches, but I am stil

Re: What's cooking in git.git (May 2018, #03; Wed, 23)

2018-05-24 Thread Luke Diamand
On 24 May 2018 at 01:02, Junio C Hamano wrote: > Here are the topics that have been cooking. Commits prefixed with > '-' are only in 'pu' (proposed updates) while commits prefixed with > '+' are in 'next'. The ones marked with '.' do not appear in any of > the integration branches, but I am stil

[PATCHv6 0/1] git-p4: unshelve

2018-05-23 Thread Luke Diamand
This just removes the verbose print change, which will end up causing conflicts later since it's also being fixed in another commit. Discussed here: https://public-inbox.org/git/byapr08mb38455afe85ae6b04eb31ef92da...@byapr08mb3845.namprd08.prod.outlook.com/ Luke Diamand (1): git-p4

[PATCHv6 1/1] git-p4: add unshelve command

2018-05-23 Thread Luke Diamand
er changes mixed-in. The reference branch can be changed manually with the "--origin" option. The change adds a new Unshelve command class. This just runs the existing P4Sync code tweaked to handle a shelved changelist. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt |

Re: [PATCH 1/1] git-p4: unshelve: use action==add instead of rev==none

2018-05-23 Thread Luke Diamand
On 23 May 2018 at 17:41, Mazo, Andrey wrote: >> The last one (i.e. "even if it is verbose, if fileSize is not >> reported, do not write the verbose output") does not look like it is >> limited to the unshelve feature, so it might, even though it is a >> one-liner, deserve to be a separate preparat

[PATCHv5 1/1] git-p4: add unshelve command

2018-05-23 Thread Luke Diamand
er changes mixed-in. The reference branch can be changed manually with the "--origin" option. The change adds a new Unshelve command class. This just runs the existing P4Sync code tweaked to handle a shelved changelist. Signed-off-by: Luke Diamand --- Documentation/git-p4.txt |

[PATCHv5 0/1] git-p4: unshelve: fix problem with newer p4d

2018-05-23 Thread Luke Diamand
This is v5 of my git-p4 unshelve patch. It fixes a problem found by SZEDER Gábor with newer versions of Perforce (2016 vs 2015). Luke Diamand (1): git-p4: add unshelve command Documentation/git-p4.txt | 32 ++ git-p4.py| 215 --- t

Re: [PATCH 1/1] git-p4: unshelve: use action==add instead of rev==none

2018-05-22 Thread Luke Diamand
On 22 May 2018 at 11:15, SZEDER Gábor wrote: > On Tue, May 22, 2018 at 10:41 AM, Luke Diamand wrote: >> SZEDER Gábor found that the unshelve tests fail with newer >> versions of Perforce (2016 vs 2015). >> >> The problem arises because when a file is added in a P4

[PATCH 0/1] git-p4: unshelving: fix problem with newer P4

2018-05-22 Thread Luke Diamand
This fixes a problem found by SZEDER Gábor with newer versions of the Perforce database engine (2016 onwards). It looks like the behaviour has change subtly when reporting the revision of newly added files. The fix is to just use the file status. Luke Diamand (1): git-p4: unshelve: use action

[PATCH 1/1] git-p4: unshelve: use action==add instead of rev==none

2018-05-22 Thread Luke Diamand
epot/new#1 add We can detect that a file has been added simply by using the file status ("add") instead, rather than the depot revision, which is what this change does. This also fixes a few verbose prints used for debugging this to be more friendly. Signed-off-by: Luke Diamand --- gi

Re: [PATCHv4 1/1] git-p4: add unshelve command

2018-05-21 Thread Luke Diamand
On 21 May 2018 at 23:09, Luke Diamand wrote: > On 21 May 2018 at 22:39, SZEDER Gábor wrote: >>> diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh > > ... > ... > >>> +' >> >> This test fails on my box and on Travis CI (in all four standa

  1   2   3   4   5   >