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:
commit
c816a6bc5a
@ -7,16 +7,20 @@ git-branch - Create a new branch, or remove an old one
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-branch' [(-d | -D) <branchname>] | [[-f] <branchname> [<start-point>]]
|
[verse]
|
||||||
|
'git-branch' [[-f] <branchname> [<start-point>]]
|
||||||
|
'git-branch' (-d | -D) <branchname>
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
If no argument is provided, show available branches and mark current
|
If no argument is provided, show available branches and mark current
|
||||||
branch with star. Otherwise, create a new branch of name <branchname>.
|
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
|
If a starting point is also specified, that will be where the branch is
|
||||||
created, otherwise it will be created at the current HEAD.
|
created, otherwise it will be created at the current HEAD.
|
||||||
|
|
||||||
|
With a `-d` or `-D` option, `<branchname>` will be deleted.
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
-d::
|
-d::
|
||||||
@ -39,7 +43,7 @@ OPTIONS
|
|||||||
Examples
|
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
|
$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
|
||||||
|
@ -7,15 +7,18 @@ git-checkout - Checkout and switch to a branch
|
|||||||
|
|
||||||
SYNOPSIS
|
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
|
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
|
updating the index and working tree to reflect the specified
|
||||||
branch, <branch>, and updating HEAD to be <branch> or, if
|
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
|
When <paths> are given, this command does *not* switch
|
||||||
branches. It updates the named paths in the working tree from
|
branches. It updates the named paths in the working tree from
|
||||||
@ -29,17 +32,17 @@ given paths before updating the working tree.
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
-f::
|
-f::
|
||||||
Force an re-read of everything.
|
Force a re-read of everything.
|
||||||
|
|
||||||
-b::
|
-b::
|
||||||
Create a new branch and start it at <branch>.
|
Create a new branch and start it at <branch>.
|
||||||
|
|
||||||
-m::
|
-m::
|
||||||
If you have local modifications to a file that is
|
If you have local modifications to one or more files that
|
||||||
different between the current branch and the branch you
|
are different between the current branch and the branch to
|
||||||
are switching to, the command refuses to switch
|
which you are switching, the command refuses to switch
|
||||||
branches, to preserve your modifications in context.
|
branches in order to preserve your modifications in context.
|
||||||
With this option, a three-way merge between the current
|
However, with this option, a three-way merge between the current
|
||||||
branch, your working tree contents, and the new branch
|
branch, your working tree contents, and the new branch
|
||||||
is done, and you will be on 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
|
. 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
|
$ git checkout mytopic
|
||||||
|
@ -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
|
VISUAL and EDITOR environment variables to edit the commit log
|
||||||
message.
|
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
|
This command can run `commit-msg`, `pre-commit`, and
|
||||||
`post-commit` hooks. See link:hooks.html[hooks] for more
|
`post-commit` hooks. See link:hooks.html[hooks] for more
|
||||||
information.
|
information.
|
||||||
|
@ -14,7 +14,8 @@ SYNOPSIS
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
--template=<template_directory>::
|
--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::
|
--shared::
|
||||||
Specify that the git repository is to be shared amongst several users.
|
Specify that the git repository is to be shared amongst several users.
|
||||||
@ -22,9 +23,17 @@ OPTIONS
|
|||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
This simply creates an empty git repository - basically a `.git` directory
|
This command creates an empty git repository - basically a `.git` directory
|
||||||
and `.git/object/??/`, `.git/refs/heads` and `.git/refs/tags` directories,
|
with subdirectories for `objects`, `refs/heads`, `refs/tags`, and
|
||||||
and links `.git/HEAD` symbolically to `.git/refs/heads/master`.
|
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
|
If the `$GIT_DIR` environment variable is set then it specifies a path
|
||||||
to use instead of `./.git` for the base of the repository.
|
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
|
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).
|
(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
|
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`
|
things that are already there. The primary reason for rerunning `git-init-db`
|
||||||
is to pick up newly added templates.
|
is to pick up newly added templates.
|
||||||
|
@ -25,7 +25,7 @@ Assume the following history exists and the current branch is "topic":
|
|||||||
/
|
/
|
||||||
D---E---F---G master
|
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
|
||||||
git-rebase master topic
|
git-rebase master topic
|
||||||
@ -36,7 +36,7 @@ would be:
|
|||||||
/
|
/
|
||||||
D---E---F---G master
|
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:
|
commands:
|
||||||
|
|
||||||
git-rebase --onto master~1 master
|
git-rebase --onto master~1 master
|
||||||
@ -58,7 +58,7 @@ OPTIONS
|
|||||||
<upstream>::
|
<upstream>::
|
||||||
Upstream branch to compare against.
|
Upstream branch to compare against.
|
||||||
|
|
||||||
<head>::
|
<branch>::
|
||||||
Working branch; defaults to HEAD.
|
Working branch; defaults to HEAD.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
|
@ -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
|
only the primary branches. In addition, if you happen to be on
|
||||||
your topic branch, it is shown as well.
|
your topic branch, it is shown as well.
|
||||||
|
|
||||||
|
@ -329,6 +329,9 @@ gitlink:git-revert[1]::
|
|||||||
gitlink:git-shortlog[1]::
|
gitlink:git-shortlog[1]::
|
||||||
Summarizes 'git log' output.
|
Summarizes 'git log' output.
|
||||||
|
|
||||||
|
gitlink:git-show[1]::
|
||||||
|
Show one commit log and its diff.
|
||||||
|
|
||||||
gitlink:git-show-branch[1]::
|
gitlink:git-show-branch[1]::
|
||||||
Show branches and their commits.
|
Show branches and their commits.
|
||||||
|
|
||||||
|
17
diff-delta.c
17
diff-delta.c
@ -136,7 +136,8 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
unsigned long *delta_size,
|
unsigned long *delta_size,
|
||||||
unsigned long max_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;
|
const unsigned char *ref_data, *ref_top, *data, *top;
|
||||||
unsigned char *out;
|
unsigned char *out;
|
||||||
struct index *entry, **hash;
|
struct index *entry, **hash;
|
||||||
@ -222,6 +223,20 @@ void *diff_delta(void *from_buf, unsigned long from_size,
|
|||||||
unsigned char *op;
|
unsigned char *op;
|
||||||
|
|
||||||
if (inscnt) {
|
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;
|
out[outpos - inscnt - 1] = inscnt;
|
||||||
inscnt = 0;
|
inscnt = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user