Re: Git prompt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 11, 2013 at 4:24 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Jeff King <peff@xxxxxxxx> writes:
>
>> On Sun, Feb 10, 2013 at 01:25:38PM -0800, Jonathan Nieder wrote:
>>
>>> Ethan Reesor wrote:
>>>
>>> > I have a git user set up on my server. It's prompt is set to
>>> > git-prompt and it's git-shell-commands is empty.
>>> [...]
>>> > How do I make the git user work like github where, upon attempting to
>>> > get a prompt, the connection is closed?
>>>
>>> I assume you mean that the user's login shell is git-shell.
>>>
>>> You can disable interactive logins by removing the
>>> ~/git-shell-commands/ directory.  Unfortunately that doesn't let you
>>> customize the message.  Perhaps it would make sense to teach shell.c
>>> to look for a
>>>
>>>      [shell]
>>>              greeting = 'Hi %(username)! You've successfully authenticated, but I do not provide interactive shell access.'
>>>
>>> setting in git's config file.  What do you think?
>>
>> I think something like that makes sense. To my knowledge there is no way
>> with stock git to customize git-shell's output (at GitHub, that message
>> comes from our front-end routing process before you even hit git-shell
>> on our backend machines).
>>
>> The "username" in our version of the message comes from a database
>> mapping public keys to GitHub users, not the Unix username.  But I
>> suspect sites running stock Git would be happy enough to have
>> %(username) map to the actual Unix username.
>
> Yeah, that greeting is cute---I like it ;-)

Indeed!  In gitolite, I borrowed that idea added to it by making it
print a list of repos you have access to, along with what permissions
(R or RW) you have :-)

I'm not suggesting git should do that, but instead of a fixed string,
a default command to be executed would be better.  That command could
do anything the local site wanted to make it do, including something
eqvt to what I just said.

This of course now means that the ~/git-shell-commands should not be
empty, since that is where this default command also will be present.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]