{"thread":{"id":"18176","subject":"[PATCH] git-p4: remove unnecessary semicolons at end of lines","startedAt":"2009-03-06T15:53:22Z","lastAt":"2009-03-07T12:26:25Z","messageCount":5,"participants":["Sam Hocevar","Brandon Casey","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"107214","messageId":"20090306155322.GC12880@zoy.org","threadId":"18176","inReplyTo":null,"subject":"[PATCH] git-p4: remove unnecessary semicolons at end of lines","fromName":"Sam Hocevar","fromEmail":"sam@zoy.org","sentAt":"2009-03-06T15:53:22Z","receivedAt":"2009-03-06T15:53:22Z","isPatch":true,"sender":{"key":"sam@zoy.org","avatar":"https://gravatar.com/avatar/1fc1e5d8c3a8d737f14572135671adfbc0e61ffba5c3bc1d1b8a6f4aac764470?d=mp&s=160"},"body":"   This is a purely cosmetic patch that makes the git-p4 code look more\npythonish by getting rid of end-of-line semicolons.\n\n\ngit-p4: remove unnecessary semicolons at end of lines.\n\nSigned-off-by: Sam Hocevar <sam@zoy.org>\n---\n contrib/fast-import/git-p4 |   46 ++++++++++++++++++++++----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 3832f60..7ea5ac6 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -12,7 +12,7 @@ import optparse, sys, os, marshal, popen2, subprocess, shelve\n import tempfile, getopt, sha, os.path, time, platform\n import re\n\n-from sets import Set;\n+from sets import Set\n\n verbose = False\n\n@@ -240,7 +240,7 @@ def p4Cmd(cmd):\n     result = {}\n     for entry in list:\n         result.update(entry)\n-    return result;\n+    return result\n\n def p4Where(depotPath):\n     if not depotPath.endswith(\"/\"):\n@@ -281,7 +281,7 @@ def currentGitBranch():\n def isValidGitDir(path):\n     if (os.path.exists(path + \"/HEAD\")\n         and os.path.exists(path + \"/refs\") and os.path.exists(path + \"/objects\")):\n-        return True;\n+        return True\n     return False\n\n def parseRevision(ref):\n@@ -328,8 +328,8 @@ def extractSettingsGitLog(log):\n\n def gitBranchExists(branch):\n     proc = subprocess.Popen([\"git\", \"rev-parse\", branch],\n-                            stderr=subprocess.PIPE, stdout=subprocess.PIPE);\n-    return proc.wait() == 0;\n+                            stderr=subprocess.PIPE, stdout=subprocess.PIPE)\n+    return proc.wait() == 0\n\n _gitConfig = {}\n def gitConfig(key):\n@@ -492,7 +492,7 @@ class P4RollBack(Command):\n         maxChange = int(args[0])\n\n         if \"p4ExitCode\" in p4Cmd(\"changes -m 1\"):\n-            die(\"Problems executing p4\");\n+            die(\"Problems executing p4\")\n\n         if self.rollbackLocalBranches:\n             refPrefix = \"refs/heads/\"\n@@ -663,7 +663,7 @@ class P4Submit(Command):\n             if response == \"s\":\n                 print \"Skipping! Good luck with the next patches...\"\n                 for f in editedFiles:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                 for f in filesToAdd:\n                     system(\"rm %s\" %f)\n                 return\n@@ -734,7 +734,7 @@ class P4Submit(Command):\n             if os.environ.has_key(\"P4EDITOR\"):\n                 editor = os.environ.get(\"P4EDITOR\")\n             else:\n-                editor = os.environ.get(\"EDITOR\", defaultEditor);\n+                editor = os.environ.get(\"EDITOR\", defaultEditor)\n             system(editor + \" \" + fileName)\n\n             response = \"y\"\n@@ -753,9 +753,9 @@ class P4Submit(Command):\n                 p4_write_pipe(\"submit -i\", submitTemplate)\n             else:\n                 for f in editedFiles:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                 for f in filesToAdd:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                     system(\"rm %s\" %f)\n\n             os.remove(fileName)\n@@ -977,9 +977,9 @@ class P4Sync(Command):\n\n             if \"p4ExitCode\" in filedata[0]:\n                 die(\"Problems executing p4. Error: [%d].\"\n-                    % (filedata[0]['p4ExitCode']));\n+                    % (filedata[0]['p4ExitCode']))\n\n-        j = 0;\n+        j = 0\n         contents = {}\n         while j < len(filedata):\n             stat = filedata[j]\n@@ -1303,8 +1303,8 @@ class P4Sync(Command):\n     def importNewBranch(self, branch, maxChange):\n         # make fast-import flush all changes to disk and update the refs using the checkpoint\n         # command so that we can try to find the branch parent in the git history\n-        self.gitStream.write(\"checkpoint\\n\\n\");\n-        self.gitStream.flush();\n+        self.gitStream.write(\"checkpoint\\n\\n\")\n+        self.gitStream.flush()\n         branchPrefix = self.depotPaths[0] + branch + \"/\"\n         range = \"@1,%s\" % maxChange\n         #print \"prefix\" + branchPrefix\n@@ -1364,12 +1364,12 @@ class P4Sync(Command):\n                                 fullBranch = self.projectName + branch\n                                 if fullBranch not in self.p4BranchesInGit:\n                                     if not self.silent:\n-                                        print(\"\\n    Importing new branch %s\" % fullBranch);\n+                                        print(\"\\n    Importing new branch %s\" % fullBranch)\n                                     if self.importNewBranch(branch, change - 1):\n                                         parent = \"\"\n                                         self.p4BranchesInGit.append(fullBranch)\n                                     if not self.silent:\n-                                        print(\"\\n    Resuming with change %s\" % change);\n+                                        print(\"\\n    Resuming with change %s\" % change)\n\n                                 if self.verbose:\n                                     print \"parent determined through known branches: %s\" % parent\n@@ -1485,7 +1485,7 @@ class P4Sync(Command):\n             self.branch = self.refPrefix + \"master\"\n             if gitBranchExists(\"refs/heads/p4\") and self.importIntoRemotes:\n                 system(\"git update-ref %s refs/heads/p4\" % self.branch)\n-                system(\"git branch -D p4\");\n+                system(\"git branch -D p4\")\n             # create it /after/ importing, when master exists\n             if not gitBranchExists(self.refPrefix + \"HEAD\") and self.importIntoRemotes and gitBranchExists(self.branch):\n                 system(\"git symbolic-ref %sHEAD %s\" % (self.refPrefix, self.branch))\n@@ -1591,7 +1591,7 @@ class P4Sync(Command):\n         self.loadUserMapFromCache()\n         self.labels = {}\n         if self.detectLabels:\n-            self.getLabels();\n+            self.getLabels()\n\n         if self.detectBranches:\n             ## FIXME - what's a P4 projectName ?\n@@ -1615,7 +1615,7 @@ class P4Sync(Command):\n\n         importProcess = subprocess.Popen([\"git\", \"fast-import\"],\n                                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n-                                         stderr=subprocess.PIPE);\n+                                         stderr=subprocess.PIPE)\n         self.gitOutput = importProcess.stdout\n         self.gitStream = importProcess.stdin\n         self.gitError = importProcess.stderr\n@@ -1688,9 +1688,9 @@ class P4Rebase(Command):\n\n     def rebase(self):\n         if os.system(\"git update-index --refresh\") != 0:\n-            die(\"Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.\");\n+            die(\"Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.\")\n         if len(read_pipe(\"git diff-index HEAD --\")) > 0:\n-            die(\"You have uncommited changes. Please commit them before rebasing or stash them away with git stash.\");\n+            die(\"You have uncommited changes. Please commit them before rebasing or stash them away with git stash.\")\n\n         [upstream, settings] = findUpstreamBranchPoint()\n         if len(upstream) == 0:\n@@ -1866,7 +1866,7 @@ def main():\n                                        description = cmd.description,\n                                        formatter = HelpFormatter())\n\n-        (cmd, args) = parser.parse_args(sys.argv[2:], cmd);\n+        (cmd, args) = parser.parse_args(sys.argv[2:], cmd)\n     global verbose\n     verbose = cmd.verbose\n     if cmd.needsGit:\n@@ -1877,7 +1877,7 @@ def main():\n                 if os.path.exists(cmd.gitdir):\n                     cdup = read_pipe(\"git rev-parse --show-cdup\").strip()\n                     if len(cdup) > 0:\n-                        chdir(cdup);\n+                        chdir(cdup)\n\n         if not isValidGitDir(cmd.gitdir):\n             if isValidGitDir(cmd.gitdir + \"/.git\"):\n\n-- \nSam.\n"},{"id":"107227","messageId":"CYOA8Q1cpfGtE1Pp6_ETXfSJevKv9ADmYIuq6_whU0qskk289fiiUw@cipher.nrlssc.navy.mil","threadId":"18176","inReplyTo":"20090306155322.GC12880@zoy.org","subject":"Re: [PATCH] git-p4: remove unnecessary semicolons at end of lines","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-03-06T16:55:35Z","receivedAt":"2009-03-06T16:55:35Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Sam Hocevar wrote:\n>    This is a purely cosmetic patch that makes the git-p4 code look more\n> pythonish by getting rid of end-of-line semicolons.\n\n\nI get the impression that you do not intend for the comments above to be\npart of the commit message.  If that is true, then they should be placed\nfurther down after the '---' and before the diff-stat, or in some other\nway partitioned from the commit message (maybe using --->8--- notation).\nOtherwise they will _become_ part of the commit message if Junio applies\nthis patch as-is.\n\n-brandon\n\n\n> git-p4: remove unnecessary semicolons at end of lines.\n> \n> Signed-off-by: Sam Hocevar <sam@zoy.org>\n> ---\n\n\nComments not intended to be part of the commit message go here, where they\nwill be ignored by git-apply.\n\n\n>  contrib/fast-import/git-p4 |   46 ++++++++++++++++++++++----------------------\n>  1 files changed, 23 insertions(+), 23 deletions(-)\n> \n> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n> index 3832f60..7ea5ac6 100755\n> --- a/contrib/fast-import/git-p4\n> +++ b/contrib/fast-import/git-p4\n> @@ -12,7 +12,7 @@ import optparse, sys, os, marshal, popen2, subprocess, shelve\n<snip>\n"},{"id":"107230","messageId":"20090306171117.GD12880@zoy.org","threadId":"18176","inReplyTo":"CYOA8Q1cpfGtE1Pp6_ETXfSJevKv9ADmYIuq6_whU0qskk289fiiUw@cipher.nrlssc.navy.mil","subject":"msysgit corrupting commit messages?","fromName":"Sam Hocevar","fromEmail":"sam@zoy.org","sentAt":"2009-03-06T17:11:17Z","receivedAt":"2009-03-06T17:11:17Z","isPatch":false,"sender":{"key":"sam@zoy.org","avatar":"https://gravatar.com/avatar/1fc1e5d8c3a8d737f14572135671adfbc0e61ffba5c3bc1d1b8a6f4aac764470?d=mp&s=160"},"body":"On Fri, Mar 06, 2009, Brandon Casey wrote:\n\n> I get the impression that you do not intend for the comments above to be\n> part of the commit message.  If that is true, then they should be placed\n> further down after the '---' and before the diff-stat, or in some other\n> way partitioned from the commit message (maybe using --->8--- notation).\n> Otherwise they will _become_ part of the commit message if Junio applies\n> this patch as-is.\n\n   Okay. I'm definitely having a problem with git on MSYS. Is anyone\nelse seeing it butcher commits it exports? They appear fine in git log\nor git log -p, but not in git format-patch. I've never had the problem\non a Linux system.\n\n-- \nSam.\n"},{"id":"107267","messageId":"alpine.DEB.1.00.0903070347220.10279@pacific.mpi-cbg.de","threadId":"18176","inReplyTo":"20090306171117.GD12880@zoy.org","subject":"Re: msysgit corrupting commit messages?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-07T02:48:34Z","receivedAt":"2009-03-07T02:48:34Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 6 Mar 2009, Sam Hocevar wrote:\n\n> On Fri, Mar 06, 2009, Brandon Casey wrote:\n> \n> > I get the impression that you do not intend for the comments above to be\n> > part of the commit message.  If that is true, then they should be placed\n> > further down after the '---' and before the diff-stat, or in some other\n> > way partitioned from the commit message (maybe using --->8--- notation).\n> > Otherwise they will _become_ part of the commit message if Junio applies\n> > this patch as-is.\n> \n>    Okay. I'm definitely having a problem with git on MSYS. Is anyone\n> else seeing it butcher commits it exports? They appear fine in git log\n> or git log -p, but not in git format-patch. I've never had the problem\n> on a Linux system.\n\nI have never had problems with msysGit's format-patch.  From Brandon's \ndescription however, it appears as if the offending changes were done \nmanually...\n\nNote: I missed the original message.\n\nCiao,\nDscho\n"},{"id":"107295","messageId":"20090307122625.GA8153@zoy.org","threadId":"18176","inReplyTo":"20090306155322.GC12880@zoy.org","subject":"[PATCH v2] git-p4: remove unnecessary semicolons at end of lines.","fromName":"Sam Hocevar","fromEmail":"sam@zoy.org","sentAt":"2009-03-07T12:26:25Z","receivedAt":"2009-03-07T12:26:25Z","isPatch":true,"sender":{"key":"sam@zoy.org","avatar":"https://gravatar.com/avatar/1fc1e5d8c3a8d737f14572135671adfbc0e61ffba5c3bc1d1b8a6f4aac764470?d=mp&s=160"},"body":"\nSigned-off-by: Sam Hocevar <sam@zoy.org>\n---\n This is a properly formatted version of the previous patch.\n\n contrib/fast-import/git-p4 |   46 ++++++++++++++++++++++----------------------\n 1 files changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 3832f60..7ea5ac6 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -12,7 +12,7 @@ import optparse, sys, os, marshal, popen2, subprocess, shelve\n import tempfile, getopt, sha, os.path, time, platform\n import re\n \n-from sets import Set;\n+from sets import Set\n \n verbose = False\n \n@@ -240,7 +240,7 @@ def p4Cmd(cmd):\n     result = {}\n     for entry in list:\n         result.update(entry)\n-    return result;\n+    return result\n \n def p4Where(depotPath):\n     if not depotPath.endswith(\"/\"):\n@@ -281,7 +281,7 @@ def currentGitBranch():\n def isValidGitDir(path):\n     if (os.path.exists(path + \"/HEAD\")\n         and os.path.exists(path + \"/refs\") and os.path.exists(path + \"/objects\")):\n-        return True;\n+        return True\n     return False\n \n def parseRevision(ref):\n@@ -328,8 +328,8 @@ def extractSettingsGitLog(log):\n \n def gitBranchExists(branch):\n     proc = subprocess.Popen([\"git\", \"rev-parse\", branch],\n-                            stderr=subprocess.PIPE, stdout=subprocess.PIPE);\n-    return proc.wait() == 0;\n+                            stderr=subprocess.PIPE, stdout=subprocess.PIPE)\n+    return proc.wait() == 0\n \n _gitConfig = {}\n def gitConfig(key):\n@@ -492,7 +492,7 @@ class P4RollBack(Command):\n         maxChange = int(args[0])\n \n         if \"p4ExitCode\" in p4Cmd(\"changes -m 1\"):\n-            die(\"Problems executing p4\");\n+            die(\"Problems executing p4\")\n \n         if self.rollbackLocalBranches:\n             refPrefix = \"refs/heads/\"\n@@ -663,7 +663,7 @@ class P4Submit(Command):\n             if response == \"s\":\n                 print \"Skipping! Good luck with the next patches...\"\n                 for f in editedFiles:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                 for f in filesToAdd:\n                     system(\"rm %s\" %f)\n                 return\n@@ -734,7 +734,7 @@ class P4Submit(Command):\n             if os.environ.has_key(\"P4EDITOR\"):\n                 editor = os.environ.get(\"P4EDITOR\")\n             else:\n-                editor = os.environ.get(\"EDITOR\", defaultEditor);\n+                editor = os.environ.get(\"EDITOR\", defaultEditor)\n             system(editor + \" \" + fileName)\n \n             response = \"y\"\n@@ -753,9 +753,9 @@ class P4Submit(Command):\n                 p4_write_pipe(\"submit -i\", submitTemplate)\n             else:\n                 for f in editedFiles:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                 for f in filesToAdd:\n-                    p4_system(\"revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f)\n                     system(\"rm %s\" %f)\n \n             os.remove(fileName)\n@@ -977,9 +977,9 @@ class P4Sync(Command):\n \n             if \"p4ExitCode\" in filedata[0]:\n                 die(\"Problems executing p4. Error: [%d].\"\n-                    % (filedata[0]['p4ExitCode']));\n+                    % (filedata[0]['p4ExitCode']))\n \n-        j = 0;\n+        j = 0\n         contents = {}\n         while j < len(filedata):\n             stat = filedata[j]\n@@ -1303,8 +1303,8 @@ class P4Sync(Command):\n     def importNewBranch(self, branch, maxChange):\n         # make fast-import flush all changes to disk and update the refs using the checkpoint\n         # command so that we can try to find the branch parent in the git history\n-        self.gitStream.write(\"checkpoint\\n\\n\");\n-        self.gitStream.flush();\n+        self.gitStream.write(\"checkpoint\\n\\n\")\n+        self.gitStream.flush()\n         branchPrefix = self.depotPaths[0] + branch + \"/\"\n         range = \"@1,%s\" % maxChange\n         #print \"prefix\" + branchPrefix\n@@ -1364,12 +1364,12 @@ class P4Sync(Command):\n                                 fullBranch = self.projectName + branch\n                                 if fullBranch not in self.p4BranchesInGit:\n                                     if not self.silent:\n-                                        print(\"\\n    Importing new branch %s\" % fullBranch);\n+                                        print(\"\\n    Importing new branch %s\" % fullBranch)\n                                     if self.importNewBranch(branch, change - 1):\n                                         parent = \"\"\n                                         self.p4BranchesInGit.append(fullBranch)\n                                     if not self.silent:\n-                                        print(\"\\n    Resuming with change %s\" % change);\n+                                        print(\"\\n    Resuming with change %s\" % change)\n \n                                 if self.verbose:\n                                     print \"parent determined through known branches: %s\" % parent\n@@ -1485,7 +1485,7 @@ class P4Sync(Command):\n             self.branch = self.refPrefix + \"master\"\n             if gitBranchExists(\"refs/heads/p4\") and self.importIntoRemotes:\n                 system(\"git update-ref %s refs/heads/p4\" % self.branch)\n-                system(\"git branch -D p4\");\n+                system(\"git branch -D p4\")\n             # create it /after/ importing, when master exists\n             if not gitBranchExists(self.refPrefix + \"HEAD\") and self.importIntoRemotes and gitBranchExists(self.branch):\n                 system(\"git symbolic-ref %sHEAD %s\" % (self.refPrefix, self.branch))\n@@ -1591,7 +1591,7 @@ class P4Sync(Command):\n         self.loadUserMapFromCache()\n         self.labels = {}\n         if self.detectLabels:\n-            self.getLabels();\n+            self.getLabels()\n \n         if self.detectBranches:\n             ## FIXME - what's a P4 projectName ?\n@@ -1615,7 +1615,7 @@ class P4Sync(Command):\n \n         importProcess = subprocess.Popen([\"git\", \"fast-import\"],\n                                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n-                                         stderr=subprocess.PIPE);\n+                                         stderr=subprocess.PIPE)\n         self.gitOutput = importProcess.stdout\n         self.gitStream = importProcess.stdin\n         self.gitError = importProcess.stderr\n@@ -1688,9 +1688,9 @@ class P4Rebase(Command):\n \n     def rebase(self):\n         if os.system(\"git update-index --refresh\") != 0:\n-            die(\"Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.\");\n+            die(\"Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.\")\n         if len(read_pipe(\"git diff-index HEAD --\")) > 0:\n-            die(\"You have uncommited changes. Please commit them before rebasing or stash them away with git stash.\");\n+            die(\"You have uncommited changes. Please commit them before rebasing or stash them away with git stash.\")\n \n         [upstream, settings] = findUpstreamBranchPoint()\n         if len(upstream) == 0:\n@@ -1866,7 +1866,7 @@ def main():\n                                        description = cmd.description,\n                                        formatter = HelpFormatter())\n \n-        (cmd, args) = parser.parse_args(sys.argv[2:], cmd);\n+        (cmd, args) = parser.parse_args(sys.argv[2:], cmd)\n     global verbose\n     verbose = cmd.verbose\n     if cmd.needsGit:\n@@ -1877,7 +1877,7 @@ def main():\n                 if os.path.exists(cmd.gitdir):\n                     cdup = read_pipe(\"git rev-parse --show-cdup\").strip()\n                     if len(cdup) > 0:\n-                        chdir(cdup);\n+                        chdir(cdup)\n \n         if not isValidGitDir(cmd.gitdir):\n             if isValidGitDir(cmd.gitdir + \"/.git\"):\n-- \n1.6.1.3\n"}]}