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

Re: [PATCH] shell: Rewrite documentation and improve error message

From
Greg Brockman <gdb@mit.edu>
Date
Aug 22, 2010, 06:00 UTC
Message-ID
<AANLkTi=u7VUhz4VrU2hdd3SXK7rMvMrijL-X9qXCG1vs@mail.gmail.com>
In-Reply-To
<1282333452-25278-1-git-send-email-artagnon@gmail.com>
Warning: the following email contains lots of nitpicks.  Proceed at
your own risk.
Show 6 quoted lines
> +A login shell for SSH accounts to provide restricted Git access. When
> +'-c' is given, the program executes <command> non-interactively;
> +<command> can be one of 'git receive-pack', 'git upload-pack', 'git
> +upload-archive', 'cvs server', or a command in COMMAND_DIR. The shell
> +is started in interactive mode when no arguments are given; in this
> +case, COMMAND_DIR must exist, and any of the executables in them can
s/in them/in it/
> +COMMAND_DIR is the path 'git-shell-commands' in the user's home
> +directory. The user must have read and execute permissions to the
- Maybe instead 'COMMAND_DIR is the path "$HOME/git-shell-commands"'?
> +directory for it to be useful.
- I would be more specific here, and instead change this insertion to
something like: "directory in order to execute commands in it."
- What about adding something like 'Commands in COMMAND_DIR are run
with a cwd of $HOME'
- Perhaps note that if a COMMAND_DIR program is invoked, 'argument' is
parsed as a command-line?
Show 15 quoted lines
>
>  Author
>  ------
> diff --git a/shell.c b/shell.c
> index ffed615..3fb804e 100644
> --- a/shell.c
> +++ b/shell.c
> @@ -152,8 +152,11 @@ int main(int argc, char **argv)
>        } else if (argc == 1) {
>                /* Allow the user to run an interactive shell */
>                cd_to_homedir();
> -               if (access(COMMAND_DIR, R_OK | X_OK) == -1)
> -                       die("Sorry, the interactive git-shell is not enabled");
> +               if (access(COMMAND_DIR, R_OK | X_OK) == -1) {
> +                       die("Inteactive git shell is not enabled.\n"
s/Inteactive/Interactive/
> +                           "hint: " COMMAND_DIR " should exist "

I would recommend displaying ~/$COMMAND_DIR instead, or $HOME/COMMAND_DIR. The latter could be considered an information leak though.

> +                           "and have read and execute access.");
Sounds fine to me otherwise.  Thanks for starting on this.
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 3 of 10 in “shell: Rewrite documentation and improve error message”
  1. shell: Rewrite documentation and improve error messageRamkumar Ramachandra, Aug 20, 2010
  2. Ramkumar RamachandraAug 20, 2010
  3. Greg BrockmanAug 22, 2010
  4. shell: Rewrite documentation and improve error messageRamkumar Ramachandra, Aug 22, 2010
  5. Greg BrockmanAug 23, 2010
  6. shell: Rewrite documentation and improve error messageRamkumar Ramachandra, Aug 24, 2010
  7. Greg BrockmanAug 24, 2010
  8. Ramkumar RamachandraAug 24, 2010
  9. Greg BrockmanAug 24, 2010
  10. Junio C HamanoAug 24, 2010

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.