git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-p4: Fix sorting changelists when cloning a Perforce repository

From
RDReece Dunn <msclrhd@googlemail.com>
Date
Aug 13, 2007, 18:50 UTC
Message-ID
<3f4fd2640708131150r1d9fb02ai1f655a22658cb544@mail.gmail.com>
Hi,

When performing a git-p4 clone operation on a Perforce repository, where the changelists change in order of magnitude (e.g. 100 to 1000), the set of changes to import from is not sorted properly. This is because the data in the list is strings not integers. The other place where this is done already converts the value to an integer, so it is not affected.

This patch fixes this issue.
- Reece
From 8c3d5e2d5886b330d0dfd139f03b3d1fd51207f5 Mon Sep 17 00:00:00 2001
From: Reece H. Dunn <msclrhd@gmail.com>
Date: Mon, 13 Aug 2007 19:40:50 +0100
Subject: [PATCH] git-p4: Fix the sorting of changelists when cloning a Perforce repository.
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 805d632..6d01062 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1322,7 +1322,7 @@ class P4Sync(Command):
 
                 for line in output:
                     changeNum = line.split(" ")[1]
-                    changes.append(changeNum)
+                    changes.append(int(changeNum))
 
                 changes.sort()
 
-- 
1.5.1.3
Next: Simon Hausmann
Message 1 of 3 in “git-p4: Fix sorting changelists when cloning a Perforce repository”
  1. git-p4: Fix sorting changelists when cloning a Perforce repositoryReece Dunn, Aug 13, 2007
  2. Simon HausmannAug 13, 2007
  3. Junio C HamanoAug 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.