-
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.
This is not 1.0rc4 yet, but to push the recent fixes out. Signed-off-by: Junio C Hamano <junkio@cox.net>
- Loading branch information
Showing
77 changed files
with
2,856 additions
and
1,804 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
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
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,170 @@ | ||
git-repo-config(1) | ||
================== | ||
|
||
NAME | ||
---- | ||
git-repo-config - Get and set options in .git/config. | ||
|
||
|
||
SYNOPSIS | ||
-------- | ||
'git-repo-config' name [value [value_regex]] | ||
'git-repo-config' --replace-all name [value [value_regex]] | ||
'git-repo-config' --get name [value_regex] | ||
'git-repo-config' --get-all name [value_regex] | ||
'git-repo-config' --unset name [value_regex] | ||
'git-repo-config' --unset-all name [value_regex] | ||
|
||
DESCRIPTION | ||
----------- | ||
You can query/set/replace/unset options with this command. The name is | ||
actually the section and the key separated by a dot, and the value will be | ||
escaped. | ||
|
||
If you want to set/unset an option which can occor on multiple lines, you | ||
should provide a POSIX regex for the value. If you want to handle the lines | ||
*not* matching the regex, just prepend a single exlamation mark in front | ||
(see EXAMPLES). | ||
|
||
This command will fail if | ||
|
||
. .git/config is invalid, | ||
. .git/config can not be written to, | ||
. no section was provided, | ||
. the section or key is invalid, | ||
. you try to unset an option which does not exist, or | ||
. you try to unset/set an option for which multiple lines match. | ||
|
||
|
||
OPTIONS | ||
------- | ||
|
||
--replace-all:: | ||
Default behaviour is to replace at most one line. This replaces | ||
all lines matching the key (and optionally the value_regex) | ||
|
||
--get:: | ||
Get the value for a given key (optionally filtered by a regex | ||
matching the value). | ||
|
||
--get-all:: | ||
Like get, but does not fail if the number of values for the key | ||
is not exactly one. | ||
|
||
--unset:: | ||
Remove the line matching the key from .git/config. | ||
|
||
--unset-all:: | ||
Remove all matching lines from .git/config. | ||
|
||
|
||
EXAMPLE | ||
------- | ||
|
||
Given a .git/config like this: | ||
|
||
# | ||
# This is the config file, and | ||
# a '#' or ';' character indicates | ||
# a comment | ||
# | ||
|
||
; core variables | ||
[core] | ||
; Don't trust file modes | ||
filemode = false | ||
|
||
; Our diff algorithm | ||
[diff] | ||
external = "/usr/local/bin/gnu-diff -u" | ||
renames = true | ||
|
||
; Proxy settings | ||
[proxy] | ||
command="ssh" for "ssh://kernel.org/" | ||
command="proxy-command" for kernel.org | ||
command="myprotocol-command" for "my://" | ||
command=default-proxy ; for all the rest | ||
|
||
you can set the filemode to true with | ||
|
||
------------ | ||
% git repo-config core.filemode true | ||
------------ | ||
|
||
The hypothetic proxy command entries actually have a postfix to discern | ||
to what URL they apply. Here is how to change the entry for kernel.org | ||
to "ssh". | ||
|
||
------------ | ||
% git repo-config proxy.command '"ssh" for kernel.org' 'for kernel.org$' | ||
------------ | ||
|
||
This makes sure that only the key/value pair for kernel.org is replaced. | ||
|
||
To delete the entry for renames, do | ||
|
||
------------ | ||
% git repo-config --unset diff.renames | ||
------------ | ||
|
||
If you want to delete an entry for a multivar (like proxy.command above), | ||
you have to provide a regex matching the value of exactly one line. | ||
|
||
To query the value for a given key, do | ||
|
||
------------ | ||
% git repo-config --get core.filemode | ||
------------ | ||
|
||
or | ||
|
||
------------ | ||
% git repo-config core.filemode | ||
------------ | ||
|
||
or, to query a multivar: | ||
|
||
------------ | ||
% git repo-config --get proxy.command "for kernel.org$" | ||
------------ | ||
|
||
If you want to know all the values for a multivar, do: | ||
|
||
------------ | ||
% git repo-config --get-all proxy.command | ||
------------ | ||
|
||
If you like to live dangerous, you can replace *all* proxy.commands by a | ||
new one with | ||
|
||
------------ | ||
% git repo-config --replace-all proxy.command ssh | ||
------------ | ||
|
||
However, if you really only want to replace the line for the default proxy, | ||
i.e. the one without a "for ..." postfix, do something like this: | ||
|
||
------------ | ||
% git repo-config proxy.command ssh '! for ' | ||
------------ | ||
|
||
To actually match only values with an exclamation mark, you have to | ||
|
||
------------ | ||
% git repo-config section.key value '[!]' | ||
------------ | ||
|
||
|
||
Author | ||
------ | ||
Written by Johannes Schindelin <Johannes.Schindelin@gmx.de> | ||
|
||
Documentation | ||
-------------- | ||
Documentation by Johannes Schindelin. | ||
|
||
GIT | ||
--- | ||
Part of the gitlink:git[7] suite | ||
|
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
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
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
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,105 @@ | ||
From: Junio C Hamano <junkio@cox.net> | ||
Subject: control access to branches. | ||
Date: Thu, 17 Nov 2005 23:55:32 -0800 | ||
Message-ID: <7vfypumlu3.fsf@assigned-by-dhcp.cox.net> | ||
Abstract: An example hooks/update script is presented to | ||
implement repository maintenance policies, such as who can push | ||
into which branch and who can make a tag. | ||
|
||
When your developer runs git-push into the repository, | ||
git-receive-pack is run (either locally or over ssh) as that | ||
developer, so is hooks/update script. Quoting from the relevant | ||
section of the documentation: | ||
|
||
Before each ref is updated, if $GIT_DIR/hooks/update file exists | ||
and executable, it is called with three parameters: | ||
|
||
$GIT_DIR/hooks/update refname sha1-old sha1-new | ||
|
||
The refname parameter is relative to $GIT_DIR; e.g. for the | ||
master head this is "refs/heads/master". Two sha1 are the | ||
object names for the refname before and after the update. Note | ||
that the hook is called before the refname is updated, so either | ||
sha1-old is 0{40} (meaning there is no such ref yet), or it | ||
should match what is recorded in refname. | ||
|
||
So if your policy is (1) always require fast-forward push | ||
(i.e. never allow "git-push repo +branch:branch"), (2) you | ||
have a list of users allowed to update each branch, and (3) you | ||
do not let tags to be overwritten, then: | ||
|
||
#!/bin/sh | ||
# This is a sample hooks/update script, written by JC | ||
# in his e-mail buffer, so naturally it is not tested | ||
# but hopefully would convey the idea. | ||
|
||
umask 002 | ||
case "$1" in | ||
refs/tags/*) | ||
# No overwriting an existing tag | ||
if test -f "$GIT_DIR/$1" | ||
then | ||
exit 1 | ||
fi | ||
;; | ||
refs/heads/*) | ||
# No rebasing or rewinding | ||
if expr "$2" : '0*$' >/dev/null | ||
then | ||
# creating a new branch | ||
; | ||
else | ||
# updating -- make sure it is a fast forward | ||
mb=`git-merge-base "$2" "$3"` | ||
case "$mb,$2" in | ||
"$2,$mb") | ||
;; # fast forward -- happy | ||
*) | ||
exit 1 ;; # unhappy | ||
esac | ||
fi | ||
;; | ||
*) | ||
# No funny refs allowed | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Is the user allowed to update it? | ||
me=`id -u -n` ;# e.g. "junio" | ||
while read head_pattern users | ||
do | ||
if expr "$1" : "$head_pattern" >/dev/null | ||
then | ||
case " $users " in | ||
*" $me "*) | ||
exit 0 ;; # happy | ||
' * ') | ||
exit 0 ;; # anybody | ||
esac | ||
fi | ||
done | ||
exit 1 | ||
|
||
For the sake of simplicity, I assumed that you keep something | ||
like this in $GIT_DIR/info/allowed-pushers file: | ||
|
||
refs/heads/master junio | ||
refs/heads/cogito$ pasky | ||
refs/heads/bw/ linus | ||
refs/heads/tmp/ * | ||
refs/tags/v[0-9]* junio | ||
|
||
With this, Linus can push or create "bw/penguin" or "bw/zebra" | ||
or "bw/panda" branches, Pasky can do only "cogito", and I can do | ||
master branch and make versioned tags. And anybody can do | ||
tmp/blah branches. This assumes all the users are in a single | ||
group that can write into $GIT_DIR/ and underneath. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.