{"thread":{"id":"14049","subject":"git svn --use-log-author misbehavior?","startedAt":"2008-06-19T23:51:39Z","lastAt":"2008-06-20T12:04:48Z","messageCount":6,"participants":["Mircea Bardac","Fredrik Skolmli","Stephen R. van den Berg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"80417","messageId":"485AF10B.7060202@mircea.bardac.net","threadId":"14049","inReplyTo":null,"subject":"git svn --use-log-author misbehavior?","fromName":"Mircea Bardac","fromEmail":"dev@mircea.bardac.net","sentAt":"2008-06-19T23:51:39Z","receivedAt":"2008-06-19T23:51:39Z","isPatch":false,"sender":{"key":"dev@mircea.bardac.net","avatar":"https://gravatar.com/avatar/9cf887bf86f677aafb60f450e5898c0342283ebf3633c9bdbec1233256f2510f?d=mp&s=160"},"body":"Hi,\n\nAccording to the documentation, this parameter (--use-log-author) should \n  use the author from the From/Signed-off-by line. Unfortunately, I \nfound this to be working only on the first git svn clone. Later rebasing \nmade the commits use the old username@uuid format.\n\nI am assuming the option is not being preserved in the Git repository \nmetadata and it is only used on cloning/init. Is this the intended \nbehavior?\n\nMany thanks.\n\n-- \nMircea\nhttp://mircea.bardac.net\n"},{"id":"80450","messageId":"20080620085618.GA27940@frsk.net","threadId":"14049","inReplyTo":"485AF10B.7060202@mircea.bardac.net","subject":"Re: git svn --use-log-author misbehavior?","fromName":"Fredrik Skolmli","fromEmail":"fredrik@frsk.net","sentAt":"2008-06-20T08:56:18Z","receivedAt":"2008-06-20T08:56:18Z","isPatch":false,"sender":{"key":"fredrik@frsk.net","avatar":"https://avatars.githubusercontent.com/u/40261?v=4"},"body":"On Fri, Jun 20, 2008 at 12:51:39AM +0100, Mircea Bardac wrote:\n> Hi,\n> \n> According to the documentation, this parameter (--use-log-author) should \n>  use the author from the From/Signed-off-by line. Unfortunately, I \n> found this to be working only on the first git svn clone. Later rebasing \n> made the commits use the old username@uuid format.\n> \n> I am assuming the option is not being preserved in the Git repository \n> metadata and it is only used on cloning/init. Is this the intended \n> behavior?\n\nDoesn't look like it. When you're using --add-author-from on dcommit, git-svn\ndoesn't seem to know that it should look after \"From:\" in the commit, thus\nnot setting the author correctly. The following oneliner should solve the\ncase. Please let me know if it works as well for you as it did for me.\n \nSigned-off-by: Fredrik Skolmli <fredrik@frsk.net>\n---\n git-svn.perl |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a54979d..8f77b91 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -432,6 +432,9 @@ sub cmd_dcommit {\n \t\t     \"without --no-rebase may be required.\"\n \t}\n \twhile (1) {\n+\t\tif ($Git::SVN::_add_author_from) {\n+\t\t\t$Git::SVN::_use_log_author = 1;\n+\t\t}\n \t\tmy $d = shift @$linear_refs or last;\n \t\tunless (defined $last_rev) {\n \t\t\t(undef, $last_rev, undef) = cmt_metadata(\"$d~1\");\n-- \n1.5.6.6.gd3e97\n\n-- \nRegards,\nFredrik Skolmli\n"},{"id":"80456","messageId":"485B82BD.2000404@mircea.bardac.net","threadId":"14049","inReplyTo":"20080620085618.GA27940@frsk.net","subject":"Re: git svn --use-log-author misbehavior?","fromName":"Mircea Bardac","fromEmail":"dev@mircea.bardac.net","sentAt":"2008-06-20T10:13:17Z","receivedAt":"2008-06-20T10:13:17Z","isPatch":false,"sender":{"key":"dev@mircea.bardac.net","avatar":"https://gravatar.com/avatar/9cf887bf86f677aafb60f450e5898c0342283ebf3633c9bdbec1233256f2510f?d=mp&s=160"},"body":"Fredrik Skolmli wrote:\n> On Fri, Jun 20, 2008 at 12:51:39AM +0100, Mircea Bardac wrote:\n>> Hi,\n>>\n>> According to the documentation, this parameter (--use-log-author) should \n>>  use the author from the From/Signed-off-by line. Unfortunately, I \n>> found this to be working only on the first git svn clone. Later rebasing \n>> made the commits use the old username@uuid format.\n>>\n>> I am assuming the option is not being preserved in the Git repository \n>> metadata and it is only used on cloning/init. Is this the intended \n>> behavior?\n> \n> Doesn't look like it. When you're using --add-author-from on dcommit, git-svn\n> doesn't seem to know that it should look after \"From:\" in the commit, thus\n> not setting the author correctly. The following oneliner should solve the\n> case. Please let me know if it works as well for you as it did for me.\n\nI haven't tested this yet but I have a feeling this is not my case, or I \nmight not be fully understanding the implications of \"--add-author-from\" \non the functionality of \"--use-log-author\". Technically, they should be \nindependent and the options should not depend on each other:\n* --use-log-author only applies to getting info from the commits\n* --add-author-from only applies to putting info in the commits\n\n From the documentation, these 2 options can only be used with git svn \ninit/clone so they should somehow be saved for future use. Maybe this \ndoesn't happen.\n\nMy Git commits (not dcommits) already have \"Signed-off-by:\" at the end, \nadded with \"git commit -s\". When I do a \"git svn dcommit\" they get \npushed to SVN and the entire commit is rewritten. I have \n--add-author-from added on git clone, but nothing else is being added to \nthe commit except the git-svn-id - from my point of view, according to \nthe documentation, this is the correct behavior (since there already is \na Signed-off-by line)\n\nThe problem is that, after the dcommit, when *viewing* the latest \ncommits in the git-svn repository, even though they have \n\"Signed-off-by:\" in them, I see them not respecting the --use-log-author \noption, showing up as username@uuid. What I assume is that, after a \ndcommit (and everything being done on dcommit) the --use-log-author \noption is ignored.\n\nLooking over the code, I see that make_log_entry (which is responsible \nfor getting the correct format for the user/e-mail out of the commit \nmessage) is only being called in do_fetch and find_parent_branch. I am \nnot sure if these are somehow called by cmd_dcommit.\n\nMany thanks.\n\n--\nMircea\nhttp://mircea.bardac.net\n"},{"id":"80457","messageId":"20080620104802.GA9690@cuci.nl","threadId":"14049","inReplyTo":"485B82BD.2000404@mircea.bardac.net","subject":"Re: git svn --use-log-author misbehavior?","fromName":"Stephen R. van den Berg","fromEmail":"srb@cuci.nl","sentAt":"2008-06-20T10:48:02Z","receivedAt":"2008-06-20T10:48:02Z","isPatch":false,"sender":{"key":"srb@cuci.nl","avatar":"https://gravatar.com/avatar/f75389059e827634d38e9df2a9b6ecbd50028b5a454442efa1c7205b7ff29c6a?d=mp&s=160"},"body":"Mircea Bardac wrote:\n>I haven't tested this yet but I have a feeling this is not my case, or I \n>might not be fully understanding the implications of \"--add-author-from\" \n>on the functionality of \"--use-log-author\". Technically, they should be \n>independent and the options should not depend on each other:\n>* --use-log-author only applies to getting info from the commits\n>* --add-author-from only applies to putting info in the commits\n\nThey are independent.\n\n>From the documentation, these 2 options can only be used with git svn \n>init/clone so they should somehow be saved for future use. Maybe this \n>doesn't happen.\n\nAt least --use-log-author can be used on git svn fetch (and possibly\nother subcommands) as well.\nAnd no, it currently is not being saved.\n-- \nSincerely,\n           Stephen R. van den Berg.\n\nConfidence is that feeling you have before you understand the situation.\n"},{"id":"80459","messageId":"20080620105729.GB27940@frsk.net","threadId":"14049","inReplyTo":"485B82BD.2000404@mircea.bardac.net","subject":"Re: git svn --use-log-author misbehavior?","fromName":"Fredrik Skolmli","fromEmail":"fredrik@frsk.net","sentAt":"2008-06-20T10:57:29Z","receivedAt":"2008-06-20T10:57:29Z","isPatch":false,"sender":{"key":"fredrik@frsk.net","avatar":"https://avatars.githubusercontent.com/u/40261?v=4"},"body":"On Fri, Jun 20, 2008 at 11:13:17AM +0100, Mircea Bardac wrote:\n\n> I haven't tested this yet but I have a feeling this is not my case, or I \n> might not be fully understanding the implications of \"--add-author-from\" \n> on the functionality of \"--use-log-author\". Technically, they should be \n> independent and the options should not depend on each other:\n> * --use-log-author only applies to getting info from the commits\n> * --add-author-from only applies to putting info in the commits\n> \n> From the documentation, these 2 options can only be used with git svn \n> init/clone so they should somehow be saved for future use. Maybe this \n> doesn't happen.\n> \n> My Git commits (not dcommits) already have \"Signed-off-by:\" at the end, \n> added with \"git commit -s\". When I do a \"git svn dcommit\" they get \n> pushed to SVN and the entire commit is rewritten. I have \n> --add-author-from added on git clone, but nothing else is being added to \n> the commit except the git-svn-id - from my point of view, according to \n> the documentation, this is the correct behavior (since there already is \n> a Signed-off-by line)\n \nDid you mean \"git svn clone\" here, not \"git clone\"? And if --use-log-author\nis to be used to get retrieve info from the commits, it should be used\ninstead of --add-author-from when doing a clone. (Which as far as I can see\nbehaves correctly.)\n\nHowever, looks like I might have misunderstood your problem, and possibly\nfound a bug in the process. I'll look closer into it. :-)\n\n-- \nRegards,\nFredrik Skolmli\n"},{"id":"80465","messageId":"485B9CE0.1060600@mircea.bardac.net","threadId":"14049","inReplyTo":"20080620105729.GB27940@frsk.net","subject":"Re: git svn --use-log-author misbehavior?","fromName":"Mircea Bardac","fromEmail":"dev@mircea.bardac.net","sentAt":"2008-06-20T12:04:48Z","receivedAt":"2008-06-20T12:04:48Z","isPatch":false,"sender":{"key":"dev@mircea.bardac.net","avatar":"https://gravatar.com/avatar/9cf887bf86f677aafb60f450e5898c0342283ebf3633c9bdbec1233256f2510f?d=mp&s=160"},"body":"Fredrik Skolmli wrote:\n> On Fri, Jun 20, 2008 at 11:13:17AM +0100, Mircea Bardac wrote:\n>> My Git commits (not dcommits) already have \"Signed-off-by:\" at the end, \n>> added with \"git commit -s\". When I do a \"git svn dcommit\" they get \n>> pushed to SVN and the entire commit is rewritten. I have \n>> --add-author-from added on git clone, but nothing else is being added to \n>> the commit except the git-svn-id - from my point of view, according to \n>> the documentation, this is the correct behavior (since there already is \n>> a Signed-off-by line)\n>  \n> Did you mean \"git svn clone\" here, not \"git clone\"?\n\nYes, I meant \"git svn clone\".\n\n> And if --use-log-author\n> is to be used to get retrieve info from the commits, it should be used\n> instead of --add-author-from when doing a clone. (Which as far as I can see\n> behaves correctly.)\n\nThat is right. I am using them like this, but according to Stephen's \nreply the --use-log-author option is not being saved. I assumed they \nwere saved as an option of the git svn clone so that they would affect \nall future dcommits.\n\n--\nMircea\nhttp://mircea.bardac.net\n"}]}