{"thread":{"id":"29994","subject":"link user-name with ssh-login","startedAt":"2012-03-19T16:58:56Z","lastAt":"2012-03-21T16:30:37Z","messageCount":5,"participants":["Roberto","Junio C Hamano","Jeff King","Shawn Pearce","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"187262","messageId":"4F6765D0.5060706@gmail.com","threadId":"29994","inReplyTo":null,"subject":"link user-name with ssh-login","fromName":"Roberto","fromEmail":"mrgreiner@gmail.com","sentAt":"2012-03-19T16:58:56Z","receivedAt":"2012-03-19T16:58:56Z","isPatch":false,"sender":{"key":"mrgreiner@gmail.com","avatar":null},"body":"Hi,\n\nI have small ssh-based git server used for insite code development. But \nthere is one thing I can't find how to set.\n\nIn the server, each developer has a valid ssh account (I switched the \nshell to git-shell). The problem is that when a developer commit's some \ncode, he can freely set in his local .git/config file the user name he \nwant's to appear in the commit logs. Is there any way to link/force a \ncertain ssh login to a name?\n\nThanks,\n\nRoberto\n\n-- \n   -----------------------------------------------------\n                 Marcos Roberto Greiner\n\n    Os otimistas acham que estamos no melhor dos mundos\n     Os pessimistas tem medo de que isto seja verdade\n                                   James Branch Cabell\n   -----------------------------------------------------\n"},{"id":"187269","messageId":"7v7gygbdxg.fsf@alter.siamese.dyndns.org","threadId":"29994","inReplyTo":"4F6765D0.5060706@gmail.com","subject":"Re: link user-name with ssh-login","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-19T19:15:07Z","receivedAt":"2012-03-19T19:15:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Roberto <mrgreiner@gmail.com> writes:\n\n> I have small ssh-based git server used for insite code\n> development. But there is one thing I can't find how to set.\n>\n> In the server, each developer has a valid ssh account (I switched the\n> shell to git-shell). The problem is that when a developer commit's\n> some code, he can freely set in his local .git/config file the user\n> name he want's to appear in the commit logs. Is there any way to\n> link/force a certain ssh login to a name?\n\nA pre-receive hook that lists the author names of the commits, along the\nlines of \"git log --format='%an <%ae>' $OLD_HEAD..$NEW_HEAD\" and compares\nagainst the name of the user authenticated against your SSH server would\nbe a way to do this.\n\nBut that would mean you are forbidding people to accept patches from\nothers, inspect the patches for validity and vouch for them, while giving\nthe credit to them by recoding the author names of the patch authors.\n\nPerhaps checking the committer name would suit your situation better.  I\ndunno.\n"},{"id":"187278","messageId":"20120319205747.GB3039@sigill.intra.peff.net","threadId":"29994","inReplyTo":"7v7gygbdxg.fsf@alter.siamese.dyndns.org","subject":"Re: link user-name with ssh-login","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-19T20:57:47Z","receivedAt":"2012-03-19T20:57:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 19, 2012 at 12:15:07PM -0700, Junio C Hamano wrote:\n\n> A pre-receive hook that lists the author names of the commits, along the\n> lines of \"git log --format='%an <%ae>' $OLD_HEAD..$NEW_HEAD\" and compares\n> against the name of the user authenticated against your SSH server would\n> be a way to do this.\n> \n> But that would mean you are forbidding people to accept patches from\n> others, inspect the patches for validity and vouch for them, while giving\n> the credit to them by recoding the author names of the patch authors.\n> \n> Perhaps checking the committer name would suit your situation better.  I\n> dunno.\n\nThen you would be forbidding merges of other people's work, no? Even if\nthe other person's commits are available in the upstream repo, they\nmight be hitting this ref for the first time, and would be generally be\nchecked by such a hook.\n\n-Peff\n"},{"id":"187285","messageId":"CAJo=hJvqr2pKVje490g2k2Wxdf2rrQYsrWQ2eN6bPn84fRxLEQ@mail.gmail.com","threadId":"29994","inReplyTo":"20120319205747.GB3039@sigill.intra.peff.net","subject":"Re: link user-name with ssh-login","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2012-03-19T21:56:04Z","receivedAt":"2012-03-19T21:56:04Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On Mon, Mar 19, 2012 at 13:57, Jeff King <peff@peff.net> wrote:\n> On Mon, Mar 19, 2012 at 12:15:07PM -0700, Junio C Hamano wrote:\n>\n>> A pre-receive hook that lists the author names of the commits, along the\n>> lines of \"git log --format='%an <%ae>' $OLD_HEAD..$NEW_HEAD\" and compares\n>> against the name of the user authenticated against your SSH server would\n>> be a way to do this.\n>>\n>> But that would mean you are forbidding people to accept patches from\n>> others, inspect the patches for validity and vouch for them, while giving\n>> the credit to them by recoding the author names of the patch authors.\n>>\n>> Perhaps checking the committer name would suit your situation better.  I\n>> dunno.\n>\n> Then you would be forbidding merges of other people's work, no? Even if\n> the other person's commits are available in the upstream repo, they\n> might be hitting this ref for the first time, and would be generally be\n> checked by such a hook.\n\nMost hooks that are trying to do this use \"$NEW_HEAD --not --all\" to\nonly examine commits that would be newly reachable. Already reachable\ncommits are presumed valid. If you want to merge someone else's\ncommits, just make sure they have already pushed their commits to a\nbranch somewhere, like a refs/heads/$USER/ sandbox space or something.\n"},{"id":"187402","messageId":"CAMK1S_iND20y+5GaeEpUzXWFZLMXa=XUs-b3hDaZ+WvhaCZvnw@mail.gmail.com","threadId":"29994","inReplyTo":"4F6765D0.5060706@gmail.com","subject":"Re: link user-name with ssh-login","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-03-21T16:30:37Z","receivedAt":"2012-03-21T16:30:37Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Mon, Mar 19, 2012 at 10:28 PM, Roberto <mrgreiner@gmail.com> wrote:\n> Hi,\n>\n> I have small ssh-based git server used for insite code development. But\n> there is one thing I can't find how to set.\n>\n> In the server, each developer has a valid ssh account (I switched the shell\n> to git-shell). The problem is that when a developer commit's some code, he\n> can freely set in his local .git/config file the user name he want's to\n> appear in the commit logs. Is there any way to link/force a certain ssh\n> login to a name?\n\nalong the lines of what others already said, here's my rant on this requirement:\n\nhttps://github.com/sitaramc/gitolite/blob/pu/contrib/VREF/gl-VREF-EMAIL_CHECK#L37\n"}]}