cosmin / git-hg

A git-hg utility for checking out and tracking a mercurial repo.
http://offbytwo.github.com/git-hg
MIT License
307 stars 51 forks source link

I get bad date and email complaints from git #18

Closed knarf-se closed 12 years ago

knarf-se commented 12 years ago

The offending mercurial repository is http://hg.dillo.org/dillo I was about to mirror it here on github and add another branch with my own edits (Which for now, would only consist of another icon theme).

The terminal interaction looks somewhat like this (I may have cut out some boring parts and personal info):

$> git-hg clone http://hg.dillo.org/dillo dillo3
    [   Enormous output that does not fit in my 1K lines of backscrolling   ]
Issued 2351 commands
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:      15000
Total objects:        12512 (      2838 duplicates                  )
      blobs  :         5341 (      2690 duplicates       4040 deltas)
      trees  :         4832 (       148 duplicates       4392 deltas)
      commits:         2339 (         0 duplicates          0 deltas)
      tags   :            0 (         0 duplicates          0 deltas)
Total branches:          14 (         2 loads     )
      marks:        1048576 (      2339 unique    )
      atoms:            294
Memory total:          2813 KiB
       pools:          2110 KiB
     objects:           703 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =       4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit      = 8589934592
pack_report: pack_used_ctr            =      20493
pack_report: pack_mmap_calls          =       4656
pack_report: pack_open_windows        =          1 /          1
pack_report: pack_mapped              =   41901214 /   41901214
---------------------------------------------------------------------

remote: Counting objects: 12512, done.
remote: Compressing objects: 100% (4080/4080), done.
remote: Total 12512 (delta 8432), reused 12512 (delta 8432)
Receiving objects: 100% (12512/12512), 39.96 MiB | 9.07 MiB/s, done.
Resolving deltas: 100% (8432/8432), done.
From .git/hgremote
 * [new branch]      dillo2     -> hg/dillo2
 * [new branch]      master     -> hg/master
 * [new tag]         start      -> start
From .git/hgremote
 * [new tag]         2.1-noCss  -> 2.1-noCss
 * [new tag]         release-2_0 -> release-2_0
 * [new tag]         release-2_1 -> release-2_1
 * [new tag]         release-2_1_1 -> release-2_1_1
 * [new tag]         release-2_2 -> release-2_2
 * [new tag]         release-2_2-rc1 -> release-2_2-rc1
 * [new tag]         release-2_2-rc2 -> release-2_2-rc2
 * [new tag]         release-2_2-rc3 -> release-2_2-rc3
 * [new tag]         release-2_2_1 -> release-2_2_1
 * [new tag]         release-3_0 -> release-3_0
 * [new tag]         release-3_0_1 -> release-3_0_1
From .git/hgremote
 * branch            master     -> FETCH_HEAD
--[00:33:27]--[pts/3]--[ ~/src ]--{ 0 }--
$> cd dillo3
--[00:34:03]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--                                                                                                   (master)
$> git st
# On branch master
nothing to commit (working directory clean)
--[00:34:07]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--                                                                                                   (master)
$> ls
AUTHORS     ChangeLog    configure.in  dillorc  doc       dpi   dpip      dw       install-dpi-local  Makefile.am  README  test
autogen.sh  config.h.in  COPYING       dlib     Doxyfile  dpid  d_size.h  INSTALL  lout               NEWS         src
--[00:34:11]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--                                                                                                   (master)
$> git remote add origin git@github.com:knarf-se/dillo.git
--[00:37:18]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--                                                                                                   (master)
$> git push -u origin master
Counting objects: 12512, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4080/4080), done.
error: object 7ec86cf5556b51b65559c32b2f88d7cacc4b6a5e:invalid author/committer line - bad date
fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:knarf-se/dillo.git'
--[00:38:15]--[pts/3]--[ ~/src/dillo3 ]--{ 1 }--
$> gitk --all
^C
--[00:43:11]--[pts/3]--[ ~/src/dillo3 ]--{ 130 }--                                                                                                 (master)
$> git co 26197be
Previous HEAD position was 3603d2f... don't force list item markers to far left (text-align)
HEAD is now at 26197be... Added better error handling for the web search dialog (search_url)
--[00:43:15]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--\n
$> git co -b mester
Switched to a new branch 'mester'
--[00:44:18]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--                                                                                                   (mester)
$> ls
AUTHORS     ChangeLog    configure.in  dillorc  doc       dpi   dpip      dw       install-dpi-local  Makefile.am  README  test
autogen.sh  config.h.in  COPYING       dlib     Doxyfile  dpid  d_size.h  INSTALL  lout               NEWS         src
--[00:44:26]--[pts/3]--[ ~/src/dillo3 ]--{ 0 }--
$> git push -u origin mester
Counting objects: 11730, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3834/3834), done.
error: object 17b16c13106bc25d817605b7a0ea9f853d0dfb5e:invalid author/committer line - bad email
fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:knarf-se/dillo.git'
--[00:45:27]--[pts/3]--[ ~/src/dillo3 ]--{ 1 }--                                                                                                   (mester)
$>

For my own sake, the Dillo git-mirror thing was not too important. I just thought I could use your script while I'm editing the Icons for Dillo anyway (I have not even compiled it yet, I wanted nicer Icons first, and Firefox is a memory sucker -- 2.7GB and counting ;) .

Otherwise, very big thanks for a nice program!

cosmin commented 12 years ago

This repository has some malformed user information on commits. All the recent stuff seems to be fairly up to date, but historically there are things like corvid@lavabit.com> and jcid. You can fix your locally converted git repo using something similar to http://stackoverflow.com/questions/6891370/how-fix-git-log-after-use-hg-fast-export-sh but I you might lose the ability to update to newer versions (not sure though).

Most of the heavy-lifting of git-hg is done by fast-export (http://repo.or.cz/w/fast-export.git/)

It has a -A option that you can supply an AUTHORFILE to which it should use to map authors in the repo to actual git authors. So you could use that to map invalid author lines to something proper. Or just hack up the Python script (http://repo.or.cz/w/fast-export.git/blob/HEAD:/hg-fast-export.py) to do something you would like if the author it detects is not valid.

If you find a general solution that should work in these types of situations let me know -- hopefully with a pull request :)

knarf-se commented 12 years ago

I might look into that someday, but not today, though. I have two other projects already that competes to get my attention.

But if I find a suitable and stable solution, I bet you'll be the first one to know :)