git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: link user-name with ssh-login

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 19, 2012, 19:15 UTC
Message-ID
<7v7gygbdxg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4F6765D0.5060706@gmail.com>
Roberto <mrgreiner@gmail.com> writes:
Show 8 quoted lines
> I have small ssh-based git server used for insite code
> development. But there is one thing I can't find how to set.
>
> In the server, each developer has a valid ssh account (I switched the
> shell to git-shell). The problem is that when a developer commit's
> some code, he can freely set in his local .git/config file the user
> name he want's to appear in the commit logs. Is there any way to
> link/force a certain ssh login to a name?

A pre-receive hook that lists the author names of the commits, along the lines of "git log --format='%an <%ae>' $OLD_HEAD..$NEW_HEAD" and compares against the name of the user authenticated against your SSH server would be a way to do this.

But that would mean you are forbidding people to accept patches from others, inspect the patches for validity and vouch for them, while giving the credit to them by recoding the author names of the patch authors.

Perhaps checking the committer name would suit your situation better. I dunno.

Previous: RobertoNext: Jeff King
Message 2 of 5 in “link user-name with ssh-login”
  1. RobertoMar 19, 2012
  2. Junio C HamanoMar 19, 2012
  3. Jeff KingMar 19, 2012
  4. Shawn PearceMar 19, 2012
  5. Sitaram ChamartyMar 21, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.