{"thread":{"id":"26275","subject":"noob question","startedAt":"2011-01-13T23:58:13Z","lastAt":"2011-01-14T21:32:53Z","messageCount":3,"participants":["Harry Johnson","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159456","messageId":"AANLkTinU---Bw5nWFXr7psSyZEty=awihPrDGqNX916O@mail.gmail.com","threadId":"26275","inReplyTo":null,"subject":"noob question","fromName":"Harry Johnson","fromEmail":"hjohnson@viasic.com","sentAt":"2011-01-13T23:58:13Z","receivedAt":"2011-01-13T23:58:13Z","isPatch":false,"sender":{"key":"hjohnson@viasic.com","avatar":null},"body":"I am completely new to git and have only read the tutorial as well as\nsome git for subversion users documentation. Our company is\nconsidering switching from subversion to git and I have been doing\nsome experimenting and have run across a potential problem. Our\nsystems are kubuntu/linux.\n\nI have used git-svn to create a git repo from our subversion repo. I\nhave done this as user foo which is just an account that is used for\ndoing central builds. I have then cloned this as repo as myself,\nharry. My thought is that the repo owned by foo would be a central\nrepo that all of the developers, including myself, could clone and to\nwhich  we could then 'git push' our changes. The nightly builds would\nthen simply build whatever was currently in the foo repo. This of\ncourse completely ignores the complexity of branches at this point but\nlike I said, I am experimenting. I did a test of this and what I found\nwhen checking the git log is that while the changes I made and checked\ninto my repo clearly showed me as the author, the same changes after\nbeing pushed to foo's repo showed a different author.\n\nSo two things.. First should the author have been preserved? How can I\nmake sure that it is?\n\nSecond, and probably the better question. Am I too focused on the\nsubversion methodology? Is there a better way of managing a central\nbuild scheme using git?\n\nThanks!\n-Harry\n"},{"id":"159478","messageId":"201101141210.25523.trast@student.ethz.ch","threadId":"26275","inReplyTo":"AANLkTinU---Bw5nWFXr7psSyZEty=awihPrDGqNX916O@mail.gmail.com","subject":"Re: noob question","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2011-01-14T11:10:25Z","receivedAt":"2011-01-14T11:10:25Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Harry Johnson wrote:\n> \n> I have used git-svn to create a git repo from our subversion repo. I\n> have done this as user foo which is just an account that is used for\n> doing central builds. I have then cloned this as repo as myself,\n> harry. My thought is that the repo owned by foo would be a central\n> repo that all of the developers, including myself, could clone and to\n> which  we could then 'git push' our changes.\n[...]\n> when checking the git log is that while the changes I made and checked\n> into my repo clearly showed me as the author, the same changes after\n> being pushed to foo's repo showed a different author.\n> \n> So two things.. First should the author have been preserved? How can I\n> make sure that it is?\n\nYes, absolutely, and since the author is encoded in the commit objects\nit's impossible to change it without also changing the commit sha1s.\n\nCan you spell your experiments in actual commands and output snippets\nso we can see what happened?\n\nDid you ever run 'git svn dcommit', 'git rebase', 'git commit --amend'\nor similar in foo's repo?  All of these rewrite commits.  As part of\ntheir rewriting they set the *committer* to the identity of the\ncurrent user.  'git svn dcommit' sets author&committer to the identity\ncoming back from SVN.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"159509","messageId":"AANLkTi=gqfb1KDGZ_h2bbxH7HyBw70JkVnO-Xi98OSCu@mail.gmail.com","threadId":"26275","inReplyTo":"201101141210.25523.trast@student.ethz.ch","subject":"Re: noob question","fromName":"Harry Johnson","fromEmail":"hjohnson@viasic.com","sentAt":"2011-01-14T21:32:53Z","receivedAt":"2011-01-14T21:32:53Z","isPatch":false,"sender":{"key":"hjohnson@viasic.com","avatar":null},"body":">> I have used git-svn to create a git repo from our subversion repo. I\n>> have done this as user foo which is just an account that is used for\n>> doing central builds. I have then cloned this as repo as myself,\n>> harry. My thought is that the repo owned by foo would be a central\n>> repo that all of the developers, including myself, could clone and to\n>> which  we could then 'git push' our changes.\n> [...]\n>> when checking the git log is that while the changes I made and checked\n>> into my repo clearly showed me as the author, the same changes after\n>> being pushed to foo's repo showed a different author.\n>>\n>> So two things.. First should the author have been preserved? How can I\n>> make sure that it is?\n>\n> Yes, absolutely, and since the author is encoded in the commit objects\n> it's impossible to change it without also changing the commit sha1s.\n>\n> Can you spell your experiments in actual commands and output snippets\n> so we can see what happened?\n>\n> Did you ever run 'git svn dcommit', 'git rebase', 'git commit --amend'\n> or similar in foo's repo?  All of these rewrite commits.  As part of\n> their rewriting they set the *committer* to the identity of the\n> current user.  'git svn dcommit' sets author&committer to the identity\n> coming back from SVN.\n\nAh that does sound like the issue then. I did in fact do a git svn\ndcommit to commit the changes from the foo repo to our subversion\nrepo. If dcommit rewrites the commit changing the author then that\nwould explain it.\n\nSo I did a new test. I made a change and committed it to my local\nrepo. I then did a git pull to bring my repo in sync with the foo\nrepo, then did a push to the foo repo. Before doing anything else I\nchecked the author of my changes in the foo repo and sure enough I am\nthe author! Yay for that.\n\nNow I try to git svn dcommit and I receive the following error:\nMerge conflict during commit: File or directory 'bar' is out of date.\nTry updating ...\n\nSo I do a git svn rebase, followed by git svn dcommit which works. Now\nlooking at git log I see that my changes are 'authored' by some else.\nAll that to say that you seem to hit the nail on the head and the git\nsvn rebase and git svn dcommit are rewriting the commits and changing\nthe author.\n\nIf we do indeed adopt git as our version control system then we would\nfreeze the subversion repo and not worry about git svn any further so\nI think this is ultimately a non-issue and just something we will deal\nwith during this hybrid testing period.\n\nThanks!!\n-Harry\n\n>\n> --\n> Thomas Rast\n> trast@{inf,student}.ethz.ch\n>\n"}]}