Open chappy84 opened 12 years ago
yep - this is a problem, I just got the same thing. Example:
2>&1 git tag -a -m "EDT-633: The characters that disallowed in an openEHR URI following the '\'':'\'' were <>|{}^~"[] and the space character. Three of these characters overlap with the RFC 3986 reserved or unreserved characters: ~[]" "Aug2007" "svn/tags/Aug2007"
After messing around with the script, i tried the following. I'm not a Ruby programmer, so don't trust me, but it worked (in /var/lib/gems/1.8/gems/svn2git-2.2.2/lib/svn2git/migration.rb)
def escape_quotes(str) str.gsub("'", "'\''") str.gsub("\"", "\"") end
I am also affected by the problem... and replacing the original escape_quotes function with your version (correctly indented) didn't work. I get a syntax error... I instead tried this: def escape_quotes(str) str.gsub("'", "'\\''") str.gsub("\"", 34.char) end
This process is still ongoing, but at least I didn't get a syntax error.
On 29/10/2012 16:45, alci63 wrote:
I am also affected by the problem... and replacing the original escape_quotes function with your version (correctly indented) didn't work. I get a syntax error... I instead tried this: def escape_quotes(str) str.gsub("'", "'\''") str.gsub("\"", 34.char) end
I assume this is to do with versions of RUby or something like that? The thing I posted is the first line of Ruby I have ever written, but it did run on my machine (Ubuntu, latest stable Ruby download about 10 days ago).
BTW the first line which was intended to fix single quotes looked 'wrong' to me, but .. I don't know Ruby, so I left it.
I have no idea what the proper Ruby is for this function, but the original tool certainly needs a reliable fix for both kinds of quotes occurring in messages.
best,
Thomas, I think I get caught by the formating of messages here on github, as it takes a lot of \ to get one on screen. So on your first post, I see two backslash, but I guess there are 4 of them really. So your code might well work (I got to try tomorow). Anyway a fix for this would indeed be welcome !
Right - I didn't think of that. I'll try quoting with 'markdown'. I just previewed it, it now looks correct.
def escape_quotes(str)
str.gsub("'", "'\\\\''")
str.gsub("\"", "\\\"")
end
Just ran across this myself. Pretty nasty bug considering svn2git will simply stop importing tags when it comes across this situation. Luckily (?) even if you don't run with the "-v" flag enabled, svn2git will display the "command failed:" error.
same Problem with $ signs in messages. You have to quote them as well
If you have stored the commit message in a variable and the message contains spaces, the variable should be double quoted (example:- "$message") in the git tag command. Otherwise it will consider it as separate parameters passed to that git tag command. example:- msg = "this is a tag name" sh """ git tag -a "tag_name" -m "$msg" #//this is correct git tag -a "tag_name" -m $msg #//this is in correct. since it contains spaces the actual understanding is git tag -a "tag_name" -m this is a tag name . That's why it shows error. """
Try replacing the double quotes to single quotes in your tag message -m
I was creating a git copy of an svn repository and when it got to a tag which was encased in double quotes it failed as the command had too many arguments
here's the screen output:
Running command: git config --local user.name "wojciech" Running command: git config --local user.email "wojciech" Running command: git tag -a -m ""added Polish translation"" "release-0.7.0@2895" "svn/tags/release-0.7.0@2895" fatal: too many params command failed: 2>&1 git tag -a -m ""added Polish translation"" "release-0.7.0@2895" "svn/tags/release-0.7.0@2895" Running command: git config --local --unset user.email Running command: git config --local --unset user.name