{"thread":{"id":"44612","subject":"[PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default","startedAt":"2016-12-04T14:03:33Z","lastAt":"2016-12-05T21:20:21Z","messageCount":4,"participants":["larsxschneider@gmail.com","Lars Schneider","Luke Diamand","Ori Rawlings"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"306893","messageId":"20161204140311.26269-1-larsxschneider@gmail.com","threadId":"44612","inReplyTo":null,"subject":"[PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default","fromName":"","fromEmail":"larsxschneider@gmail.com","sentAt":"2016-12-04T14:03:11Z","receivedAt":"2016-12-04T14:03:33Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"From: Lars Schneider <lars.schneider@autodesk.com>\n\nP4 commands can fail due to random network issues. P4 users can counter\nthese issues by using a retry flag supported by all p4 commands [1].\n\nAdd an integer Git config value `git-p4.retries` to define the number of\nretries for all p4 invocations. If the config is not defined then set\nthe default retry count to 3.\n\n[1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html\n\nSigned-off-by: Lars Schneider <larsxschneider@gmail.com>\n---\n\nNotes:\n    Base Commit: 454cb6b (v2.11.0)\n    Diff on Web: https://github.com/git/git/compare/454cb6b...larsxschneider:654c727\n    Checkout:    git fetch https://github.com/larsxschneider/git git-p4/retries-v1 && git checkout 654c727\n\n Documentation/git-p4.txt | 4 ++++\n git-p4.py                | 5 +++++\n 2 files changed, 9 insertions(+)\n\ndiff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt\nindex c83aaf39c3..656587248c 100644\n--- a/Documentation/git-p4.txt\n+++ b/Documentation/git-p4.txt\n@@ -467,6 +467,10 @@ git-p4.client::\n \tClient specified as an option to all p4 commands, with\n \t'-c <client>', including the client spec.\n \n+git-p4.retries::\n+\tSpecifies the number of times to retry a p4 command (notably,\n+\t'p4 sync') if the network times out. The default value is 3.\n+\n Clone and sync variables\n ~~~~~~~~~~~~~~~~~~~~~~~~\n git-p4.syncFromOrigin::\ndiff --git a/git-p4.py b/git-p4.py\nindex fd5ca52462..2422178210 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -78,6 +78,11 @@ def p4_build_cmd(cmd):\n     if len(client) > 0:\n         real_cmd += [\"-c\", client]\n \n+    retries = gitConfigInt(\"git-p4.retries\")\n+    if retries is None:\n+        # Perform 3 retries by default\n+        retries = 3\n+    real_cmd += [\"-r\", str(retries)]\n \n     if isinstance(cmd,basestring):\n         real_cmd = ' '.join(real_cmd) + ' ' + cmd\n-- \n2.11.0\n\n"},{"id":"306922","messageId":"EFB6754A-8205-4B5C-BD2E-13D2AA211369@gmail.com","threadId":"44612","inReplyTo":"20161204140311.26269-1-larsxschneider@gmail.com","subject":"Re: [PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2016-12-05T09:09:48Z","receivedAt":"2016-12-05T10:04:07Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"\n> On 04 Dec 2016, at 15:03, larsxschneider@gmail.com wrote:\n> \n> From: Lars Schneider <lars.schneider@autodesk.com>\n\nHi Junio,\n\nif you decide to queue this patch and/or the \"git-p4: fix empty file \nprocessing for large file system backend GitLFS\", please use my \nsigned-off address. I accidentally messed up the author field in\nboth.\n\nThanks,\nLars\n\n\n> \n> P4 commands can fail due to random network issues. P4 users can counter\n> these issues by using a retry flag supported by all p4 commands [1].\n> \n> Add an integer Git config value `git-p4.retries` to define the number of\n> retries for all p4 invocations. If the config is not defined then set\n> the default retry count to 3.\n> \n> [1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html\n> \n> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>\n\n"},{"id":"306926","messageId":"CAE5ih7-+TZVMhbF5b4TxhvZv3=eXFntN+MJqP6iDq0HyA6Ntfg@mail.gmail.com","threadId":"44612","inReplyTo":"20161204140311.26269-1-larsxschneider@gmail.com","subject":"Re: [PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2016-12-05T11:02:01Z","receivedAt":"2016-12-05T11:02:07Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 4 December 2016 at 14:03,  <larsxschneider@gmail.com> wrote:\n> From: Lars Schneider <lars.schneider@autodesk.com>\n>\n> P4 commands can fail due to random network issues. P4 users can counter\n> these issues by using a retry flag supported by all p4 commands [1].\n>\n> Add an integer Git config value `git-p4.retries` to define the number of\n> retries for all p4 invocations. If the config is not defined then set\n> the default retry count to 3.\n\nLooks good to me, ack.\n\n>\n> [1] https://www.perforce.com/perforce/doc.current/manuals/cmdref/global.options.html\n>\n> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>\n> ---\n>\n> Notes:\n>     Base Commit: 454cb6b (v2.11.0)\n>     Diff on Web: https://github.com/git/git/compare/454cb6b...larsxschneider:654c727\n>     Checkout:    git fetch https://github.com/larsxschneider/git git-p4/retries-v1 && git checkout 654c727\n>\n>  Documentation/git-p4.txt | 4 ++++\n>  git-p4.py                | 5 +++++\n>  2 files changed, 9 insertions(+)\n>\n> diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt\n> index c83aaf39c3..656587248c 100644\n> --- a/Documentation/git-p4.txt\n> +++ b/Documentation/git-p4.txt\n> @@ -467,6 +467,10 @@ git-p4.client::\n>         Client specified as an option to all p4 commands, with\n>         '-c <client>', including the client spec.\n>\n> +git-p4.retries::\n> +       Specifies the number of times to retry a p4 command (notably,\n> +       'p4 sync') if the network times out. The default value is 3.\n> +\n>  Clone and sync variables\n>  ~~~~~~~~~~~~~~~~~~~~~~~~\n>  git-p4.syncFromOrigin::\n> diff --git a/git-p4.py b/git-p4.py\n> index fd5ca52462..2422178210 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -78,6 +78,11 @@ def p4_build_cmd(cmd):\n>      if len(client) > 0:\n>          real_cmd += [\"-c\", client]\n>\n> +    retries = gitConfigInt(\"git-p4.retries\")\n> +    if retries is None:\n> +        # Perform 3 retries by default\n> +        retries = 3\n> +    real_cmd += [\"-r\", str(retries)]\n>\n>      if isinstance(cmd,basestring):\n>          real_cmd = ' '.join(real_cmd) + ' ' + cmd\n> --\n> 2.11.0\n>\n"},{"id":"306964","messageId":"CAPv0x+Ps9YiMgHsJ0_VKzjbXRtqybDoJryt2NcVmE38JvUCeWA@mail.gmail.com","threadId":"44612","inReplyTo":"20161204140311.26269-1-larsxschneider@gmail.com","subject":"Re: [PATCH v1] git-p4: add config to retry p4 commands; retry 3 times by default","fromName":"Ori Rawlings","fromEmail":"orirawlings@gmail.com","sentAt":"2016-12-05T21:19:00Z","receivedAt":"2016-12-05T21:20:21Z","isPatch":true,"sender":{"key":"orirawlings@gmail.com","avatar":"https://gravatar.com/avatar/e0b03bf25fd033ff21a27f7c801240da759f001b28acfa3087f60532bd4c9fa6?d=mp&s=160"},"body":"Looks good to me, too.\n\n-r flag seems to be supported as far back as I can search in the Helix\nrelease notes.\n\nOri Rawlings\n"}]}