<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/shell.c, branch v1.8.3.3</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.3.3</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.3.3'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2013-03-10T07:21:35Z</updated>
<entry>
<title>shell: new no-interactive-login command to print a custom message</title>
<updated>2013-03-10T07:21:35Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-03-09T22:00:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=35297089e550c30e6d0f6db2adca5d44d254a7ed'/>
<id>urn:sha1:35297089e550c30e6d0f6db2adca5d44d254a7ed</id>
<content type='text'>
If I disable git-shell's interactive mode by removing the
~/git-shell-commands directory, attempts to ssh in to the service
produce a message intended for the administrator:

	$ ssh git@myserver
	fatal: Interactive git shell is not enabled.
	hint: ~/git-shell-commands should exist and have read and execute access.
	$

That is helpful for the new admin who is wondering "What? Why isn't
the git-shell I just set up working?", but once the site setup is
complete, it would be better to give the user a friendly hint that she
is on the right track, like GitHub does.

	Hi &lt;username&gt;! You've successfully authenticated, but
	GitHub does not provide shell access.

An appropriate greeting might even include more complex dynamic
information, like gitolite's list of repositories the user has access
to.  Add support for a ~/git-shell-commands/no-interactive-login
command that generates an arbitrary greeting.  When the user tries to
log in:

 * If the file ~/git-shell-commands/no-interactive-login exists,
   run no-interactive-login to let the server say what it likes,
   then hang up.

 * Otherwise, if ~/git-shell-commands/ is present, start an
   interactive read-eval-print loop.

 * Otherwise, print the usual configuration hint and hang up.

Reported-by: Ethan Reesor &lt;firelizzard@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Improved-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: add infrastructure for translating Git with gettext</title>
<updated>2011-12-06T04:46:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2011-11-17T23:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5e9637c629702e3d41ad01d95956d1835d7338e0'/>
<id>urn:sha1:5e9637c629702e3d41ad01d95956d1835d7338e0</id>
<content type='text'>
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.

This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.

This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.

The rest of the commit message goes into detail about various
sub-parts of this commit.

= Installation

Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.

= Perl

Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.

Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.

Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.

I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.

See &lt;AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com&gt; for
a further elaboration on this topic.

= Shell

Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.

If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.

If neither are present we'll use a dumb printf(1) fall-through
wrapper.

= About libcharset.h and langinfo.h

We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.

The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.

GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.

=Credits

This patch is based on work by Jeff Epler &lt;jepler@unpythonic.net&gt; who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.

[jc: squashed a small Makefile fix from Ramsay]

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>shell: add missing initialization of argv0_path</title>
<updated>2011-05-05T16:32:28Z</updated>
<author>
<name>Dima Sharov</name>
<email>git.avalakvista@gmail.com</email>
</author>
<published>2011-05-05T06:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2d9932cf67a886c8f356603b9ffd81832cc1850f'/>
<id>urn:sha1:2d9932cf67a886c8f356603b9ffd81832cc1850f</id>
<content type='text'>
According to c6dfb39 (remote-curl: add missing initialization of
argv0_path, 2009-10-13), stand-alone programs (non-builtins)
must call git_extract_argv0_path(argv[0]) in order to help builds
that derive the installation prefix at runtime. Without this call,
the program segfaults (or raises an assertion failure).

Signed-off-by: Dima Sharov &lt;git.avalakvista@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>shell: Display errors from improperly-formatted command lines</title>
<updated>2010-08-27T17:43:59Z</updated>
<author>
<name>Greg Brockman</name>
<email>gdb@MIT.EDU</email>
</author>
<published>2010-08-27T05:36:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9f29fe9a779e55e7387577cd7f712de0b13b5cd6'/>
<id>urn:sha1:9f29fe9a779e55e7387577cd7f712de0b13b5cd6</id>
<content type='text'>
The interface for split_cmdline has changed such that the caller holds
responsibility for printing any error messages.  This patch changes
the git shell to print these error messages as appropriate.

Signed-off-by: Greg Brockman &lt;gdb@mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>shell: Rewrite documentation and improve error message</title>
<updated>2010-08-24T17:47:21Z</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>artagnon@gmail.com</email>
</author>
<published>2010-08-24T05:36:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=70256a3a6780a9fd181edf0bf0e762eb56637c9c'/>
<id>urn:sha1:70256a3a6780a9fd181edf0bf0e762eb56637c9c</id>
<content type='text'>
Update the documentation of 'git shell' to mention the interactive
mode and COMMAND_DIR. Also provide a hint when interactive mode is not
available in the shell.

Signed-off-by: Ramkumar Ramachandra &lt;artagnon@gmail.com&gt;
Reviewed-by: Greg Brockman &lt;gdb@MIT.EDU&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add interactive mode to git-shell for user-friendliness</title>
<updated>2010-08-12T22:16:31Z</updated>
<author>
<name>Greg Brockman</name>
<email>gdb@MIT.EDU</email>
</author>
<published>2010-07-28T07:43:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e69164ddb9d6092a94915bb984749d48f598cea8'/>
<id>urn:sha1:e69164ddb9d6092a94915bb984749d48f598cea8</id>
<content type='text'>
Signed-off-by: Greg Brockman &lt;gdb@mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Allow creation of arbitrary git-shell commands</title>
<updated>2010-08-12T22:16:15Z</updated>
<author>
<name>Greg Brockman</name>
<email>gdb@MIT.EDU</email>
</author>
<published>2010-07-29T00:31:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2dbc887eaa6fbd787edfc9472b86b0faeb54e2ae'/>
<id>urn:sha1:2dbc887eaa6fbd787edfc9472b86b0faeb54e2ae</id>
<content type='text'>
This provides a mechanism for the server to expose custom
functionality to clients.  My particular use case is that I would like
a way of discovering all repositories available for cloning.  A
client that clones via

  git clone user@example.com

can invoke a command by

  ssh user@example.com $command

Signed-off-by: Greg Brockman &lt;gdb@mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Convert existing die(..., strerror(errno)) to die_errno()</title>
<updated>2009-06-27T18:14:53Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2009-06-27T15:58:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d824cbba02a4061400a0e382f9bd241fbbff34f0'/>
<id>urn:sha1:d824cbba02a4061400a0e382f9bd241fbbff34f0</id>
<content type='text'>
Change calls to die(..., strerror(errno)) to use the new die_errno().

In the process, also make slight style adjustments: at least state
_something_ about the function that failed (instead of just printing
the pathname), and put paths in single quotes.

Signed-off-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-shell: Add 'git-upload-archive' to allowed commands.</title>
<updated>2009-04-11T18:01:15Z</updated>
<author>
<name>Erik Broes</name>
<email>erikbroes@ripe.net</email>
</author>
<published>2009-04-09T19:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=79f72b97633d1699f131e798bb9833339ba22f6a'/>
<id>urn:sha1:79f72b97633d1699f131e798bb9833339ba22f6a</id>
<content type='text'>
This allows for example gitosis to allow use of 'git archive --remote' in a
controlled environment.

Signed-off-by: Erik Broes &lt;erikbroes@ripe.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2008-08-29T07:16:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-08-29T07:16:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=445cac18c015809a7fcb4a570d3c6571b1ddaf7d'/>
<id>urn:sha1:445cac18c015809a7fcb4a570d3c6571b1ddaf7d</id>
<content type='text'>
* maint:
  tutorial: gentler illustration of Alice/Bob workflow using gitk
  pretty=format: respect date format options
  make git-shell paranoid about closed stdin/stdout/stderr
  Document gitk --argscmd flag.
  Fix '--dirstat' with cross-directory renaming
  for-each-ref: Allow a trailing slash in the patterns
</content>
</entry>
</feed>
