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

[PATCH] builtin-fast-export: Only output a single parent per line

From
PBPieter de Bie <pdebie@ai.rug.nl>
Date
May 24, 2008, 23:21 UTC
Message-ID
<1211671313-99006-1-git-send-email-pdebie@ai.rug.nl>

According to the git-fast-import man-page, you can only put a single committish per merge: line, like this:

  merge :10
  merge :11
However, git-fast-export puts all parents on a single line, like this:
  merge :10 :11

This may be fine with git-fast-import, but other importers based on it, like bzr-fast-import, can't handle this.

This changes fast-export to also output a single parent per line.
Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
---
I'm not sure why this was done, but it messed up my import :)
 builtin-fast-export.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index e1c5630..34acdf9 100755
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -204,10 +204,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
 			continue;
 		if (i == 0)
 			printf("from :%d\n", mark);
-		else if (i == 1)
-			printf("merge :%d", mark);
 		else
-			printf(" :%d", mark);
+			printf("merge :%d\n", mark);
 		i++;
 	}
 	if (i > 1)
-- 
1.5.5.1.541.g51dc4.dirty
Next: Junio C Hamano
Message 1 of 6 in “builtin-fast-export: Only output a single parent per line”
  1. builtin-fast-export: Only output a single parent per linePieter de Bie, May 24, 2008
  2. Junio C HamanoMay 25, 2008
  3. Shawn O. PearceMay 26, 2008
  4. Junio C HamanoMay 26, 2008
  5. Junio C HamanoMay 26, 2008
  6. Shawn O. PearceMay 26, 2008

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.