Merge branch 'master' into next

* master:
  3% tighter packs for free
  Rewrite synopsis to clarify the two primary uses of git-checkout.
  Fix minor typo.
  Reference git-commit-tree for env vars.
  Clarify git-rebase example commands.
  Document the default source of template files.
  Call out the two different uses of git-branch and fix a typo.
  Add git-show reference
This commit is contained in:
Junio C Hamano 2006-03-17 20:43:15 -08:00
commit c816a6bc5a
8 changed files with 60 additions and 23 deletions

View File

@ -7,16 +7,20 @@ git-branch - Create a new branch, or remove an old one
SYNOPSIS
--------
'git-branch' [(-d | -D) <branchname>] | [[-f] <branchname> [<start-point>]]
[verse]
'git-branch' [[-f] <branchname> [<start-point>]]
'git-branch' (-d | -D) <branchname>
DESCRIPTION
-----------
If no argument is provided, show available branches and mark current
branch with star. Otherwise, create a new branch of name <branchname>.
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, `<branchname>` 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

View File

@ -7,15 +7,18 @@ git-checkout - Checkout and switch to a branch
SYNOPSIS
--------
'git-checkout' [-f] [-b <new_branch>] [-m] [<branch>] [<paths>...]
[verse]
'git-checkout' [-f] [-b <new_branch>] [-m] [<branch>]
'git-checkout' [-m] [<branch>] <paths>...
DESCRIPTION
-----------
When <paths> are not given, this command switches branches, by
When <paths> are not given, this command switches branches by
updating the index and working tree to reflect the specified
branch, <branch>, and updating HEAD to be <branch> or, if
specified, <new_branch>.
specified, <new_branch>. Using -b will cause <new_branch> to
be created.
When <paths> 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 <branch>.
-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

View File

@ -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.

View File

@ -14,7 +14,8 @@ SYNOPSIS
OPTIONS
-------
--template=<template_directory>::
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=<template_directory>` is specified, `<template_directory>`
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.

View File

@ -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>::
Upstream branch to compare against.
<head>::
<branch>::
Working branch; defaults to HEAD.
Author

View File

@ -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.

View File

@ -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.

View File

@ -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;
}