{"thread":{"id":"26693","subject":"Who created a branch - reflog","startedAt":"2011-03-08T14:38:46Z","lastAt":"2011-03-08T15:11:07Z","messageCount":3,"participants":["Miklos Vajna","Shawn Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162991","messageId":"20110308143846.GV3609@genesis.frugalware.org","threadId":"26693","inReplyTo":null,"subject":"Who created a branch - reflog","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2011-03-08T14:38:46Z","receivedAt":"2011-03-08T14:38:46Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hi,\n\nWe have a repo where multiple users have push access, they access the\nrepo via ssh. Now let's say one of the developers (\"A\") accidently create a\nbranch named \"foo\" in the shared repo. Of course the tip of \"foo\" may\nnot point to a commit authored by \"A\".\n\nIIRC reflogs could be used in that case when the push is done via http,\nas the HTTP username is recorded in the reflog, so we can know who to\nblame.\n\nUnfortunately - as far as I see - this is not true for ssh, there simply\nthe author of the tip commit is used.\n\nHave I missed something? Would it be possible to have the username of\nthe user in the reflog, even when pushing via ssh?\n\nThanks.\n"},{"id":"162992","messageId":"AANLkTimsz7OPfUF5j=xY6ro4uX4AQty+PzW-tG6TQbuW@mail.gmail.com","threadId":"26693","inReplyTo":"20110308143846.GV3609@genesis.frugalware.org","subject":"Re: Who created a branch - reflog","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2011-03-08T14:57:38Z","receivedAt":"2011-03-08T14:57:38Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On Tue, Mar 8, 2011 at 06:38, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> We have a repo where multiple users have push access, they access the\n> repo via ssh. Now let's say one of the developers (\"A\") accidently create a\n> branch named \"foo\" in the shared repo. Of course the tip of \"foo\" may\n> not point to a commit authored by \"A\".\n>\n> IIRC reflogs could be used in that case when the push is done via http,\n> as the HTTP username is recorded in the reflog, so we can know who to\n> blame.\n>\n> Unfortunately - as far as I see - this is not true for ssh, there simply\n> the author of the tip commit is used.\n>\n> Have I missed something? Would it be possible to have the username of\n> the user in the reflog, even when pushing via ssh?\n\nreflog identity entries are derived from GIT_COMMITTER_NAME and\nGIT_COMMITTER_EMAIL in the environment at the time that the log event\ntakes place. If these aren't set, they are derived from the current\nuser's gecos, or from $GIT_DIR/config or ~/.gitconfig as the\nuser.name/user.email variables.\n\nPerhaps over SSH one of these is triggering for a user, allowing the\nuser to fill in their own identity... or someone else's. If you want\nto enforce an identity you should set these environment variables on\nthe SSH server side before invoking git-receive-pack, perhaps by way\nof a forced SSH command the way gitosis or gitolite is installed.\n\n-- \nShawn.\n"},{"id":"162993","messageId":"20110308151107.GW3609@genesis.frugalware.org","threadId":"26693","inReplyTo":"AANLkTimsz7OPfUF5j=xY6ro4uX4AQty+PzW-tG6TQbuW@mail.gmail.com","subject":"Re: Who created a branch - reflog","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2011-03-08T15:11:07Z","receivedAt":"2011-03-08T15:11:07Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Tue, Mar 08, 2011 at 06:57:38AM -0800, Shawn Pearce <spearce@spearce.org> wrote:\n> reflog identity entries are derived from GIT_COMMITTER_NAME and\n> GIT_COMMITTER_EMAIL in the environment at the time that the log event\n> takes place. If these aren't set, they are derived from the current\n> user's gecos, or from $GIT_DIR/config or ~/.gitconfig as the\n> user.name/user.email variables.\n> \n> Perhaps over SSH one of these is triggering for a user, allowing the\n> user to fill in their own identity... or someone else's. If you want\n> to enforce an identity you should set these environment variables on\n> the SSH server side before invoking git-receive-pack, perhaps by way\n> of a forced SSH command the way gitosis or gitolite is installed.\n\nThen once I'm sure the users can't alter their identity on the server,\nthe same can be achieved using ssh as with http.\n\nGreat, that's exactly what I was needed. :)\n\nThanks!\n"}]}