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
Nov 7, 2011, 21:36 UTC
Message-ID
<1320701799-26071-3-git-send-email-luke@diamand.org>
In-Reply-To
<1320701799-26071-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.
---
 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 bcac6ec..02f0f54 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1511,9 +1511,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.7.295.g34dd4
Previous: Luke DiamandNext: Luke Diamand
Message 3 of 6 in “git-p4: small fixes to branches and labels; tests”
  1. 0/4 git-p4: small fixes to branches and labels; testsLuke Diamand, Nov 7, 2011
  2. 1/4 git-p4: handle p4 branches and labels containing shell charsLuke Diamand, Nov 7, 2011
  3. 2/4 git-p4: cope with labels with empty descriptionsLuke Diamand, Nov 7, 2011
  4. 3/4 git-p4: importing labels should cope with missing ownerLuke Diamand, Nov 7, 2011
  5. Pete WyckoffNov 7, 2011
  6. 4/4 git-p4: add test for p4 labelsLuke Diamand, Nov 7, 2011

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.