-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a 'list' command to view available bare repositories ending in .git and a 'help command to display usage. Also add documentation in a README Signed-off-by: Greg Brockman <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Sample programs callable through git-shell. Place a directory named | ||
'git-shell-commands' in the home directory of a user whose shell is | ||
git-shell. Then anyone logging in as that user will be able to run | ||
executables in the 'git-shell-commands' directory. | ||
|
||
Provided commands: | ||
|
||
help: Prints out the names of available commands. When run | ||
interactively, git-shell will automatically run 'help' on startup, | ||
provided it exists. | ||
|
||
list: Displays any bare repository whose name ends with ".git" under | ||
user's home directory. No other git repositories are visible, | ||
although they might be clonable through git-shell. 'list' is designed | ||
to minimize the number of calls to git that must be made in finding | ||
available repositories; if your setup has additional repositories that | ||
should be user-discoverable, you may wish to modify 'list' | ||
accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
if tty -s | ||
then | ||
echo "Run 'help' for help, or 'exit' to leave. Available commands:" | ||
else | ||
echo "Run 'help' for help. Available commands:" | ||
fi | ||
|
||
cd "$(dirname "$0")" | ||
|
||
for cmd in * | ||
do | ||
case "$cmd" in | ||
help) ;; | ||
*) [ -f "$cmd" ] && [ -x "$cmd" ] && echo "$cmd" ;; | ||
esac | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
print_if_bare_repo=' | ||
if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true | ||
then | ||
printf "%s\n" "${1#./}" | ||
fi | ||
' | ||
|
||
find -type d -name "*.git" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null |