Jump to content

git fast-import corrupt mark line

Recommended Posts

When attempting to export our Plastic SCM repo into a Git repo we tried cm fast-export:

Here is the batch script we are using:

@echo off

set "MARKS_FILE_NAME=D:\marks.05.cm"

cm fast-export WINS_Clone@local %EXPORT_FILE_NAME% --export-marks=%MARKS_FILE_NAME%

And then we open a bash window and attempt to import it into a new Git repo

#!/usr/bin/env bash


rm -R -f "${GIT_REPO_DIR}"
mkdir "${GIT_REPO_DIR}"
pushd "${GIT_REPO_DIR}"
git init --bare .
cat "${EXPORT_FILE_NAME}" | git fast-import --stats --import-marks="${MARKS_FILE_NAME}"

When we run this we get the following output:

Initialized empty Git repository in D:/Repos/WINS5.git/
fatal: corrupt mark line: 2 20939

fast-import: dumping crash report to fast_import_crash_28364

The crash report is relatively small so I will just include it in this post:

fast-import crash report:
    fast-import process: 28364
    parent process     : 1
    at 2023-02-08 19:22:12 +0000

fatal: corrupt mark line: 2 20939

Most Recent Commands Before Crash

Active Branch LRU
    active_branches = 0 cur, 5 max

  pos  clock name

Inactive Branches



Looking into the code behind fast-import where it attempts to load the marks it seems it expects a ':' in the beginning of the line: https://chromium.googlesource.com/external/msysgit/git/+/fb6aa9a54fa455d8e8b9e3971b1738afabab2679/fast-import.c


What is the cause of this?

Link to comment
Share on other sites

  • 1 month later...



I'm afraid there is no easy way to tell what is going on. Most likely, something got corrupted during the process and is preventing the operation from finishing. That being said, this issue was resolved through a support ticket, and the problem was addressed by using the "git gc" command. Am I right?




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...