Skip to content

Commit

Permalink
GIT 0.99.9k
Browse files Browse the repository at this point in the history
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
Junio C Hamano committed Nov 26, 2005
2 parents 52b6536 + 2a1ddc5 commit 93dcab2
Show file tree
Hide file tree
Showing 77 changed files with 2,856 additions and 1,804 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ git-rebase
git-receive-pack
git-relink
git-repack
git-repo-config
git-request-pull
git-reset
git-resolve
Expand Down
18 changes: 15 additions & 3 deletions Documentation/git-daemon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ git-daemon - A really simple server for git repositories.
SYNOPSIS
--------
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
[--timeout=n] [--init-timeout=n] [directory...]
[--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]

DESCRIPTION
-----------
Expand All @@ -29,9 +29,15 @@ This is ideally suited for read-only updates, ie pulling from git repositories.

OPTIONS
-------
--strict-paths::
Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
"/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
git-daemon will refuse to start when this option is enabled and no
whitelist is specified.

--export-all::
Allow pulling from all directories that look like GIT repositories
(have the 'objects' subdirectory and a 'HEAD' file), even if they
(have the 'objects' and 'refs' subdirectories), even if they
do not have the 'git-daemon-export-ok' file.

--inetd::
Expand All @@ -57,9 +63,15 @@ OPTIONS
--verbose::
Log details about the incoming connections and requested files.

<directory>::
A directory to add to the whitelist of allowed directories. Unless
--strict-paths is specified this will also include subdirectories
of each named directory.

Author
------
Written by Linus Torvalds <torvalds@osdl.org> and YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Written by Linus Torvalds <torvalds@osdl.org>, YOSHIFUJI Hideaki
<yoshfuji@linux-ipv6.org> and the git-list <git@vger.kernel.org>

Documentation
--------------
Expand Down
170 changes: 170 additions & 0 deletions Documentation/git-repo-config.txt
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

19 changes: 15 additions & 4 deletions Documentation/git-reset.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,30 @@ DESCRIPTION
Sets the current head to the specified commit and optionally resets the
index and working tree to match.

This command is useful if you notice some small error in a recent
commit (or set of commits) and want to redo that part without showing
the undo in the history.

If you want to undo a commit other than the latest on a branch,
gitlink:git-revert[1] is your friend.

OPTIONS
-------
--mixed::
Like --soft but reports what has not been updated. This is the
default action.
Resets the index but not the working tree (ie, the changed files
are preserved but not marked for commit) and reports what has not
been updated. This is the default action.

--soft::
Does not touch the index file nor the working tree at all, but
requires them in a good order.
requires them to be in a good order. This leaves all your changed
files "Updated but not checked in", as gitlink:git-status[1] would
put it.

--hard::
Matches the working tree and index to that of the tree being
switched to.
switched to. Any changes to tracked files in the working tree
since <commit-ish> are lost.

<commit-ish>::
Commit to make the current HEAD.
Expand Down
3 changes: 3 additions & 0 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ gitlink:git-prune-packed[1]::
gitlink:git-read-tree[1]::
Reads tree information into the directory index

gitlink:git-repo-config[1]::
Get and set options in .git/config.

gitlink:git-unpack-objects[1]::
Unpacks objects out of a packed archive.

Expand Down
7 changes: 2 additions & 5 deletions Documentation/howto/rebase-from-internal-branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ So I started from master, made a bunch of edits, and committed:
$ git checkout master
$ cd Documentation; ed git.txt ...
$ cd ..; git add Documentation/*.txt
$ git commit -s -v

NOTE. The -v flag to commit is a handy way to make sure that
your additions are not introducing bogusly formatted lines.
$ git commit -s

After the commit, the ancestry graph would look like this:

Expand Down Expand Up @@ -98,7 +95,7 @@ to do cherrypicking using only the core GIT tools.
Let's go back to the earlier picture, with different labels.

You, as an individual developer, cloned upstream repository and
amde a couple of commits on top of it.
made a couple of commits on top of it.

*your "master" head
upstream --> #1 --> #2 --> #3
Expand Down
105 changes: 105 additions & 0 deletions Documentation/howto/update-hook-example.txt
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.








Loading

0 comments on commit 93dcab2

Please sign in to comment.