* link user-name with ssh-login
@ 2012-03-19 16:58 Roberto
2012-03-19 19:15 ` Junio C Hamano
2012-03-21 16:30 ` Sitaram Chamarty
0 siblings, 2 replies; 5+ messages in thread
From: Roberto @ 2012-03-19 16:58 UTC (permalink / raw)
To: git
Hi,
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?
Thanks,
Roberto
--
-----------------------------------------------------
Marcos Roberto Greiner
Os otimistas acham que estamos no melhor dos mundos
Os pessimistas tem medo de que isto seja verdade
James Branch Cabell
-----------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: link user-name with ssh-login
2012-03-19 16:58 link user-name with ssh-login Roberto
@ 2012-03-19 19:15 ` Junio C Hamano
2012-03-19 20:57 ` Jeff King
2012-03-21 16:30 ` Sitaram Chamarty
1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-03-19 19:15 UTC (permalink / raw)
To: Roberto; +Cc: git
Roberto <mrgreiner@gmail.com> writes:
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: link user-name with ssh-login
2012-03-19 19:15 ` Junio C Hamano
@ 2012-03-19 20:57 ` Jeff King
2012-03-19 21:56 ` Shawn Pearce
0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2012-03-19 20:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Roberto, git
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.
-Peff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: link user-name with ssh-login
2012-03-19 20:57 ` Jeff King
@ 2012-03-19 21:56 ` Shawn Pearce
0 siblings, 0 replies; 5+ messages in thread
From: Shawn Pearce @ 2012-03-19 21:56 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, Roberto, git
On Mon, Mar 19, 2012 at 13:57, Jeff King <peff@peff.net> wrote:
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: link user-name with ssh-login
2012-03-19 16:58 link user-name with ssh-login Roberto
2012-03-19 19:15 ` Junio C Hamano
@ 2012-03-21 16:30 ` Sitaram Chamarty
1 sibling, 0 replies; 5+ messages in thread
From: Sitaram Chamarty @ 2012-03-21 16:30 UTC (permalink / raw)
To: Roberto; +Cc: git
On Mon, Mar 19, 2012 at 10:28 PM, Roberto <mrgreiner@gmail.com> wrote:
> Hi,
>
> 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?
along the lines of what others already said, here's my rant on this requirement:
https://github.com/sitaramc/gitolite/blob/pu/contrib/VREF/gl-VREF-EMAIL_CHECK#L37
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-21 16:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 16:58 link user-name with ssh-login Roberto
2012-03-19 19:15 ` Junio C Hamano
2012-03-19 20:57 ` Jeff King
2012-03-19 21:56 ` Shawn Pearce
2012-03-21 16:30 ` Sitaram Chamarty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).