{"thread":{"id":"26587","subject":"git-svn dcommit losing/detaching head when commit message empty","startedAt":"2011-02-24T01:27:25Z","lastAt":"2011-02-27T02:50:39Z","messageCount":3,"participants":["Hin-Tak Leung","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162094","messageId":"AANLkTi=A-UG2aOcwwNbjoBK4pYDtKp=0nFmcwrgVv0f8@mail.gmail.com","threadId":"26587","inReplyTo":null,"subject":"git-svn dcommit losing/detaching head when commit message empty","fromName":"Hin-Tak Leung","fromEmail":"hintak.leung@gmail.com","sentAt":"2011-02-24T01:27:25Z","receivedAt":"2011-02-24T01:27:25Z","isPatch":false,"sender":{"key":"hintak.leung@gmail.com","avatar":null},"body":"Hi,\n\nI have just encountered a small problem with git-svn dcommit, which\nwhile not fatal, were quite worrying as\nit resulted in a detached head(?) for a while. This is with\ngit-1.7.4-1.fc14.x86_64 .\n\nWhat happened is that I was trying to cherry-pick from one svn branch\n(of commits from somebody else using genuine svn)\ninto another svn branch and then do some fix-ups before dcommit to\npush into another svn branch.\n\nWhen dcommit'ing, it bombed out in the middle because one of the older\ncherry-picks has no/empty svn commit message. So it\nresults into this message:\n\n-------------------\nA repository hook failed: 'pre-commit' hook failed with error output:\nPlease enter a commit message which details what has changed during this commit.\n at /usr/libexec/git-core/git-svn line 576\n-------------------\n\nThat's fair enough and obvious enough, but then at that point, the\nindex is at the pre-bomb, and the working directory is post-bomb, I\nthink, and neither is HEAD of\nmy working branch. This is quite worrying - I think if I had done 'git\ngc --prune=now --aggressive' at this point I would have lost my work?\nLuckily I had a \"git log\" display before, so I did \"git checkout -b\npreserving_work sha1_of_working_branch_head\" to keep it.\n\nSo I did git rebase -i to edit the original commit messages to add\nsomething to them. (which arguably git-svn should do automatically? or\nempty messages really frowned upon? I always commit with at least a\ntrivial message, but as I said, I was cherry-picking others' commits,\nwhose development habits I have no control over)\n\nAfter I fixed that and continue as I intended, then there is another\nbomb-out, when git-svn complains about a git commit message of mine\n(with minor edit):\n-------------\nRunning\nperl -pi -e 's(sometag=\"original\")(sometag=\"replacement\")' directory/*\n-------------\nbeing empty. On hind-sight, it is probably not a good idea to have\nperl regular expression code within a commit message (git-svn itself\nbeing in perl), but complaining about a non-empty commit message (and\nseem to be a valid one, no strange utf8/chinese characters, etc) being\nempty seems to be a bug.\n\nHope this helps. BTW, git-svn is a great tool, and thanks a lot for\nthat - I wouldn't use anything else (including the \"authentic\" svn\nclient) to interact with svn repositories these days.\n\nHin-Tak\n"},{"id":"162099","messageId":"AANLkTi=Dk4VDkzE=j=CCbkb6dUAQRKHT9xT6Oefn+Ujd@mail.gmail.com","threadId":"26587","inReplyTo":"AANLkTi=A-UG2aOcwwNbjoBK4pYDtKp=0nFmcwrgVv0f8@mail.gmail.com","subject":"Re: git-svn dcommit losing/detaching head when commit message empty","fromName":"Hin-Tak Leung","fromEmail":"hintak.leung@gmail.com","sentAt":"2011-02-24T02:37:17Z","receivedAt":"2011-02-24T02:37:17Z","isPatch":false,"sender":{"key":"hintak.leung@gmail.com","avatar":null},"body":"On Thu, Feb 24, 2011 at 1:27 AM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:\n...\n> After I fixed that and continue as I intended, then there is another\n> bomb-out, when git-svn complains about a git commit message of mine\n> (with minor edit):\n> -------------\n> Running\n> perl -pi -e 's(sometag=\"original\")(sometag=\"replacement\")' directory/*\n> -------------\n> being empty. On hind-sight, it is probably not a good idea to have\n> perl regular expression code within a commit message (git-svn itself\n> being in perl), but complaining about a non-empty commit message (and\n> seem to be a valid one, no strange utf8/chinese characters, etc) being\n> empty seems to be a bug.\n\nJust adding to this part: it appears that git-svn doesn't like the\nfirst-line of the commit message being just one word (in this case,\n\"Running\"). I have just done one where the commit message was a single\nword \"renaming\" (it would be obvious which file I was renaming, so I\nthought there is no need to say more), which also caused git-svn\ndcommit to complain about it being empty.\n\nMany thanks for git-svn - as I wrote below, I wouldn't use anything\nelse these days.\n\n> Hope this helps. BTW, git-svn is a great tool, and thanks a lot for\n> that - I wouldn't use anything else (including the \"authentic\" svn\n> client) to interact with svn repositories these days.\n>\n> Hin-Tak\n>\n"},{"id":"162336","messageId":"20110227025039.GB26643@dcvr.yhbt.net","threadId":"26587","inReplyTo":"AANLkTi=A-UG2aOcwwNbjoBK4pYDtKp=0nFmcwrgVv0f8@mail.gmail.com","subject":"Re: git-svn dcommit losing/detaching head when commit message empty","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2011-02-27T02:50:39Z","receivedAt":"2011-02-27T02:50:39Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Hin-Tak Leung <hintak.leung@gmail.com> wrote:\n> Hi,\n> \n> I have just encountered a small problem with git-svn dcommit, which\n> while not fatal, were quite worrying as\n> it resulted in a detached head(?) for a while. This is with\n> git-1.7.4-1.fc14.x86_64 .\n\nThis is a known issue for a while that nobody's had time to get around\nto fixing just yet.  I think setting aside a temporary branch should\nwork...\n\n> Hope this helps. BTW, git-svn is a great tool, and thanks a lot for\n> that - I wouldn't use anything else (including the \"authentic\" svn\n> client) to interact with svn repositories these days.\n\nThanks for the encouragement.  I hardly need git svn nowadays so I\nneed all the encouragement I can get to set aside time for it from\nother projects :)\n\n-- \nEric Wong\n"}]}