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

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

From
Luke Diamand <luke@diamand.org>
Date
Nov 30, 2011, 09:03 UTC
Message-ID
<1322643817-13051-3-git-send-email-luke@diamand.org>
In-Reply-To
<1322643817-13051-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 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.8.rc1.209.geac91.dirty
Previous: Luke DiamandNext: Luke Diamand
Message 3 of 17 in “[PATCHv2 0/4] git-p4: small fixes to branches and labels; tests”
  1. Luke DiamandNov 30, 2011
  2. 1/4 git-p4: handle p4 branches and labels containing shell charsLuke Diamand, Nov 30, 2011
  3. 2/4 git-p4: cope with labels with empty descriptionsLuke Diamand, Nov 30, 2011
  4. 3/4 git-p4: importing labels should cope with missing ownerLuke Diamand, Nov 30, 2011
  5. 4/4 git-p4: add test for p4 labelsLuke Diamand, Nov 30, 2011
  6. Vitor AntunesNov 30, 2011
  7. Luke DiamandNov 30, 2011
  8. Vitor AntunesNov 30, 2011
  9. Pete WyckoffNov 30, 2011
  10. Pete WyckoffNov 30, 2011
  11. Vitor AntunesDec 1, 2011
  12. Pete WyckoffDec 4, 2011
  13. Luke DiamandDec 1, 2011
  14. Vitor AntunesDec 1, 2011
  15. Pete WyckoffDec 1, 2011
  16. Vitor AntunesDec 1, 2011
  17. Luke DiamandDec 2, 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.