dusty-phillips / gitifyhg

Tools for using git as a client to mercurial repositories
GNU General Public License v3.0
62 stars 17 forks source link

Signed tags don't work #59

Open PaulPrice opened 11 years ago

PaulPrice commented 11 years ago

I used a signed tag from force of habit, and it didn't work.

$ git tag foo -asm "Tag message here"

You need a passphrase to unlock the secret key for
user: "Paul Price <nospam@nospam.pls>"
2048-bit RSA key, ID XXXXXXXX, created 2012-02-30 (main key ID XXXXXXXX)

gpg: gpg-agent is not available in this session

$ git push origin foo
fatal: Encountered signed tag c0103ae88260faab2be7383adf292ec32c719266; use --signed-tag=<mode> to handle it.
fatal: Error while running fast-export
Traceback (most recent call last):
  File "/home/price/local/Linux.x86_64/bin/git-remote-gitifyhg", line 8, in <module>
    load_entry_point('gitifyhg==0.8', 'console_scripts', 'git-remote-gitifyhg')()
  File "build/bdist.linux-x86_64/egg/gitifyhg/gitifyhg.py", line 262, in main
  File "build/bdist.linux-x86_64/egg/gitifyhg/gitifyhg.py", line 172, in process
  File "build/bdist.linux-x86_64/egg/gitifyhg/gitifyhg.py", line 255, in do_export
  File "build/bdist.linux-x86_64/egg/gitifyhg/gitexporter.py", line 57, in process
IndexError: list index out of range
dusty-phillips commented 11 years ago

Whoah, that's exciting!! :-) I'll try to look at it during the pycon sprints this week.

PaulPrice commented 11 years ago

Dunno that I would have called an exception "exciting", but to each their own.... (:

Thanks, Dusty!

PaulPrice commented 11 years ago

This looks like a limitation/bug in the git-remote-helpers. The default for the --signed-tags option to git fast-export is abort, which produces the error in the DEBUG_GITIFYHG stream:

fatal: Encountered signed tag 72bdf8dd0a31c4783c00e21f1a54760f1f16c11d; use --signed-tag=<mode> to handle it.

(Yes, the error message refers to --signed-tag, singular, while the manpage refers to --signed-tags, plural; this appears to be a typo in git's fast-export.c.)

However, as far as I can tell, there's no way to set the --signed-tags option (e.g., strip might be appropriate). I can't see any git config parameters that will do that. I would think that the git-remote-helpers should ask the helper how it wants to handle signed tags (or just pass them on so it can drop them on the floor in the parsing) rather than defaulting to abort.