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

Re: link user-name with ssh-login

From
Shawn Pearce <spearce@spearce.org>
Date
Mar 19, 2012, 21:56 UTC
Message-ID
<CAJo=hJvqr2pKVje490g2k2Wxdf2rrQYsrWQ2eN6bPn84fRxLEQ@mail.gmail.com>
In-Reply-To
<20120319205747.GB3039@sigill.intra.peff.net>
On Mon, Mar 19, 2012 at 13:57, Jeff King <peff@peff.net> wrote:
Show 18 quoted lines
> On Mon, Mar 19, 2012 at 12:15:07PM -0700, Junio C Hamano wrote:
>
>> 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.
>
> Then you would be forbidding merges of other people's work, no? Even if
> the other person's commits are available in the upstream repo, they
> might be hitting this ref for the first time, and would be generally be
> checked by such a hook.

Most hooks that are trying to do this use "$NEW_HEAD --not --all" to only examine commits that would be newly reachable. Already reachable commits are presumed valid. If you want to merge someone else's commits, just make sure they have already pushed their commits to a branch somewhere, like a refs/heads/$USER/ sandbox space or something.

Previous: Jeff KingNext: Sitaram Chamarty
Message 4 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.