Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no checks in ident string #43

Closed
ewongbb opened this issue Nov 6, 2014 · 6 comments
Closed

no checks in ident string #43

ewongbb opened this issue Nov 6, 2014 · 6 comments

Comments

@ewongbb
Copy link

ewongbb commented Nov 6, 2014

I'm currently trying to convert a large mercurial repo to git using fast-export. After running it for some time, fast-export crashes with:

fatal: Missing > in ident string: test user <test@test.com 123456778 +1200
with the following traceback:
Traceback (most recent call last):
File "/home/cc/projs/fast-export/hg-fast-export.py", line 442, in
notes=options.notes,encoding=encoding))
File "/home/cc/projs/fast-export/hg-fast-export.py", line 364, in hg2git
c=export_commit(ui,repo,rev,old_marks,max,c,authors,sob,brmap,hgtags,notes,encoding)
File "/home/cc/projs/fast-export/hg-fast-export.py", line 226, in export_commit
export_file_contents(ctx,man,changed,hgtags,encoding)
File "/home/cc/projs/fast-export/hg-fast-export.py", line 140, in export_file_contents
wr(d)
File "/home/cc/projs/fast-export/hg-fast-export.py", line 37, in wr
wr_no_nl(msg)
File "/home/cc/projs/fast-export/hg-fast-export.py", line 34, in wr_no_nl
sys.stdout.write(msg)
IOError: [Errno 32] Broken pipe

@ewongbb
Copy link
Author

ewongbb commented Nov 6, 2014

my current 'fix'/hack is:
diff --git a/hg-fast-export.py b/hg-fast-export.py
index 0c683c5..2f1c90b 100755
--- a/hg-fast-export.py
+++ b/hg-fast-export.py
@@ -184,6 +184,8 @@ def export_commit(ui,repo,revision,old_marks,max,count,authors,sob,brmap,hgtags,
wr('mark :%d' % (revision+1))
if sob:
wr('author %s %d %s' % (get_author(desc,user,authors),time,timezone))

  • if '<<' in user:
  • user.replace('<<', '<')
    wr('committer %s %d %s' % (user,time,timezone))
    wr('data %d' % (len(desc)+1)) # wtf?
    wr(desc)

of course, with the different possible ways to break that, it'd have to be a bit better at
checking the ident syntax, et. al. (but right now it fixes my issue)

@ewongbb
Copy link
Author

ewongbb commented Nov 6, 2014

nvm.. the fix didn't work.

Should've been |user = user.replace('<<', '<')

@frej
Copy link
Owner

frej commented Nov 7, 2014

What you want to use is the author map (-A) option (Look in the
README).

Fast-export is not in the business of doing cute transformations in
order to try to guess the correct author string. The policy is to keep
things simple. If you have too many malformed identities to deal with
them manually, write an external tool which produces the author map.

@frej
Copy link
Owner

frej commented Nov 7, 2014

Won't fix

@c4lliope
Copy link

Picking up this long-dead thread,
I had a similar issue parsing Mozilla's source;
a couple <<address@place> cases and similar.

I am mirroring this code base, and in this code base I made a couple changes;
see the change log.

Open an issue here should you experience similar issues,
and link the code base you need help on.

@c4lliope
Copy link

Once I searched around, I realized https://github.com/glandium/git-cinnabar handles these cases nicely,
and is a really speedy program.

I'm mirroring the code here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants