summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Documentation/Makefile1
-rw-r--r--Documentation/SubmittingPatches4
-rw-r--r--Documentation/git-add.txt5
-rw-r--r--Documentation/git-branch.txt3
-rw-r--r--Documentation/git-check-ref-format.txt2
-rw-r--r--Documentation/git-checkout.txt5
-rw-r--r--Documentation/git-quiltimport.txt61
-rw-r--r--Documentation/git-read-tree.txt11
-rw-r--r--Documentation/git-write-tree.txt8
-rwxr-xr-xDocumentation/install-webdoc.sh8
-rw-r--r--Documentation/tutorial-2.txt391
-rw-r--r--Documentation/tutorial.txt199
-rwxr-xr-xGIT-VERSION-GEN4
-rw-r--r--Makefile94
-rw-r--r--builtin-add.c189
-rw-r--r--builtin-apply.c (renamed from apply.c)90
-rw-r--r--builtin-check-ref-format.c14
-rw-r--r--builtin-commit-tree.c (renamed from commit-tree.c)5
-rw-r--r--builtin-diff-files.c (renamed from diff-files.c)3
-rw-r--r--builtin-diff-index.c (renamed from diff-index.c)3
-rw-r--r--builtin-diff-stages.c (renamed from diff-stages.c)3
-rw-r--r--builtin-diff-tree.c (renamed from diff-tree.c)8
-rw-r--r--builtin-diff.c4
-rw-r--r--builtin-grep.c23
-rw-r--r--builtin-init-db.c (renamed from init-db.c)12
-rw-r--r--builtin-log.c146
-rw-r--r--builtin-ls-files.c (renamed from ls-files.c)384
-rw-r--r--builtin-ls-tree.c (renamed from ls-tree.c)5
-rw-r--r--builtin-read-tree.c (renamed from read-tree.c)180
-rw-r--r--builtin-rev-list.c (renamed from rev-list.c)7
-rw-r--r--builtin-rm.c152
-rw-r--r--builtin-show-branch.c (renamed from show-branch.c)9
-rw-r--r--builtin-tar-tree.c (renamed from tar-tree.c)62
-rw-r--r--builtin-upload-tar.c74
-rw-r--r--builtin.h17
-rw-r--r--cache-tree.c557
-rw-r--r--cache-tree.h33
-rw-r--r--cache.h9
-rw-r--r--check-ref-format.c17
-rw-r--r--checkout-index.c1
-rw-r--r--commit.c105
-rw-r--r--commit.h2
-rw-r--r--compat/inet_ntop.c200
-rw-r--r--connect.c2
-rw-r--r--contrib/remotes2config.sh35
-rw-r--r--diff.c131
-rw-r--r--diff.h4
-rw-r--r--dir.c401
-rw-r--r--dir.h51
-rw-r--r--dump-cache-tree.c64
-rw-r--r--fetch-pack.c66
-rw-r--r--fsck-objects.c25
-rwxr-xr-xgenerate-cmdlist.sh1
-rwxr-xr-xgit-add.sh56
-rwxr-xr-xgit-am.sh38
-rwxr-xr-xgit-clone.sh4
-rwxr-xr-xgit-commit.sh17
-rwxr-xr-xgit-cvsimport.perl231
-rwxr-xr-xgit-format-patch.sh344
-rwxr-xr-xgit-parse-remote.sh28
-rwxr-xr-xgit-quiltimport.sh118
-rwxr-xr-xgit-rebase.sh2
-rwxr-xr-xgit-rm.sh70
-rw-r--r--git.c20
-rw-r--r--http-fetch.c4
-rw-r--r--log-tree.c53
-rw-r--r--mailinfo.c129
-rw-r--r--mktag.c45
-rw-r--r--read-cache.c255
-rw-r--r--revision.h2
-rw-r--r--sha1_file.c46
-rwxr-xr-xt/t0000-basic.sh14
-rwxr-xr-xt/t1002-read-tree-m-u-2way.sh66
-rwxr-xr-xt/t3500-cherry.sh1
-rwxr-xr-xt/t4002-diff-basic.sh6
-rwxr-xr-xt/t6022-merge-rename.sh1
-rw-r--r--update-index.c205
-rw-r--r--write-tree.c166
79 files changed, 4157 insertions, 1656 deletions
diff --git a/.gitignore b/.gitignore
index b5959d6311..18a7295e6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,6 +77,7 @@ git-prune
git-prune-packed
git-pull
git-push
+git-quiltimport
git-read-tree
git-rebase
git-receive-pack
@@ -123,6 +124,7 @@ git-write-tree
git-core-*/?*
test-date
test-delta
+test-dump-cache-tree
common-cmds.h
*.tar.gz
*.dsc
diff --git a/Documentation/Makefile b/Documentation/Makefile
index c1af22ce04..2a08f592d9 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -7,6 +7,7 @@ MAN7_TXT=git.txt
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
ARTICLES = tutorial
+ARTICLES += tutorial-2
ARTICLES += core-tutorial
ARTICLES += cvs-migration
ARTICLES += diffcore
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 318b04fdeb..8601949e80 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -266,8 +266,8 @@ This recipe appears to work with the current [*1*] Thunderbird from Suse.
The following Thunderbird extensions are needed:
AboutConfig 0.5
http://aboutconfig.mozdev.org/
- External Editor 0.5.4
- http://extensionroom.mozdev.org/more-info/exteditor
+ External Editor 0.7.2
+ http://globs.org/articles.php?lng=en&pg=8
1) Prepare the patch as a text file using your method of choice.
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 5e3112943d..6342ea33e4 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -14,11 +14,13 @@ DESCRIPTION
A simple wrapper for git-update-index to add files to the index,
for people used to do "cvs add".
+It only adds non-ignored files, to add ignored files use
+"git update-index --add".
OPTIONS
-------
<file>...::
- Files to add to the index.
+ Files to add to the index (see gitlink:git-ls-files[1]).
-n::
Don't actually add the file(s), just show if they exist.
@@ -68,6 +70,7 @@ git-add git-*.sh::
See Also
--------
gitlink:git-rm[1]
+gitlink:git-ls-files[1]
Author
------
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index a7bec3c101..d43ef1dec4 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -49,6 +49,9 @@ OPTIONS
<branchname>::
The name of the branch to create or delete.
+ The new branch name must pass all checks defined by
+ gitlink:git-check-ref-format[1]. Some of these checks
+ may restrict the characters allowed in a branch name.
<start-point>::
The new branch will be created with a HEAD equal to this. It may
diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt
index 7dc1bdb6ef..3ea720dd00 100644
--- a/Documentation/git-check-ref-format.txt
+++ b/Documentation/git-check-ref-format.txt
@@ -45,6 +45,8 @@ refname expressions (see gitlink:git-rev-parse[1]). Namely:
. colon `:` is used as in `srcref:dstref` to mean "use srcref\'s
value and store it in dstref" in fetch and push operations.
+ It may also be used to select a specific object such as with
+ gitlink:git-cat-file[1] "git-cat-file blob v1.3.3:refs.c".
GIT
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 0643943854..fbdbadc74f 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -35,7 +35,10 @@ OPTIONS
Force a re-read of everything.
-b::
- Create a new branch and start it at <branch>.
+ Create a new branch named <new_branch> and start it at
+ <branch>. The new branch name must pass all checks defined
+ by gitlink:git-check-ref-format[1]. Some of these checks
+ may restrict the characters allowed in a branch name.
-l::
Create the new branch's ref log. This activates recording of
diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
new file mode 100644
index 0000000000..6e9a8c369a
--- /dev/null
+++ b/Documentation/git-quiltimport.txt
@@ -0,0 +1,61 @@
+git-quiltimport(1)
+================
+
+NAME
+----
+git-quiltimport - Applies a quilt patchset onto the current branch
+
+
+SYNOPSIS
+--------
+[verse]
+'git-quiltimport' [--dry-run] [--author <author>] [--patches <dir>]
+
+
+DESCRIPTION
+-----------
+Applies a quilt patchset onto the current git branch, preserving
+the patch boundaries, patch order, and patch descriptions present
+in the quilt patchset.
+
+For each patch the code attempts to extract the author from the
+patch description. If that fails it falls back to the author
+specified with --author. If the --author flag was not given
+the patch description is displayed and the user is asked to
+interactively enter the author of the patch.
+
+If a subject is not found in the patch description the patch name is
+preserved as the 1 line subject in the git description.
+
+OPTIONS
+-------
+--dry-run::
+ Walk through the patches in the series and warn
+ if we cannot find all of the necessary information to commit
+ a patch. At the time of this writing only missing author
+ information is warned about.
+
+--author Author Name <Author Email>::
+ The author name and email address to use when no author
+ information can be found in the patch description.
+
+--patches <dir>::
+ The directory to find the quilt patches and the
+ quilt series file.
+
+ The default for the patch directory is patches
+ or the value of the $QUILT_PATCHES environment
+ variable.
+
+Author
+------
+Written by Eric Biederman <ebiederm@lnxi.com>
+
+Documentation
+--------------
+Documentation by Eric Biederman <ebiederm@lnxi.com>
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 844cfda8d2..1f21d95684 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -8,7 +8,7 @@ git-read-tree - Reads tree information into the index
SYNOPSIS
--------
-'git-read-tree' (<tree-ish> | [[-m [--aggressive]| --reset] [-u | -i]] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
+'git-read-tree' (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
DESCRIPTION
@@ -63,6 +63,15 @@ OPTIONS
* when both sides adds a path identically. The resolution
is to add that path.
+--prefix=<prefix>/::
+ Keep the current index contents, and read the contents
+ of named tree-ish under directory at `<prefix>`. The
+ original index file cannot have anything at the path
+ `<prefix>` itself, and have nothing in `<prefix>/`
+ directory. Note that the `<prefix>/` value must end
+ with a slash.
+
+
<tree-ish#>::
The id of the tree object(s) to be read/merged.
diff --git a/Documentation/git-write-tree.txt b/Documentation/git-write-tree.txt
index 77e12cb949..c85fa89c30 100644
--- a/Documentation/git-write-tree.txt
+++ b/Documentation/git-write-tree.txt
@@ -8,7 +8,7 @@ git-write-tree - Creates a tree object from the current index
SYNOPSIS
--------
-'git-write-tree' [--missing-ok]
+'git-write-tree' [--missing-ok] [--prefix=<prefix>/]
DESCRIPTION
-----------
@@ -30,6 +30,12 @@ OPTIONS
directory exist in the object database. This option disables this
check.
+--prefix=<prefix>/::
+ Writes a tree object that represents a subdirectory
+ `<prefix>`. This can be used to write the tree object
+ for a subproject that is in the named subdirectory.
+
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh
index 50638c78d5..60211a5058 100755
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -4,12 +4,16 @@ T="$1"
for h in *.html *.txt howto/*.txt howto/*.html
do
- diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h" || {
+ if test -f "$T/$h" &&
+ diff -u -I'Last updated [0-9][0-9]-[A-Z][a-z][a-z]-' "$T/$h" "$h"
+ then
+ :; # up to date
+ else
echo >&2 "# install $h $T/$h"
rm -f "$T/$h"
mkdir -p `dirname "$T/$h"`
cp "$h" "$T/$h"
- }
+ fi
done
strip_leading=`echo "$T/" | sed -e 's|.|.|g'`
for th in "$T"/*.html "$T"/*.txt "$T"/howto/*.txt "$T"/howto/*.html
diff --git a/Documentation/tutorial-2.txt b/Documentation/tutorial-2.txt
new file mode 100644
index 0000000000..08d3453e5c
--- /dev/null
+++ b/Documentation/tutorial-2.txt
@@ -0,0 +1,391 @@
+A tutorial introduction to git: part two
+========================================
+
+You should work through link:tutorial.html[A tutorial introduction to
+git] before reading this tutorial.
+
+The goal of this tutorial is to introduce two fundamental pieces of
+git's architecture--the object database and the index file--and to
+provide the reader with everything necessary to understand the rest
+of the git documentation.
+
+The git object database
+-----------------------
+
+Let's start a new project and create a small amount of history:
+
+------------------------------------------------
+$ mkdir test-project
+$ cd test-project
+$ git init-db
+defaulting to local storage area
+$ echo 'hello world' > file.txt
+$ git add .
+$ git commit -a -m "initial commit"
+Committing initial tree 92b8b694ffb1675e5975148e1121810081dbdffe
+$ echo 'hello world!' >file.txt
+$ git commit -a -m "add emphasis"
+------------------------------------------------
+
+What are the 40 digits of hex that git responded to the first commit
+with?
+
+We saw in part one of the tutorial that commits have names like this.
+It turns out that every object in the git history is stored under
+such a 40-digit hex name. That name is the SHA1 hash of the object's
+contents; among other things, this ensures that git will never store
+the same data twice (since identical data is given an identical SHA1
+name), and that the contents of a git object will never change (since
+that would change the object's name as well).
+
+We can ask git about this particular object with the cat-file
+command--just cut-and-paste from the reply to the initial commit, to
+save yourself typing all 40 hex digits:
+
+------------------------------------------------
+$ git cat-file -t 92b8b694ffb1675e5975148e1121810081dbdffe
+tree
+------------------------------------------------
+
+A tree can refer to one or more "blob" objects, each corresponding to
+a file. In addition, a tree can also refer to other tree objects,
+thus creating a directory heirarchy. You can examine the contents of
+any tree using ls-tree (remember that a long enough initial portion
+of the SHA1 will also work):
+
+------------------------------------------------
+$ git ls-tree 92b8b694
+100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad file.txt
+------------------------------------------------
+
+Thus we see that this tree has one file in it. The SHA1 hash is a
+reference to that file's data:
+
+------------------------------------------------
+$ git cat-file -t 3b18e512
+blob
+------------------------------------------------
+
+A "blob" is just file data, which we can also examine with cat-file:
+
+------------------------------------------------
+$ git cat-file blob 3b18e512
+hello world
+------------------------------------------------
+
+Note that this is the old file data; so the object that git named in
+its response to the initial tree was a tree with a snapshot of the
+directory state that was recorded by the first commit.
+
+All of these objects are stored under their SHA1 names inside the git
+directory:
+
+------------------------------------------------
+$ find .git/objects/
+.git/objects/
+.git/objects/pack
+.git/objects/info
+.git/objects/3b
+.git/objects/3b/18e512dba79e4c8300dd08aeb37f8e728b8dad
+.git/objects/92
+.git/objects/92/b8b694ffb1675e5975148e1121810081dbdffe
+.git/objects/54
+.git/objects/54/196cc2703dc165cbd373a65a4dcf22d50ae7f7
+.git/objects/a0
+.git/objects/a0/423896973644771497bdc03eb99d5281615b51
+.git/objects/d0
+.git/objects/d0/492b368b66bdabf2ac1fd8c92b39d3db916e59
+.git/objects/c4
+.git/objects/c4/d59f390b9cfd4318117afde11d601c1085f241
+------------------------------------------------
+
+and the contents of these files is just the compressed data plus a
+header identifying their length and their type. The type is either a
+blob, a tree, a commit, or a tag. We've seen a blob and a tree now,
+so next we should look at a commit.
+
+The simplest commit to find is the HEAD commit, which we can find
+from .git/HEAD:
+
+------------------------------------------------
+$ cat .git/HEAD
+ref: refs/heads/master
+------------------------------------------------
+
+As you can see, this tells us which branch we're currently on, and it
+tells us this by naming a file under the .git directory, which itself
+contains a SHA1 name referring to a commit object, which we can
+examine with cat-file:
+
+------------------------------------------------
+$ cat .git/refs/heads/master
+c4d59f390b9cfd4318117afde11d601c1085f241
+$ git cat-file -t c4d59f39
+commit
+$ git cat-file commit c4d59f39
+tree d0492b368b66bdabf2ac1fd8c92b39d3db916e59
+parent 54196cc2703dc165cbd373a65a4dcf22d50ae7f7
+author J. Bruce Fields <bfields@puzzle.fieldses.org> 1143418702 -0500
+committer J. Bruce Fields <bfields@puzzle.fieldses.org> 1143418702 -0500
+
+add emphasis
+------------------------------------------------
+
+The "tree" object here refers to the new state of the tree:
+
+------------------------------------------------
+$ git ls-tree d0492b36
+100644 blob a0423896973644771497bdc03eb99d5281615b51 file.txt
+$ git cat-file commit a0423896
+hello world!
+------------------------------------------------
+
+and the "parent" object refers to the previous commit: