{"thread":{"id":"22673","subject":"[PATCH] git-p4: fix bug in symlink handling","startedAt":"2010-02-16T08:44:08Z","lastAt":"2010-02-20T19:22:15Z","messageCount":3,"participants":["Evan Powers","Pete Wyckoff","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"134717","messageId":"6682cfcf1002160044i7aacd1b0t7bb351380b1bd27c@mail.gmail.com","threadId":"22673","inReplyTo":null,"subject":"[PATCH] git-p4: fix bug in symlink handling","fromName":"Evan Powers","fromEmail":"evan.powers@gmail.com","sentAt":"2010-02-16T08:44:08Z","receivedAt":"2010-02-16T08:44:08Z","isPatch":true,"sender":{"key":"evan.powers@gmail.com","avatar":null},"body":"Fix inadvertent breakage from b932705 in the code that strips the\ntrailing '\\n' from p4 print on a symlink. (In practice, contents is of\nthe form ['target\\n', ''].)\n\nSigned-off-by: Evan Powers <evan.powers@gmail.com>\n---\nThis patch Works For Me, but I didn't take the time to understand the\nentire code path so it might be equally valid to replace contents.pop()\nwith contents.pop(0) and call it a day.\n\n contrib/fast-import/git-p4 |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex e7c4814..cd96c6f 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -967,9 +967,8 @@ class P4Sync(Command):\n         elif file[\"type\"] == \"symlink\":\n             mode = \"120000\"\n             # p4 print on a symlink contains \"target\\n\", so strip it off\n-            last = contents.pop()\n-            last = last[:-1]\n-            contents.append(last)\n+            data = ''.join(contents)\n+            contents = [data[:-1]]\n\n         if self.isWindows and file[\"type\"].endswith(\"text\"):\n             mangled = []\n-- \n1.6.6\n"},{"id":"135158","messageId":"20100220140500.GA23423@arf.padd.com","threadId":"22673","inReplyTo":"6682cfcf1002160044i7aacd1b0t7bb351380b1bd27c@mail.gmail.com","subject":"Re: [PATCH] git-p4: fix bug in symlink handling","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2010-02-20T14:05:00Z","receivedAt":"2010-02-20T14:05:00Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"evan.powers@gmail.com wrote on Tue, 16 Feb 2010 00:44 -0800:\n> Fix inadvertent breakage from b932705 in the code that strips the\n> trailing '\\n' from p4 print on a symlink. (In practice, contents is of\n> the form ['target\\n', ''].)\n> \n> Signed-off-by: Evan Powers <evan.powers@gmail.com>\n\nAcked-by: Pete Wyckoff <pw@padd.com>\n\nThis was indeed an inadvertent bug introduced by that commit.\nOld code just appended all the data sections so did not see the\nnull.  This fix works for me.\n\n\t\t-- Pete\n\n> ---\n> This patch Works For Me, but I didn't take the time to understand the\n> entire code path so it might be equally valid to replace contents.pop()\n> with contents.pop(0) and call it a day.\n> \n>  contrib/fast-import/git-p4 |    5 ++---\n>  1 files changed, 2 insertions(+), 3 deletions(-)\n> \n> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n> index e7c4814..cd96c6f 100755\n> --- a/contrib/fast-import/git-p4\n> +++ b/contrib/fast-import/git-p4\n> @@ -967,9 +967,8 @@ class P4Sync(Command):\n>          elif file[\"type\"] == \"symlink\":\n>              mode = \"120000\"\n>              # p4 print on a symlink contains \"target\\n\", so strip it off\n> -            last = contents.pop()\n> -            last = last[:-1]\n> -            contents.append(last)\n> +            data = ''.join(contents)\n> +            contents = [data[:-1]]\n> \n>          if self.isWindows and file[\"type\"].endswith(\"text\"):\n>              mangled = []\n> -- \n> 1.6.6\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"135172","messageId":"7vsk8vk908.fsf@alter.siamese.dyndns.org","threadId":"22673","inReplyTo":"20100220140500.GA23423@arf.padd.com","subject":"Re: [PATCH] git-p4: fix bug in symlink handling","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-20T19:22:15Z","receivedAt":"2010-02-20T19:22:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; will apply to 'maint'.\n"}]}