diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 4cd0cb90ad..71ecd858aa 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -7,16 +7,20 @@ git-branch - Create a new branch, or remove an old one SYNOPSIS -------- -'git-branch' [(-d | -D) ] | [[-f] []] +[verse] +'git-branch' [[-f] []] +'git-branch' (-d | -D) DESCRIPTION ----------- If no argument is provided, show available branches and mark current branch with star. Otherwise, create a new branch of name . - If a starting point is also specified, that will be where the branch is created, otherwise it will be created at the current HEAD. +With a `-d` or `-D` option, `` will be deleted. + + OPTIONS ------- -d:: @@ -39,7 +43,7 @@ OPTIONS Examples ~~~~~~~~ -Start development off of a know tag:: +Start development off of a known tag:: + ------------ $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6 diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 556e733c9b..985bb2f827 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -7,15 +7,18 @@ git-checkout - Checkout and switch to a branch SYNOPSIS -------- -'git-checkout' [-f] [-b ] [-m] [] [...] +[verse] +'git-checkout' [-f] [-b ] [-m] [] +'git-checkout' [-m] [] ... DESCRIPTION ----------- -When are not given, this command switches branches, by +When are not given, this command switches branches by updating the index and working tree to reflect the specified branch, , and updating HEAD to be or, if -specified, . +specified, . Using -b will cause to +be created. When are given, this command does *not* switch branches. It updates the named paths in the working tree from @@ -29,17 +32,17 @@ given paths before updating the working tree. OPTIONS ------- -f:: - Force an re-read of everything. + Force a re-read of everything. -b:: Create a new branch and start it at . -m:: - If you have local modifications to a file that is - different between the current branch and the branch you - are switching to, the command refuses to switch - branches, to preserve your modifications in context. - With this option, a three-way merge between the current + If you have local modifications to one or more files that + are different between the current branch and the branch to + which you are switching, the command refuses to switch + branches in order to preserve your modifications in context. + However, with this option, a three-way merge between the current branch, your working tree contents, and the new branch is done, and you will be on the new branch. + @@ -82,7 +85,7 @@ $ git checkout -- hello.c ------------ . After working in a wrong branch, switching to the correct -branch you would want to is done with: +branch would be done using: + ------------ $ git checkout mytopic diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 214ed235c5..d04b342a95 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -18,6 +18,10 @@ Updates the index file for given paths, or all modified files if VISUAL and EDITOR environment variables to edit the commit log message. +Several environment variable are used during commits. They are +documented in gitlink:git-commit-tree[1]. + + This command can run `commit-msg`, `pre-commit`, and `post-commit` hooks. See link:hooks.html[hooks] for more information. diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt index ea4d849aa3..aeb1115af9 100644 --- a/Documentation/git-init-db.txt +++ b/Documentation/git-init-db.txt @@ -14,7 +14,8 @@ SYNOPSIS OPTIONS ------- --template=:: - Provide the directory in from which templates will be used. + Provide the directory from which templates will be used. + The default template directory is `/usr/share/git-core/templates`. --shared:: Specify that the git repository is to be shared amongst several users. @@ -22,9 +23,17 @@ OPTIONS DESCRIPTION ----------- -This simply creates an empty git repository - basically a `.git` directory -and `.git/object/??/`, `.git/refs/heads` and `.git/refs/tags` directories, -and links `.git/HEAD` symbolically to `.git/refs/heads/master`. +This command creates an empty git repository - basically a `.git` directory +with subdirectories for `objects`, `refs/heads`, `refs/tags`, and +templated files. +An initial `HEAD` file that references the HEAD of the master branch +is also created. + +If `--template=` is specified, `` +is used as the source of the template files rather than the default. +The template files include some directory structure, some suggested +"exclude patterns", and copies of non-executing "hook" files. The +suggested patterns and hook files are all modifiable and extensible. If the `$GIT_DIR` environment variable is set then it specifies a path to use instead of `./.git` for the base of the repository. @@ -38,7 +47,6 @@ repository. When specifying `--shared` the config variable "core.sharedRepositor is set to 'true' so that directories under `$GIT_DIR` are made group writable (and g+sx, since the git group may be not the primary group of all users). - Running `git-init-db` in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunning `git-init-db` is to pick up newly added templates. diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 4d5b546db1..b36276c7ed 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -25,7 +25,7 @@ Assume the following history exists and the current branch is "topic": / D---E---F---G master -From this point, the result of the following commands: +From this point, the result of either of the following commands: git-rebase master git-rebase master topic @@ -36,7 +36,7 @@ would be: / D---E---F---G master -While, starting from the same point, the result of the following +While, starting from the same point, the result of either of the following commands: git-rebase --onto master~1 master @@ -58,7 +58,7 @@ OPTIONS :: Upstream branch to compare against. -:: +:: Working branch; defaults to HEAD. Author diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt index d3b6e620a8..f115b45ef6 100644 --- a/Documentation/git-show-branch.txt +++ b/Documentation/git-show-branch.txt @@ -141,7 +141,7 @@ it, having the following in the configuration file may help: ------------ -With this,`git show-branch` without extra parameters would show +With this, `git show-branch` without extra parameters would show only the primary branches. In addition, if you happen to be on your topic branch, it is shown as well. diff --git a/Documentation/git.txt b/Documentation/git.txt index 8610d36c49..de3934d098 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -329,6 +329,9 @@ gitlink:git-revert[1]:: gitlink:git-shortlog[1]:: Summarizes 'git log' output. +gitlink:git-show[1]:: + Show one commit log and its diff. + gitlink:git-show-branch[1]:: Show branches and their commits. diff --git a/diff-delta.c b/diff-delta.c index aaee7be4d2..1188b31cd0 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -136,7 +136,8 @@ void *diff_delta(void *from_buf, unsigned long from_size, unsigned long *delta_size, unsigned long max_size) { - unsigned int i, outpos, outsize, inscnt, hash_shift; + unsigned int i, outpos, outsize, hash_shift; + int inscnt; const unsigned char *ref_data, *ref_top, *data, *top; unsigned char *out; struct index *entry, **hash; @@ -222,6 +223,20 @@ void *diff_delta(void *from_buf, unsigned long from_size, unsigned char *op; if (inscnt) { + while (moff && ref_data[moff-1] == data[-1]) { + if (msize == 0x10000) + break; + /* we can match one byte back */ + msize++; + moff--; + data--; + outpos--; + if (--inscnt) + continue; + outpos--; /* remove count slot */ + inscnt--; /* make it -1 */ + break; + } out[outpos - inscnt - 1] = inscnt; inscnt = 0; }