From 55258b5c20d3647f44e1bb3c69e39966b2c07619 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:21:39 -0600 Subject: [PATCH 1/8] Add git-show reference Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git.txt | 3 +++ 1 file changed, 3 insertions(+) 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. From dd1811199ed01280f882f9907e743153b4a2c937 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:24:37 -0600 Subject: [PATCH 2/8] Call out the two different uses of git-branch and fix a typo. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-branch.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 From 81ea3ce2ace4d8b76dbfe2aa6b4199472115a115 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:24:49 -0600 Subject: [PATCH 3/8] Document the default source of template files. Also explain a bit more about how the template option works. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-init-db.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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. From 228382aee45ec7f17db220e9099b46347ba2e1c7 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:25:30 -0600 Subject: [PATCH 4/8] Clarify git-rebase example commands. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-rebase.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 5bfc4f23bca0a89e50853b2bdaa6d0118045a9f6 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:25:09 -0600 Subject: [PATCH 5/8] Reference git-commit-tree for env vars. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-commit.txt | 4 ++++ 1 file changed, 4 insertions(+) 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. From beb8e1343745e99988b84b05d257ef3171f127be Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:25:46 -0600 Subject: [PATCH 6/8] Fix minor typo. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-show-branch.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 71bb10336fa79ff667f4753668aaa72b6ebfc689 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 17 Mar 2006 18:26:01 -0600 Subject: [PATCH 7/8] Rewrite synopsis to clarify the two primary uses of git-checkout. Fix a few typo/grammar problems. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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 From 5a1fb2ca92caaa7ae9044ab81dc102f59d17b97a Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 17 Mar 2006 22:45:07 -0500 Subject: [PATCH 8/8] 3% tighter packs for free This patch makes for 3.4% smaller pack with the git repository, and a bit more than 3% smaller pack with the kernel repository. And so with _no_ measurable CPU difference. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- diff-delta.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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; }