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

[PATCH 2/4] git-p4: cope with labels with empty descriptions

From
Luke Diamand <luke@diamand.org>
Date
Jan 16, 2012, 23:14 UTC
Message-ID
<1326755689-3344-3-git-send-email-luke@diamand.org>
In-Reply-To
<1326755689-3344-1-git-send-email-luke@diamand.org>

Use an explicit length for the data in a label, rather than EOT, so that labels with empty descriptions are passed through correctly.

Signed-off-by: Luke Diamand <luke@diamand.org>
---
 contrib/fast-import/git-p4 |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 822e6f1..f7707f2 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1741,9 +1741,11 @@ class P4Sync(Command, P4UserMap):
                     else:
                         tagger = "%s <a@b> %s %s" % (owner, epoch, self.tz)
                     self.gitStream.write("tagger %s\n" % tagger)
-                    self.gitStream.write("data <<EOT\n")
-                    self.gitStream.write(labelDetails["Description"])
-                    self.gitStream.write("EOT\n\n")
+
+                    description = labelDetails["Description"]
+                    self.gitStream.write("data %d\n" % len(description))
+                    self.gitStream.write(description)
+                    self.gitStream.write("\n")
 
                 else:
                     if not self.silent:
-- 
1.7.8.rc1.209.geac91.dirty
Previous: Luke DiamandNext: Luke Diamand
Message 5 of 7 in “[PATCHv3 0/4] git-p4: small fixes to branches and labels”
  1. Luke DiamandJan 16, 2012
  2. 1/4 git-p4: handle p4 branches and labels containing shell charsLuke Diamand, Jan 16, 2012
  3. Pete WyckoffJan 17, 2012
  4. Luke DiamandJan 19, 2012
  5. 2/4 git-p4: cope with labels with empty descriptionsLuke Diamand, Jan 16, 2012
  6. 3/4 git-p4: importing labels should cope with missing ownerLuke Diamand, Jan 16, 2012
  7. 4/4 git-p4: add test for p4 labelsLuke Diamand, Jan 16, 2012

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.