summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Documentation/RelNotes-1.5.0.4.txt2
-rw-r--r--Documentation/RelNotes-1.5.0.5.txt2
-rw-r--r--Documentation/RelNotes-1.5.0.6.txt1
-rw-r--r--Documentation/RelNotes-1.5.1.3.txt1
-rw-r--r--Documentation/SubmittingPatches14
-rw-r--r--Documentation/asciidoc.conf2
-rw-r--r--Documentation/config.txt4
-rw-r--r--Documentation/core-tutorial.txt46
-rw-r--r--Documentation/diff-format.txt21
-rw-r--r--Documentation/diff-options.txt9
-rw-r--r--Documentation/diffcore.txt3
-rw-r--r--Documentation/docbook-xsl.css572
-rw-r--r--Documentation/fetch-options.txt1
-rw-r--r--Documentation/git-add.txt1
-rw-r--r--Documentation/git-am.txt1
-rw-r--r--Documentation/git-apply.txt1
-rw-r--r--Documentation/git-archimport.txt45
-rw-r--r--Documentation/git-archive.txt2
-rw-r--r--Documentation/git-bisect.txt3
-rw-r--r--Documentation/git-branch.txt1
-rw-r--r--Documentation/git-cat-file.txt1
-rw-r--r--Documentation/git-check-attr.txt1
-rw-r--r--Documentation/git-checkout-index.txt1
-rw-r--r--Documentation/git-checkout.txt1
-rw-r--r--Documentation/git-cherry-pick.txt1
-rw-r--r--Documentation/git-cherry.txt4
-rw-r--r--Documentation/git-clone.txt3
-rw-r--r--Documentation/git-commit-tree.txt3
-rw-r--r--Documentation/git-config.txt1
-rw-r--r--Documentation/git-convert-objects.txt1
-rw-r--r--Documentation/git-count-objects.txt1
-rw-r--r--Documentation/git-cvsexportcommit.txt15
-rw-r--r--Documentation/git-cvsimport.txt13
-rw-r--r--Documentation/git-daemon.txt1
-rw-r--r--Documentation/git-describe.txt1
-rw-r--r--Documentation/git-diff-files.txt3
-rw-r--r--Documentation/git-diff-index.txt3
-rw-r--r--Documentation/git-diff-tree.txt1
-rw-r--r--Documentation/git-diff.txt1
-rw-r--r--Documentation/git-fast-import.txt1
-rw-r--r--Documentation/git-fmt-merge-msg.txt1
-rw-r--r--Documentation/git-format-patch.txt1
-rw-r--r--Documentation/git-fsck.txt1
-rw-r--r--Documentation/git-get-tar-commit-id.txt1
-rw-r--r--Documentation/git-grep.txt1
-rw-r--r--Documentation/git-hash-object.txt3
-rw-r--r--Documentation/git-http-fetch.txt1
-rw-r--r--Documentation/git-http-push.txt2
-rw-r--r--Documentation/git-index-pack.txt1
-rw-r--r--Documentation/git-init-db.txt1
-rw-r--r--Documentation/git-init.txt1
-rw-r--r--Documentation/git-instaweb.txt1
-rw-r--r--Documentation/git-local-fetch.txt1
-rw-r--r--Documentation/git-log.txt1
-rw-r--r--Documentation/git-ls-files.txt1
-rw-r--r--Documentation/git-ls-remote.txt1
-rw-r--r--Documentation/git-ls-tree.txt1
-rw-r--r--Documentation/git-mailinfo.txt1
-rw-r--r--Documentation/git-mailsplit.txt1
-rw-r--r--Documentation/git-merge-base.txt1
-rw-r--r--Documentation/git-merge-index.txt3
-rw-r--r--Documentation/git-merge-one-file.txt1
-rw-r--r--Documentation/git-merge-tree.txt1
-rw-r--r--Documentation/git-merge.txt2
-rw-r--r--Documentation/git-mergetool.txt3
-rw-r--r--Documentation/git-mktag.txt15
-rw-r--r--Documentation/git-mktree.txt1
-rw-r--r--Documentation/git-mv.txt1
-rw-r--r--Documentation/git-name-rev.txt1
-rw-r--r--Documentation/git-p4import.txt1
-rw-r--r--Documentation/git-pack-objects.txt1
-rw-r--r--Documentation/git-pack-redundant.txt3
-rw-r--r--Documentation/git-patch-id.txt1
-rw-r--r--Documentation/git-peek-remote.txt1
-rw-r--r--Documentation/git-prune-packed.txt1
-rw-r--r--Documentation/git-prune.txt3
-rw-r--r--Documentation/git-pull.txt1
-rw-r--r--Documentation/git-push.txt1
-rw-r--r--Documentation/git-quiltimport.txt1
-rw-r--r--Documentation/git-read-tree.txt1
-rw-r--r--Documentation/git-rebase.txt1
-rw-r--r--Documentation/git-reflog.txt1
-rw-r--r--Documentation/git-relink.txt1
-rw-r--r--Documentation/git-remote.txt1
-rw-r--r--Documentation/git-repack.txt1
-rw-r--r--Documentation/git-request-pull.txt1
-rw-r--r--Documentation/git-rev-parse.txt1
-rw-r--r--Documentation/git-revert.txt1
-rw-r--r--Documentation/git-rm.txt1
-rw-r--r--Documentation/git-runstatus.txt1
-rw-r--r--Documentation/git-send-email.txt3
-rw-r--r--Documentation/git-sh-setup.txt1
-rw-r--r--Documentation/git-shell.txt1
-rw-r--r--Documentation/git-shortlog.txt1
-rw-r--r--Documentation/git-show-index.txt1
-rw-r--r--Documentation/git-show.txt1
-rw-r--r--Documentation/git-ssh-fetch.txt1
-rw-r--r--Documentation/git-ssh-upload.txt1
-rw-r--r--Documentation/git-status.txt1
-rw-r--r--Documentation/git-stripspace.txt1
-rw-r--r--Documentation/git-submodule.txt16
-rw-r--r--Documentation/git-svnimport.txt1
-rw-r--r--Documentation/git-tar-tree.txt1
-rw-r--r--Documentation/git-unpack-file.txt1
-rw-r--r--Documentation/git-unpack-objects.txt5
-rw-r--r--Documentation/git-update-index.txt9
-rw-r--r--Documentation/git-update-server-info.txt1
-rw-r--r--Documentation/git-var.txt1
-rw-r--r--Documentation/git-verify-pack.txt1
-rw-r--r--Documentation/git-verify-tag.txt1
-rw-r--r--Documentation/git-whatchanged.txt1
-rw-r--r--Documentation/git-write-tree.txt1
-rw-r--r--Documentation/git.txt1
-rw-r--r--Documentation/gitk.txt1
-rw-r--r--Documentation/howto/rebase-and-edit.txt20
-rw-r--r--Documentation/howto/rebase-from-internal-branch.txt12
-rw-r--r--Documentation/howto/rebuild-from-update-hook.txt1
-rw-r--r--Documentation/howto/revert-branch-rebase.txt2
-rw-r--r--Documentation/howto/separating-topic-branches.txt13
-rw-r--r--Documentation/howto/use-git-daemon.txt1
-rw-r--r--Documentation/merge-options.txt1
-rw-r--r--Documentation/pretty-formats.txt1
-rw-r--r--Documentation/pretty-options.txt1
-rw-r--r--Documentation/pull-fetch-param.txt2
-rw-r--r--Documentation/repository-layout.txt1
-rw-r--r--Documentation/technical/pack-format.txt8
-rw-r--r--Documentation/tutorial.txt4
-rw-r--r--Documentation/user-manual.txt55
-rw-r--r--INSTALL3
-rw-r--r--Makefile7
-rw-r--r--arm/sha1.c4
-rw-r--r--arm/sha1_arm.S1
-rw-r--r--builtin-annotate.c1
-rw-r--r--builtin-branch.c4
-rw-r--r--builtin-diff-index.c2
-rw-r--r--builtin-fmt-merge-msg.c1
-rw-r--r--builtin-fsck.c4
-rw-r--r--builtin-init-db.c2
-rw-r--r--builtin-log.c8
-rw-r--r--builtin-ls-files.c2
-rw-r--r--builtin-mailinfo.c4
-rw-r--r--builtin-mailsplit.c4
-rw-r--r--builtin-merge-file.c6
-rw-r--r--builtin-name-rev.c1
-rw-r--r--builtin-pack-objects.c2
-rw-r--r--builtin-rerere.c1
-rw-r--r--builtin-revert.c2
-rw-r--r--builtin-shortlog.c1
-rw-r--r--builtin-stripspace.c2
-rw-r--r--builtin.h3
-rw-r--r--cache.h2
-rw-r--r--commit.c23
-rw-r--r--commit.h4
-rw-r--r--compat/mmap.c1
-rw-r--r--config.c3
-rw-r--r--config.mak.in1
-rw-r--r--connect.c2
-rw-r--r--contrib/README1
-rw-r--r--contrib/blameview/README1
-rwxr-xr-xcontrib/gitview/gitview13
-rw-r--r--contrib/hooks/post-receive-email2
-rw-r--r--contrib/remotes2config.sh2
-rw-r--r--convert-objects.c2
-rw-r--r--copy.c1
-rw-r--r--ctype.c1
-rw-r--r--daemon.c6
-rw-r--r--date.c16
-rw-r--r--diff-lib.c2
-rw-r--r--diff.c10
-rw-r--r--diff.h2
-rw-r--r--diffcore-pickaxe.c2
-rw-r--r--entry.c2
-rw-r--r--environment.c2
-rw-r--r--fetch-pack.c2
-rw-r--r--fetch.c4
-rwxr-xr-xgit-archimport.perl175
-rwxr-xr-xgit-checkout.sh7
-rwxr-xr-xgit-clone.sh7
-rwxr-xr-xgit-commit.sh2
-rwxr-xr-xgit-cvsexportcommit.perl2
-rwxr-xr-xgit-cvsimport.perl40
-rwxr-xr-xgit-cvsserver.perl11
-rwxr-xr-xgit-gui/GIT-VERSION-GEN4
-rwxr-xr-xgit-gui/git-gui.sh174
-rw-r--r--git-gui/lib/blame.tcl973
-rw-r--r--git-gui/lib/branch.tcl14
-rw-r--r--git-gui/lib/branch_rename.tcl136
-rw-r--r--git-gui/lib/browser.tcl1
-rw-r--r--git-gui/lib/class.tcl25
-rw-r--r--git-gui/lib/console.tcl2
-rw-r--r--git-gui/lib/diff.tcl2
-rw-r--r--git-gui/lib/merge.tcl5
-rw-r--r--git-gui/lib/option.tcl22
-rw-r--r--git-gui/lib/remote.tcl11
-rw-r--r--git-gui/lib/remote_branch_delete.tcl347
-rw-r--r--git-gui/lib/transport.tcl16
-rwxr-xr-xgit-merge-one-file.sh2
-rwxr-xr-xgit-mergetool.sh54
-rw-r--r--git-p4import.py1
-rwxr-xr-xgit-send-email.perl3
-rwxr-xr-xgit-submodule.sh83
-rwxr-xr-xgit-svnimport.perl4
-rwxr-xr-xgit-tag.sh5
-rwxr-xr-xgit-verify-tag.sh1
-rw-r--r--git.spec.in2
-rwxr-xr-xgitk2
-rw-r--r--gitweb/README1
-rw-r--r--gitweb/gitweb.css5
-rwxr-xr-xgitweb/gitweb.perl481
-rw-r--r--help.c2
-rw-r--r--http-fetch.c2
-rw-r--r--http-push.c2
-rw-r--r--http.c2
-rw-r--r--imap-send.c2
-rw-r--r--local-fetch.c8
-rw-r--r--lockfile.c1
-rw-r--r--mailmap.c1
-rw-r--r--match-trees.c1
-rw-r--r--merge-index.c2
-rw-r--r--mktag.c9
-rw-r--r--mozilla-sha1/sha1.c19
-rw-r--r--mozilla-sha1/sha1.h18
-rw-r--r--object-refs.c2
-rw-r--r--object.c3
-rw-r--r--object.h2
-rw-r--r--pack-check.c47
-rw-r--r--pack-redundant.c4
-rw-r--r--patch-id.c2
-rw-r--r--path-list.c1
-rw-r--r--perl/Makefile1
-rw-r--r--pkt-line.c2
-rw-r--r--ppc/sha1.c2
-rw-r--r--quote.c14
-rw-r--r--quote.h2
-rw-r--r--read-cache.c10
-rw-r--r--remote.c39
-rw-r--r--revision.c16
-rw-r--r--revision.h3
-rw-r--r--rsh.h2
-rw-r--r--setup.c4
-rw-r--r--sha1_file.c8
-rw-r--r--sha1_name.c2
-rw-r--r--shallow.c1
-rw-r--r--ssh-upload.c10
-rw-r--r--strbuf.c1
-rw-r--r--t/Makefile1
-rw-r--r--t/lib-read-tree-m-3way.sh2
-rwxr-xr-xt/t0000-basic.sh2
-rwxr-xr-xt/t1200-tutorial.sh1
-rwxr-xr-xt/t1300-repo-config.sh1
-rwxr-xr-xt/t2000-checkout-cache-clash.sh2
-rwxr-xr-xt/t2001-checkout-cache-clash.sh1
-rwxr-xr-xt/t3030-merge-recursive.sh1
-rwxr-xr-xt/t3403-rebase-skip.sh1
-rwxr-xr-xt/t4006-diff-mode.sh1
-rwxr-xr-xt/t4100-apply-stat.sh1
-rwxr-xr-xt/t4110-apply-scan.sh1
-rwxr-xr-xt/t4112-apply-renames.sh16
-rwxr-xr-xt/t4118-apply-empty-context.sh1
-rwxr-xr-xt/t4119-apply-config.sh2
-rwxr-xr-xt/t4121-apply-diffs.sh1
-rwxr-xr-xt/t4122-apply-symlink-inside.sh1
-rwxr-xr-xt/t4200-rerere.sh2
-rwxr-xr-xt/t5000-tar-tree.sh7
-rwxr-xr-xt/t5400-send-pack.sh2
-rwxr-xr-xt/t5516-fetch-push.sh82
-rwxr-xr-xt/t5520-pull.sh1
-rwxr-xr-xt/t5701-clone-local.sh46
-rwxr-xr-xt/t5710-info-alternate.sh1
-rwxr-xr-xt/t6000lib.sh16
-rwxr-xr-xt/t6002-rev-list-bisect.sh8
-rwxr-xr-xt/t6021-merge-criss-cross.sh2
-rwxr-xr-xt/t6023-merge-file.sh6
-rwxr-xr-xt/t6030-bisect-porcelain.sh1
-rwxr-xr-xt/t6101-rev-parse-parents.sh1
-rwxr-xr-xt/t7201-co.sh40
-rwxr-xr-xt/t7400-submodule-basic.sh38
-rwxr-xr-xt/t9107-git-svn-migrate.sh1
-rw-r--r--t/t9111/svnsync.dump2
-rwxr-xr-xt/t9400-git-cvsserver-server.sh34
-rw-r--r--t/test-lib.sh2
-rw-r--r--templates/Makefile2
-rw-r--r--templates/hooks--commit-msg1
-rw-r--r--templates/hooks--post-receive1
-rw-r--r--templates/hooks--pre-applypatch1
-rw-r--r--templates/hooks--pre-commit1
-rw-r--r--tree-walk.c1
-rw-r--r--tree.c7
-rw-r--r--upload-pack.c4
-rw-r--r--var.c4
-rw-r--r--wt-status.c2
-rw-r--r--xdiff-interface.c2
-rw-r--r--xdiff/xdiff.h1
-rw-r--r--xdiff/xdiffi.c1
-rw-r--r--xdiff/xdiffi.h1
-rw-r--r--xdiff/xemit.c5
-rw-r--r--xdiff/xemit.h1
-rw-r--r--xdiff/xinclude.h1
-rw-r--r--xdiff/xmacros.h1
-rw-r--r--xdiff/xprepare.c1
-rw-r--r--xdiff/xprepare.h1
-rw-r--r--xdiff/xtypes.h1
-rw-r--r--xdiff/xutils.c1
-rw-r--r--xdiff/xutils.h1
305 files changed, 2960 insertions, 1491 deletions
diff --git a/.gitignore b/.gitignore
index 27e5aeb8a0..bd49cd4627 100644
--- a/.gitignore
+++ b/.gitignore
@@ -159,7 +159,7 @@ common-cmds.h
*.deb
git-core.spec
*.exe
-*.[ao]
+*.[aos]
*.py[co]
config.mak
autom4te.cache
diff --git a/Documentation/RelNotes-1.5.0.4.txt b/Documentation/RelNotes-1.5.0.4.txt
index b727a8d1e5..feefa5dfd4 100644
--- a/Documentation/RelNotes-1.5.0.4.txt
+++ b/Documentation/RelNotes-1.5.0.4.txt
@@ -20,5 +20,3 @@ Fixes since v1.5.0.3
* Documentation updates
* User manual updates
-
-
diff --git a/Documentation/RelNotes-1.5.0.5.txt b/Documentation/RelNotes-1.5.0.5.txt
index aa86149d4f..eeec3d73d0 100644
--- a/Documentation/RelNotes-1.5.0.5.txt
+++ b/Documentation/RelNotes-1.5.0.5.txt
@@ -24,5 +24,3 @@ Fixes since v1.5.0.3
* Documentation updates
* User manual updates
-
-
diff --git a/Documentation/RelNotes-1.5.0.6.txt b/Documentation/RelNotes-1.5.0.6.txt
index e15447ffdb..c02015ad5f 100644
--- a/Documentation/RelNotes-1.5.0.6.txt
+++ b/Documentation/RelNotes-1.5.0.6.txt
@@ -19,4 +19,3 @@ Fixes since v1.5.0.5
- user-manual has better cross references.
- gitweb installation/deployment procedure is now documented.
-
diff --git a/Documentation/RelNotes-1.5.1.3.txt b/Documentation/RelNotes-1.5.1.3.txt
index 2ddeabd029..876408b65a 100644
--- a/Documentation/RelNotes-1.5.1.3.txt
+++ b/Documentation/RelNotes-1.5.1.3.txt
@@ -43,4 +43,3 @@ Fixes since v1.5.1.2
description was given by the caller.
Also contains various documentation updates.
-
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b9baa1d3b4..01354c2bb5 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -296,15 +296,15 @@ diff --git a/pico/pico.c b/pico/pico.c
--- a/pico/pico.c
+++ b/pico/pico.c
@@ -219,7 +219,9 @@ PICO *pm;
- switch(pico_all_done){ /* prepare for/handle final events */
- case COMP_EXIT : /* already confirmed */
- packheader();
+ switch(pico_all_done){ /* prepare for/handle final events */
+ case COMP_EXIT : /* already confirmed */
+ packheader();
+#if 0
- stripwhitespace();
+ stripwhitespace();
+#endif
- c |= COMP_EXIT;
- break;
-
+ c |= COMP_EXIT;
+ break;
+
(Daniel Barkalow)
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 60e15ba349..99302c5beb 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -54,5 +54,3 @@ ifdef::backend-xhtml11[]
[gitlink-inlinemacro]
<a href="{target}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]
-
-
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5868d587a9..a2057d9d24 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -531,7 +531,7 @@ merge.summary::
merge.tool::
Controls which merge resolution program is used by
gitlink:git-mergetool[l]. Valid values are: "kdiff3", "tkdiff",
- "meld", "xxdiff", "emerge", "vimdiff", and "opendiff"
+ "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and "opendiff".
merge.verbosity::
Controls the amount of output shown by the recursive merge
@@ -682,5 +682,3 @@ receive.denyNonFastForwards::
transfer.unpackLimit::
When `fetch.unpackLimit` or `receive.unpackLimit` are
not set, the value of this variable is used instead.
-
-
diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt
index 6b9b9ad7d1..4fb6f4143c 100644
--- a/Documentation/core-tutorial.txt
+++ b/Documentation/core-tutorial.txt
@@ -9,11 +9,11 @@ repository, mainly because being hands-on and using explicit examples is
often the best way of explaining what is going on.
In normal life, most people wouldn't use the "core" git programs
-directly, but rather script around them to make them more palatable.
+directly, but rather script around them to make them more palatable.
Understanding the core git stuff may help some people get those scripts
done, though, and it may also be instructive in helping people
understand what it is that the higher-level helper scripts are actually
-doing.
+doing.
The core git is often called "plumbing", with the prettier user
interfaces on top of it called "porcelain". You may not want to use the
@@ -41,7 +41,7 @@ Creating a new git repository couldn't be easier: all git repositories start
out empty, and the only thing you need to do is find yourself a
subdirectory that you want to use as a working tree - either an empty
one for a totally new project, or an existing working tree that you want
-to import into git.
+to import into git.
For our first example, we're going to start a totally new repository from
scratch, with no pre-existing files, and we'll call it `git-tutorial`.
@@ -169,7 +169,7 @@ $ ls .git/objects/??/*
and see two files:
----------------
-.git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238
+.git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238
.git/objects/f2/4c74a2e500f5ee1332c86b94199f52b1d1d962
----------------
@@ -220,7 +220,7 @@ you have not actually really "checked in" your files into git so far,
you've only *told* git about them.
However, since git knows about them, you can now start using some of the
-most basic git commands to manipulate the files or look at their status.
+most basic git commands to manipulate the files or look at their status.
In particular, let's not even check in the two files into git yet, we'll
start off by adding another line to `hello` first:
@@ -350,7 +350,7 @@ Making a change
Remember how we did the `git-update-index` on file `hello` and then we
changed `hello` afterward, and could compare the new state of `hello` with the
-state we saved in the index file?
+state we saved in the index file?
Further, remember how I said that `git-write-tree` writes the contents
of the *index* file to the tree, and thus what we just committed was in
@@ -370,7 +370,7 @@ file and the working tree, `git-diff-index` shows the differences
between a committed *tree* and either the index file or the working
tree. In other words, `git-diff-index` wants a tree to be diffed
against, and before we did the commit, we couldn't do that, because we
-didn't have anything to diff against.
+didn't have anything to diff against.
But now we can do
@@ -379,7 +379,7 @@ $ git-diff-index -p HEAD
----------------
(where `-p` has the same meaning as it did in `git-diff-files`), and it
-will show us the same difference, but for a totally different reason.
+will show us the same difference, but for a totally different reason.
Now we're comparing the working tree not against the index file,
but against the tree we just wrote. It just so happens that those two
are obviously the same, so we get the same result.
@@ -398,7 +398,7 @@ working tree, but when given the `\--cached` flag, it is told to
instead compare against just the index cache contents, and ignore the
current working tree state entirely. Since we just wrote the index
file to HEAD, doing `git-diff-index \--cached -p HEAD` should thus return
-an empty set of differences, and that's exactly what it does.
+an empty set of differences, and that's exactly what it does.
[NOTE]
================
@@ -549,7 +549,7 @@ $ git-whatchanged -p --root
----------------
and you will see exactly what has changed in the repository over its
-short history.
+short history.
[NOTE]
The `\--root` flag is a flag to `git-diff-tree` to tell it to
@@ -637,7 +637,7 @@ So the mental model of "the git information is always tied directly to
the working tree that it describes" may not be technically 100%
accurate, but it's a good model for all normal use.
-This has two implications:
+This has two implications:
- if you grow bored with the tutorial repository you created (or you've
made a mistake and want to start all over), you can just do simple
@@ -705,7 +705,7 @@ Many (most?) public remote repositories will not contain any of
the checked out files or even an index file, and will *only* contain the
actual core git files. Such a repository usually doesn't even have the
`.git` subdirectory, but has all the git files directly in the
-repository.
+repository.
To create your own local live copy of such a "raw" git repository, you'd
first create your own subdirectory for the project, and then copy the
@@ -718,7 +718,7 @@ $ cd my-git
$ rsync -rL rsync://rsync.kernel.org/pub/scm/git/git.git/ .git
----------------
-followed by
+followed by
----------------
$ git-read-tree HEAD
@@ -738,7 +738,7 @@ up-to-date (so that you don't have to refresh it afterward), and the
`-a` flag means "check out all files" (if you have a stale copy or an
older version of a checked out tree you may also need to add the `-f`
flag first, to tell git-checkout-index to *force* overwriting of any old
-files).
+files).
Again, this can all be simplified with
@@ -751,7 +751,7 @@ $ git checkout
which will end up doing all of the above for you.
You have now successfully copied somebody else's (mine) remote
-repository, and checked it out.
+repository, and checked it out.
Creating a new branch
@@ -760,14 +760,14 @@ Creating a new branch
Branches in git are really nothing more than pointers into the git
object database from within the `.git/refs/` subdirectory, and as we
already discussed, the `HEAD` branch is nothing but a symlink to one of
-these object pointers.
+these object pointers.
You can at any time create a new branch by just picking an arbitrary
point in the project history, and just writing the SHA1 name of that
object into a file under `.git/refs/heads/`. You can use any filename you
want (and indeed, subdirectories), but the convention is that the
"normal" branch is called `master`. That's just a convention, though,
-and nothing enforces it.
+and nothing enforces it.
To show that as an example, let's go back to the git-tutorial repository we
used earlier, and create a branch in it. You do that by simply just
@@ -778,7 +778,7 @@ $ git checkout -b mybranch
------------
will create a new branch based at the current `HEAD` position, and switch
-to it.
+to it.
[NOTE]
================================================
@@ -825,7 +825,7 @@ checking it out and switching to it. If so, just use the command
$ git branch <branchname> [startingpoint]
------------
-which will simply _create_ the branch, but will not do anything further.
+which will simply _create_ the branch, but will not do anything further.
You can then later -- once you decide that you want to actually develop
on that branch -- switch to that branch with a regular `git checkout`
with the branchname as the argument.
@@ -884,7 +884,7 @@ $ gitk --all
will show you graphically both of your branches (that's what the `\--all`
means: normally it will just show you your current `HEAD`) and their
histories. You can also see exactly how they came to be from a common
-source.
+source.
Anyway, let's exit `gitk` (`^Q` or the File menu), and decide that we want
to merge the work we did on the `mybranch` branch into the `master`
@@ -905,8 +905,8 @@ of it as it can automatically (which in this case is just merge the `example`
file, which had no differences in the `mybranch` branch), and say:
----------------
- Auto-merging hello
- CONFLICT (content): Merge conflict in hello
+ Auto-merging hello
+ CONFLICT (content): Merge conflict in hello
Automatic merge failed; fix up by hand
----------------
@@ -1387,7 +1387,7 @@ repository. Kernel.org mirror network takes care of the
propagation to other publicly visible machines:
------------
-$ git push master.kernel.org:/pub/scm/git/git.git/
+$ git push master.kernel.org:/pub/scm/git/git.git/
------------
diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt
index e38a1f1405..18d49d2c3b 100644
--- a/Documentation/diff-format.txt
+++ b/Documentation/diff-format.txt
@@ -1,7 +1,7 @@
The output format from "git-diff-index", "git-diff-tree" and
"git-diff-files" are very similar.
-These commands all compare two sets of things; what is
+These commands all compare two sets of things; what is
compared differs:
git-diff-index <tree-ish>::
@@ -139,28 +139,28 @@ index fabadb8,cc95eb0..4866510
--- a/describe.c
+++ b/describe.c
@@@ -98,20 -98,12 +98,20 @@@
- return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
+ return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
}
-
+
- static void describe(char *arg)
-static void describe(struct commit *cmit, int last_one)
++static void describe(char *arg, int last_one)
{
+ unsigned char sha1[20];
+ struct commit *cmit;
- struct commit_list *list;
- static int initialized = 0;
- struct commit_name *n;
-
+ struct commit_list *list;
+ static int initialized = 0;
+ struct commit_name *n;
+
+ if (get_sha1(arg, sha1) < 0)
+ usage(describe_usage);
+ cmit = lookup_commit_reference(sha1);
+ if (!cmit)
+ usage(describe_usage);
+
- if (!initialized) {
- initialized = 1;
- for_each_ref(get_name);
+ if (!initialized) {
+ initialized = 1;
+ for_each_ref(get_name);
------------
1. It is preceded with a "git diff" header, that looks like
@@ -233,4 +233,3 @@ parents). When shown by `git diff-files -c`, it compares the
two unresolved merge parents with the working tree file
(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
"their version").
-
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 1689c74817..0f07c9c4a8 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -86,7 +86,7 @@
Detect renames.
-C::
- Detect copies as well as renames.
+ Detect copies as well as renames. See also `--find-copies-harder`.
--diff-filter=[ACDMRTUXB*]::
Select only files that are Added (`A`), Copied (`C`),
@@ -100,12 +100,13 @@
that matches other criteria, nothing is selected.
--find-copies-harder::
- For performance reasons, by default, -C option finds copies only
- if the original file of the copy was modified in the same
+ For performance reasons, by default, `-C` option finds copies only
+ if the original file of the copy was modified in the same
changeset. This flag makes the command
inspect unmodified files as candidates for the source of
copy. This is a very expensive operation for large
- projects, so use it with caution.
+ projects, so use it with caution. Giving more than one
+ `-C` option has the same effect.
-l<num>::
-M and -C options require O(n^2) processing time where n
diff --git a/Documentation/diffcore.txt b/Documentation/diffcore.txt
index 34cd306bb1..c6a983a5d5 100644
--- a/Documentation/diffcore.txt
+++ b/Documentation/diffcore.txt
@@ -71,7 +71,7 @@ The first transformation in the chain is diffcore-pathspec, and
is controlled by giving the pathname parameters to the
git-diff-* commands on the command line. The pathspec is used
to limit the world diff operates in. It removes the filepairs
-outside the specified set of pathnames. E.g. If the input set
+outside the specified set of pathnames. E.g. If the input set
of filepairs included:
------------------------------------------------
@@ -269,4 +269,3 @@ Documentation
*.c
t
------------------------------------------------
-
diff --git a/Documentation/docbook-xsl.css b/Documentation/docbook-xsl.css
index 8821e305dd..b878b385c6 100644
--- a/Documentation/docbook-xsl.css
+++ b/Documentation/docbook-xsl.css
@@ -1,286 +1,286 @@
-/*
- CSS stylesheet for XHTML produced by DocBook XSL stylesheets.
- Tested with XSL stylesheets 1.61.2, 1.67.2
-*/
-
-span.strong {
- font-weight: bold;
-}
-
-body blockquote {
- margin-top: .75em;
- line-height: 1.5;
- margin-bottom: .75em;
-}
-
-html body {
- margin: 1em 5% 1em 5%;
- line-height: 1.2;
-}
-
-body div {
- margin: 0;
-}
-
-h1, h2, h3, h4, h5, h6,
-div.toc p b,
-div.list-of-figures p b,
-div.list-of-tables p b,
-div.abstract p.title
-{
- color: #527bbd;
- font-family: tahoma, verdana, sans-serif;
-}
-
-div.toc p:first-child,
-div.list-of-figures p:first-child,
-div.list-of-tables p:first-child,
-div.example p.title
-{
- margin-bottom: 0.2em;
-}
-
-body h1 {
- margin: .0em 0 0 -4%;
- line-height: 1.3;
- border-bottom: 2px solid silver;
-}
-
-body h2 {
- margin: 0.5em 0 0 -4%;
- line-height: 1.3;
- border-bottom: 2px solid silver;
-}
-
-body h3 {
- margin: .8em 0 0 -3%;
- line-height: 1.3;
-}
-
-body h4 {
- margin: .8em 0 0 -3%;
- line-height: 1.3;
-}
-
-body h5 {
- margin: .8em 0 0 -2%;
- line-height: 1.3;
-}
-
-body h6 {
- margin: .8em 0 0 -1%;
- line-height: 1.3;
-}
-
-body hr {
- border: none; /* Broken on IE6 */
-}
-div.footnotes hr {
- border: 1px solid silver;
-}
-
-div.navheader th, div.navheader td, div.navfooter td {
- font-family: sans-serif;
- font-size: 0.9em;
- font-weight: bold;
- color: #527bbd;
-}
-div.navheader img, div.navfooter img {
- border-style: none;
-}
-div.navheader a, div.navfooter a {
- font-weight: normal;
-}
-div.navfooter hr {
- border: 1px solid silver;
-}
-
-body td {
- line-height: 1.2
-}
-
-body th {
- line-height: 1.2;
-}
-
-ol {
- line-height: 1.2;
-}
-
-ul, body dir, body menu {
- line-height: 1.2;
-}
-
-html {
- margin: 0;
- padding: 0;
-}
-
-body h1, body h2, body h3, body h4, body h5, body h6 {
- margin-left: 0
-}
-
-body pre {
- margin: 0.5em 10% 0.5em 1em;
- line-height: 1.0;
- color: navy;
-}
-
-tt.literal, code.literal {
- color: navy;
-}
-
-div.literallayout p {
- padding: 0em;
- margin: 0em;
-}
-
-div.literallayout {
- font-family: monospace;
-# margin: 0.5em 10% 0.5em 1em;
- margin: 0em;
- color: navy;
- border: 1px solid silver;
- background: #f4f4f4;
- padding: 0.5em;
-}
-
-.programlisting, .screen {
- border: 1px solid silver;
- background: #f4f4f4;
- margin: 0.5em 10% 0.5em 0;
- padding: 0.5em 1em;
-}
-
-div.sidebar {
- background: #ffffee;
- margin: 1.0em 10% 0.5em 0;
- padding: 0.5em 1em;
- border: 1px solid silver;
-}
-div.sidebar * { padding: 0; }
-div.sidebar div { margin: 0; }
-div.sidebar p.title {
- font-family: sans-serif;
- margin-top: 0.5em;
- margin-bottom: 0.2em;
-}
-
-div.bibliomixed {
- margin: 0.5em 5% 0.5em 1em;
-}
-
-div.glossary dt {
- font-weight: bold;
-}
-div.glossary dd p {
- margin-top: 0.2em;
-}
-
-dl {
- margin: .8em 0;
- line-height: 1.2;
-}
-
-dt {
- margin-top: 0.5em;
-}
-
-dt span.term {
- font-style: italic;
-}
-
-div.variablelist dd p {
- margin-top: 0;
-}
-
-div.itemizedlist li, div.orderedlist li {
- margin-left: -0.8em;
- margin-top: 0.5em;
-}
-
-ul, ol {
- list-style-position: outside;
-}
-
-div.sidebar ul, div.sidebar ol {
- margin-left: 2.8em;
-}
-
-div.itemizedlist p.title,
-div.orderedlist p.title,
-div.variablelist p.title
-{
- margin-bottom: -0.8em;
-}
-
-div.revhistory table {
- border-collapse: collapse;
- border: none;
-}
-div.revhistory th {
- border: none;
- color: #527bbd;
- font-family: tahoma, verdana, sans-serif;
-}
-div.revhistory td {
- border: 1px solid silver;
-}
-
-/* Keep TOC and index lines close together. */
-div.toc dl, div.toc dt,
-div.list-of-figures dl, div.list-of-figures dt,
-div.list-of-tables dl, div.list-of-tables dt,
-div.indexdiv dl, div.indexdiv dt
-{
- line-height: normal;
- margin-top: 0;
- margin-bottom: 0;
-}
-
-/*
- Table styling does not work because of overriding attributes in
- generated HTML.
-*/
-div.table table,
-div.informaltable table
-{
- margin-left: 0;
- margin-right: 5%;
- margin-bottom: 0.8em;
-}
-div.informaltable table
-{
- margin-top: 0.4em
-}
-div.table thead,
-div.table tfoot,
-div.table tbody,
-div.informaltable thead,
-div.informaltable tfoot,
-div.informaltable tbody
-{
- /* No effect in IE6. */
- border-top: 2px solid #527bbd;
- border-bottom: 2px solid #527bbd;
-}
-div.table thead, div.table tfoot,
-div.informaltable thead, div.informaltable tfoot
-{
- font-weight: bold;
-}
-
-div.mediaobject img {
- border: 1px solid silver;
- margin-bottom: 0.8em;
-}
-div.figure p.title,
-div.table p.title
-{
- margin-top: 1em;
- margin-bottom: 0.4em;
-}
-
-@media print {
- div.navheader, div.navfooter { display: none; }
-}
+/*
+ CSS stylesheet for XHTML produced by DocBook XSL stylesheets.
+ Tested with XSL stylesheets 1.61.2, 1.67.2
+*/
+
+span.strong {
+ font-weight: bold;
+}
+
+body blockquote {
+ margin-top: .75em;
+ line-height: 1.5;
+ margin-bottom: .75em;
+}
+
+html body {
+ margin: 1em 5% 1em 5%;
+ line-height: 1.2;
+}
+
+body div {
+ margin: 0;
+}
+
+h1, h2, h3, h4, h5, h6,
+div.toc p b,
+div.list-of-figures p b,
+div.list-of-tables p b,
+div.abstract p.title
+{
+ color: #527bbd;
+ font-family: tahoma, verdana, sans-serif;
+}
+
+div.toc p:first-child,
+div.list-of-figures p:first-child,
+div.list-of-tables p:first-child,
+div.example p.title
+{
+ margin-bottom: 0.2em;
+}
+
+body h1 {
+ margin: .0em 0 0 -4%;
+ line-height: 1.3;
+ border-bottom: 2px solid silver;
+}
+
+body h2 {
+ margin: 0.5em 0 0 -4%;
+ line-height: 1.3;
+ border-bottom: 2px solid silver;
+}
+
+body h3 {
+ margin: .8em 0 0 -3%;
+ line-height: 1.3;
+}
+
+body h4 {
+ margin: .8em 0 0 -3%;
+ line-height: 1.3;
+}
+
+body h5 {
+ margin: .8em 0 0 -2%;
+ line-height: 1.3;
+}
+
+body h6 {
+ margin: .8em 0 0 -1%;
+ line-height: 1.3;
+}
+
+body hr {
+ border: none; /* Broken on IE6 */
+}
+div.footnotes hr {
+ border: 1px solid silver;
+}
+
+div.navheader th, div.navheader td, div.navfooter td {
+ font-family: sans-serif;
+ font-size: 0.9em;
+ font-weight: bold;
+ color: #527bbd;
+}
+div.navheader img, div.navfooter img {
+ border-style: none;
+}
+div.navheader a, div.navfooter a {
+ font-weight: normal;
+}
+div.navfooter hr {
+ border: 1px solid silver;
+}
+
+body td {
+ line-height: 1.2
+}
+
+body th {
+ line-height: 1.2;
+}
+
+ol {
+ line-height: 1.2;
+}
+
+ul, body dir, body menu {
+ line-height: 1.2;
+}
+
+html {
+ margin: 0;
+ padding: 0;
+}
+
+body h1, body h2, body h3, body h4, body h5, body h6 {
+ margin-left: 0
+}
+
+body pre {
+ margin: 0.5em 10% 0.5em 1em;
+ line-height: 1.0;
+ color: navy;
+}
+
+tt.literal, code.literal {
+ color: navy;
+}
+
+div.literallayout p {
+ padding: 0em;
+ margin: 0em;
+}
+
+div.literallayout {
+ font-family: monospace;
+# margin: 0.5em 10% 0.5em 1em;
+ margin: 0em;
+ color: navy;
+ border: 1px solid silver;
+ background: #f4f4f4;
+ padding: 0.5em;
+}
+
+.programlisting, .screen {
+ border: 1px solid silver;
+ background: #f4f4f4;
+ margin: 0.5em 10% 0.5em 0;
+ padding: 0.5em 1em;
+}
+
+div.sidebar {
+ background: #ffffee;
+ margin: 1.0em 10% 0.5em 0;
+ padding: 0.5em 1em;
+ border: 1px solid silver;
+}
+div.sidebar * { padding: 0; }
+div.sidebar div { margin: 0; }
+div.sidebar p.title {
+ font-family: sans-serif;
+ margin-top: 0.5em;
+ margin-bottom: 0.2em;
+}
+
+div.bibliomixed {
+ margin: 0.5em 5% 0.5em 1em;
+}
+
+div.glossary dt {
+ font-weight: bold;
+}
+div.glossary dd p {
+ margin-top: 0.2em;
+}
+
+dl {
+ margin: .8em 0;
+ line-height: 1.2;
+}
+
+dt {
+ margin-top: 0.5em;
+}
+
+dt span.term {
+ font-style: italic;
+}
+
+div.variablelist dd p {
+ margin-top: 0;
+}
+
+div.itemizedlist li, div.orderedlist li {
+ margin-left: -0.8em;
+ margin-top: 0.5em;
+}
+
+ul, ol {
+ list-style-position: outside;
+}
+
+div.sidebar ul, div.sidebar ol {
+ margin-left: 2.8em;
+}
+
+div.itemizedlist p.title,
+div.orderedlist p.title,
+div.variablelist p.title
+{
+ margin-bottom: -0.8em;
+}
+
+div.revhistory table {
+ border-collapse: collapse;
+ border: none;
+}
+div.revhistory th {
+ border: none;
+ color: #527bbd;
+ font-family: tahoma, verdana, sans-serif;
+}
+div.revhistory td {
+ border: 1px solid silver;
+}
+
+/* Keep TOC and index lines close together. */
+div.toc dl, div.toc dt,
+div.list-of-figures dl, div.list-of-figures dt,
+div.list-of-tables dl, div.list-of-tables dt,
+div.indexdiv dl, div.indexdiv dt
+{
+ line-height: normal;
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+/*
+ Table styling does not work because of overriding attributes in
+ generated HTML.
+*/
+div.table table,
+div.informaltable table
+{
+ margin-left: 0;
+ margin-right: 5%;
+ margin-bottom: 0.8em;
+}
+div.informaltable table
+{
+ margin-top: 0.4em
+}
+div.table thead,
+div.table tfoot,
+div.table tbody,
+div.informaltable thead,
+div.informaltable tfoot,
+div.informaltable tbody
+{
+ /* No effect in IE6. */
+ border-top: 2px solid #527bbd;
+ border-bottom: 2px solid #527bbd;
+}
+div.table thead, div.table tfoot,
+div.informaltable thead, div.informaltable tfoot
+{
+ font-weight: bold;
+}
+
+div.mediaobject img {
+ border: 1px solid silver;
+ margin-bottom: 0.8em;
+}
+div.figure p.title,
+div.table p.title
+{
+ margin-top: 1em;
+ margin-bottom: 0.4em;
+}
+
+@media print {
+ div.navheader, div.navfooter { display: none; }
+}
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index bdc7332c7b..da034223f3 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -52,4 +52,3 @@
Deepen the history of a 'shallow' repository created by
`git clone` with `--depth=<depth>` option (see gitlink:git-clone[1])
by the specified number of commits.
-
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index a0c9f68580..76d2b05854 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -228,4 +228,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index f3387f5d09..e4a6b3a6f0 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -158,4 +158,3 @@ Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.o
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 3bd2c995da..f03f661652 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -183,4 +183,3 @@ Documentation by Junio C Hamano
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-archimport.txt b/Documentation/git-archimport.txt
index 82cb41d279..7091b8d61c 100644
--- a/Documentation/git-archimport.txt
+++ b/Documentation/git-archimport.txt
@@ -17,26 +17,26 @@ DESCRIPTION
Imports a project from one or more Arch repositories. It will follow branches
and repositories within the namespaces defined by the <archive/branch>
parameters supplied. If it cannot find the remote branch a merge comes from
-it will just import it as a regular commit. If it can find it, it will mark it
-as a merge whenever possible (see discussion below).
+it will just import it as a regular commit. If it can find it, it will mark it
+as a merge whenever possible (see discussion below).
-The script expects you to provide the key roots where it can start the import
-from an 'initial import' or 'tag' type of Arch commit. It will follow and
-import new branches within the provided roots.
+The script expects you to provide the key roots where it can start the import
+from an 'initial import' or 'tag' type of Arch commit. It will follow and
+import new branches within the provided roots.
-It expects to be dealing with one project only. If it sees
-branches that have different roots, it will refuse to run. In that case,
-edit your <archive/branch> parameters to define clearly the scope of the
-import.
+It expects to be dealing with one project only. If it sees
+branches that have different roots, it will refuse to run. In that case,
+edit your <archive/branch> parameters to define clearly the scope of the
+import.
-`git-archimport` uses `tla` extensively in the background to access the
+`git-archimport` uses `tla` extensively in the background to access the
Arch repository.
Make sure you have a recent version of `tla` available in the path. `tla` must
-know about the repositories you pass to `git-archimport`.
+know about the repositories you pass to `git-archimport`.
-For the initial import `git-archimport` expects to find itself in an empty
-directory. To follow the development of a project that uses Arch, rerun
-`git-archimport` with the same parameters as the initial import to perform
+For the initial import `git-archimport` expects to find itself in an empty
+directory. To follow the development of a project that uses Arch, rerun
+`git-archimport` with the same parameters as the initial import to perform
incremental imports.
While git-archimport will try to create sensible branch names for the
@@ -54,15 +54,15 @@ convert Arch repositories that had been rotated periodically.
MERGES
------
-Patch merge data from Arch is used to mark merges in git as well. git
+Patch merge data from Arch is used to mark merges in git as well. git
does not care much about tracking patches, and only considers a merge when a
branch incorporates all the commits since the point they forked. The end result
-is that git will have a good idea of how far branches have diverged. So the
+is that git will have a good idea of how far branches have diverged. So the
import process does lose some patch-trading metadata.
-Fortunately, when you try and merge branches imported from Arch,
-git will find a good merge base, and it has a good chance of identifying
-patches that have been traded out-of-sequence between the branches.
+Fortunately, when you try and merge branches imported from Arch,
+git will find a good merge base, and it has a good chance of identifying
+patches that have been traded out-of-sequence between the branches.
OPTIONS
-------
@@ -71,10 +71,10 @@ OPTIONS
Display usage.
-v::
- Verbose output.
+ Verbose output.
-T::
- Many tags. Will create a tag for every commit, reflecting the commit
+ Many tags. Will create a tag for every commit, reflecting the commit
name in the Arch repository.
-f::
@@ -104,7 +104,7 @@ OPTIONS
<archive/branch>::
- Archive/branch identifier in a format that `tla log` understands.
+ Archive/branch identifier in a format that `tla log` understands.
Author
@@ -118,4 +118,3 @@ Documentation by Junio C Hamano, Martin Langhoff and the git-list <git@vger.kern
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 721e0351c3..4da07c1580 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -3,7 +3,7 @@ git-archive(1)
NAME
----
-git-archive - Creates an archive of files from a named tree
+git-archive - Create an archive of files from a named tree
SYNOPSIS
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 5f68ee1584..1072fb87d1 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -8,7 +8,7 @@ git-bisect - Find the change that introduced a bug by binary search
SYNOPSIS
--------
-'git bisect' <subcommand> <options>
+'git bisect' <subcommand> <options>
DESCRIPTION
-----------
@@ -200,4 +200,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 8dc5171f5e..8d72bb9368 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -158,4 +158,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 075c0d05ef..afa095c795 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -71,4 +71,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt
index ceb51959b1..856d2af2ed 100644
--- a/Documentation/git-check-attr.txt
+++ b/Documentation/git-check-attr.txt
@@ -34,4 +34,3 @@ Documentation by James Bowes.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt
index 6dd6db04bb..b1a8ce110c 100644
--- a/Documentation/git-checkout-index.txt
+++ b/Documentation/git-checkout-index.txt
@@ -182,4 +182,3 @@ Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 918d8ee720..ea26da8e21 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -215,4 +215,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 68bba98260..47b1e8c2fc 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -68,4 +68,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt
index 27b67b81a5..e6943822cd 100644
--- a/Documentation/git-cherry.txt
+++ b/Documentation/git-cherry.txt
@@ -53,6 +53,9 @@ OPTIONS
<head>::
Working branch; defaults to HEAD.
+<limit>::
+ Do not report commits up to (and including) limit.
+
Author
------
Written by Junio C Hamano <junkio@cox.net>
@@ -64,4 +67,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 644bf126fb..4a5bab510e 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -3,7 +3,7 @@ git-clone(1)
NAME
----
-git-clone - Clones a repository into a new directory
+git-clone - Clone a repository into a new directory
SYNOPSIS
@@ -175,4 +175,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index 504a3aa1b4..9586b97291 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -40,7 +40,7 @@ OPTIONS
-p <parent commit>::
Each '-p' indicates the id of a parent commit object.
-
+
Commit Information
------------------
@@ -107,4 +107,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 056b14724c..f2c67176f4 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -291,4 +291,3 @@ Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.ker
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-convert-objects.txt b/Documentation/git-convert-objects.txt
index b1220c06e1..9718abf86d 100644
--- a/Documentation/git-convert-objects.txt
+++ b/Documentation/git-convert-objects.txt
@@ -26,4 +26,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt
index 91c8c92c76..81614111a4 100644
--- a/Documentation/git-count-objects.txt
+++ b/Documentation/git-count-objects.txt
@@ -35,4 +35,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index da5c242241..827711c3c9 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -14,19 +14,19 @@ SYNOPSIS
DESCRIPTION
-----------
Exports a commit from GIT to a CVS checkout, making it easier
-to merge patches from a git repository into a CVS repository.
+to merge patches from a git repository into a CVS repository.
-Execute it from the root of the CVS working copy. GIT_DIR must be defined.
+Execute it from the root of the CVS working copy. GIT_DIR must be defined.
See examples below.
-It does its best to do the safe thing, it will check that the files are
-unchanged and up to date in the CVS checkout, and it will not autocommit
+It does its best to do the safe thing, it will check that the files are
+unchanged and up to date in the CVS checkout, and it will not autocommit
by default.
Supports file additions, removals, and commits that affect binary files.
If the commit is a merge commit, you must tell git-cvsexportcommit what parent
-should the changeset be done against.
+should the changeset be done against.
OPTIONS
-------
@@ -55,7 +55,7 @@ OPTIONS
Force the parent commit, even if it is not a direct parent.
-m::
- Prepend the commit message with the provided prefix.
+ Prepend the commit message with the provided prefix.
Useful for patch series and the like.
-u::
@@ -73,7 +73,7 @@ Merge one patch into CVS::
$ export GIT_DIR=~/project/.git
$ cd ~/project_cvs_checkout
$ git-cvsexportcommit -v <commit-sha1>
-$ cvs commit -F .mgs <files>
+$ cvs commit -F .mgs <files>
------------
Merge pending patches into CVS automatically -- only if you really know what you are doing ::
@@ -95,4 +95,3 @@ Documentation by Martin Langhoff <martin@catalyst.net.nz>
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index 4e5f1c6ba3..fdd7ec7edd 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -39,7 +39,7 @@ OPTIONS
-d <CVSROOT>::
The root of the CVS archive. May be local (a simple path) or remote;
- currently, only the :local:, :ext: and :pserver: access methods
+ currently, only the :local:, :ext: and :pserver: access methods
are supported. If not given, git-cvsimport will try to read it
from `CVS/Root`. If no such file exists, it checks for the
`CVSROOT` environment variable.
@@ -78,7 +78,7 @@ the old cvs2git tool.
-k::
Kill keywords: will extract files with '-kk' from the CVS archive
to avoid noisy changesets. Highly recommended, but off by default
- to preserve compatibility with early imported trees.
+ to preserve compatibility with early imported trees.
-u::
Convert underscores in tag and branch names to dots.
@@ -100,15 +100,15 @@ If you need to pass multiple options, separate them with a comma.
Instead of calling cvsps, read the provided cvsps output file. Useful
for debugging or when cvsps is being handled outside cvsimport.
--m::
+-m::
Attempt to detect merges based on the commit message. This option
- will enable default regexes that try to capture the name source
- branch name from the commit message.
+ will enable default regexes that try to capture the name source
+ branch name from the commit message.
-M <regex>::
Attempt to detect merges based on the commit message with a custom
regex. It can be used with '-m' to also see the default regexes.
- You must escape forward slashes.
+ You must escape forward slashes.
-S <regex>::
Skip paths matching the regex.
@@ -167,4 +167,3 @@ Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
index 9ddab71203..4b30b18b42 100644
--- a/Documentation/git-daemon.txt
+++ b/Documentation/git-daemon.txt
@@ -235,4 +235,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index dc47b65ced..ac23e28f27 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -124,4 +124,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt
index 2e1e29ef5a..d8a0a86022 100644
--- a/Documentation/git-diff-files.txt
+++ b/Documentation/git-diff-files.txt
@@ -26,7 +26,7 @@ include::diff-options.txt[]
branch" respectively. With these options, diffs for
merged entries are not shown.
+
-The default is to diff against our branch (-2) and the
+The default is to diff against our branch (-2) and the
cleanly resolved paths. The option -0 can be given to
omit diff output for unmerged entries and just show "Unmerged".
@@ -58,4 +58,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-diff-index.txt b/Documentation/git-diff-index.txt
index 2df581c2c9..7bd262cefd 100644
--- a/Documentation/git-diff-index.txt
+++ b/Documentation/git-diff-index.txt
@@ -75,7 +75,7 @@ actually doing a "git-write-tree" and comparing that. Except this one is much
nicer for the case where you just want to check where you are.
So doing a "git-diff-index --cached" is basically very useful when you are
-asking yourself "what have I already marked for being committed, and
+asking yourself "what have I already marked for being committed, and
what's the difference to a previous tree".
Non-cached Mode
@@ -130,4 +130,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 6e660e2d08..6b3f74efe7 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -166,4 +166,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 044cee9b42..639b969315 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -138,4 +138,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 8d06775a6b..5eacab08dc 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -908,4 +908,3 @@ Documentation by Shawn O. Pearce <spearce@spearce.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index 4913c2552f..6affc5bb4d 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -60,4 +60,3 @@ Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.o
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 363edb0fcf..647de90361 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -178,4 +178,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index ed6413a3c7..234c22f57f 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -145,4 +145,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-get-tar-commit-id.txt b/Documentation/git-get-tar-commit-id.txt
index 48805b651c..9b5f86fc30 100644
--- a/Documentation/git-get-tar-commit-id.txt
+++ b/Documentation/git-get-tar-commit-id.txt
@@ -34,4 +34,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index c5a5dad1ce..97faaa1d3a 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -144,4 +144,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt
index 5edc36f060..616f196d81 100644
--- a/Documentation/git-hash-object.txt
+++ b/Documentation/git-hash-object.txt
@@ -18,7 +18,7 @@ work tree), and optionally writes the resulting object into the
object database. Reports its object ID to its standard output.
This is used by "git-cvsimport" to update the index
without modifying files in the work tree. When <type> is not
-specified, it defaults to "blob".
+specified, it defaults to "blob".
OPTIONS
-------
@@ -43,4 +43,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-http-fetch.txt b/Documentation/git-http-fetch.txt
index 4deabc376c..45e48453a1 100644
--- a/Documentation/git-http-fetch.txt
+++ b/Documentation/git-http-fetch.txt
@@ -54,4 +54,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-http-push.txt b/Documentation/git-http-push.txt
index a15cf5b2a3..9afb860381 100644
--- a/Documentation/git-http-push.txt
+++ b/Documentation/git-http-push.txt
@@ -52,7 +52,7 @@ Specifying the Refs
A '<ref>' specification can be either a single pattern, or a pair
of such patterns separated by a colon ":" (this means that a ref name
-cannot have a colon in it). A single pattern '<name>' is just a
+cannot have a colon in it). A single pattern '<name>' is just a
shorthand for '<name>:<name>'.
Each pattern pair consists of the source side (before the colon)
diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt
index 226926964e..a8a7f6f04b 100644
--- a/Documentation/git-index-pack.txt
+++ b/Documentation/git-index-pack.txt
@@ -98,4 +98,3 @@ Documentation by Sergey Vlasov
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt
index 5412135d76..ab0201aec2 100644
--- a/Documentation/git-init-db.txt
+++ b/Documentation/git-init-db.txt
@@ -16,4 +16,3 @@ DESCRIPTION
This is a synonym for gitlink:git-init[1]. Please refer to the
documentation of that command.
-
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 1b64d3ab03..413ed65143 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -108,4 +108,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt
index 9df0ab2d76..cec60ee780 100644
--- a/Documentation/git-instaweb.txt
+++ b/Documentation/git-instaweb.txt
@@ -82,4 +82,3 @@ Documentation by Eric Wong <normalperson@yhbt.net>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-local-fetch.txt b/Documentation/git-local-fetch.txt
index 51389ef37d..19b5f8895c 100644
--- a/Documentation/git-local-fetch.txt
+++ b/Documentation/git-local-fetch.txt
@@ -62,4 +62,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 0f353f6558..6157edb404 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -101,4 +101,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index a78a9ff1b8..997594549f 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -180,4 +180,3 @@ Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index c254005ca3..93e9a60330 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -70,4 +70,3 @@ Written by Junio C Hamano <junkio@cox.net>
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index ad7f1b9202..7b78599673 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -92,4 +92,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
index 16956951dd..64aa6a1ea6 100644
--- a/Documentation/git-mailinfo.txt
+++ b/Documentation/git-mailinfo.txt
@@ -67,4 +67,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt
index abb0903696..c4f4cabbdc 100644
--- a/Documentation/git-mailsplit.txt
+++ b/Documentation/git-mailsplit.txt
@@ -56,4 +56,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 3190aed108..6b71880ec4 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -40,4 +40,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-merge-index.txt b/Documentation/git-merge-index.txt
index b8ee1ff2b0..17e9f10c65 100644
--- a/Documentation/git-merge-index.txt
+++ b/Documentation/git-merge-index.txt
@@ -59,7 +59,7 @@ Examples:
This is modified MM in the branch B. # merge2
This is modified MM in the branch B. # current contents
-or
+or
torvalds@ppc970:~/merge-test> git-merge-index cat AA MM
cat: : No such file or directory
@@ -85,4 +85,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-merge-one-file.txt b/Documentation/git-merge-one-file.txt
index f80ab3b8c4..f35d0e1b45 100644
--- a/Documentation/git-merge-one-file.txt
+++ b/Documentation/git-merge-one-file.txt
@@ -27,4 +27,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt
index 35fb4fb713..6892fdac3d 100644
--- a/Documentation/git-merge-tree.txt
+++ b/Documentation/git-merge-tree.txt
@@ -34,4 +34,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 912ef29efc..d285cba033 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -95,7 +95,7 @@ When things cleanly merge, these things happen:
1. the results are updated both in the index file and in your
working tree,
2. index file is written out as a tree,
-3. the tree gets committed, and
+3. the tree gets committed, and
4. the `HEAD` pointer gets advanced.
Because of 2., we require that the original state of the index
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index add01e855a..6c32c6d18e 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -25,7 +25,7 @@ OPTIONS
-t or --tool=<tool>::
Use the merge resolution program specified by <tool>.
Valid merge tools are:
- kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff
+ kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff
+
If a merge resolution program is not specified, 'git mergetool'
will use the configuration variable merge.tool. If the
@@ -43,4 +43,3 @@ Documentation by Theodore Y Ts'o.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-mktag.txt b/Documentation/git-mktag.txt
index 2860a3d1ba..ea7a75234a 100644
--- a/Documentation/git-mktag.txt
+++ b/Documentation/git-mktag.txt
@@ -19,18 +19,18 @@ The output is the new tag's <object> identifier.
Tag Format
----------
-A tag signature file has a very simple fixed format: three lines of
+A tag signature file has a very simple fixed format: four lines of
object <sha1>
type <typename>
tag <tagname>
+ tagger <tagger>
-followed by some 'optional' free-form signature that git itself
-doesn't care about, but that can be verified with gpg or similar.
-
-The size of the full object is artificially limited to 8kB. (Just
-because I'm a lazy bastard, and if you can't fit a signature in that
-size, you're doing something wrong)
+followed by some 'optional' free-form message (some tags created
+by older git may not have `tagger` line). The message, when
+exists, is separated by a blank line from the header. The
+message part may contain a signature that git itself doesn't
+care about, but that can be verified with gpg.
Author
@@ -44,4 +44,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-mktree.txt b/Documentation/git-mktree.txt
index 5f9ee603b7..638abc7d0f 100644
--- a/Documentation/git-mktree.txt
+++ b/Documentation/git-mktree.txt
@@ -32,4 +32,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt
index 6756b76bb1..2c9cf743c7 100644
--- a/Documentation/git-mv.txt
+++ b/Documentation/git-mv.txt
@@ -51,4 +51,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt
index 9a1645d292..91eede120e 100644
--- a/Documentation/git-name-rev.txt
+++ b/Documentation/git-name-rev.txt
@@ -76,4 +76,3 @@ Documentation by Johannes Schindelin.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-p4import.txt b/Documentation/git-p4import.txt
index 714abbe28e..9967587fe6 100644
--- a/Documentation/git-p4import.txt
+++ b/Documentation/git-p4import.txt
@@ -165,4 +165,3 @@ Written by Sean Estabrooks <seanlkml@sympatico.ca>
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index cfe127ad9e..e3549b5044 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -185,4 +185,3 @@ gitlink:git-prune-packed[1]
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-pack-redundant.txt b/Documentation/git-pack-redundant.txt
index 94bbea0db2..f2ceebac4b 100644
--- a/Documentation/git-pack-redundant.txt
+++ b/Documentation/git-pack-redundant.txt
@@ -17,7 +17,7 @@ are redundant. The output is suitable for piping to
'xargs rm' if you are in the root of the repository.
git-pack-redundant accepts a list of objects on standard input. Any objects
-given will be ignored when checking which packs are required. This makes the
+given will be ignored when checking which packs are required. This makes the
following command useful when wanting to remove packs which contain unreachable
objects.
@@ -55,4 +55,3 @@ gitlink:git-prune-packed[1]
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-patch-id.txt b/Documentation/git-patch-id.txt
index a7e9fd021a..ad528a9224 100644
--- a/Documentation/git-patch-id.txt
+++ b/Documentation/git-patch-id.txt
@@ -40,4 +40,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-peek-remote.txt b/Documentation/git-peek-remote.txt
index 74f37bd904..abc171266a 100644
--- a/Documentation/git-peek-remote.txt
+++ b/Documentation/git-peek-remote.txt
@@ -52,4 +52,3 @@ Documentation by Junio C Hamano.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-prune-packed.txt b/Documentation/git-prune-packed.txt
index 310033e460..3800edb7bb 100644
--- a/Documentation/git-prune-packed.txt
+++ b/Documentation/git-prune-packed.txt
@@ -50,4 +50,3 @@ gitlink:git-repack[1]
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt
index 0b44f3015d..0ace233d18 100644
--- a/Documentation/git-prune.txt
+++ b/Documentation/git-prune.txt
@@ -3,7 +3,7 @@ git-prune(1)
NAME
----
-git-prune - Prunes all unreachable objects from the object database
+git-prune - Prune all unreachable objects from the object database
SYNOPSIS
@@ -58,4 +58,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 94478ed94d..84693f8b10 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -165,4 +165,3 @@ Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index e9ad10672a..366c5dbdce 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -110,4 +110,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
index 296937a416..1c3ef4c593 100644
--- a/Documentation/git-quiltimport.txt
+++ b/Documentation/git-quiltimport.txt
@@ -58,4 +58,3 @@ 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 acb57447a8..84184d6294 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -356,4 +356,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 753b275a0f..0c00090a6b 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -237,4 +237,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index 1e343bcdcd..f717e1e30c 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -65,4 +65,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-relink.txt b/Documentation/git-relink.txt
index aca60120c8..fe631bb3dd 100644
--- a/Documentation/git-relink.txt
+++ b/Documentation/git-relink.txt
@@ -34,4 +34,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 3dde7134a5..ab232c2f68 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -128,4 +128,3 @@ Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt
index 2847c9b8d7..c33a512ffb 100644
--- a/Documentation/git-repack.txt
+++ b/Documentation/git-repack.txt
@@ -101,4 +101,3 @@ gitlink:git-prune-packed[1]
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-request-pull.txt b/Documentation/git-request-pull.txt
index 478a5fd6b7..087eeb7cc2 100644
--- a/Documentation/git-request-pull.txt
+++ b/Documentation/git-request-pull.txt
@@ -37,4 +37,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 7757abe621..e1cb4ef856 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -286,4 +286,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 8081bbaffa..69db498447 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -56,4 +56,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index a65f24a0f6..78f45dca2e 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -95,4 +95,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-runstatus.txt b/Documentation/git-runstatus.txt
index 8bb52f4687..dee5d0da9d 100644
--- a/Documentation/git-runstatus.txt
+++ b/Documentation/git-runstatus.txt
@@ -66,4 +66,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 7ae39fd5a2..946bd76afc 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -78,7 +78,7 @@ The --cc option must be repeated for each user you want on the cc list.
`localhost` otherwise.
--subject::
- Specify the initial subject of the email thread.
+ Specify the initial subject of the email thread.
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.
@@ -137,4 +137,3 @@ Documentation by Ryan Anderson
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index 2b2abebd60..1ea1faa1b5 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -69,4 +69,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt
index 228b9f14f3..48f2d57b7b 100644
--- a/Documentation/git-shell.txt
+++ b/Documentation/git-shell.txt
@@ -32,4 +32,3 @@ Documentation by Petr Baudis and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index 15cc6f77c1..2220ef6ea8 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -56,4 +56,3 @@ Documentation by Junio C Hamano.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-show-index.txt b/Documentation/git-show-index.txt
index be09b62beb..764d99356b 100644
--- a/Documentation/git-show-index.txt
+++ b/Documentation/git-show-index.txt
@@ -32,4 +32,3 @@ Documentation by Junio C Hamano
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 34c5caf2d0..a42e121150 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -84,4 +84,3 @@ This manual page is a stub. You can help the git documentation by expanding it.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-ssh-fetch.txt b/Documentation/git-ssh-fetch.txt
index 192b1f15a9..aaf3db06da 100644
--- a/Documentation/git-ssh-fetch.txt
+++ b/Documentation/git-ssh-fetch.txt
@@ -48,4 +48,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-ssh-upload.txt b/Documentation/git-ssh-upload.txt
index a9b7e9f974..4796224244 100644
--- a/Documentation/git-ssh-upload.txt
+++ b/Documentation/git-ssh-upload.txt
@@ -44,4 +44,3 @@ Documentation by Daniel Barkalow
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 1fd1af102a..6f16eb0328 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -58,4 +58,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-stripspace.txt b/Documentation/git-stripspace.txt
index 3a03dd0410..1306d7bab7 100644
--- a/Documentation/git-stripspace.txt
+++ b/Documentation/git-stripspace.txt
@@ -30,4 +30,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index cb0424f77b..f8fb80f18b 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -23,15 +23,15 @@ status::
repository. This command is the default command for git-submodule.
init::
- Initialize the submodules, i.e. clone the git repositories specified
- in the .gitmodules file and checkout the submodule commits specified
- in the index of the containing repository. This will make the
- submodules HEAD be detached.
+ Initialize the submodules, i.e. register in .git/config each submodule
+ path and url found in .gitmodules. The key used in git/config is
+ `submodule.$path.url`. This command does not alter existing information
+ in .git/config.
update::
- Update the initialized submodules, i.e. checkout the submodule commits
- specified in the index of the containing repository. This will make
- the submodules HEAD be detached.
+ Update the registered submodules, i.e. clone missing submodules and
+ checkout the commit specified in the index of the containing repository.
+ This will make the submodules HEAD be detached.
OPTIONS
@@ -50,7 +50,7 @@ OPTIONS
FILES
-----
-When cloning submodules, a .gitmodules file in the top-level directory
+When initializing submodules, a .gitmodules file in the top-level directory
of the containing repository is used to find the url of each submodule.
This file should be formatted in the same way as $GIR_DIR/config. The key
to each submodule url is "module.$path.url".
diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt
index bdae7d87dc..e97d15e8f2 100644
--- a/Documentation/git-svnimport.txt
+++ b/Documentation/git-svnimport.txt
@@ -174,4 +174,3 @@ Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-tar-tree.txt b/Documentation/git-tar-tree.txt
index 7bde73b1b8..2d01d9666f 100644
--- a/Documentation/git-tar-tree.txt
+++ b/Documentation/git-tar-tree.txt
@@ -90,4 +90,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-unpack-file.txt b/Documentation/git-unpack-file.txt
index 213dc8196b..20bb6a7800 100644
--- a/Documentation/git-unpack-file.txt
+++ b/Documentation/git-unpack-file.txt
@@ -33,4 +33,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-unpack-objects.txt b/Documentation/git-unpack-objects.txt
index ff6184b0f7..d529a43f55 100644
--- a/Documentation/git-unpack-objects.txt
+++ b/Documentation/git-unpack-objects.txt
@@ -27,8 +27,8 @@ new packs and replace existing ones.
OPTIONS
-------
-n::
- Only list the objects that would be unpacked, don't actually unpack
- them.
+ Dry run. Check the pack file without actually unpacking
+ the objects.
-q::
The command usually shows percentage progress. This
@@ -52,4 +52,3 @@ Documentation by Junio C Hamano
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 6cfbd9a842..0a1953803e 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -56,7 +56,7 @@ OPTIONS
--unmerged::
If --refresh finds unmerged changes in the index, the default
- behavior is to error out. This option makes git-update-index
+ behavior is to error out. This option makes git-update-index
continue anyway.
--ignore-missing::
@@ -64,12 +64,12 @@ OPTIONS
--cacheinfo <mode> <object> <path>::
Directly insert the specified info into the index.
-
+
--index-info::
Read index information from stdin.
--chmod=(+|-)x::
- Set the execute permissions on the updated files.
+ Set the execute permissions on the updated files.
--assume-unchanged, --no-assume-unchanged::
When these flags are specified, the object name recorded
@@ -126,7 +126,7 @@ OPTIONS
<file>::
Files to act on.
Note that files beginning with '.' are discarded. This includes
- `./file` and `dir/./file`. If you don't want this, then use
+ `./file` and `dir/./file`. If you don't want this, then use
cleaner names.
The same applies to directories ending '/' and paths with '//'
@@ -324,4 +324,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt
index 88a03c7c5e..e7e82a31ea 100644
--- a/Documentation/git-update-server-info.txt
+++ b/Documentation/git-update-server-info.txt
@@ -55,4 +55,3 @@ Documentation by Junio C Hamano.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt
index 9b0de1c111..813942368b 100644
--- a/Documentation/git-var.txt
+++ b/Documentation/git-var.txt
@@ -62,4 +62,3 @@ Documentation by Eric Biederman and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt
index 7a6132b016..f4c540f39b 100644
--- a/Documentation/git-verify-pack.txt
+++ b/Documentation/git-verify-pack.txt
@@ -51,4 +51,3 @@ Documentation by Junio C Hamano
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt
index 0f9bdb58dc..48d17fd9c4 100644
--- a/Documentation/git-verify-tag.txt
+++ b/Documentation/git-verify-tag.txt
@@ -29,4 +29,3 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt
index 399bff3bbc..607df48f09 100644
--- a/Documentation/git-whatchanged.txt
+++ b/Documentation/git-whatchanged.txt
@@ -78,4 +78,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git-write-tree.txt b/Documentation/git-write-tree.txt
index 96d5e07b11..cb8d6aadeb 100644
--- a/Documentation/git-write-tree.txt
+++ b/Documentation/git-write-tree.txt
@@ -47,4 +47,3 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 98860af045..ba077c39c6 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -428,4 +428,3 @@ contributors on the git-list <git@vger.kernel.org>.
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index 48c5894736..e9f82b97b9 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -99,4 +99,3 @@ Documentation by Junio C Hamano, Jonas Fonseca, and the git-list
GIT
---
Part of the gitlink:git[7] suite
-
diff --git a/Documentation/howto/rebase-and-edit.txt b/Documentation/howto/rebase-and-edit.txt
index 646c55cc69..554909fe08 100644
--- a/Documentation/howto/rebase-and-edit.txt
+++ b/Documentation/howto/rebase-and-edit.txt
@@ -9,16 +9,16 @@ Abstract: In this article, Linus demonstrates how a broken commit
On Sat, 13 Aug 2005, Linus Torvalds wrote:
-> That's correct. Same things apply: you can move a patch over, and create a
-> new one with a modified comment, but basically the _old_ commit will be
+> That's correct. Same things apply: you can move a patch over, and create a
+> new one with a modified comment, but basically the _old_ commit will be
> immutable.
Let me clarify.
You can entirely _drop_ old branches, so commits may be immutable, but
-nothing forces you to keep them. Of course, when you drop a commit, you'll
-always end up dropping all the commits that depended on it, and if you
-actually got somebody else to pull that commit you can't drop it from
+nothing forces you to keep them. Of course, when you drop a commit, you'll
+always end up dropping all the commits that depended on it, and if you
+actually got somebody else to pull that commit you can't drop it from
_their_ repository, but undoing things is not impossible.
For example, let's say that you've made a mess of things: you've committed
@@ -29,7 +29,7 @@ want to save "b" and "c". What you can do is
# for reference
git branch broken
- # Reset the main branch to three parents back: this
+ # Reset the main branch to three parents back: this
# effectively undoes the three top commits
git reset HEAD^^^
git checkout -f
@@ -59,7 +59,7 @@ Finally, check out the end result again:
to see that everything looks sensible.
-And then, you can just remove the broken branch if you decide you really
+And then, you can just remove the broken branch if you decide you really
don't want it:
# remove 'broken' branch
@@ -68,8 +68,8 @@ don't want it:
# Prune old objects if you're really really sure
git prune
-And yeah, I'm sure there are other ways of doing this. And as usual, the
-above is totally untested, and I just wrote it down in this email, so if
+And yeah, I'm sure there are other ways of doing this. And as usual, the
+above is totally untested, and I just wrote it down in this email, so if
I've done something wrong, you'll have to figure it out on your own ;)
Linus
@@ -77,5 +77,3 @@ I've done something wrong, you'll have to figure it out on your own ;)
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
-
-
diff --git a/Documentation/howto/rebase-from-internal-branch.txt b/Documentation/howto/rebase-from-internal-branch.txt
index 3b3a5c2e69..7a76045eb7 100644
--- a/Documentation/howto/rebase-from-internal-branch.txt
+++ b/Documentation/howto/rebase-from-internal-branch.txt
@@ -14,10 +14,10 @@ Petr Baudis <pasky@suse.cz> writes:
> Dear diary, on Sun, Aug 14, 2005 at 09:57:13AM CEST, I got a letter
> where Junio C Hamano <junkio@cox.net> told me that...
>> Linus Torvalds <torvalds@osdl.org> writes:
->>
->> > Junio, maybe you want to talk about how you move patches from your "pu"
+>>
+>> > Junio, maybe you want to talk about how you move patches from your "pu"
>> > branch to the real branches.
->>
+>>
> Actually, wouldn't this be also precisely for what StGIT is intended to?
Exactly my feeling. I was sort of waiting for Catalin to speak
@@ -118,7 +118,7 @@ up your changes, along with other changes.
where *your "master" head
upstream --> #1 --> #2 --> #3
- used \
+ used \
to be \--> #A --> #2' --> #3' --> #B --> #C
*upstream head
@@ -133,7 +133,7 @@ You fetch from upstream, but not merge.
$ git fetch upstream
This leaves the updated upstream head in .git/FETCH_HEAD but
-does not touch your .git/HEAD nor .git/refs/heads/master.
+does not touch your .git/HEAD nor .git/refs/heads/master.
You run "git rebase" now.
$ git rebase FETCH_HEAD master
@@ -161,5 +161,3 @@ the #1' commit.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
-
-
diff --git a/Documentation/howto/rebuild-from-update-hook.txt b/Documentation/howto/rebuild-from-update-hook.txt
index 02621b54a0..8d55dfbfae 100644
--- a/Documentation/howto/rebuild-from-update-hook.txt
+++ b/Documentation/howto/rebuild-from-update-hook.txt
@@ -84,4 +84,3 @@ There are four things worth mentioning:
- This is still crude and does not protect against simultaneous
make invocations stomping on each other. I would need to add
some locking mechanism for this.
-
diff --git a/Documentation/howto/revert-branch-rebase.txt b/Documentation/howto/revert-branch-rebase.txt
index d88ec23a97..865a666324 100644
--- a/Documentation/howto/revert-branch-rebase.txt
+++ b/Documentation/howto/revert-branch-rebase.txt
@@ -146,7 +146,7 @@ Everything is in the good order. I do not need the temporary branch
nor tag anymore, so remove them:
------------------------------------------------
-$ rm -f .git/refs/tags/pu-anchor
+$ rm -f .git/refs/tags/pu-anchor
$ git branch -d revert-c99
------------------------------------------------
diff --git a/Documentation/howto/separating-topic-branches.txt b/Documentation/howto/separating-topic-branches.txt
index 090e2c9b01..0d73b31224 100644
--- a/Documentation/howto/separating-topic-branches.txt
+++ b/Documentation/howto/separating-topic-branches.txt
@@ -12,7 +12,7 @@ up with a history like this:
"master"
o---o
- \ "topic"
+ \ "topic"
o---o---o---o---o---o
At this point, "topic" contains something I know I want, but it
@@ -29,11 +29,11 @@ start building on top of "master":
$ git checkout -b topicA master
... pick and apply pieces from P.diff to build
... commits on topicA branch.
-
+
o---o---o
/ "topicA"
o---o"master"
- \ "topic"
+ \ "topic"
o---o---o---o---o---o
Before doing each commit on "topicA" HEAD, I run "diff HEAD"
@@ -59,7 +59,7 @@ other topic:
/o---o---o
|/ "topicA"
o---o"master"
- \ "topic"
+ \ "topic"
o---o---o---o---o---o
After I am done, I'd try a pretend-merge between "topicA" and
@@ -73,7 +73,7 @@ After I am done, I'd try a pretend-merge between "topicA" and
/o---o---o----------'
|/ "topicA"
o---o"master"
- \ "topic"
+ \ "topic"
o---o---o---o---o---o
The last diff better not to show anything other than cleanups
@@ -84,8 +84,7 @@ for crufts. Then I can finally clean things up:
"topicB"
o---o---o---o---o
- /
+ /
/o---o---o
|/ "topicA"
o---o"master"
-
diff --git a/Documentation/howto/use-git-daemon.txt b/Documentation/howto/use-git-daemon.txt
index 1a1eb246bf..4e2f75cb61 100644
--- a/Documentation/howto/use-git-daemon.txt
+++ b/Documentation/howto/use-git-daemon.txt
@@ -49,4 +49,3 @@ Now, test your daemon with
$ git ls-remote git://127.0.0.1/rule-the-world.git
If this does not work, find out why, and submit a patch to this document.
-
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 56f1d8d69d..d64c259bb3 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -25,4 +25,3 @@
If there is no `-s` option, a built-in list of strategies
is used instead (`git-merge-recursive` when merging a single
head, `git-merge-octopus` otherwise).
-
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index d922e8e86c..c551ea61d2 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -121,4 +121,3 @@ The placeholders are:
- '%Creset': reset color
- '%m': left, right or boundary mark
- '%n': newline
-
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index 7d515be0fd..6338def5a7 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -11,4 +11,3 @@
command to re-code the commit log message in the encoding
preferred by the user. For non plumbing commands this
defaults to UTF-8.
-
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 8d4e950abc..b6eb7fc618 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -58,7 +58,7 @@ is often useful.
+
Some short-cut notations are also supported.
+
-* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
+* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
it requests fetching everything up to the given tag.
* A parameter <ref> without a colon is equivalent to
<ref>: when pulling/fetching, so it merges <ref> into the current
diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt
index 15221b5320..4c92e375fe 100644
--- a/Documentation/repository-layout.txt
+++ b/Documentation/repository-layout.txt
@@ -177,4 +177,3 @@ shallow::
This is similar to `info/grafts` but is internally used
and maintained by shallow clone mechanism. See `--depth`
option to gitlink:git-clone[1] and gitlink:git-fetch[1].
-
diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt
index 9ce3c473ae..e5b31c81fa 100644
--- a/Documentation/technical/pack-format.txt
+++ b/Documentation/technical/pack-format.txt
@@ -80,7 +80,7 @@ Pack Idx file:
+--------------------------------+ |
main | offset | |
index | object name 00XXXXXXXXXXXXXXXX | |
-table +--------------------------------+ |
+table +--------------------------------+ |
| offset | |
| object name 00XXXXXXXXXXXXXXXX | |
+--------------------------------+ |
@@ -97,14 +97,14 @@ trailer | | packfile checksum |
| +--------------------------------+
| | idxfile checksum |
| +--------------------------------+
- .-------.
+ .-------.
|
Pack file entry: <+
packed object header:
1-byte size extension bit (MSB)
type (next 3 bit)
- size0 (lower 4-bit)
+ size0 (lower 4-bit)
n-byte sizeN (as long as MSB is set, each 7-bit)
size0..sizeN form 4+7+7+..+7 bit integer, size0
is the least significant part, and sizeN is the
@@ -114,5 +114,5 @@ Pack file entry: <+
is the size before compression).
If it is DELTA, then
20-byte base object name SHA1 (the size above is the
- size of the delta data that follows).
+ size of the delta data that follows).
delta data, deflated.
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index f55d4083ed..118ff72869 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -132,8 +132,8 @@ and newly modified files, and in both cases it takes a snapshot of the
given files and stages that content in the index, ready for inclusion in
the next commit.
-Viewing the changelog
----------------------
+Viewing project history
+-----------------------
At any point you can view the history of your changes using
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 7eaafa80e9..0bfa21b3d2 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -27,7 +27,7 @@ $ man git-clone
See also <<git-quick-start>> for a brief overview of git commands,
without any explanation.
-Also, see <<todo>> for ways that you can help make this manual more
+Finally, see <<todo>> for ways that you can help make this manual more
complete.
@@ -154,11 +154,11 @@ Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date: Sat Dec 2 22:22:25 2006 -0800
[XFRM]: Fix aevent structuring to be more complete.
-
+
aevents can not uniquely identify an SA. We break the ABI with this
patch, but consensus is that since it is not yet utilized by any
(known) application then it is fine (better do it now than later).
-
+
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
@@ -167,7 +167,7 @@ index 8be626f..d7aac9d 100644
--- a/Documentation/networking/xfrm_sync.txt
+++ b/Documentation/networking/xfrm_sync.txt
@@ -47,10 +47,13 @@ aevent_id structure looks like:
-
+
struct xfrm_aevent_id {
struct xfrm_usersa_id sa_id;
+ xfrm_address_t saddr;
@@ -921,6 +921,7 @@ echo "git diff --stat --summary -M v$last v$new > ../diffstat-$new"
and then he just cut-and-pastes the output commands after verifying that
they look OK.
+[[Finding-comments-with-given-content]]
Finding commits referencing a file with given content
-----------------------------------------------------
@@ -1056,7 +1057,7 @@ $ git show
-------------------------------------------------
As a special shortcut,
-
+
-------------------------------------------------
$ git commit -a
-------------------------------------------------
@@ -1554,7 +1555,7 @@ history.
Fortunately, git also keeps a log, called a "reflog", of all the
previous values of each branch. So in this case you can still find the
-old history using, for example,
+old history using, for example,
-------------------------------------------------
$ git log master@{1}
@@ -1630,7 +1631,7 @@ If you decide you want the history back, you can always create a new
reference pointing to it, for example, a new branch:
------------------------------------------------
-$ git branch recovered-branch 7281251ddd
+$ git branch recovered-branch 7281251ddd
------------------------------------------------
Other types of dangling objects (blobs and trees) are also possible, and
@@ -1682,7 +1683,7 @@ automatically set the default remote branch to pull from at the time
that a branch is created:
-------------------------------------------------
-$ git checkout --track -b origin/maint maint
+$ git checkout --track -b maint origin/maint
-------------------------------------------------
In addition to saving you keystrokes, "git pull" also helps you by
@@ -1793,7 +1794,7 @@ like this:
you push
your personal repo ------------------> your public repo
- ^ |
+ ^ |
| |
| you pull | they pull
| |
@@ -2359,7 +2360,7 @@ the result would create a new merge commit, like this:
\ \
a--b--c--m <-- mywork
................................................
-
+
However, if you prefer to keep the history in mywork a simple series of
commits without any merges, you may instead choose to use
gitlink:git-rebase[1]:
@@ -2735,7 +2736,7 @@ must have at least one root, and while you can tie several different
root objects together into one project by creating a commit object which
has two or more separate roots as its ultimate parents, that's probably
just going to confuse people. So aim for the notion of "one root object
-per project", even if git itself does not enforce that.
+per project", even if git itself does not enforce that.
A <<def_tag_object,"tag" object>> symbolically identifies and can be
used to sign other objects. It contains the identifier and type of
@@ -2757,7 +2758,7 @@ independently of the contents or the type of the object: all objects can
be validated by verifying that (a) their hashes match the content of the
file and (b) the object successfully inflates to a stream of bytes that
forms a sequence of <ascii type without space> + <space> + <ascii decimal
-size> + <byte\0> + <binary object data>.
+size> + <byte\0> + <binary object data>.
The structured objects can further have their structure and
connectivity to other objects verified. This is generally done with
@@ -2954,7 +2955,7 @@ cache, and the normal operation is to re-generate it completely from a
known tree object, or update/compare it with a live tree that is being
developed. If you blow the directory cache away entirely, you generally
haven't lost any information as long as you have the name of the tree
-that it described.
+that it described.
At the same time, the index is at the same time also the
staging area for creating new trees, and creating a new tree always
@@ -2974,7 +2975,7 @@ Generally, all "git" operations work on the index file. Some operations
work *purely* on the index file (showing the current state of the
index), but most operations move data to and from the index file. Either
from the database or from the working directory. Thus there are four
-main combinations:
+main combinations:
[[working-directory-to-index]]
working directory -> index
@@ -3437,7 +3438,7 @@ because you interrupted a "git fetch" with ^C or something like that,
leaving _some_ of the new objects in the object database, but just
dangling and useless.
-Anyway, once you are sure that you're not interested in any dangling
+Anyway, once you are sure that you're not interested in any dangling
state, you can just prune all unreachable objects:
------------------------------------------------
@@ -3448,12 +3449,12 @@ and they'll be gone. But you should only run "git prune" on a quiescent
repository - it's kind of like doing a filesystem fsck recovery: you
don't want to do that while the filesystem is mounted.
-(The same is true of "git-fsck" itself, btw - but since
-git-fsck never actually *changes* the repository, it just reports
-on what it found, git-fsck itself is never "dangerous" to run.
-Running it while somebody is actually changing the repository can cause
-confusing and scary messages, but it won't actually do anything bad. In
-contrast, running "git prune" while somebody is actively changing the
+(The same is true of "git-fsck" itself, btw - but since
+git-fsck never actually *changes* the repository, it just reports
+on what it found, git-fsck itself is never "dangerous" to run.
+Running it while somebody is actually changing the repository can cause
+confusing and scary messages, but it won't actually do anything bad. In
+contrast, running "git prune" while somebody is actively changing the
repository is a *BAD* idea).
[[birdview-on-the-source-code]]
@@ -3669,11 +3670,11 @@ itself!
include::glossary.txt[]
[[git-quick-start]]
-Appendix A: Git Quick Start
-===========================
+Appendix A: Git Quick Reference
+===============================
-This is a quick summary of the major commands; the following chapters
-will explain how these work in more detail.
+This is a quick summary of the major commands; the previous chapters
+explain how these work in more detail.
[[quick-creating-a-new-repository]]
Creating a new repository
@@ -3951,3 +3952,7 @@ CVS, Subversion, and just imports of series of release tarballs.
More details on gitweb?
Write a chapter on using plumbing and writing scripts.
+
+Alternates, clone -reference, etc.
+
+git unpack-objects -r for recovery
diff --git a/INSTALL b/INSTALL
index 361c65bacc..95269cc513 100644
--- a/INSTALL
+++ b/INSTALL
@@ -31,7 +31,7 @@ Issues of note:
interactive tools. None of the core git stuff needs the wrapper,
it's just a convenient shorthand and while it is documented in some
places, you can always replace "git commit" with "git-commit"
- instead.
+ instead.
But let's face it, most of us don't have GNU interactive tools, and
even if we had it, we wouldn't know what it does. I don't think it
@@ -111,4 +111,3 @@ Issues of note:
would instead give you a copy of what you see at:
http://www.kernel.org/pub/software/scm/git/docs/
-
diff --git a/Makefile b/Makefile
index cd3026db8d..0f6540c6d8 100644
--- a/Makefile
+++ b/Makefile
@@ -144,8 +144,8 @@ STRIP ?= strip
prefix = $(HOME)
bindir = $(prefix)/bin
gitexecdir = $(bindir)
-sharedir = $(prefix)/share/
-template_dir = $(sharedir)/git-core/templates/
+sharedir = $(prefix)/share
+template_dir = $(sharedir)/git-core/templates
ifeq ($(prefix),/usr)
sysconfdir = /etc
else
@@ -238,7 +238,6 @@ PROGRAMS = \
git-convert-objects$X git-fetch-pack$X \
git-hash-object$X git-index-pack$X git-local-fetch$X \
git-fast-import$X \
- git-merge-base$X \
git-daemon$X \
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
@@ -846,6 +845,8 @@ git$X git.spec \
%.o: %.c GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
+%.s: %.c GIT-CFLAGS
+ $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
%.o: %.S
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
diff --git a/arm/sha1.c b/arm/sha1.c
index 11b1a048b4..9e3ae038e8 100644
--- a/arm/sha1.c
+++ b/arm/sha1.c
@@ -49,7 +49,7 @@ void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
void SHA1_Final(unsigned char *hash, SHA_CTX *c)
{
uint64_t bitlen;
- uint32_t bitlen_hi, bitlen_lo;
+ uint32_t bitlen_hi, bitlen_lo;
unsigned int i, offset, padlen;
unsigned char bits[8];
static const unsigned char padding[64] = { 0x80, };
@@ -69,7 +69,7 @@ void SHA1_Final(unsigned char *hash, SHA_CTX *c)
bits[5] = bitlen_lo >> 16;
bits[6] = bitlen_lo >> 8;
bits[7] = bitlen_lo;
- SHA1_Update(c, bits, 8);
+ SHA1_Update(c, bits, 8);
for (i = 0; i < 5; i++) {
uint32_t v = c->hash[i];
diff --git a/arm/sha1_arm.S b/arm/sha1_arm.S
index a328b73375..8c1cb99fb4 100644
--- a/arm/sha1_arm.S
+++ b/arm/sha1_arm.S
@@ -181,4 +181,3 @@ sha_transform:
.L_sha_K:
.word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
-
diff --git a/builtin-annotate.c b/builtin-annotate.c
index 9db7cfe74c..fc43eed36b 100644
--- a/builtin-annotate.c
+++ b/builtin-annotate.c
@@ -22,4 +22,3 @@ int cmd_annotate(int argc, const char **argv, const char *prefix)
return cmd_blame(argc + 1, nargv, prefix);
}
-
diff --git a/builtin-branch.c b/builtin-branch.c
index 67f46c1ae2..da480519d7 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -55,7 +55,7 @@ static int parse_branch_color_slot(const char *var, int ofs)
die("bad config variable '%s'", var);
}
-int git_branch_config(const char *var, const char *value)
+static int git_branch_config(const char *var, const char *value)
{
if (!strcmp(var, "color.branch")) {
branch_use_color = git_config_colorbool(var, value);
@@ -72,7 +72,7 @@ int git_branch_config(const char *var, const char *value)
return git_default_config(var, value);
}
-const char *branch_get_color(enum color_branch ix)
+static const char *branch_get_color(enum color_branch ix)
{
if (branch_use_color)
return branch_colors[ix];
diff --git a/builtin-diff-index.c b/builtin-diff-index.c
index d90eba95a6..81e7167438 100644
--- a/builtin-diff-index.c
+++ b/builtin-diff-index.c
@@ -23,7 +23,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, &rev, NULL);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
-
+
if (!strcmp(arg, "--cached"))
cached = 1;
else
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index 5c145d2165..ae60fccea7 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -357,4 +357,3 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
return 0;
}
-
diff --git a/builtin-fsck.c b/builtin-fsck.c
index bacae5dfa6..944a496650 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -351,7 +351,7 @@ static int fsck_commit(struct commit *commit)
if (!commit->parents && show_root)
printf("root %s\n", sha1_to_hex(commit->object.sha1));
if (!commit->date)
- printf("bad commit date in %s\n",
+ printf("bad commit date in %s\n",
sha1_to_hex(commit->object.sha1));
return 0;
}
@@ -719,7 +719,7 @@ int cmd_fsck(int argc, char **argv, const char *prefix)
heads = 0;
for (i = 1; i < argc; i++) {
- const char *arg = argv[i];
+ const char *arg = argv[i];
if (*arg == '-')
continue;
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 4df9fd0fad..0be2d2ef6e 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -7,7 +7,7 @@
#include "builtin.h"
#ifndef DEFAULT_GIT_TEMPLATE_DIR
-#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates/"
+#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
#endif
#ifdef NO_TRUSTABLE_FILEMODE
diff --git a/builtin-log.c b/builtin-log.c
index 212cdfc769..0aede76839 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -60,13 +60,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
rev->always_show_header = 0;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
- if (!prefixcmp(arg, "--encoding=")) {
- arg += 11;
- if (strcmp(arg, "none"))
- git_log_output_encoding = xstrdup(arg);
- else
- git_log_output_encoding = "";
- } else if (!strcmp(arg, "--decorate")) {
+ if (!strcmp(arg, "--decorate")) {
if (!decorate)
for_each_ref(add_ref_decoration, NULL);
decorate = 1;
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index f7c066b24b..5398a41415 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -117,7 +117,7 @@ static void show_other_files(struct dir_struct *dir)
if (0 <= pos)
continue; /* exact match */
pos = -pos - 1;
- if (pos < active_nr) {
+ if (pos < active_nr) {
ce = active_cache[pos];
if (ce_namelen(ce) == len &&
!memcmp(ce->name, ent->name, len))
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index c95e477e83..489c2c58c0 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -851,8 +851,8 @@ static void handle_info(void)
fprintf(fout, "\n");
}
-int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
- const char *msg, const char *patch)
+static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
+ const char *msg, const char *patch)
{
keep_subject = ks;
metainfo_charset = encoding;
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index c938425555..43fc373a15 100644
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
@@ -159,8 +159,8 @@ out:
return ret;
}
-int split_mbox(const char *file, const char *dir, int allow_bare,
- int nr_prec, int skip)
+static int split_mbox(const char *file, const char *dir, int allow_bare,
+ int nr_prec, int skip)
{
char name[PATH_MAX];
int ret = -1;
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index 9135773908..10ec63b17e 100644
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
@@ -36,9 +36,13 @@ int cmd_merge_file(int argc, char **argv, char **envp)
for (; i < 3; i++)
names[i] = argv[i + 1];
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; i++) {
if (read_mmfile(mmfs + i, argv[i + 1]))
return -1;
+ if (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
+ return error("Cannot merge binary files: %s\n",
+ argv[i + 1]);
+ }
ret = xdl_merge(mmfs + 1, mmfs + 0, names[0], mmfs + 2, names[2],
&xpp, XDL_MERGE_ZEALOUS, &result);
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index d3c42ed67e..61eba343ab 100644
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
@@ -290,4 +290,3 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
return 0;
}
-
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 8b9740c277..3d396ca37a 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -252,7 +252,7 @@ static void *delta_against(void *buf, unsigned long size, struct object_entry *e
delta_buf = diff_delta(otherbuf, othersize,
buf, size, &delta_size, 0);
if (!delta_buf || delta_size != entry->delta_size)
- die("delta size changed");
+ die("delta size changed");
free(buf);
free(otherbuf);
return delta_buf;
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 8c2c8bdc18..f6409b93c1 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -434,4 +434,3 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
path_list_clear(&merge_rr, 1);
return 0;
}
-
diff --git a/builtin-revert.c b/builtin-revert.c
index 80c348c401..8f02ed7bd1 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -107,7 +107,7 @@ static char *get_oneline(const char *message)
return result;
}
-char *get_encoding(const char *message)
+static char *get_encoding(const char *message)
{
const char *p = message, *eol;
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 8d3f742d43..16af6199ab 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -331,4 +331,3 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
return 0;
}
-
diff --git a/builtin-stripspace.c b/builtin-stripspace.c
index f0d4d9e2d1..62bd4b547b 100644
--- a/builtin-stripspace.c
+++ b/builtin-stripspace.c
@@ -26,7 +26,7 @@ static int cleanup(char *line)
return 1;
}
-void stripspace(FILE *in, FILE *out)
+static void stripspace(FILE *in, FILE *out)
{
int empties = -1;
int incomplete = 0;
diff --git a/builtin.h b/builtin.h
index 39290d1b8e..da4834c312 100644
--- a/builtin.h
+++ b/builtin.h
@@ -7,9 +7,6 @@ extern const char git_version_string[];
extern const char git_usage_string[];
extern void help_unknown_cmd(const char *cmd);
-extern int mailinfo(FILE *in, FILE *out, int ks, const char *encoding, const char *msg, const char *patch);
-extern int split_mbox(const char *file, const char *dir, int allow_bare, int nr_prec, int skip);
-extern void stripspace(FILE *in, FILE *out);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
extern void prune_packed_objects(int);
diff --git a/cache.h b/cache.h
index 8a9d1f3883..5e7381eb1e 100644
--- a/cache.h
+++ b/cache.h
@@ -479,7 +479,7 @@ extern void prepare_packed_git(void);
extern void reprepare_packed_git(void);
extern void install_packed_git(struct packed_git *pack);
-extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
+extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs);
extern void pack_report(void);
diff --git a/commit.c b/commit.c
index 5632e32685..4ca4d44ba0 100644
--- a/commit.c
+++ b/commit.c
@@ -148,7 +148,7 @@ static int commit_graft_pos(const unsigned char *sha1)
int register_commit_graft(struct commit_graft *graft, int ignore_dups)
{
int pos = commit_graft_pos(graft->sha1);
-
+
if (0 <= pos) {
if (ignore_dups)
free(graft);
@@ -406,7 +406,7 @@ struct commit_list * insert_by_date(struct commit *item, struct commit_list **li
return commit_list_insert(item, pp);
}
-
+
void sort_by_date(struct commit_list **list)
{
struct commit_list *ret = NULL;
@@ -1116,15 +1116,6 @@ struct commit *pop_commit(struct commit_list **stack)
return item;
}
-int count_parents(struct commit * commit)
-{
- int count;
- struct commit_list * parents = commit->parents;
- for (count = 0; parents; parents = parents->next,count++)
- ;
- return count;
-}
-
void topo_sort_default_setter(struct commit *c, void *data)
{
c->util = data;
@@ -1160,7 +1151,7 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
next = next->next;
count++;
}
-
+
if (!count)
return;
/* allocate an array to help sort the list */
@@ -1188,11 +1179,11 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
}
next=next->next;
}
- /*
+ /*
* find the tips
*
- * tips are nodes not reachable from any other node in the list
- *
+ * tips are nodes not reachable from any other node in the list
+ *
* the tips serve as a starting set for the work queue.
*/
next=*list;
@@ -1220,7 +1211,7 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
if (pn) {
/*
- * parents are only enqueued for emission
+ * parents are only enqueued for emission
* when all their children have been emitted thereby
* guaranteeing topological order.
*/
diff --git a/commit.h b/commit.h
index 86e8dca0c9..a313b53c31 100644
--- a/commit.h
+++ b/commit.h
@@ -66,15 +66,13 @@ extern unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit
/** Removes the first commit from a list sorted by date, and adds all
* of its parents.
**/
-struct commit *pop_most_recent_commit(struct commit_list **list,
+struct commit *pop_most_recent_commit(struct commit_list **list,
unsigned int mark);
struct commit *pop_commit(struct commit_list **stack);
void clear_commit_marks(struct commit *commit, unsigned int mark);
-int count_parents(struct commit * commit);
-
/*
* Performs an in-place topological sort of list supplied.
*
diff --git a/compat/mmap.c b/compat/mmap.c
index 4cfaee3136..c9d46d1742 100644
--- a/compat/mmap.c
+++ b/compat/mmap.c
@@ -40,4 +40,3 @@ int git_munmap(void *start, size_t length)
free(start);
return 0;
}
-
diff --git a/config.c b/config.c
index 0614c2b29f..58d3ed5d37 100644
--- a/config.c
+++ b/config.c
@@ -621,7 +621,7 @@ static ssize_t find_beginning_of_line(const char* contents, size_t size,
size_t equal_offset = size, bracket_offset = size;
ssize_t offset;
- for (offset = offset_-2; offset > 0
+ for (offset = offset_-2; offset > 0
&& contents[offset] != '\n'; offset--)
switch (contents[offset]) {
case '=': equal_offset = offset; break;
@@ -989,4 +989,3 @@ int git_config_rename_section(const char *old_name, const char *new_name)
free(config_filename);
return ret;
}
-
diff --git a/config.mak.in b/config.mak.in
index eb9d7a5549..a3032e389f 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -38,4 +38,3 @@ NO_STRCASESTR=@NO_STRCASESTR@
NO_STRLCPY=@NO_STRLCPY@
NO_SETENV=@NO_SETENV@
NO_ICONV=@NO_ICONV@
-
diff --git a/connect.c b/connect.c
index 8cbda88dda..7fab9c0fd9 100644
--- a/connect.c
+++ b/connect.c
@@ -390,7 +390,7 @@ static int git_proxy_command_options(const char *var, const char *value)
}
if (0 <= matchlen) {
/* core.gitproxy = none for kernel.org */
- if (matchlen == 4 &&
+ if (matchlen == 4 &&
!memcmp(value, "none", 4))
matchlen = 0;
git_proxy_command = xmalloc(matchlen + 1);
diff --git a/contrib/README b/contrib/README
index e1c0a01ff3..05f291c1f1 100644
--- a/contrib/README
+++ b/contrib/README
@@ -41,4 +41,3 @@ submit a patch to create a subdirectory of contrib/ and put your
stuff there.
-jc
-
diff --git a/contrib/blameview/README b/contrib/blameview/README
index 50a6f67fd6..fada5ce909 100644
--- a/contrib/blameview/README
+++ b/contrib/blameview/README
@@ -7,4 +7,3 @@ To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Date: Sat, 27 Jan 2007 18:52:38 -0500
Message-ID: <20070127235238.GA28706@coredump.intra.peff.net>
-
diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview
index 2d80e2bad2..098cb01353 100755
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
@@ -259,10 +259,13 @@ class CellRendererGraph(gtk.GenericCellRenderer):
self.set_colour(ctx, colour, 0.0, 0.5)
ctx.show_text(name)
-class Commit:
+class Commit(object):
""" This represent a commit object obtained after parsing the git-rev-list
output """
+ __slots__ = ['children_sha1', 'message', 'author', 'date', 'committer',
+ 'commit_date', 'commit_sha1', 'parent_sha1']
+
children_sha1 = {}
def __init__(self, commit_lines):
@@ -339,7 +342,7 @@ class Commit:
fp.close()
return diff
-class AnnotateWindow:
+class AnnotateWindow(object):
"""Annotate window.
This object represents and manages a single window containing the
annotate information of the file
@@ -519,7 +522,7 @@ class AnnotateWindow:
self.io_watch_tag = gobject.io_add_watch(fp, gobject.IO_IN, self.data_ready)
-class DiffWindow:
+class DiffWindow(object):
"""Diff window.
This object represents and manages a single window containing the
differences between two revisions on a branch.
@@ -674,7 +677,7 @@ class DiffWindow:
fp.close()
dialog.destroy()
-class GitView:
+class GitView(object):
""" This is the main class
"""
version = "0.9"
@@ -1277,5 +1280,3 @@ if __name__ == "__main__":
view = GitView( without_diff != 1)
view.run(sys.argv[without_diff:])
-
-
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index d1bef9125b..c589a39a0c 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -199,7 +199,7 @@ generate_email_footer()
hooks/post-receive
- --
+ --
$projectdesc
EOF
}
diff --git a/contrib/remotes2config.sh b/contrib/remotes2config.sh
index dc09eae972..0c8b954490 100644
--- a/contrib/remotes2config.sh
+++ b/contrib/remotes2config.sh
@@ -31,5 +31,3 @@ if [ -d "$GIT_DIR"/remotes ]; then
esac
done
fi
-
-
diff --git a/convert-objects.c b/convert-objects.c
index cefbcebdca..90e7900e6d 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -194,7 +194,7 @@ static unsigned long parse_oldstyle_date(const char *buf)
fmt++;
} while (*buf && *fmt);
printf("left: %s\n", buf);
- return mktime(&tm);
+ return mktime(&tm);
}
static int convert_date_line(char *dst, void **buf, unsigned long *sp)
diff --git a/copy.c b/copy.c
index d340bb253e..c225d1b0ff 100644
--- a/copy.c
+++ b/copy.c
@@ -34,4 +34,3 @@ int copy_fd(int ifd, int ofd)
close(ifd);
return 0;
}
-
diff --git a/ctype.c b/ctype.c
index 56bdffa636..ee06eb7f48 100644
--- a/ctype.c
+++ b/ctype.c
@@ -20,4 +20,3 @@ unsigned char sane_ctype[256] = {
AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, 0, 0, 0, 0, 0, /* 112-15 */
/* Nothing in the 128.. range */
};
-
diff --git a/daemon.c b/daemon.c
index 674e30dca3..a3f2ac1d81 100644
--- a/daemon.c
+++ b/daemon.c
@@ -133,7 +133,7 @@ static int avoid_alias(char *p)
{
int sl, ndot;
- /*
+ /*
* This resurrects the belts and suspenders paranoia check by HPA
* done in <435560F7.4080006@zytor.com> thread, now enter_repo()
* does not do getcwd() based path canonicalizations.
@@ -247,7 +247,7 @@ static char *path_ok(struct interp *itable)
int pathlen = strlen(path);
/* The validation is done on the paths after enter_repo
- * appends optional {.git,.git/.git} and friends, but
+ * appends optional {.git,.git/.git} and friends, but
* it does not use getcwd(). So if your /pub is
* a symlink to /mnt/pub, you can whitelist /pub and
* do not have to say /mnt/pub.
@@ -439,7 +439,7 @@ static void parse_extra_args(struct interp *table, char *extra_args, int buflen)
}
}
-void fill_in_extra_table_entries(struct interp *itable)
+static void fill_in_extra_table_entries(struct interp *itable)
{
char *hp;
diff --git a/date.c b/date.c
index a9b59a289e..316841e8ad 100644
--- a/date.c
+++ b/date.c
@@ -403,7 +403,7 @@ static int match_multi_number(unsigned long num, char c, const char *date, char
}
/*
- * We've seen a digit. Time? Year? Date?
+ * We've seen a digit. Time? Year? Date?
*/
static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt)
{
@@ -414,9 +414,11 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
num = strtoul(date, &end, 10);
/*
- * Seconds since 1970? We trigger on that for anything after Jan 1, 2000
+ * Seconds since 1970? We trigger on that for any numbers with
+ * more than 8 digits. This is because we don't want to rule out
+ * numbers like 20070606 as a YYYYMMDD date.
*/
- if (num > 946684800) {
+ if (num >= 100000000) {
time_t time = num;
if (gmtime_r(&time, tm)) {
*tm_gmt = 1;
@@ -493,7 +495,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
} else if (num > 0 && num < 13) {
tm->tm_mon = num-1;
}
-
+
return n;
}
@@ -567,13 +569,13 @@ int parse_date(const char *date, char *result, int maxlen)
if (!match) {
/* BAD CRAP */
match = 1;
- }
+ }
date += match;
}
/* mktime uses local timezone */
- then = my_mktime(&tm);
+ then = my_mktime(&tm);
if (offset == -1)
offset = (then - mktime(&tm)) / 60;
@@ -689,7 +691,7 @@ static const struct typelen {
{ "days", 24*60*60 },
{ "weeks", 7*24*60*60 },
{ NULL }
-};
+};
static const char *approxidate_alpha(const char *date, struct tm *tm, int *num)
{
diff --git a/diff-lib.c b/diff-lib.c
index 07f4e8106a..7fb19c7b87 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -664,7 +664,7 @@ int run_diff_index(struct rev_info *revs, int cached)
const char *tree_name;
int match_missing = 0;
- /*
+ /*
* Backward compatibility wart - "diff-index -m" does
* not mean "do not ignore merges", but totally different.
*/
diff --git a/diff.c b/diff.c
index c57ac33414..4aa9bbc011 100644
--- a/diff.c
+++ b/diff.c
@@ -2103,6 +2103,8 @@ static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *va
return 1;
}
+static int diff_scoreopt_parse(const char *opt);
+
int diff_opt_parse(struct diff_options *options, const char **av, int ac)
{
const char *arg = av[0];
@@ -2199,6 +2201,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
options->detect_rename = DIFF_DETECT_RENAME;
}
else if (!prefixcmp(arg, "-C")) {
+ if (options->detect_rename == DIFF_DETECT_COPY)
+ options->find_copies_harder = 1;
if ((options->rename_score =
diff_scoreopt_parse(arg)) == -1)
return -1;
@@ -2274,7 +2278,7 @@ static int parse_num(const char **cp_p)
return (int)((num >= scale) ? MAX_SCORE : (MAX_SCORE * num / scale));
}
-int diff_scoreopt_parse(const char *opt)
+static int diff_scoreopt_parse(const char *opt)
{
int opt1, opt2, cmd;
@@ -3031,7 +3035,7 @@ void diff_addremove(struct diff_options *options,
* entries to the diff-core. They will be prefixed
* with something like '=' or '*' (I haven't decided
* which but should not make any difference).
- * Feeding the same new and old to diff_change()
+ * Feeding the same new and old to diff_change()
* also has the same effect.
* Before the final output happens, they are pruned after
* merged into rename/copy pairs as appropriate.
@@ -3058,7 +3062,7 @@ void diff_change(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
const unsigned char *old_sha1,
const unsigned char *new_sha1,
- const char *base, const char *path)
+ const char *base, const char *path)
{
char concatpath[PATH_MAX];
struct diff_filespec *one, *two;
diff --git a/diff.h b/diff.h
index 63738c1dd4..a7ee6d8c87 100644
--- a/diff.h
+++ b/diff.h
@@ -155,8 +155,6 @@ extern void diff_unmerge(struct diff_options *,
unsigned mode,
const unsigned char *sha1);
-extern int diff_scoreopt_parse(const char *opt);
-
#define DIFF_SETUP_REVERSE 1
#define DIFF_SETUP_USE_CACHE 2
#define DIFF_SETUP_USE_SIZE_CACHE 4
diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index c4a77d71da..af9fffe6e8 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -102,7 +102,7 @@ void diffcore_pickaxe(const char *needle, int opts)
for (i = 0; i < q->nr; i++)
diff_free_filepair(q->queue[i]);
}
- else
+ else
/* Showing only the filepairs that has the needle */
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
diff --git a/entry.c b/entry.c
index ae6476496a..c540ae13e8 100644
--- a/entry.c
+++ b/entry.c
@@ -31,7 +31,7 @@ static void remove_subtree(const char *path)
struct dirent *de;
char pathbuf[PATH_MAX];
char *name;
-
+
if (!dir)
die("cannot opendir %s (%s)", path, strerror(errno));
strcpy(pathbuf, path);
diff --git a/environment.c b/environment.c
index 9d3e5eb72f..8b9b89d0a0 100644
--- a/environment.c
+++ b/environment.c
@@ -105,5 +105,3 @@ char *get_graft_file(void)
setup_git_env();
return git_graft_file;
}
-
-
diff --git a/fetch-pack.c b/fetch-pack.c
index aa59043c03..9c81305be5 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -114,7 +114,7 @@ static const unsigned char* get_rev(void)
commit->object.flags |= POPPED;
if (!(commit->object.flags & COMMON))
non_common_revs--;
-
+
parents = commit->parents;
if (commit->object.flags & COMMON) {
diff --git a/fetch.c b/fetch.c
index 8e29d313f8..dda33e548b 100644
--- a/fetch.c
+++ b/fetch.c
@@ -15,7 +15,7 @@ int get_verbosely = 0;
int get_recover = 0;
static unsigned char current_commit_sha1[20];
-void pull_say(const char *fmt, const char *hex)
+void pull_say(const char *fmt, const char *hex)
{
if (get_verbosely)
fprintf(stderr, fmt, hex);
@@ -153,7 +153,7 @@ static int process(struct object *obj)
return 0;
prefetch(obj->sha1);
}
-
+
object_list_insert(obj, process_queue_end);
process_queue_end = &(*process_queue_end)->next;
return 0;
diff --git a/git-archimport.perl b/git-archimport.perl
index c1e7c1ddcb..b21077206a 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -3,19 +3,19 @@
# This tool is copyright (c) 2005, Martin Langhoff.
# It is released under the Gnu Public License, version 2.
#
-# The basic idea is to walk the output of tla abrowse,
-# fetch the changesets and apply them.
+# The basic idea is to walk the output of tla abrowse,
+# fetch the changesets and apply them.
#
=head1 Invocation
- git-archimport [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ]
- [ -D depth] [ -t tempdir ] <archive>/<branch> [ <archive>/<branch> ]
+ git-archimport [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ]
+ [ -D depth] [ -t tempdir ] <archive>/<branch> [ <archive>/<branch> ]
Imports a project from one or more Arch repositories. It will follow branches
and repositories within the namespaces defined by the <archive/branch>
parameters supplied. If it cannot find the remote branch a merge comes from
-it will just import it as a regular commit. If it can find it, it will mark it
+it will just import it as a regular commit. If it can find it, it will mark it
as a merge whenever possible.
See man (1) git-archimport for more details.
@@ -25,14 +25,14 @@ See man (1) git-archimport for more details.
- create tag objects instead of ref tags
- audit shell-escaping of filenames
- hide our private tags somewhere smarter
- - find a way to make "cat *patches | patch" safe even when patchfiles are missing newlines
+ - find a way to make "cat *patches | patch" safe even when patchfiles are missing newlines
- sort and apply patches by graphing ancestry relations instead of just
relying in dates supplied in the changeset itself.
tla ancestry-graph -m could be helpful here...
=head1 Devel tricks
-Add print in front of the shell commands invoked via backticks.
+Add print in front of the shell commands invoked via backticks.
=head1 Devel Notes
@@ -126,16 +126,16 @@ sub do_abrowse {
my $stage = shift;
while (my ($limit, $level) = each %arch_branches) {
next unless $level == $stage;
-
- open ABROWSE, "$TLA abrowse -fkD --merges $limit |"
+
+ open ABROWSE, "$TLA abrowse -fkD --merges $limit |"
or die "Problems with tla abrowse: $!";
-
+
my %ps = (); # the current one
my $lastseen = '';
-
+
while (<ABROWSE>) {
chomp;
-
+
# first record padded w 8 spaces
if (s/^\s{8}\b//) {
my ($id, $type) = split(m/\s+/, $_, 2);
@@ -147,13 +147,13 @@ sub do_abrowse {
push (@psets, \%last_ps);
$psets{ $last_ps{id} } = \%last_ps;
}
-
+
my $branch = extract_versionname($id);
%ps = ( id => $id, branch => $branch );
if (%last_ps && ($last_ps{branch} eq $branch)) {
$ps{parent_id} = $last_ps{id};
}
-
+
$arch_branches{$branch} = 1;
$lastseen = 'id';
@@ -166,16 +166,16 @@ sub do_abrowse {
$ps{type} = 't';
# read which revision we've tagged when we parse the log
$ps{tag} = $1;
- } else {
+ } else {
warn "Unknown type $type";
}
$arch_branches{$branch} = 1;
$lastseen = 'id';
- } elsif (s/^\s{10}//) {
- # 10 leading spaces or more
+ } elsif (s/^\s{10}//) {
+ # 10 leading spaces or more
# indicate commit metadata
-
+
# date
if ($lastseen eq 'id' && m/^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d)/){
$ps{date} = $1;
@@ -186,12 +186,12 @@ sub do_abrowse {
} elsif ($lastseen eq 'merges' && s/^\s{2}//) {
my $id = $_;
push (@{$ps{merges}}, $id);
-
+
# aggressive branch finding:
if ($opt_D) {
my $branch = extract_versionname($id);
my $repo = extract_reponame($branch);
-
+
if (archive_reachable($repo) &&
!defined $arch_branches{$branch}) {
$arch_branches{$branch} = $stage + 1;
@@ -208,10 +208,10 @@ sub do_abrowse {
if (@psets && $psets[$#psets]{branch} eq $ps{branch}) {
$temp{parent_id} = $psets[$#psets]{id};
}
- push (@psets, \%temp);
+ push (@psets, \%temp);
$psets{ $temp{id} } = \%temp;
- }
-
+ }
+
close ABROWSE or die "$TLA abrowse failed on $limit\n";
}
} # end foreach $root
@@ -253,7 +253,7 @@ unless (-d $git_dir) { # initial import
while (my $file = readdir(DIR)) {
# skip non-interesting-files
next unless -f "$ptag_dir/$file";
-
+
# convert first '--' to '/' from old git-archimport to use
# as an archivename/c--b--v private tag
if ($file !~ m!,!) {
@@ -275,7 +275,7 @@ sub extract_reponame {
my $fq_cvbr = shift; # archivename/[[[[category]branch]version]revision]
return (split(/\//, $fq_cvbr))[0];
}
-
+
sub extract_versionname {
my $name = shift;
$name =~ s/--(?:patch|version(?:fix)?|base)-\d+$//;
@@ -283,7 +283,7 @@ sub extract_versionname {
}
# convert a fully-qualified revision or version to a unique dirname:
-# normalperson@yhbt.net-05/mpd--uclinux--1--patch-2
+# normalperson@yhbt.net-05/mpd--uclinux--1--patch-2
# becomes: normalperson@yhbt.net-05,mpd--uclinux--1
#
# the git notion of a branch is closer to
@@ -339,7 +339,7 @@ sub git_branchname {
sub process_patchset_accurate {
my $ps = shift;
-
+
# switch to that branch if we're not already in that branch:
if (-e "$git_dir/refs/heads/$ps->{branch}") {
system('git-checkout','-f',$ps->{branch}) == 0 or die "$! $?\n";
@@ -348,7 +348,7 @@ sub process_patchset_accurate {
my $rm = safe_pipe_capture('git-ls-files','--others','-z');
rmtree(split(/\0/,$rm)) if $rm;
}
-
+
# Apply the import/changeset/merge into the working tree
my $dir = sync_to_ps($ps);
# read the new log entry:
@@ -361,9 +361,9 @@ sub process_patchset_accurate {
parselog($ps, \@commitlog);
if ($ps->{id} =~ /--base-0$/ && $ps->{id} ne $psets[0]{id}) {
- # this should work when importing continuations
+ # this should work when importing continuations
if ($ps->{tag} && (my $branchpoint = eval { ptag($ps->{tag}) })) {
-
+
# find where we are supposed to branch from
if (! -e "$git_dir/refs/heads/$ps->{branch}") {
system('git-branch',$ps->{branch},$branchpoint) == 0 or die "$! $?\n";
@@ -388,8 +388,8 @@ sub process_patchset_accurate {
}
# allow multiple bases/imports here since Arch supports cherry-picks
# from unrelated trees
- }
-
+ }
+
# update the index with all the changes we got
system('git-diff-files --name-only -z | '.
'git-update-index --remove -z --stdin') == 0 or die "$! $?\n";
@@ -402,7 +402,7 @@ sub process_patchset_accurate {
# does not handle permissions or any renames involving directories
sub process_patchset_fast {
my $ps = shift;
- #
+ #
# create the branch if needed
#
if ($ps->{type} eq 'i' && !$import) {
@@ -417,9 +417,9 @@ sub process_patchset_fast {
# new branch! we need to verify a few things
die "Branch on a non-tag!" unless $ps->{type} eq 't';
my $branchpoint = ptag($ps->{tag});
- die "Tagging from unknown id unsupported: $ps->{tag}"
+ die "Tagging from unknown id unsupported: $ps->{tag}"
unless $branchpoint;
-
+
# find where we are supposed to branch from
if (! -e "$git_dir/refs/heads/$ps->{branch}") {
system('git-branch',$ps->{branch},$branchpoint) == 0 or die "$! $?\n";
@@ -435,13 +435,13 @@ sub process_patchset_fast {
}
system('git-checkout',$ps->{branch}) == 0 or die "$! $?\n";
return 0;
- }
+ }
die $! if $?;
- }
+ }
#
# Apply the import/changeset/merge into the working tree
- #
+ #
if ($ps->{type} eq 'i' || $ps->{type} eq 't') {
apply_import($ps) or die $!;
$stats{import_or_tag}++;
@@ -455,10 +455,10 @@ sub process_patchset_fast {
# prepare update git's index, based on what arch knows
# about the pset, resolve parents, etc
#
-
- my @commitlog = safe_pipe_capture($TLA,'cat-archive-log',$ps->{id});
+
+ my @commitlog = safe_pipe_capture($TLA,'cat-archive-log',$ps->{id});
die "Error in cat-archive-log: $!" if $?;
-
+
parselog($ps,\@commitlog);
# imports don't give us good info
@@ -485,10 +485,10 @@ sub process_patchset_fast {
if (@$ren % 2) {
die "Odd number of entries in rename!?";
}
-
+
while (@$ren) {
my $from = shift @$ren;
- my $to = shift @$ren;
+ my $to = shift @$ren;
unless (-d dirname($to)) {
mkpath(dirname($to)); # will die on err
@@ -529,20 +529,20 @@ if ($opt_f) {
"Things may be a bit slow\n";
*process_patchset = *process_patchset_accurate;
}
-
+
foreach my $ps (@psets) {
# process patchsets
$ps->{branch} = git_branchname($ps->{id});
#
- # ensure we have a clean state
- #
+ # ensure we have a clean state
+ #
if (my $dirty = `git-diff-files`) {
die "Unclean tree when about to process $ps->{id} " .
" - did we fail to commit cleanly before?\n$dirty";
}
die $! if $?;
-
+
#
# skip commits already in repo
#
@@ -559,7 +559,7 @@ foreach my $ps (@psets) {
my $tree = `git-write-tree`;
die "cannot write tree $!" if $?;
chomp $tree;
-
+
#
# Who's your daddy?
#
@@ -570,18 +570,18 @@ foreach my $ps (@psets) {
close HEAD;
chomp $p;
push @par, '-p', $p;
- } else {
+ } else {
if ($ps->{type} eq 's') {
warn "Could not find the right head for the branch $ps->{branch}";
}
}
}
-
+
if ($ps->{merges}) {
push @par, find_parents($ps);
}
- #
+ #
# Commit, tag and clean state
#
$ENV{TZ} = 'GMT';
@@ -592,14 +592,14 @@ foreach my $ps (@psets) {
$ENV{GIT_COMMITTER_EMAIL} = $ps->{email};
$ENV{GIT_COMMITTER_DATE} = $ps->{date};
- my $pid = open2(*READER, *WRITER,'git-commit-tree',$tree,@par)
+ my $pid = open2(*READER, *WRITER,'git-commit-tree',$tree,@par)
or die $!;
print WRITER $ps->{summary},"\n\n";
print WRITER $ps->{message},"\n";
-
+
# make it easy to backtrack and figure out which Arch revision this was:
print WRITER 'git-archimport-id: ',$ps->{id},"\n";
-
+
close WRITER;
my $commitid = <READER>; # read
chomp $commitid;
@@ -611,7 +611,7 @@ foreach my $ps (@psets) {
}
#
# Update the branch
- #
+ #
open HEAD, ">","$git_dir/refs/heads/$ps->{branch}";
print HEAD $commitid;
close HEAD;
@@ -640,7 +640,7 @@ exit 0;
sub sync_to_ps {
my $ps = shift;
my $tree_dir = $tmp.'/'.tree_dirname($ps->{id});
-
+
$opt_v && print "sync_to_ps($ps->{id}) method: ";
if (-d $tree_dir) {
@@ -674,7 +674,7 @@ sub sync_to_ps {
safe_pipe_capture($TLA,'get','--no-pristine',$ps->{id},$tree_dir);
$stats{get_new}++;
}
-
+
# added -I flag to rsync since we're going to fast! AIEEEEE!!!!
system('rsync','-aI','--delete','--exclude',$git_dir,
# '--exclude','.arch-inventory',
@@ -691,15 +691,15 @@ sub apply_import {
mkpath($tmp);
safe_pipe_capture($TLA,'get','-s','--no-pristine',$ps->{id},"$tmp/import");
- die "Cannot get import: $!" if $?;
+ die "Cannot get import: $!" if $?;
system('rsync','-aI','--delete', '--exclude',$git_dir,
'--exclude','.arch-ids','--exclude','{arch}',
"$tmp/import/", './');
die "Cannot rsync import:$!" if $?;
-
+
rmtree("$tmp/import");
die "Cannot remove tempdir: $!" if $?;
-
+
return 1;
}
@@ -712,13 +712,13 @@ sub apply_cset {
# get the changeset
safe_pipe_capture($TLA,'get-changeset',$ps->{id},"$tmp/changeset");
die "Cannot get changeset: $!" if $?;
-
+
# apply patches
if (`find $tmp/changeset/patches -type f -name '*.patch'`) {
# this can be sped up considerably by doing
# (find | xargs cat) | patch
# but that can get mucked up by patches
- # with missing trailing newlines or the standard
+ # with missing trailing newlines or the standard
# 'missing newline' flag in the patch - possibly
# produced with an old/buggy diff.
# slow and safe, we invoke patch once per patchfile
@@ -741,7 +741,7 @@ sub apply_cset {
# bring in new files
system('rsync','-aI','--exclude',$git_dir,
- '--exclude','.arch-ids',
+ '--exclude','.arch-ids',
'--exclude', '{arch}',
"$tmp/changeset/new-files-archive/",'./');
@@ -789,7 +789,7 @@ sub parselog {
removed_files => 1,
removed_directories => 1,
);
-
+
chomp (@$log);
while ($_ = shift @$log) {
if (/^Continuation-of:\s*(.*)/) {
@@ -828,7 +828,7 @@ sub parselog {
}
}
}
-
+
# drop leading empty lines from the log message
while (@$log && $log->[0] eq '') {
shift @$log;
@@ -842,7 +842,7 @@ sub parselog {
$ps->{summary} = $log->[0] . '...';
}
$ps->{message} = join("\n",@$log);
-
+
# skip Arch control files, unescape pika-escaped files
foreach my $k (keys %want_headers) {
next unless (defined $ps->{$k});
@@ -867,7 +867,7 @@ sub parselog {
# write/read a tag
sub tag {
my ($tag, $commit) = @_;
-
+
if ($opt_o) {
$tag =~ s|/|--|g;
} else {
@@ -875,7 +875,7 @@ sub tag {
$patchname =~ s/.*--//;
$tag = git_branchname ($tag) . '--' . $patchname;
}
-
+
if ($commit) {
open(C,">","$git_dir/refs/tags/$tag")
or die "Cannot create tag $tag: $!\n";
@@ -902,8 +902,8 @@ sub ptag {
my ($tag, $commit) = @_;
# don't use subdirs for tags yet, it could screw up other porcelains
- $tag =~ s|/|,|g;
-
+ $tag =~ s|/|,|g;
+
my $tag_file = "$ptag_dir/$tag";
my $tag_branch_dir = dirname($tag_file);
mkpath($tag_branch_dir) unless (-d $tag_branch_dir);
@@ -915,7 +915,7 @@ sub ptag {
or die "Cannot write tag $tag: $!\n";
close(C)
or die "Cannot write tag $tag: $!\n";
- $rptags{$commit} = $tag
+ $rptags{$commit} = $tag
unless $tag =~ m/--base-0$/;
} else { # read
# if the tag isn't there, return 0
@@ -941,7 +941,7 @@ sub find_parents {
# Identify what branches are merging into me
# and whether we are fully merged
# git-merge-base <headsha> <headsha> should tell
- # me what the base of the merge should be
+ # me what the base of the merge should be
#
my $ps = shift;
@@ -963,14 +963,14 @@ sub find_parents {
}
#
- # foreach branch find a merge base and walk it to the
+ # foreach branch find a merge base and walk it to the
# head where we are, collecting the merged patchsets that
# Arch has recorded. Keep that in @have
# Compare that with the commits on the other branch
# between merge-base and the tip of the branch (@need)
# and see if we have a series of consecutive patches
# starting from the merge base. The tip of the series
- # of consecutive patches merged is our new parent for
+ # of consecutive patches merged is our new parent for
# that branch.
#
foreach my $branch (keys %branches) {
@@ -979,13 +979,13 @@ sub find_parents {
next unless -e "$git_dir/refs/heads/$branch";
my $mergebase = `git-merge-base $branch $ps->{branch}`;
- if ($?) {
- # Don't die here, Arch supports one-way cherry-picking
- # between branches with no common base (or any relationship
- # at all beforehand)
- warn "Cannot find merge base for $branch and $ps->{branch}";
- next;
- }
+ if ($?) {
+ # Don't die here, Arch supports one-way cherry-picking
+ # between branches with no common base (or any relationship
+ # at all beforehand)
+ warn "Cannot find merge base for $branch and $ps->{branch}";
+ next;
+ }
chomp $mergebase;
# now walk up to the mergepoint collecting what patches we have
@@ -1010,7 +1010,7 @@ sub find_parents {
# merge what we have with what ancestors have
%have = (%have, %ancestorshave);
- # see what the remote branch has - these are the merges we
+ # see what the remote branch has - these are the merges we
# will want to have in a consecutive series from the mergebase
my $otherbranchtip = git_rev_parse($branch);
my @needraw = `git-rev-list --topo-order $otherbranchtip ^$mergebase`;
@@ -1018,7 +1018,7 @@ sub find_parents {
foreach my $needps (@needraw) { # get the psets
$needps = commitid2pset($needps);
# git-rev-list will also
- # list commits merged in via earlier
+ # list commits merged in via earlier
# merges. we are only interested in commits
# from the branch we're looking at
if ($branch eq $needps->{branch}) {
@@ -1054,7 +1054,7 @@ sub find_parents {
next unless ref $psets{$p}{merges};
my @merges = @{$psets{$p}{merges}};
foreach my $merge (@merges) {
- if ($parents{$merge}) {
+ if ($parents{$merge}) {
delete $parents{$merge};
}
}
@@ -1079,10 +1079,10 @@ sub git_rev_parse {
sub commitid2pset {
my $commitid = shift;
chomp $commitid;
- my $name = $rptags{$commitid}
+ my $name = $rptags{$commitid}
|| die "Cannot find reverse tag mapping for $commitid";
$name =~ s|,|/|;
- my $ps = $psets{$name}
+ my $ps = $psets{$name}
|| (print Dumper(sort keys %psets)) && die "Cannot find patchset for $name";
return $ps;
}
@@ -1112,7 +1112,7 @@ sub archive_reachable {
my $archive = shift;
return 1 if $reachable{$archive};
return 0 if $unreachable{$archive};
-
+
if (system "$TLA whereis-archive $archive >/dev/null") {
if ($opt_a && (system($TLA,'register-archive',
"http://mirrors.sourcecontrol.net/$archive") == 0)) {
@@ -1127,4 +1127,3 @@ sub archive_reachable {
return 1;
}
}
-
diff --git a/git-checkout.sh b/git-checkout.sh
index 6b6facfd5a..33f1e87c0c 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -63,12 +63,13 @@ while [ "$#" != "0" ]; do
echo "unknown flag $arg"
exit 1
fi
- new="$rev"
new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg"
then
+ rev=$(git-rev-parse --verify "refs/heads/$arg^0")
branch="$arg"
fi
+ new="$rev"
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.
@@ -210,7 +211,7 @@ else
esac
# Match the index to the working tree, and do a three-way.
- git diff-files --name-only | git update-index --remove --stdin &&
+ git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
git read-tree $v --reset -u $new || exit
@@ -245,7 +246,7 @@ else
(exit $saved_err)
fi
-#
+#
# Switch the HEAD pointer to the new branch if we
# checked out a branch head, and remove any potential
# old MERGE_HEAD's (subsequent commits will clearly not
diff --git a/git-clone.sh b/git-clone.sh
index fdd354f2da..3a410624d3 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -2,7 +2,7 @@
#
# Copyright (c) 2005, Linus Torvalds
# Copyright (c) 2005, Junio C Hamano
-#
+#
# Clone a repository into a different directory that does not yet exist.
# See git-sh-setup why.
@@ -20,7 +20,7 @@ usage() {
get_repo_base() {
(
cd "`/bin/pwd`" &&
- cd "$1" &&
+ cd "$1" || cd "$1.git" &&
{
cd .git
pwd
@@ -98,7 +98,7 @@ while
*,--na|*,--nak|*,--nake|*,--naked|\
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
- *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
+ *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
local_shared=yes; use_local=yes ;;
1,--template) usage ;;
*,--template)
@@ -410,4 +410,3 @@ fi
rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD"
trap - 0
-
diff --git a/git-commit.sh b/git-commit.sh
index e8b60f7049..5547a02954 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -557,7 +557,7 @@ then
} >>"$GIT_DIR"/COMMIT_EDITMSG
else
# we need to check if there is anything to commit
- run_status >/dev/null
+ run_status >/dev/null
fi
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
then
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 42060ef6e1..e9832d2bb9 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -197,7 +197,7 @@ if (@canstatusfiles) {
# ... validate new files,
foreach my $f (@afiles) {
if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") {
- $dirty = 1;
+ $dirty = 1;
warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n";
warn "Status was: $cvsstat{$f}\n";
}
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 598b9c8da9..433b7fd324 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -153,7 +153,7 @@ my $cvs_tree;
if ($#ARGV == 0) {
$cvs_tree = $ARGV[0];
} elsif (-f 'CVS/Repository') {
- open my $f, '<', 'CVS/Repository' or
+ open my $f, '<', 'CVS/Repository' or
die 'Failed to open CVS/Repository';
$cvs_tree = <$f>;
chomp $cvs_tree;
@@ -442,7 +442,7 @@ sub file {
my ($self,$fn,$rev) = @_;
my $res;
- my ($fh, $name) = tempfile('gitcvs.XXXXXX',
+ my ($fh, $name) = tempfile('gitcvs.XXXXXX',
DIR => File::Spec->tmpdir(), UNLINK => 1);
$self->_file($fn,$rev) and $res = $self->_line($fh);
@@ -528,8 +528,8 @@ sub is_sha1 {
sub get_headref ($$) {
my $name = shift;
- my $git_dir = shift;
-
+ my $git_dir = shift;
+
my $f = "$git_dir/$remote/$name";
if (open(my $fh, $f)) {
chomp(my $r = <$fh>);
@@ -700,8 +700,8 @@ sub commit {
if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
# looks like an initial commit
# use the index primed by git-init
- $ENV{GIT_INDEX_FILE} = '.git/index';
- $index{$branch} = '.git/index';
+ $ENV{GIT_INDEX_FILE} = "$git_dir/index";
+ $index{$branch} = "$git_dir/index";
} else {
# use an index per branch to speed up
# imports of projects with many branches
@@ -779,31 +779,9 @@ sub commit {
$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
$xtag =~ tr/_/\./ if ( $opt_u );
$xtag =~ s/[\/]/$opt_s/g;
-
- my $pid = open2($in, $out, 'git-mktag');
- print $out "object $cid\n".
- "type commit\n".
- "tag $xtag\n".
- "tagger $author_name <$author_email>\n"
- or die "Cannot create tag object $xtag: $!\n";
- close($out)
- or die "Cannot create tag object $xtag: $!\n";
-
- my $tagobj = <$in>;
- chomp $tagobj;
-
- if ( !close($in) or waitpid($pid, 0) != $pid or
- $? != 0 or $tagobj !~ /^[0123456789abcdef]{40}$/ ) {
- die "Cannot create tag object $xtag: $!\n";
- }
-
-
- open(C,">$git_dir/refs/tags/$xtag")
+
+ system('git-tag', $xtag, $cid) == 0
or die "Cannot create tag $xtag: $!\n";
- print C "$tagobj\n"
- or die "Cannot write tag $xtag: $!\n";
- close(C)
- or die "Cannot write tag $xtag: $!\n";
print "Created tag '$xtag' on '$branch'\n" if $opt_v;
}
@@ -992,7 +970,7 @@ if ($line =~ /^(\d+) objects, (\d+) kilobytes$/) {
}
foreach my $git_index (values %index) {
- if ($git_index ne '.git/index') {
+ if ($git_index ne "$git_dir/index") {
unlink($git_index);
}
}
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 2b4825a8ee..d41b29f30b 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -167,6 +167,17 @@ sub req_Root
my ( $cmd, $data ) = @_;
$log->debug("req_Root : $data");
+ unless ($data =~ m#^/#) {
+ print "error 1 Root must be an absolute pathname\n";
+ return 0;
+ }
+
+ if ($state->{CVSROOT}
+ && ($state->{CVSROOT} ne $data)) {
+ print "error 1 Conflicting roots specified\n";
+ return 0;
+ }
+
$state->{CVSROOT} = $data;
$ENV{GIT_DIR} = $state->{CVSROOT} . "/";
diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN
index 25647c8060..9770b0bc27 100755
--- a/git-gui/GIT-VERSION-GEN
+++ b/git-gui/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=0.7.GITGUI
+DEF_VER=0.8.GITGUI
LF='
'
@@ -78,5 +78,3 @@ test "$VN" = "$VC" || {
echo >&2 "GITGUI_VERSION = $VN"
echo "GITGUI_VERSION = $VN" >$GVF
}
-
-
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index dba585111c..3237f3d596 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -22,6 +22,40 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
######################################################################
##
+## Tcl/Tk sanity check
+
+if {[catch {package require Tcl 8.4} err]
+ || [catch {package require Tk 8.4} err]
+} {
+ catch {wm withdraw .}
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title "git-gui: fatal error" \
+ -message $err
+ exit 1
+}
+
+######################################################################
+##
+## enable verbose loading?
+
+if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
+ unset _verbose
+ rename auto_load real__auto_load
+ proc auto_load {name args} {
+ puts stderr "auto_load $name"
+ return [uplevel 1 real__auto_load $name $args]
+ }
+ rename source real__source
+ proc source {name} {
+ puts stderr "source $name"
+ uplevel 1 real__source $name
+ }
+}
+
+######################################################################
+##
## configure our library
set oguilib {@@GITGUI_LIBDIR@@}
@@ -32,26 +66,33 @@ if {$oguirel eq {1}} {
} elseif {[string match @@* $oguirel]} {
set oguilib [file join [file dirname [file normalize $argv0]] lib]
}
+
set idx [file join $oguilib tclIndex]
-catch {
- set fd [open $idx r]
- if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
- set idx [list]
- while {[gets $fd n] >= 0} {
- if {$n ne {} && ![string match #* $n]} {
- lappend idx $n
- }
+if {[catch {set fd [open $idx r]} err]} {
+ catch {wm withdraw .}
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title "git-gui: fatal error" \
+ -message $err
+ exit 1
+}
+if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
+ set idx [list]
+ while {[gets $fd n] >= 0} {
+ if {$n ne {} && ![string match #* $n]} {
+ lappend idx $n
}
- } else {
- set idx {}
}
- close $fd
+} else {
+ set idx {}
}
+close $fd
+
if {$idx ne {}} {
set loaded [list]
foreach p $idx {
if {[lsearch -exact $loaded $p] >= 0} continue
- puts $p
source [file join $oguilib $p]
lappend loaded $p
}
@@ -59,21 +100,7 @@ if {$idx ne {}} {
} else {
set auto_path [concat [list $oguilib] $auto_path]
}
-unset -nocomplain oguilib oguirel idx fd
-
-if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
- unset _verbose
- rename auto_load real__auto_load
- proc auto_load {name args} {
- puts stderr "auto_load $name"
- return [uplevel 1 real__auto_load $name $args]
- }
- rename source real__source
- proc source {name} {
- puts stderr "source $name"
- uplevel 1 real__source $name
- }
-}
+unset -nocomplain oguirel idx fd
######################################################################
##
@@ -189,6 +216,15 @@ proc is_config_true {name} {
}
}
+proc get_config {name} {
+ global repo_config
+ if {[catch {set v $repo_config($name)}]} {
+ return {}
+ } else {
+ return $v
+ }
+}
+
proc load_config {include_global} {
global repo_config global_config default_config
@@ -242,6 +278,17 @@ proc git {args} {
return [eval exec git $args]
}
+proc current-branch {} {
+ set ref {}
+ set fd [open [gitdir HEAD] r]
+ if {[gets $fd ref] <16
+ || ![regsub {^ref: refs/heads/} $ref {} ref]} {
+ set ref {}
+ }
+ close $fd
+ return $ref
+}
+
auto_load tk_optionMenu
rename tk_optionMenu real__tkOptionMenu
proc tk_optionMenu {w varName args} {
@@ -390,15 +437,7 @@ proc repository_state {ctvar hdvar mhvar} {
set mh [list]
- if {[catch {set current_branch [git symbolic-ref HEAD]}]} {
- set current_branch {}
- } else {
- regsub ^refs/((heads|tags|remotes)/)? \
- $current_branch \
- {} \
- current_branch
- }
-
+ set current_branch [current-branch]
if {[catch {set hd [git rev-parse --verify HEAD]}]} {
set hd {}
set ct initial
@@ -455,7 +494,8 @@ proc rescan {after {honor_trustmtime 1}} {
if {![$ui_comm edit modified]
|| [string trim [$ui_comm get 0.0 end]] eq {}} {
- if {[load_message GITGUI_MSG]} {
+ if {[string match amend* $commit_type]} {
+ } elseif {[load_message GITGUI_MSG]} {
} elseif {[load_message MERGE_MSG]} {
} elseif {[load_message SQUASH_MSG]} {
}
@@ -1008,6 +1048,7 @@ proc incr_font_size {font {amt 1}} {
incr sz $amt
font configure $font -size $sz
font configure ${font}bold -size $sz
+ font configure ${font}italic -size $sz
}
######################################################################
@@ -1200,16 +1241,22 @@ catch {
destroy .dummy
}
+font create font_uiitalic
font create font_uibold
font create font_diffbold
+font create font_diffitalic
foreach class {Button Checkbutton Entry Label
Labelframe Listbox Menu Message
- Radiobutton Text} {
+ Radiobutton Spinbox Text} {
option add *$class.font font_ui
}
unset class
+if {[is_Windows] || [is_MacOSX]} {
+ option add *Menu.tearOff 0
+}
+
if {[is_MacOSX]} {
set M1B M1
set M1T Cmd
@@ -1233,16 +1280,20 @@ proc apply_config {} {
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
+ font configure ${font}italic $cn $cv
}
font configure ${font}bold -weight bold
+ font configure ${font}italic -slant italic
}
}
+set default_config(merge.diffstat) true
set default_config(merge.summary) false
set default_config(merge.verbosity) 2
set default_config(user.name) {}
set default_config(user.email) {}
+set default_config(gui.pruneduringfetch) false
set default_config(gui.trustmtime) false
set default_config(gui.diffcontext) 5
set default_config(gui.newbranchtemplate) {}
@@ -1404,6 +1455,11 @@ if {[is_enabled branch]} {
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
+ .mbar.branch add command -label {Rename...} \
+ -command branch_rename::dialog
+ lappend disable_on_lock [list .mbar.branch entryconf \
+ [.mbar.branch index last] -state]
+
.mbar.branch add command -label {Delete...} \
-command do_delete_branch
lappend disable_on_lock [list .mbar.branch entryconf \
@@ -1501,6 +1557,8 @@ if {[is_enabled transport]} {
menu .mbar.push
.mbar.push add command -label {Push...} \
-command do_push_anywhere
+ .mbar.push add command -label {Delete...} \
+ -command remote_branch_delete::dialog
}
if {[is_MacOSX]} {
@@ -1600,7 +1658,7 @@ unset browser doc_path doc_url
# -- Standard bindings
#
-bind . <Destroy> do_quit
+wm protocol . WM_DELETE_WINDOW do_quit
bind all <$M1B-Key-q> do_quit
bind all <$M1B-Key-Q> do_quit
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
@@ -1618,14 +1676,8 @@ switch -- $subcommand {
browser {
set subcommand_args {rev?}
switch [llength $argv] {
- 0 {
- set current_branch [git symbolic-ref HEAD]
- regsub ^refs/((heads|tags|remotes)/)? \
- $current_branch {} current_branch
- }
- 1 {
- set current_branch [lindex $argv 0]
- }
+ 0 { set current_branch [current-branch] }
+ 1 { set current_branch [lindex $argv 0] }
default usage
}
browser::new $current_branch
@@ -1658,9 +1710,7 @@ blame {
unset is_path
if {$head eq {}} {
- set current_branch [git symbolic-ref HEAD]
- regsub ^refs/((heads|tags|remotes)/)? \
- $current_branch {} current_branch
+ set current_branch [current-branch]
} else {
set current_branch $head
}
@@ -1715,7 +1765,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
#
frame .vpane.files.index -height 100 -width 200
label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
- -background green
+ -background lightgreen
text $ui_index -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
@@ -1735,7 +1785,7 @@ pack $ui_index -side left -fill both -expand 1
#
frame .vpane.files.workdir -height 100 -width 200
label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
- -background red
+ -background lightsalmon
text $ui_workdir -background white -borderwidth 0 \
-width 20 -height 10 \
-wrap none \
@@ -1752,10 +1802,8 @@ pack $ui_workdir -side left -fill both -expand 1
.vpane.files add .vpane.files.workdir -sticky nsew
foreach i [list $ui_index $ui_workdir] {
- $i tag conf in_diff -font font_uibold
- $i tag conf in_sel \
- -background [$i cget -foreground] \
- -foreground [$i cget -background]
+ $i tag conf in_diff -background lightgray
+ $i tag conf in_sel -background lightgray
}
unset i
@@ -1913,18 +1961,18 @@ proc trace_current_diff_path {varname args} {
}
trace add variable current_diff_path write trace_current_diff_path
-frame .vpane.lower.diff.header -background orange
+frame .vpane.lower.diff.header -background gold
label .vpane.lower.diff.header.status \
- -background orange \
+ -background gold \
-width $max_status_desc \
-anchor w \
-justify left
label .vpane.lower.diff.header.file \
- -background orange \
+ -background gold \
-anchor w \
-justify left
label .vpane.lower.diff.header.path \
- -background orange \
+ -background gold \
-anchor w \
-justify left
pack .vpane.lower.diff.header.status -side left
@@ -2038,17 +2086,17 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
-label {Show Less Context} \
- -command {if {$repo_config(gui.diffcontext) >= 2} {
+ -command {if {$repo_config(gui.diffcontext) >= 1} {
incr repo_config(gui.diffcontext) -1
reshow_diff
}}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
-label {Show More Context} \
- -command {
+ -command {if {$repo_config(gui.diffcontext) < 99} {
incr repo_config(gui.diffcontext)
reshow_diff
- }
+ }}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command -label {Options...} \
diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl
index 8b032d9590..139171d39e 100644
--- a/git-gui/lib/blame.tcl
+++ b/git-gui/lib/blame.tcl
@@ -3,145 +3,270 @@
class blame {
-field commit ; # input commit to blame
-field path ; # input filename to view in $commit
+image create photo ::blame::img_back_arrow -data {R0lGODlhGAAYAIUAAPwCBEzKXFTSZIz+nGzmhGzqfGTidIT+nEzGXHTqhGzmfGzifFzadETCVES+VARWDFzWbHzyjAReDGTadFTOZDSyRDyyTCymPARaFGTedFzSbDy2TCyqRCyqPARaDAyCHES6VDy6VCyiPAR6HCSeNByWLARyFARiDARqFGTifARiFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAYABgAAAajQIBwSCwaj8ikcsk0BppJwRPqHEypQwHBis0WDAdEFyBIKBaMAKLBdjQeSkFBYTBAIvgEoS6JmhUTEwIUDQ4VFhcMGEhyCgoZExoUaxsWHB0THkgfAXUGAhoBDSAVFR0XBnCbDRmgog0hpSIiDJpJIyEQhBUcJCIlwA22SSYVogknEg8eD82qSigdDSknY0IqJQXPYxIl1dZCGNvWw+Dm510GQQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7}
+
+# Persistant data (survives loads)
+#
+field history {}; # viewer history: {commit path}
+field header ; # array commit,key -> header field
+
+# Tk UI control paths
+#
+field w ; # top window in this viewer
+field w_back ; # our back button
+field w_path ; # label showing the current file path
+field w_columns ; # list of all column widgets in the viewer
+field w_line ; # text column: all line numbers
+field w_amov ; # text column: annotations + move tracking
+field w_asim ; # text column: annotations (simple computation)
+field w_file ; # text column: actual file data
+field w_cviewer ; # pane showing commit message
+field status ; # text variable bound to status bar
+field old_height ; # last known height of $w.file_pane
+
+# Tk UI colors
+#
+variable active_color #c0edc5
+variable group_colors {
+ #d6d6d6
+ #e1e1e1
+ #ececec
+}
-field w
-field w_line
-field w_load
-field w_file
-field w_cmit
-field status
+# Current blame data; cleared/reset on each load
+#
+field commit ; # input commit to blame
+field path ; # input filename to view in $commit
-field highlight_line -1 ; # current line selected
-field highlight_commit {} ; # sha1 of commit selected
+field current_fd {} ; # background process running
+field highlight_line -1 ; # current line selected
+field highlight_column {} ; # current commit column selected
+field highlight_commit {} ; # sha1 of commit selected
field total_lines 0 ; # total length of file
field blame_lines 0 ; # number of lines computed
-field commit_count 0 ; # number of commits in $commit_list
-field commit_list {} ; # list of commit sha1 in receipt order
-field order ; # array commit -> receipt order
-field header ; # array commit,key -> header field
-field line_commit ; # array line -> sha1 commit
-field line_file ; # array line -> file name
-
-field r_commit ; # commit currently being parsed
-field r_orig_line ; # original line number
-field r_final_line ; # final line number
-field r_line_count ; # lines in this region
+field amov_data ; # list of {commit origfile origline}
+field asim_data ; # list of {commit origfile origline}
+
+field r_commit ; # commit currently being parsed
+field r_orig_line ; # original line number
+field r_final_line ; # final line number
+field r_line_count ; # lines in this region
+
+field tooltip_wm {} ; # Current tooltip toplevel, if open
+field tooltip_t {} ; # Text widget in $tooltip_wm
+field tooltip_timer {} ; # Current timer event for our tooltip
+field tooltip_commit {} ; # Commit(s) in tooltip
constructor new {i_commit i_path} {
+ global cursor_ptr
+ variable active_color
+ variable group_colors
+
set commit $i_commit
set path $i_path
make_toplevel top w
wm title $top "[appname] ([reponame]): File Viewer"
- set status "Loading $commit:$path..."
- label $w.path -text "$commit:$path" \
+ frame $w.header -background gold
+ label $w.header.commit_l \
+ -text {Commit:} \
+ -background gold \
-anchor w \
- -justify left \
- -borderwidth 1 \
- -relief sunken \
- -font font_uibold
- pack $w.path -side top -fill x
-
- frame $w.out
- text $w.out.loaded_t \
+ -justify left
+ set w_back $w.header.commit_b
+ label $w_back \
+ -image ::blame::img_back_arrow \
+ -borderwidth 0 \
+ -relief flat \
+ -state disabled \
+ -background gold \
+ -activebackground gold
+ bind $w_back <Button-1> "
+ if {\[$w_back cget -state\] eq {normal}} {
+ [cb _history_menu]
+ }
+ "
+ label $w.header.commit \
+ -textvariable @commit \
+ -background gold \
+ -anchor w \
+ -justify left
+ label $w.header.path_l \
+ -text {File:} \
+ -background gold \
+ -anchor w \
+ -justify left
+ set w_path $w.header.path
+ label $w_path \
+ -background gold \
+ -anchor w \
+ -justify left
+ pack $w.header.commit_l -side left
+ pack $w_back -side left
+ pack $w.header.commit -side left
+ pack $w_path -fill x -side right
+ pack $w.header.path_l -side right
+
+ panedwindow $w.file_pane -orient vertical
+ frame $w.file_pane.out
+ frame $w.file_pane.cm
+ $w.file_pane add $w.file_pane.out \
+ -sticky nsew \
+ -minsize 100 \
+ -height 100 \
+ -width 100
+ $w.file_pane add $w.file_pane.cm \
+ -sticky nsew \
+ -minsize 25 \
+ -height 25 \
+ -width 100
+
+ set w_line $w.file_pane.out.linenumber_t
+ text $w_line \
+ -takefocus 0 \
+ -highlightthickness 0 \
+ -padx 0 -pady 0 \
-background white -borderwidth 0 \
-state disabled \
-wrap none \
-height 40 \
- -width 1 \
+ -width 6 \
-font font_diff
- $w.out.loaded_t tag conf annotated -background grey
+ $w_line tag conf linenumber -justify right -rmargin 5
- text $w.out.linenumber_t \
+ set w_amov $w.file_pane.out.amove_t
+ text $w_amov \
+ -takefocus 0 \
+ -highlightthickness 0 \
+ -padx 0 -pady 0 \
-background white -borderwidth 0 \
-state disabled \
-wrap none \
-height 40 \
-width 5 \
-font font_diff
- $w.out.linenumber_t tag conf linenumber -justify right
-
- text $w.out.file_t \
+ $w_amov tag conf author_abbr -justify right -rmargin 5
+ $w_amov tag conf curr_commit
+ $w_amov tag conf prior_commit -foreground blue -underline 1
+ $w_amov tag bind prior_commit \
+ <Button-1> \
+ "[cb _load_commit $w_amov @amov_data @%x,%y];break"
+
+ set w_asim $w.file_pane.out.asimple_t
+ text $w_asim \
+ -takefocus 0 \
+ -highlightthickness 0 \
+ -padx 0 -pady 0 \
+ -background white -borderwidth 0 \
+ -state disabled \
+ -wrap none \
+ -height 40 \
+ -width 4 \
+ -font font_diff
+ $w_asim tag conf author_abbr -justify right
+ $w_asim tag conf curr_commit
+ $w_asim tag conf prior_commit -foreground blue -underline 1
+ $w_asim tag bind prior_commit \
+ <Button-1> \
+ "[cb _load_commit $w_asim @asim_data @%x,%y];break"
+
+ set w_file $w.file_pane.out.file_t
+ text $w_file \
+ -takefocus 0 \
+ -highlightthickness 0 \
+ -padx 0 -pady 0 \
-background white -borderwidth 0 \
-state disabled \
-wrap none \
-height 40 \
-width 80 \
- -xscrollcommand [list $w.out.sbx set] \
+ -xscrollcommand [list $w.file_pane.out.sbx set] \
-font font_diff
- scrollbar $w.out.sbx -orient h -command [list $w.out.file_t xview]
- scrollbar $w.out.sby -orient v \
- -command [list scrollbar2many [list \
- $w.out.loaded_t \
- $w.out.linenumber_t \
- $w.out.file_t \
- ] yview]
- grid \
- $w.out.linenumber_t \
- $w.out.loaded_t \
- $w.out.file_t \
- $w.out.sby \
- -sticky nsew
- grid conf $w.out.sbx -column 2 -sticky we
- grid columnconfigure $w.out 2 -weight 1
- grid rowconfigure $w.out 0 -weight 1
- pack $w.out -fill both -expand 1
-
- label $w.status \
- -textvariable @status \
- -anchor w \
- -justify left \
- -borderwidth 1 \
- -relief sunken
- pack $w.status -side bottom -fill x
-
- frame $w.cm
- text $w.cm.t \
+ set w_columns [list $w_amov $w_asim $w_line $w_file]
+
+ scrollbar $w.file_pane.out.sbx \
+ -orient h \
+ -command [list $w_file xview]
+ scrollbar $w.file_pane.out.sby \
+ -orient v \
+ -command [list scrollbar2many $w_columns yview]
+ eval grid $w_columns $w.file_pane.out.sby -sticky nsew
+ grid conf \
+ $w.file_pane.out.sbx \
+ -column [expr {[llength $w_columns] - 1}] \
+ -sticky we
+ grid columnconfigure \
+ $w.file_pane.out \
+ [expr {[llength $w_columns] - 1}] \
+ -weight 1
+ grid rowconfigure $w.file_pane.out 0 -weight 1
+
+ set w_cviewer $w.file_pane.cm.t
+ text $w_cviewer \
-background white -borderwidth 0 \
-state disabled \
-wrap none \
-height 10 \
-width 80 \
- -xscrollcommand [list $w.cm.sbx set] \
- -yscrollcommand [list $w.cm.sby set] \
+ -xscrollcommand [list $w.file_pane.cm.sbx set] \
+ -yscrollcommand [list $w.file_pane.cm.sby set] \
-font font_diff
- scrollbar $w.cm.sbx -orient h -command [list $w.cm.t xview]
- scrollbar $w.cm.sby -orient v -command [list $w.cm.t yview]
- pack $w.cm.sby -side right -fill y
- pack $w.cm.sbx -side bottom -fill x
- pack $w.cm.t -expand 1 -fill both
- pack $w.cm -side bottom -fill x
+ $w_cviewer tag conf still_loading \
+ -font font_uiitalic \
+ -justify center
+ $w_cviewer tag conf header_key \
+ -tabs {3c} \
+ -background $active_color \
+ -font font_uibold
+ $w_cviewer tag conf header_val \
+ -background $active_color \
+ -font font_ui
+ $w_cviewer tag raise sel
+ scrollbar $w.file_pane.cm.sbx \
+ -orient h \
+ -command [list $w_cviewer xview]
+ scrollbar $w.file_pane.cm.sby \
+ -orient v \
+ -command [list $w_cviewer yview]
+ pack $w.file_pane.cm.sby -side right -fill y
+ pack $w.file_pane.cm.sbx -side bottom -fill x
+ pack $w_cviewer -expand 1 -fill both
+
+ frame $w.status \
+ -borderwidth 1 \
+ -relief sunken
+ label $w.status.l \
+ -textvariable @status \
+ -anchor w \
+ -justify left
+ pack $w.status.l -side left
menu $w.ctxm -tearoff 0
$w.ctxm add command \
-label "Copy Commit" \
-command [cb _copycommit]
- set w_line $w.out.linenumber_t
- set w_load $w.out.loaded_t
- set w_file $w.out.file_t
- set w_cmit $w.cm.t
-
- foreach i [list \
- $w.out.loaded_t \
- $w.out.linenumber_t \
- $w.out.file_t] {
- $i tag conf in_sel \
- -background [$i cget -foreground] \
- -foreground [$i cget -background]
- $i conf -yscrollcommand \
- [list many2scrollbar [list \
- $w.out.loaded_t \
- $w.out.linenumber_t \
- $w.out.file_t \
- ] yview $w.out.sby]
- bind $i <Button-1> "[cb _click $i @%x,%y]; focus $i"
+ foreach i $w_columns {
+ for {set g 0} {$g < [llength $group_colors]} {incr g} {
+ $i tag conf color$g -background [lindex $group_colors $g]
+ }
+
+ $i conf -cursor $cursor_ptr
+ $i conf -yscrollcommand [list many2scrollbar \
+ $w_columns yview $w.file_pane.out.sby]
+ bind $i <Button-1> "
+ [cb _hide_tooltip]
+ [cb _click $i @%x,%y]
+ focus $i
+ "
+ bind $i <Any-Motion> [cb _show_tooltip $i @%x,%y]
+ bind $i <Any-Enter> [cb _hide_tooltip]
+ bind $i <Any-Leave> [cb _hide_tooltip]
bind_button3 $i "
+ [cb _hide_tooltip]
set cursorX %x
set cursorY %y
set cursorW %W
@@ -149,11 +274,7 @@ constructor new {i_commit i_path} {
"
}
- foreach i [list \
- $w.out.loaded_t \
- $w.out.linenumber_t \
- $w.out.file_t \
- $w.cm.t] {
+ foreach i [concat $w_columns $w_cviewer] {
bind $i <Key-Up> {catch {%W yview scroll -1 units};break}
bind $i <Key-Down> {catch {%W yview scroll 1 units};break}
bind $i <Key-Left> {catch {%W xview scroll -1 units};break}
@@ -166,10 +287,95 @@ constructor new {i_commit i_path} {
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
}
- bind $w.cm.t <Button-1> [list focus $w.cm.t]
+ bind $w_cviewer <Button-1> [list focus $w_cviewer]
bind $top <Visibility> [list focus $top]
- bind $top <Destroy> [list delete_this $this]
+ grid configure $w.header -sticky ew
+ grid configure $w.file_pane -sticky nsew
+ grid configure $w.status -sticky ew
+ grid columnconfigure $top 0 -weight 1
+ grid rowconfigure $top 0 -weight 0
+ grid rowconfigure $top 1 -weight 1
+ grid rowconfigure $top 2 -weight 0
+
+ set req_w [winfo reqwidth $top]
+ set req_h [winfo reqheight $top]
+ if {$req_w < 600} {set req_w 600}
+ if {$req_h < 400} {set req_h 400}
+ set g "${req_w}x${req_h}"
+ wm geometry $top $g
+ update
+
+ set old_height [winfo height $w.file_pane]
+ $w.file_pane sash place 0 \
+ [lindex [$w.file_pane sash coord 0] 0] \
+ [expr {int($old_height * 0.70)}]
+ bind $w.file_pane <Configure> \
+ "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}"
+
+ _load $this {}
+}
+
+method _load {jump} {
+ variable group_colors
+
+ _hide_tooltip $this
+
+ if {$total_lines != 0 || $current_fd ne {}} {
+ if {$current_fd ne {}} {
+ catch {close $current_fd}
+ set current_fd {}
+ }
+
+ foreach i $w_columns {
+ $i conf -state normal
+ $i delete 0.0 end
+ foreach g [$i tag names] {
+ if {[regexp {^g[0-9a-f]{40}$} $g]} {
+ $i tag delete $g
+ }
+ }
+ $i conf -state disabled
+ }
+
+ $w_cviewer conf -state normal
+ $w_cviewer delete 0.0 end
+ $w_cviewer conf -state disabled
+
+ set highlight_line -1
+ set highlight_column {}
+ set highlight_commit {}
+ set total_lines 0
+ }
+
+ if {[winfo exists $w.status.c]} {
+ $w.status.c coords bar 0 0 0 20
+ } else {
+ canvas $w.status.c \
+ -width 100 \
+ -height [expr {int([winfo reqheight $w.status.l] * 0.6)}] \
+ -borderwidth 1 \
+ -relief groove \
+ -highlightt 0
+ $w.status.c create rectangle 0 0 0 20 -tags bar -fill navy
+ pack $w.status.c -side right
+ }
+
+ if {$history eq {}} {
+ $w_back conf -state disabled
+ } else {
+ $w_back conf -state normal
+ }
+
+ # Index 0 is always empty. There is never line 0 as
+ # we use only 1 based lines, as that matches both with
+ # git-blame output and with Tk's text widget.
+ #
+ set amov_data [list [list]]
+ set asim_data [list [list]]
+
+ set status "Loading $commit:[escape_path $path]..."
+ $w_path conf -text [escape_path $path]
if {$commit eq {}} {
set fd [open $path r]
} else {
@@ -177,41 +383,133 @@ constructor new {i_commit i_path} {
set fd [open "| $cmd" r]
}
fconfigure $fd -blocking 0 -translation lf -encoding binary
- fileevent $fd readable [cb _read_file $fd]
+ fileevent $fd readable [cb _read_file $fd $jump]
+ set current_fd $fd
}
-method _read_file {fd} {
- $w_load conf -state normal
- $w_line conf -state normal
- $w_file conf -state normal
+method _history_menu {} {
+ set m $w.backmenu
+ if {[winfo exists $m]} {
+ $m delete 0 end
+ } else {
+ menu $m -tearoff 0
+ }
+
+ for {set i [expr {[llength $history] - 1}]
+ } {$i >= 0} {incr i -1} {
+ set e [lindex $history $i]
+ set c [lindex $e 0]
+ set f [lindex $e 1]
+
+ if {[regexp {^[0-9a-f]{40}$} $c]} {
+ set t [string range $c 0 8]...
+ } elseif {$c eq {}} {
+ set t {Working Directory}
+ } else {
+ set t $c
+ }
+ if {![catch {set summary $header($c,summary)}]} {
+ append t " $summary"
+ if {[string length $t] > 70} {
+ set t [string range $t 0 66]...
+ }
+ }
+
+ $m add command -label $t -command [cb _goback $i]
+ }
+ set X [winfo rootx $w_back]
+ set Y [expr {[winfo rooty $w_back] + [winfo height $w_back]}]
+ tk_popup $m $X $Y
+}
+
+method _goback {i} {
+ set dat [lindex $history $i]
+ set history [lrange $history 0 [expr {$i - 1}]]
+ set commit [lindex $dat 0]
+ set path [lindex $dat 1]
+ _load $this [lrange $dat 2 5]
+}
+
+method _read_file {fd jump} {
+ if {$fd ne $current_fd} {
+ catch {close $fd}
+ return
+ }
+
+ foreach i $w_columns {$i conf -state normal}
while {[gets $fd line] >= 0} {
regsub "\r\$" $line {} line
incr total_lines
- $w_load insert end "\n"
- $w_line insert end "$total_lines\n" linenumber
- $w_file insert end "$line\n"
+ lappend amov_data {}
+ lappend asim_data {}
+
+ if {$total_lines > 1} {
+ foreach i $w_columns {$i insert end "\n"}
+ }
+
+ $w_line insert end "$total_lines" linenumber
+ $w_file insert end "$line"
}
- $w_load conf -state disabled
- $w_line conf -state disabled
- $w_file conf -state disabled
+
+ set ln_wc [expr {[string length $total_lines] + 2}]
+ if {[$w_line cget -width] < $ln_wc} {
+ $w_line conf -width $ln_wc
+ }
+
+ foreach i $w_columns {$i conf -state disabled}
if {[eof $fd]} {
close $fd
- _status $this
- set cmd [list git blame -M -C --incremental]
- if {$commit eq {}} {
- lappend cmd --contents $path
- } else {
- lappend cmd $commit
+
+ # If we don't force Tk to update the widgets *right now*
+ # none of our jump commands will cause a change in the UI.
+ #
+ update
+
+ if {[llength $jump] == 1} {
+ set highlight_line [lindex $jump 0]
+ $w_file see "$highlight_line.0"
+ } elseif {[llength $jump] == 4} {
+ set highlight_column [lindex $jump 0]
+ set highlight_line [lindex $jump 1]
+ $w_file xview moveto [lindex $jump 2]
+ $w_file yview moveto [lindex $jump 3]
}
- lappend cmd -- $path
- set fd [open "| $cmd" r]
- fconfigure $fd -blocking 0 -translation lf -encoding binary
- fileevent $fd readable [cb _read_blame $fd]
+
+ _exec_blame $this $w_asim @asim_data \
+ [list] \
+ { copy/move tracking}
}
} ifdeleted { catch {close $fd} }
-method _read_blame {fd} {
+method _exec_blame {cur_w cur_d options cur_s} {
+ set cmd [list nice git blame]
+ set cmd [concat $cmd $options]
+ lappend cmd --incremental
+ if {$commit eq {}} {
+ lappend cmd --contents $path
+ } else {
+ lappend cmd $commit
+ }
+ lappend cmd -- $path
+ set fd [open "| $cmd" r]
+ fconfigure $fd -blocking 0 -translation lf -encoding binary
+ fileevent $fd readable [cb _read_blame $fd $cur_w $cur_d $cur_s]
+ set current_fd $fd
+ set blame_lines 0
+ _status $this $cur_s
+}
+
+method _read_blame {fd cur_w cur_d cur_s} {
+ upvar #0 $cur_d line_data
+ variable group_colors
+
+ if {$fd ne $current_fd} {
+ catch {close $fd}
+ return
+ }
+
+ $cur_w conf -state normal
while {[gets $fd line] >= 0} {
if {[regexp {^([a-z0-9]{40}) (\d+) (\d+) (\d+)$} $line line \
cmit original_line final_line line_count]} {
@@ -219,127 +517,240 @@ method _read_blame {fd} {
set r_orig_line $original_line
set r_final_line $final_line
set r_line_count $line_count
-
- if {[catch {set g $order($cmit)}]} {
- $w_line tag conf g$cmit
- $w_file tag conf g$cmit
- $w_line tag raise in_sel
- $w_file tag raise in_sel
- $w_file tag raise sel
- set order($cmit) $commit_count
- incr commit_count
- lappend commit_list $cmit
- }
} elseif {[string match {filename *} $line]} {
set file [string range $line 9 end]
set n $r_line_count
set lno $r_final_line
+ set oln $r_orig_line
set cmit $r_commit
+ if {[regexp {^0{40}$} $cmit]} {
+ set commit_abbr work
+ set commit_type curr_commit
+ } elseif {$cmit eq $commit} {
+ set commit_abbr this
+ set commit_type curr_commit
+ } else {
+ set commit_type prior_commit
+ set commit_abbr [string range $cmit 0 3]
+ }
+
+ set author_abbr {}
+ set a_name {}
+ catch {set a_name $header($cmit,author)}
+ while {$a_name ne {}} {
+ if {![regexp {^([[:upper:]])} $a_name _a]} break
+ append author_abbr $_a
+ unset _a
+ if {![regsub \
+ {^[[:upper:]][^\s]*\s+} \
+ $a_name {} a_name ]} break
+ }
+ if {$author_abbr eq {}} {
+ set author_abbr { |}
+ } else {
+ set author_abbr [string range $author_abbr 0 3]
+ }
+ unset a_name
+
+ set first_lno $lno
+ while {
+ $first_lno > 1
+ && $cmit eq [lindex $line_data [expr {$first_lno - 1}] 0]
+ && $file eq [lindex $line_data [expr {$first_lno - 1}] 1]
+ } {
+ incr first_lno -1
+ }
+
+ set color {}
+ if {$first_lno < $lno} {
+ foreach g [$w_file tag names $first_lno.0] {
+ if {[regexp {^color[0-9]+$} $g]} {
+ set color $g
+ break
+ }
+ }
+ } else {
+ set i [lsort [concat \
+ [$w_file tag names "[expr {$first_lno - 1}].0"] \
+ [$w_file tag names "[expr {$lno + $n}].0"] \
+ ]]
+ for {set g 0} {$g < [llength $group_colors]} {incr g} {
+ if {[lsearch -sorted -exact $i color$g] == -1} {
+ set color color$g
+ break
+ }
+ }
+ }
+ if {$color eq {}} {
+ set color color0
+ }
+
while {$n > 0} {
set lno_e "$lno.0 lineend + 1c"
- if {[catch {set g g$line_commit($lno)}]} {
- $w_load tag add annotated $lno.0 $lno_e
+ if {[lindex $line_data $lno] ne {}} {
+ set g [lindex $line_data $lno 0]
+ foreach i $w_columns {
+ $i tag remove g$g $lno.0 $lno_e
+ }
+ }
+ lset line_data $lno [list $cmit $file $oln]
+
+ $cur_w delete $lno.0 "$lno.0 lineend"
+ if {$lno == $first_lno} {
+ $cur_w insert $lno.0 $commit_abbr $commit_type
+ } elseif {$lno == [expr {$first_lno + 1}]} {
+ $cur_w insert $lno.0 $author_abbr author_abbr
} else {
- $w_line tag remove g$g $lno.0 $lno_e
- $w_file tag remove g$g $lno.0 $lno_e
+ $cur_w insert $lno.0 { |}
}
- set line_commit($lno) $cmit
- set line_file($lno) $file
- $w_line tag add g$cmit $lno.0 $lno_e
- $w_file tag add g$cmit $lno.0 $lno_e
+ foreach i $w_columns {
+ if {$cur_w eq $w_amov} {
+ for {set g 0} \
+ {$g < [llength $group_colors]} \
+ {incr g} {
+ $i tag remove color$g $lno.0 $lno_e
+ }
+ $i tag add $color $lno.0 $lno_e
+ }
+ $i tag add g$cmit $lno.0 $lno_e
+ }
- if {$highlight_line == -1} {
- if {[lindex [$w_file yview] 0] == 0} {
+ if {$highlight_column eq $cur_w} {
+ if {$highlight_line == -1
+ && [lindex [$w_file yview] 0] == 0} {
$w_file see $lno.0
- _showcommit $this $lno
+ set highlight_line $lno
+ }
+ if {$highlight_line == $lno} {
+ _showcommit $this $cur_w $lno
}
- } elseif {$highlight_line == $lno} {
- _showcommit $this $lno
}
incr n -1
incr lno
+ incr oln
incr blame_lines
}
- set hc $highlight_commit
- if {$hc ne {}
- && [expr {$order($hc) + 1}] == $order($cmit)} {
- _showcommit $this $highlight_line
+ while {
+ $cmit eq [lindex $line_data $lno 0]
+ && $file eq [lindex $line_data $lno 1]
+ } {
+ $cur_w delete $lno.0 "$lno.0 lineend"
+
+ if {$lno == $first_lno} {
+ $cur_w insert $lno.0 $commit_abbr $commit_type
+ } elseif {$lno == [expr {$first_lno + 1}]} {
+ $cur_w insert $lno.0 $author_abbr author_abbr
+ } else {
+ $cur_w insert $lno.0 { |}
+ }
+
+ if {$cur_w eq $w_amov} {
+ foreach i $w_columns {
+ for {set g 0} \
+ {$g < [llength $group_colors]} \
+ {incr g} {
+ $i tag remove color$g $lno.0 $lno_e
+ }
+ $i tag add $color $lno.0 $lno_e
+ }
+ }
+
+ incr lno
}
+
} elseif {[regexp {^([a-z-]+) (.*)$} $line line key data]} {
set header($r_commit,$key) $data
}
}
+ $cur_w conf -state disabled
if {[eof $fd]} {
close $fd
- set status {Annotation complete.}
+ if {$cur_w eq $w_asim} {
+ _exec_blame $this $w_amov @amov_data \
+ [list -M -C -C] \
+ { original location}
+ } else {
+ set current_fd {}
+ set status {Annotation complete.}
+ destroy $w.status.c
+ }
} else {
- _status $this
+ _status $this $cur_s
}
} ifdeleted { catch {close $fd} }
-method _status {} {
+method _status {cur_s} {
set have $blame_lines
set total $total_lines
set pdone 0
if {$total} {set pdone [expr {100 * $have / $total}]}
set status [format \
- "Loading annotations... %i of %i lines annotated (%2i%%)" \
- $have $total $pdone]
+ "Loading%s annotations... %i of %i lines annotated (%2i%%)" \
+ $cur_s $have $total $pdone]
+ $w.status.c coords bar 0 0 $pdone 20
}
method _click {cur_w pos} {
set lno [lindex [split [$cur_w index $pos] .] 0]
- if {$lno eq {}} return
-
- set lno_e "$lno.0 + 1 line"
- $w_line tag remove in_sel 0.0 end
- $w_file tag remove in_sel 0.0 end
- $w_line tag add in_sel $lno.0 $lno_e
- $w_file tag add in_sel $lno.0 $lno_e
-
- _showcommit $this $lno
+ _showcommit $this $cur_w $lno
}
-variable blame_colors {
- #ff4040
- #ff40ff
- #4040ff
+method _load_commit {cur_w cur_d pos} {
+ upvar #0 $cur_d line_data
+ set lno [lindex [split [$cur_w index $pos] .] 0]
+ set dat [lindex $line_data $lno]
+ if {$dat ne {}} {
+ lappend history [list \
+ $commit $path \
+ $highlight_column \
+ $highlight_line \
+ [lindex [$w_file xview] 0] \
+ [lindex [$w_file yview] 0] \
+ ]
+ set commit [lindex $dat 0]
+ set path [lindex $dat 1]
+ _load $this [list [lindex $dat 2]]
+ }
}
-method _showcommit {lno} {
+method _showcommit {cur_w lno} {
global repo_config
- variable blame_colors
+ variable active_color
if {$highlight_commit ne {}} {
- set idx $order($highlight_commit)
- set i 0
- foreach c $blame_colors {
- set h [lindex $commit_list [expr {$idx - 1 + $i}]]
- $w_line tag conf g$h -background white
- $w_file tag conf g$h -background white
- incr i
+ foreach i $w_columns {
+ $i tag conf g$highlight_commit -background {}
+ $i tag lower g$highlight_commit
}
}
- $w_cmit conf -state normal
- $w_cmit delete 0.0 end
- if {[catch {set cmit $line_commit($lno)}]} {
+ if {$cur_w eq $w_asim} {
+ set dat [lindex $asim_data $lno]
+ set highlight_column $w_asim
+ } else {
+ set dat [lindex $amov_data $lno]
+ set highlight_column $w_amov
+ }
+
+ $w_cviewer conf -state normal
+ $w_cviewer delete 0.0 end
+
+ if {$dat eq {}} {
set cmit {}
- $w_cmit insert end "Loading annotation..."
+ $w_cviewer insert end "Loading annotation..." still_loading
} else {
- set idx $order($cmit)
- set i 0
- foreach c $blame_colors {
- set h [lindex $commit_list [expr {$idx - 1 + $i}]]
- $w_line tag conf g$h -background $c
- $w_file tag conf g$h -background $c
- incr i
+ set cmit [lindex $dat 0]
+ set file [lindex $dat 1]
+
+ foreach i $w_columns {
+ $i tag conf g$cmit -background $active_color
+ $i tag raise g$cmit
}
set author_name {}
@@ -388,29 +799,199 @@ method _showcommit {lno} {
set header($cmit,message) $msg
}
- $w_cmit insert end "commit $cmit
-Author: $author_name $author_email $author_time
-Committer: $committer_name $committer_email $committer_time
-Original File: [escape_path $line_file($lno)]
+ $w_cviewer insert end "commit $cmit\n" header_key
+ $w_cviewer insert end "Author:\t" header_key
+ $w_cviewer insert end "$author_name $author_email" header_val
+ $w_cviewer insert end " $author_time\n" header_val
+
+ $w_cviewer insert end "Committer:\t" header_key
+ $w_cviewer insert end "$committer_name $committer_email" header_val
+ $w_cviewer insert end " $committer_time\n" header_val
-$msg"
+ if {$file ne $path} {
+ $w_cviewer insert end "Original File:\t" header_key
+ $w_cviewer insert end "[escape_path $file]\n" header_val
+ }
+
+ $w_cviewer insert end "\n$msg"
}
- $w_cmit conf -state disabled
+ $w_cviewer conf -state disabled
set highlight_line $lno
set highlight_commit $cmit
+
+ if {[lsearch -exact $tooltip_commit $highlight_commit] != -1} {
+ _hide_tooltip $this
+ }
}
method _copycommit {} {
set pos @$::cursorX,$::cursorY
set lno [lindex [split [$::cursorW index $pos] .] 0]
- if {![catch {set commit $line_commit($lno)}]} {
+ set dat [lindex $amov_data $lno]
+ if {$dat ne {}} {
clipboard clear
clipboard append \
-format STRING \
-type STRING \
- -- $commit
+ -- [lindex $dat 0]
}
}
+method _show_tooltip {cur_w pos} {
+ if {$tooltip_wm ne {}} {
+ _open_tooltip $this $cur_w
+ } elseif {$tooltip_timer eq {}} {
+ set tooltip_timer [after 1000 [cb _open_tooltip $cur_w]]
+ }
+}
+
+method _open_tooltip {cur_w} {
+ set tooltip_timer {}
+ set pos_x [winfo pointerx $cur_w]
+ set pos_y [winfo pointery $cur_w]
+ if {[winfo containing $pos_x $pos_y] ne $cur_w} {
+ _hide_tooltip $this
+ return
+ }
+
+ if {$tooltip_wm ne "$cur_w.tooltip"} {
+ _hide_tooltip $this
+
+ set tooltip_wm [toplevel $cur_w.tooltip -borderwidth 1]
+ wm overrideredirect $tooltip_wm 1
+ wm transient $tooltip_wm [winfo toplevel $cur_w]
+ set tooltip_t $tooltip_wm.label
+ text $tooltip_t \
+ -takefocus 0 \
+ -highlightthickness 0 \
+ -relief flat \
+ -borderwidth 0 \
+ -wrap none \
+ -background lightyellow \
+ -foreground black
+ $tooltip_t tag conf section_header -font font_uibold
+ pack $tooltip_t
+ } else {
+ $tooltip_t conf -state normal
+ $tooltip_t delete 0.0 end
+ }
+
+ set pos @[join [list \
+ [expr {$pos_x - [winfo rootx $cur_w]}] \
+ [expr {$pos_y - [winfo rooty $cur_w]}]] ,]
+ set lno [lindex [split [$cur_w index $pos] .] 0]
+ if {$cur_w eq $w_amov} {
+ set dat [lindex $amov_data $lno]
+ set org {}
+ } else {
+ set dat [lindex $asim_data $lno]
+ set org [lindex $amov_data $lno]
+ }
+
+ set cmit [lindex $dat 0]
+ set tooltip_commit [list $cmit]
+
+ set author_name {}
+ set summary {}
+ set author_time {}
+ catch {set author_name $header($cmit,author)}
+ catch {set summary $header($cmit,summary)}
+ catch {set author_time [clock format \
+ $header($cmit,author-time) \
+ -format {%Y-%m-%d %H:%M:%S}
+ ]}
+
+ $tooltip_t insert end "commit $cmit\n"
+ $tooltip_t insert end "$author_name $author_time\n"
+ $tooltip_t insert end "$summary"
+
+ if {$org ne {} && [lindex $org 0] ne $cmit} {
+ set save [$tooltip_t get 0.0 end]
+ $tooltip_t delete 0.0 end
+
+ set cmit [lindex $org 0]
+ set file [lindex $org 1]
+ lappend tooltip_commit $cmit
+
+ set author_name {}
+ set summary {}
+ set author_time {}
+ catch {set author_name $header($cmit,author)}
+ catch {set summary $header($cmit,summary)}
+ catch {set author_time [clock format \
+ $header($cmit,author-time) \
+ -format {%Y-%m-%d %H:%M:%S}
+ ]}
+
+ $tooltip_t insert end "Originally By:\n" section_header
+ $tooltip_t insert end "commit $cmit\n"
+ $tooltip_t insert end "$author_name $author_time\n"
+ $tooltip_t insert end "$summary\n"
+
+ if {$file ne $path} {
+ $tooltip_t insert end "In File: " section_header
+ $tooltip_t insert end "$file\n"
+ }
+
+ $tooltip_t insert end "\n"
+ $tooltip_t insert end "Copied Or Moved Here By:\n" section_header
+ $tooltip_t insert end $save
+ }
+
+ $tooltip_t conf -state disabled
+ _position_tooltip $this
+}
+
+method _position_tooltip {} {
+ set max_h [lindex [split [$tooltip_t index end] .] 0]
+ set max_w 0
+ for {set i 1} {$i <= $max_h} {incr i} {
+ set c [lindex [split [$tooltip_t index "$i.0 lineend"] .] 1]
+ if {$c > $max_w} {set max_w $c}
+ }
+ $tooltip_t conf -width $max_w -height $max_h
+
+ set req_w [winfo reqwidth $tooltip_t]
+ set req_h [winfo reqheight $tooltip_t]
+ set pos_x [expr {[winfo pointerx .] + 5}]
+ set pos_y [expr {[winfo pointery .] + 10}]
+
+ set g "${req_w}x${req_h}"
+ if {$pos_x >= 0} {append g +}
+ append g $pos_x
+ if {$pos_y >= 0} {append g +}
+ append g $pos_y
+
+ wm geometry $tooltip_wm $g
+ raise $tooltip_wm
+}
+
+method _hide_tooltip {} {
+ if {$tooltip_wm ne {}} {
+ destroy $tooltip_wm
+ set tooltip_wm {}
+ set tooltip_commit {}
+ }
+ if {$tooltip_timer ne {}} {
+ after cancel $tooltip_timer
+ set tooltip_timer {}
+ }
+}
+
+method _resize {new_height} {
+ set diff [expr {$new_height - $old_height}]
+ if {$diff == 0} return
+
+ set my [expr {[winfo height $w.file_pane] - 25}]
+ set o [$w.file_pane sash coord 0]
+ set ox [lindex $o 0]
+ set oy [expr {[lindex $o 1] + $diff}]
+ if {$oy < 0} {set oy 0}
+ if {$oy > $my} {set oy $my}
+ $w.file_pane sash place 0 $ox $oy
+
+ set old_height $new_height
+}
+
}
diff --git a/git-gui/lib/branch.tcl b/git-gui/lib/branch.tcl
index caaee5cf17..4f648b2bc7 100644
--- a/git-gui/lib/branch.tcl
+++ b/git-gui/lib/branch.tcl
@@ -201,12 +201,14 @@ proc do_create_branch {} {
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
labelframe $w.from -text {Starting Revision}
- radiobutton $w.from.head_r \
- -text {Local Branch:} \
- -value head \
- -variable create_branch_revtype
- eval tk_optionMenu $w.from.head_m create_branch_head $all_heads
- grid $w.from.head_r $w.from.head_m -sticky w
+ if {$all_heads ne {}} {
+ radiobutton $w.from.head_r \
+ -text {Local Branch:} \
+ -value head \
+ -variable create_branch_revtype
+ eval tk_optionMenu $w.from.head_m create_branch_head $all_heads
+ grid $w.from.head_r $w.from.head_m -sticky w
+ }
set all_trackings [all_tracking_branches]
if {$all_trackings ne {}} {
set create_branch_trackinghead [lindex $all_trackings 0]
diff --git a/git-gui/lib/branch_rename.tcl b/git-gui/lib/branch_rename.tcl
new file mode 100644
index 0000000000..405101637f
--- /dev/null
+++ b/git-gui/lib/branch_rename.tcl
@@ -0,0 +1,136 @@
+# git-gui branch rename support
+# Copyright (C) 2007 Shawn Pearce
+
+class branch_rename {
+
+field w
+field oldname
+field newname
+
+constructor dialog {} {
+ global all_heads current_branch
+
+ make_toplevel top w
+ wm title $top "[appname] ([reponame]): Rename Branch"
+ if {$top ne {.}} {
+ wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
+ }
+
+ set oldname $current_branch
+ set newname [get_config gui.newbranchtemplate]
+
+ label $w.header -text {Rename Branch} -font font_uibold
+ pack $w.header -side top -fill x
+
+ frame $w.buttons
+ button $w.buttons.rename -text Rename \
+ -default active \
+ -command [cb _rename]
+ pack $w.buttons.rename -side right
+ button $w.buttons.cancel -text {Cancel} \
+ -command [list destroy $w]
+ pack $w.buttons.cancel -side right -padx 5
+ pack $w.buttons -side bottom -fill x -pady 10 -padx 10
+
+ frame $w.rename
+ label $w.rename.oldname_l -text {Branch:}
+ eval tk_optionMenu $w.rename.oldname_m @oldname $all_heads
+
+ label $w.rename.newname_l -text {New Name:}
+ entry $w.rename.newname_t \
+ -borderwidth 1 \
+ -relief sunken \
+ -width 40 \
+ -textvariable @newname \
+ -validate key \
+ -validatecommand {
+ if {%d == 1 && [regexp {[~^:?*\[\0- ]} %S]} {return 0}
+ return 1
+ }
+
+ grid $w.rename.oldname_l $w.rename.oldname_m -sticky w -padx {0 5}
+ grid $w.rename.newname_l $w.rename.newname_t -sticky we -padx {0 5}
+ grid columnconfigure $w.rename 1 -weight 1
+ pack $w.rename -anchor nw -fill x -pady 5 -padx 5
+
+ bind $w <Key-Return> [cb _rename]
+ bind $w <Key-Escape> [list destroy $w]
+ bind $w <Visibility> "
+ grab $w
+ $w.rename.newname_t icursor end
+ focus $w.rename.newname_t
+ "
+ tkwait window $w
+}
+
+method _rename {} {
+ global all_heads current_branch
+
+ if {$oldname eq {}} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Please select a branch to rename."
+ focus $w.rename.oldname_m
+ return
+ }
+ if {$newname eq {}
+ || $newname eq [get_config gui.newbranchtemplate]} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Please supply a branch name."
+ focus $w.rename.newname_t
+ return
+ }
+ if {![catch {git show-ref --verify -- "refs/heads/$newname"}]} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Branch '$newname' already exists."
+ focus $w.rename.newname_t
+ return
+ }
+ if {[catch {git check-ref-format "heads/$newname"}]} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "We do not like '$newname' as a branch name."
+ focus $w.rename.newname_t
+ return
+ }
+
+ if {[catch {git branch -m $oldname $newname} err]} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Failed to rename '$oldname'.\n\n$err"
+ return
+ }
+
+ set oldidx [lsearch -exact -sorted $all_heads $oldname]
+ if {$oldidx >= 0} {
+ set all_heads [lreplace $all_heads $oldidx $oldidx]
+ }
+ lappend all_heads $newname
+ set all_heads [lsort $all_heads]
+ populate_branch_menu
+
+ if {$current_branch eq $oldname} {
+ set current_branch $newname
+ }
+
+ destroy $w
+}
+
+}
diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index fd86b11217..3d6341bcc5 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -70,7 +70,6 @@ constructor new {commit} {
bind $w_list <Right> break
bind $w_list <Visibility> [list focus $w_list]
- bind $w_list <Destroy> [list delete_this $this]
set w $w_list
_ls $this $browser_commit
return $this
diff --git a/git-gui/lib/class.tcl b/git-gui/lib/class.tcl
index 88b056522a..9d298d0dcc 100644
--- a/git-gui/lib/class.tcl
+++ b/git-gui/lib/class.tcl
@@ -120,10 +120,21 @@ proc delete_this {{t {}}} {
if {[namespace exists $t]} {namespace delete $t}
}
-proc make_toplevel {t w} {
- upvar $t top $w pfx
+proc make_toplevel {t w args} {
+ upvar $t top $w pfx this this
+
+ if {[llength $args] % 2} {
+ error "make_toplevel topvar winvar {options}"
+ }
+ set autodelete 1
+ foreach {name value} $args {
+ switch -exact -- $name {
+ -autodelete {set autodelete $value}
+ default {error "unsupported option $name"}
+ }
+ }
+
if {[winfo ismapped .]} {
- upvar this this
regsub -all {::} $this {__} w
set top .$w
set pfx $top
@@ -132,6 +143,13 @@ proc make_toplevel {t w} {
set top .
set pfx {}
}
+
+ if {$autodelete} {
+ wm protocol $top WM_DELETE_WINDOW "
+ [list delete_this $this]
+ [list destroy $top]
+ "
+ }
}
@@ -151,4 +169,3 @@ auto_mkindex_parser::command constructor {name args} {
[format { [list source [file join $dir %s]]} \
[file split $scriptFile]] "\n"
}
-
diff --git a/git-gui/lib/console.tcl b/git-gui/lib/console.tcl
index 8c112f3a89..ce25d92cac 100644
--- a/git-gui/lib/console.tcl
+++ b/git-gui/lib/console.tcl
@@ -17,7 +17,7 @@ constructor new {short_title long_title} {
method _init {} {
global M1B
- make_toplevel top w
+ make_toplevel top w -autodelete 0
wm title $top "[appname] ([reponame]): $t_short"
set console_cr 1.0
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index 7e715a6865..29436b50cb 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -145,7 +145,7 @@ proc show_diff {path w {lno {}}} {
lappend cmd -p
lappend cmd --no-color
- if {$repo_config(gui.diffcontext) > 0} {
+ if {$repo_config(gui.diffcontext) >= 0} {
lappend cmd "-U$repo_config(gui.diffcontext)"
}
if {$w eq $ui_index} {
diff --git a/git-gui/lib/merge.tcl b/git-gui/lib/merge.tcl
index 24ed24b3d0..ae0389df5b 100644
--- a/git-gui/lib/merge.tcl
+++ b/git-gui/lib/merge.tcl
@@ -125,7 +125,8 @@ Please select fewer branches. To merge more than 15 branches, merge the branche
set cons [console::new "Merge" $msg]
console::exec $cons $cmd \
[namespace code [list _finish $revcnt $cons]]
- bind $w <Destroy> {}
+
+ wm protocol $w WM_DELETE_WINDOW {}
destroy $w
}
@@ -250,7 +251,7 @@ proc dialog {} {
bind $w <$M1B-Key-Return> $_start
bind $w <Visibility> "grab $w; focus $w.source.l"
bind $w <Key-Escape> "unlock_index;destroy $w"
- bind $w <Destroy> unlock_index
+ wm protocol $w WM_DELETE_WINDOW "unlock_index;destroy $w"
wm title $w "[appname] ([reponame]): Merge"
tkwait window $w
}
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 17fcc65f78..ae19a8f9cf 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -15,6 +15,9 @@ proc save_config {} {
font configure ${font}bold \
-family $global_config_new(gui.$font^^family) \
-size $global_config_new(gui.$font^^size)
+ font configure ${font}italic \
+ -family $global_config_new(gui.$font^^family) \
+ -size $global_config_new(gui.$font^^size)
set global_config_new(gui.$name) [font configure $font]
unset global_config_new(gui.$font^^family)
unset global_config_new(gui.$font^^size)
@@ -52,7 +55,7 @@ proc save_config {} {
}
proc do_about {} {
- global appvers copyright
+ global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
set w .about_dialog
@@ -91,6 +94,10 @@ $copyright" \
append v ", Tk version $tk_patchLevel"
}
+ set d {}
+ append d "git exec dir: [gitexec]\n"
+ append d "git-gui lib: $oguilib"
+
label $w.vers \
-text $v \
-padx 5 -pady 5 \
@@ -100,6 +107,15 @@ $copyright" \
-relief solid
pack $w.vers -side top -fill x -padx 5 -pady 5
+ label $w.dirs \
+ -text $d \
+ -padx 5 -pady 5 \
+ -justify left \
+ -anchor w \
+ -borderwidth 1 \
+ -relief solid
+ pack $w.dirs -side top -fill x -padx 5 -pady 5
+
menu $w.ctxm -tearoff 0
$w.ctxm add command \
-label {Copy} \
@@ -171,9 +187,11 @@ proc do_options {} {
{b merge.summary {Summarize Merge Commits}}
{i-1..5 merge.verbosity {Merge Verbosity}}
+ {b merge.diffstat {Show Diffstat After Merge}}
{b gui.trustmtime {Trust File Modification Timestamps}}
- {i-1..99 gui.diffcontext {Number of Diff Context Lines}}
+ {b gui.pruneduringfetch {Prune Tracking Branches During Fetch}}
+ {i-0..99 gui.diffcontext {Number of Diff Context Lines}}
{t gui.newbranchtemplate {New Branch Name Template}}
} {
set type [lindex $option 0]
diff --git a/git-gui/lib/remote.tcl b/git-gui/lib/remote.tcl
index 99f353ed7d..b54824ab72 100644
--- a/git-gui/lib/remote.tcl
+++ b/git-gui/lib/remote.tcl
@@ -95,6 +95,7 @@ proc populate_fetch_menu {} {
global all_remotes repo_config
set m .mbar.fetch
+ set prune_list [list]
foreach r $all_remotes {
set enable 0
if {![catch {set a $repo_config(remote.$r.url)}]} {
@@ -115,11 +116,21 @@ proc populate_fetch_menu {} {
}
if {$enable} {
+ lappend prune_list $r
$m add command \
-label "Fetch from $r..." \
-command [list fetch_from $r]
}
}
+
+ if {$prune_list ne {}} {
+ $m add separator
+ }
+ foreach r $prune_list {
+ $m add command \
+ -label "Prune from $r..." \
+ -command [list prune_from $r]
+ }
}
proc populate_push_menu {} {
diff --git a/git-gui/lib/remote_branch_delete.tcl b/git-gui/lib/remote_branch_delete.tcl
new file mode 100644
index 0000000000..b83e1b6315
--- /dev/null
+++ b/git-gui/lib/remote_branch_delete.tcl
@@ -0,0 +1,347 @@
+# git-gui remote branch deleting support
+# Copyright (C) 2007 Shawn Pearce
+
+class remote_branch_delete {
+
+field w
+field head_m
+
+field urltype {url}
+field remote {}
+field url {}
+
+field checktype {head}
+field check_head {}
+
+field status {}
+field idle_id {}
+field full_list {}
+field head_list {}
+field active_ls {}
+field head_cache
+field full_cache
+field cached
+
+constructor dialog {} {
+ global all_remotes M1B
+
+ make_toplevel top w
+ wm title $top "[appname] ([reponame]): Delete Remote Branch"
+ if {$top ne {.}} {
+ wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
+ }
+
+ label $w.header -text {Delete Remote Branch} -font font_uibold
+ pack $w.header -side top -fill x
+
+ frame $w.buttons
+ button $w.buttons.delete -text Delete \
+ -default active \
+ -command [cb _delete]
+ pack $w.buttons.delete -side right
+ button $w.buttons.cancel -text {Cancel} \
+ -command [list destroy $w]
+ pack $w.buttons.cancel -side right -padx 5
+ pack $w.buttons -side bottom -fill x -pady 10 -padx 10
+
+ labelframe $w.dest -text {From Repository}
+ if {$all_remotes ne {}} {
+ radiobutton $w.dest.remote_r \
+ -text {Remote:} \
+ -value remote \
+ -variable @urltype
+ eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
+ grid $w.dest.remote_r $w.dest.remote_m -sticky w
+ if {[lsearch -sorted -exact $all_remotes origin] != -1} {
+ set remote origin
+ } else {
+ set remote [lindex $all_remotes 0]
+ }
+ set urltype remote
+ trace add variable @remote write [cb _write_remote]
+ } else {
+ set urltype url
+ }
+ radiobutton $w.dest.url_r \
+ -text {Arbitrary URL:} \
+ -value url \
+ -variable @urltype
+ entry $w.dest.url_t \
+ -borderwidth 1 \
+ -relief sunken \
+ -width 50 \
+ -textvariable @url \
+ -validate key \
+ -validatecommand {
+ if {%d == 1 && [regexp {\s} %S]} {return 0}
+ return 1
+ }
+ trace add variable @url write [cb _write_url]
+ grid $w.dest.url_r $w.dest.url_t -sticky we -padx {0 5}
+ grid columnconfigure $w.dest 1 -weight 1
+ pack $w.dest -anchor nw -fill x -pady 5 -padx 5
+
+ labelframe $w.heads -text {Branches}
+ listbox $w.heads.l \
+ -height 10 \
+ -width 70 \
+ -listvariable @head_list \
+ -selectmode extended \
+ -yscrollcommand [list $w.heads.sby set]
+ scrollbar $w.heads.sby -command [list $w.heads.l yview]
+
+ frame $w.heads.footer
+ label $w.heads.footer.status \
+ -textvariable @status \
+ -anchor w \
+ -justify left
+ button $w.heads.footer.rescan \
+ -text {Rescan} \
+ -command [cb _rescan]
+ pack $w.heads.footer.status -side left -fill x -expand 1
+ pack $w.heads.footer.rescan -side right
+
+ pack $w.heads.footer -side bottom -fill x -expand 1
+ pack $w.heads.sby -side right -fill y
+ pack $w.heads.l -side left -fill both -expand 1
+ pack $w.heads -fill both -expand 1 -pady 5 -padx 5
+
+ labelframe $w.validate -text {Delete Only If}
+ radiobutton $w.validate.head_r \
+ -text {Merged Into:} \
+ -value head \
+ -variable @checktype
+ set head_m [tk_optionMenu $w.validate.head_m @check_head {}]
+ trace add variable @head_list write [cb _write_head_list]
+ trace add variable @check_head write [cb _write_check_head]
+ grid $w.validate.head_r $w.validate.head_m -sticky w
+ radiobutton $w.validate.always_r \
+ -text {Always (Do not perform merge checks)} \
+ -value always \
+ -variable @checktype
+ grid $w.validate.always_r -columnspan 2 -sticky w
+ grid columnconfigure $w.validate 1 -weight 1
+ pack $w.validate -anchor nw -fill x -pady 5 -padx 5
+
+ trace add variable @urltype write [cb _write_urltype]
+ _rescan $this
+
+ bind $w <Key-F5> [cb _rescan]
+ bind $w <$M1B-Key-r> [cb _rescan]
+ bind $w <$M1B-Key-R> [cb _rescan]
+ bind $w <Key-Return> [cb _delete]
+ bind $w <Key-Escape> [list destroy $w]
+ return $w
+}
+
+method _delete {} {
+ switch $urltype {
+ remote {set uri $remote}
+ url {set uri $url}
+ }
+
+ set cache $urltype:$uri
+ set crev {}
+ if {$checktype eq {head}} {
+ if {$check_head eq {}} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "A branch is required for 'Merged Into'."
+ return
+ }
+ set crev $full_cache("$cache\nrefs/heads/$check_head")
+ }
+
+ set not_merged [list]
+ set need_fetch 0
+ set have_selection 0
+ set push_cmd [list git push]
+ lappend push_cmd -v
+ lappend push_cmd $uri
+
+ foreach i [$w.heads.l curselection] {
+ set ref [lindex $full_list $i]
+ if {$crev ne {}} {
+ set obj $full_cache("$cache\n$ref")
+ if {[catch {set m [git merge-base $obj $crev]}]} {
+ set need_fetch 1
+ set m {}
+ }
+ if {$obj ne $m} {
+ lappend not_merged [lindex $head_list $i]
+ continue
+ }
+ }
+
+ lappend push_cmd :$ref
+ set have_selection 1
+ }
+
+ if {$not_merged ne {}} {
+ set msg "The following branches are not completely merged into $check_head:
+
+ - [join $not_merged "\n - "]"
+
+ if {$need_fetch} {
+ append msg "
+
+One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from $uri first."
+ }
+
+ tk_messageBox \
+ -icon info \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message $msg
+ if {!$have_selection} return
+ }
+
+ if {!$have_selection} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Please select one or more branches to delete."
+ return
+ }
+
+ if {[tk_messageBox \
+ -icon warning \
+ -type yesno \
+ -title [wm title $w] \
+ -parent $w \
+ -message {Recovering deleted branches is difficult.
+
+Delete the selected branches?}] ne yes} {
+ return
+ }
+
+ destroy $w
+
+ set cons [console::new \
+ "push $uri" \
+ "Deleting branches from $uri"]
+ console::exec $cons $push_cmd
+}
+
+method _rescan {{force 1}} {
+ switch $urltype {
+ remote {set uri $remote}
+ url {set uri $url}
+ }
+
+ if {$force} {
+ unset -nocomplain cached($urltype:$uri)
+ }
+
+ if {$idle_id ne {}} {
+ after cancel $idle_id
+ set idle_id {}
+ }
+
+ _load $this $urltype:$uri $uri
+}
+
+method _write_remote {args} { set urltype remote }
+method _write_url {args} { set urltype url }
+method _write_check_head {args} { set checktype head }
+
+method _write_head_list {args} {
+ $head_m delete 0 end
+ foreach abr $head_list {
+ $head_m insert end radiobutton \
+ -label $abr \
+ -value $abr \
+ -variable @check_head
+ }
+ if {[lsearch -exact -sorted $head_list $check_head] < 0} {
+ set check_head {}
+ }
+}
+
+method _write_urltype {args} {
+ if {$urltype eq {url}} {
+ if {$idle_id ne {}} {
+ after cancel $idle_id
+ }
+ _load $this none: {}
+ set idle_id [after 1000 [cb _rescan 0]]
+ } else {
+ _rescan $this 0
+ }
+}
+
+method _load {cache uri} {
+ if {$active_ls ne {}} {
+ catch {close $active_ls}
+ }
+
+ if {$uri eq {}} {
+ $w.heads.l conf -state disabled
+ set head_list [list]
+ set full_list [list]
+ set status {No repository selected.}
+ return
+ }
+
+ if {[catch {set x $cached($cache)}]} {
+ set status "Scanning $uri..."
+ $w.heads.l conf -state disabled
+ set head_list [list]
+ set full_list [list]
+ set head_cache($cache) [list]
+ set full_cache($cache) [list]
+ set active_ls [open "| [list git ls-remote $uri]" r]
+ fconfigure $active_ls \
+ -blocking 0 \
+ -translation lf \
+ -encoding utf-8
+ fileevent $active_ls readable [cb _read $cache $active_ls]
+ } else {
+ set status {}
+ set full_list $full_cache($cache)
+ set head_list $head_cache($cache)
+ $w.heads.l conf -state normal
+ }
+}
+
+method _read {cache fd} {
+ if {$fd ne $active_ls} {
+ catch {close $fd}
+ return
+ }
+
+ while {[gets $fd line] >= 0} {
+ if {[string match {*^{}} $line]} continue
+ if {[regexp {^([0-9a-f]{40}) (.*)$} $line _junk obj ref]} {
+ if {[regsub ^refs/heads/ $ref {} abr]} {
+ lappend head_list $abr
+ lappend head_cache($cache) $abr
+ lappend full_list $ref
+ lappend full_cache($cache) $ref
+ set full_cache("$cache\n$ref") $obj
+ }
+ }
+ }
+
+ if {[eof $fd]} {
+ if {[catch {close $fd} err]} {
+ set status $err
+ set head_list [list]
+ set full_list [list]
+ } else {
+ set status {}
+ set cached($cache) 1
+ $w.heads.l conf -state normal
+ }
+ }
+} ifdeleted {
+ catch {close $fd}
+}
+
+}
diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index c0e7d20fce..e8ebc6eda0 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -5,9 +5,19 @@ proc fetch_from {remote} {
set w [console::new \
"fetch $remote" \
"Fetching new changes from $remote"]
- set cmd [list git fetch]
- lappend cmd $remote
- console::exec $w $cmd
+ set cmds [list]
+ lappend cmds [list exec git fetch $remote]
+ if {[is_config_true gui.pruneduringfetch]} {
+ lappend cmds [list exec git remote prune $remote]
+ }
+ console::chain $w $cmds
+}
+
+proc prune_from {remote} {
+ set w [console::new \
+ "remote prune $remote" \
+ "Pruning tracking branches deleted from $remote"]
+ console::exec $w [list git remote prune $remote]
}
proc push_to {remote} {
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index 7d62d7902c..254d210bdc 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -88,7 +88,7 @@ case "${1:-.}${2:-.}${3:-.}" in
# remove lines that are unique to ours.
orig=`git-unpack-file $2`
sz0=`wc -c <"$orig"`
- diff -u -La/$orig -Lb/$orig $orig $src2 | git-apply --no-add
+ diff -u -La/$orig -Lb/$orig $orig $src2 | git-apply --no-add
sz1=`wc -c <"$orig"`
# If we do not have enough common material, it is not
diff --git a/git-mergetool.sh b/git-mergetool.sh
index bb21b037d6..7b66309193 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -215,6 +215,12 @@ merge_file () {
check_unchanged
save_backup
;;
+ gvimdiff)
+ touch "$BACKUP"
+ gvimdiff -f -- "$LOCAL" "$path" "$REMOTE"
+ check_unchanged
+ save_backup
+ ;;
xxdiff)
touch "$BACKUP"
if base_present ; then
@@ -293,7 +299,7 @@ done
if test -z "$merge_tool"; then
merge_tool=`git-config merge.tool`
case "$merge_tool" in
- kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | "")
+ kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | "")
;; # happy
*)
echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
@@ -304,28 +310,42 @@ if test -z "$merge_tool"; then
fi
if test -z "$merge_tool" ; then
- if type kdiff3 >/dev/null 2>&1 && test -n "$DISPLAY"; then
- merge_tool="kdiff3";
- elif type tkdiff >/dev/null 2>&1 && test -n "$DISPLAY"; then
- merge_tool=tkdiff
- elif type xxdiff >/dev/null 2>&1 && test -n "$DISPLAY"; then
- merge_tool=xxdiff
- elif type meld >/dev/null 2>&1 && test -n "$DISPLAY"; then
- merge_tool=meld
- elif type opendiff >/dev/null 2>&1; then
- merge_tool=opendiff
- elif type emacs >/dev/null 2>&1; then
- merge_tool=emerge
- elif type vimdiff >/dev/null 2>&1; then
- merge_tool=vimdiff
- else
+ if test -n "$DISPLAY"; then
+ merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
+ if test -n "$GNOME_DESKTOP_SESSION_ID" ; then
+ merge_tool_candidates="meld $merge_tool_candidates"
+ fi
+ if test "$KDE_FULL_SESSION" = "true"; then
+ merge_tool_candidates="kdiff3 $merge_tool_candidates"
+ fi
+ fi
+ if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
+ merge_tool_candidates="$merge_tool_candidates emerge"
+ fi
+ if echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
+ merge_tool_candidates="$merge_tool_candidates vimdiff"
+ fi
+ merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
+ echo "merge tool candidates: $merge_tool_candidates"
+ for i in $merge_tool_candidates; do
+ if test $i = emerge ; then
+ cmd=emacs
+ else
+ cmd=$i
+ fi
+ if type $cmd > /dev/null 2>&1; then
+ merge_tool=$i
+ break
+ fi
+ done
+ if test -z "$merge_tool" ; then
echo "No available merge resolution programs available."
exit 1
fi
fi
case "$merge_tool" in
- kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)
+ kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)
if ! type "$merge_tool" > /dev/null 2>&1; then
echo "The merge tool $merge_tool is not available"
exit 1
diff --git a/git-p4import.py b/git-p4import.py
index 60a758bfe3..0f3d97b67e 100644
--- a/git-p4import.py
+++ b/git-p4import.py
@@ -358,4 +358,3 @@ for id in changes:
if stitch == 1:
git.clean_directories()
stitch = 0
-
diff --git a/git-send-email.perl b/git-send-email.perl
index eb876f88dd..7c0c90bd21 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -561,7 +561,8 @@ foreach my $t (@files) {
$subject = $1;
} elsif (/^(Cc|From):\s+(.*)$/) {
- if ($2 eq $from) {
+ if (unquote_rfc2047($2) eq $from) {
+ $from = $2;
next if ($suppress_from);
}
elsif ($1 eq 'From') {
diff --git a/git-submodule.sh b/git-submodule.sh
index 6ed5a6ced2..8bdd99a2f3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -25,8 +25,35 @@ say()
fi
}
+
#
-# Run clone + checkout on missing submodules
+# Clone a submodule
+#
+module_clone()
+{
+ path=$1
+ url=$2
+
+ # If there already is a directory at the submodule path,
+ # expect it to be empty (since that is the default checkout
+ # action) and try to remove it.
+ # Note: if $path is a symlink to a directory the test will
+ # succeed but the rmdir will fail. We might want to fix this.
+ if test -d "$path"
+ then
+ rmdir "$path" 2>/dev/null ||
+ die "Directory '$path' exist, but is neither empty nor a git repository"
+ fi
+
+ test -e "$path" &&
+ die "A file already exist at path '$path'"
+
+ git-clone -n "$url" "$path" ||
+ die "Clone of submodule '$path' failed"
+}
+
+#
+# Register submodules in .git/config
#
# $@ = requested paths (default to all)
#
@@ -35,52 +62,23 @@ modules_init()
git ls-files --stage -- "$@" | grep -e '^160000 ' |
while read mode sha1 stage path
do
- # Skip submodule paths that already contain a .git directory.
- # This will also trigger if $path is a symlink to a git
- # repository
- test -d "$path"/.git && continue
-
- # If there already is a directory at the submodule path,
- # expect it to be empty (since that is the default checkout
- # action) and try to remove it.
- # Note: if $path is a symlink to a directory the test will
- # succeed but the rmdir will fail. We might want to fix this.
- if test -d "$path"
- then
- rmdir "$path" 2>/dev/null ||
- die "Directory '$path' exist, but is neither empty nor a git repository"
- fi
-
- test -e "$path" &&
- die "A file already exist at path '$path'"
+ # Skip already registered paths
+ url=$(git-config submodule."$path".url)
+ test -z "$url" || continue
url=$(GIT_CONFIG=.gitmodules git-config module."$path".url)
test -z "$url" &&
die "No url found for submodule '$path' in .gitmodules"
- # MAYBE FIXME: this would be the place to check GIT_CONFIG
- # for a preferred url for this submodule, possibly like this:
- #
- # modname=$(GIT_CONFIG=.gitmodules git-config module."$path".name)
- # alturl=$(git-config module."$modname".url)
- #
- # This would let the versioned .gitmodules file use the submodule
- # path as key, while the unversioned GIT_CONFIG would use the
- # logical modulename (if present) as key. But this would need
- # another fallback mechanism if the module wasn't named.
-
- git-clone -n "$url" "$path" ||
- die "Clone of submodule '$path' failed"
+ git-config submodule."$path".url "$url" ||
+ die "Failed to register url for submodule '$path'"
- (unset GIT_DIR && cd "$path" && git-checkout -q "$sha1") ||
- die "Checkout of submodule '$path' failed"
-
- say "Submodule '$path' initialized"
+ say "Submodule '$path' registered with url '$url'"
done
}
#
-# Checkout correct revision of each initialized submodule
+# Update each submodule path to correct revision, using clone and checkout as needed
#
# $@ = requested paths (default to all)
#
@@ -89,14 +87,21 @@ modules_update()
git ls-files --stage -- "$@" | grep -e '^160000 ' |
while read mode sha1 stage path
do
- if ! test -d "$path"/.git
+ url=$(git-config submodule."$path".url)
+ if test -z "$url"
then
# Only mention uninitialized submodules when its
# path have been specified
test "$#" != "0" &&
say "Submodule '$path' not initialized"
- continue;
+ continue
fi
+
+ if ! test -d "$path"/.git
+ then
+ module_clone "$path" "$url" || exit
+ fi
+
subsha1=$(unset GIT_DIR && cd "$path" &&
git-rev-parse --verify HEAD) ||
die "Unable to find current revision of submodule '$path'"
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 3af8c7e110..f4597626b9 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -542,7 +542,7 @@ sub copy_path($$$$$$$$) {
if ($node_kind eq $SVN::Node::dir) {
$srcpath =~ s#/*$#/#;
}
-
+
my $pid = open my $f,'-|';
die $! unless defined $pid;
if (!$pid) {
@@ -560,7 +560,7 @@ sub copy_path($$$$$$$$) {
} else {
$p = $path;
}
- push(@$new,[$mode,$sha1,$p]);
+ push(@$new,[$mode,$sha1,$p]);
}
close($f) or
print STDERR "$newrev:$newbranch: could not list files in $oldpath \@ $rev\n";
diff --git a/git-tag.sh b/git-tag.sh
index 37cee978d2..c84043902f 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -64,7 +64,7 @@ do
done
;;
-m)
- annotate=1
+ annotate=1
shift
message="$1"
if test "$#" = "0"; then
@@ -90,7 +90,7 @@ do
username="$1"
;;
-d)
- shift
+ shift
had_error=0
for tag
do
@@ -180,4 +180,3 @@ if [ "$annotate" ]; then
fi
git update-ref "refs/tags/$name" "$object" "$prev"
-
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
index 8db7dd0b7d..f2d5597dba 100755
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -42,4 +42,3 @@ cat "$GIT_DIR/.tmp-vtag" |
sed '/-----BEGIN PGP/Q' |
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
rm -f "$GIT_DIR/.tmp-vtag"
-
diff --git a/git.spec.in b/git.spec.in
index 3a45eb8761..b9dc1d59eb 100644
--- a/git.spec.in
+++ b/git.spec.in
@@ -63,7 +63,7 @@ Git tools for importing Perforce repositories.
%package email
Summary: Git tools for sending email
Group: Development/Tools
-Requires: git-core = %{version}-%{release}
+Requires: git-core = %{version}-%{release}
%description email
Git tools for sending email.
diff --git a/gitk b/gitk
index a57e84cef7..87c3690ff3 100755
--- a/gitk
+++ b/gitk
@@ -337,7 +337,7 @@ proc readrefs {} {
set tagids($name) $commit
lappend idtags($commit) $name
}
- }
+ }
catch {
set tagcontents($name) [exec git cat-file tag $id]
}
diff --git a/gitweb/README b/gitweb/README
index e02e90f042..7186cede2f 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -79,4 +79,3 @@ Originally written by:
Any comment/question/concern to:
Git mailing list <git@vger.kernel.org>
-
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 9f0822fab3..7908fe3b5f 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -181,10 +181,15 @@ table.diff_tree {
font-family: monospace;
}
+table.combined.diff_tree th {
+ text-align: center;
+}
+
table.combined.diff_tree td {
padding-right: 24px;
}
+table.combined.diff_tree th.link,
table.combined.diff_tree td.link {
padding: 0px 2px;
}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e92596c295..a6383dc85b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -954,7 +954,200 @@ sub format_subject_html {
}
}
-# format patch (diff) line (rather not to be used for diff headers)
+# format git diff header line, i.e. "diff --(git|combined|cc) ..."
+sub format_git_diff_header_line {
+ my $line = shift;
+ my $diffinfo = shift;
+ my ($from, $to) = @_;
+
+ if ($diffinfo->{'nparents'}) {
+ # combined diff
+ $line =~ s!^(diff (.*?) )"?.*$!$1!;
+ if ($to->{'href'}) {
+ $line .= $cgi->a({-href => $to->{'href'}, -class => "path"},
+ esc_path($to->{'file'}));
+ } else { # file was deleted (no href)
+ $line .= esc_path($to->{'file'});
+ }
+ } else {
+ # "ordinary" diff
+ $line =~ s!^(diff (.*?) )"?a/.*$!$1!;
+ if ($from->{'href'}) {
+ $line .= $cgi->a({-href => $from->{'href'}, -class => "path"},
+ 'a/' . esc_path($from->{'file'}));
+ } else { # file was added (no href)
+ $line .= 'a/' . esc_path($from->{'file'});
+ }
+ $line .= ' ';
+ if ($to->{'href'}) {
+ $line .= $cgi->a({-href => $to->{'href'}, -class => "path"},
+ 'b/' . esc_path($to->{'file'}));
+ } else { # file was deleted
+ $line .= 'b/' . esc_path($to->{'file'});
+ }
+ }
+
+ return "<div class=\"diff header\">$line</div>\n";
+}
+
+# format extended diff header line, before patch itself
+sub format_extended_diff_header_line {
+ my $line = shift;
+ my $diffinfo = shift;
+ my ($from, $to) = @_;
+
+ # match <path>
+ if ($line =~ s!^((copy|rename) from ).*$!$1! && $from->{'href'}) {
+ $line .= $cgi->a({-href=>$from->{'href'}, -class=>"path"},
+ esc_path($from->{'file'}));
+ }
+ if ($line =~ s!^((copy|rename) to ).*$!$1! && $to->{'href'}) {
+ $line .= $cgi->a({-href=>$to->{'href'}, -class=>"path"},
+ esc_path($to->{'file'}));
+ }
+ # match single <mode>
+ if ($line =~ m/\s(\d{6})$/) {
+ $line .= '<span class="info"> (' .
+ file_type_long($1) .
+ ')</span>';
+ }
+ # match <hash>
+ if ($line =~ m/^index [0-9a-fA-F]{40},[0-9a-fA-F]{40}/) {
+ # can match only for combined diff
+ $line = 'index ';
+ for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
+ if ($from->{'href'}[$i]) {
+ $line .= $cgi->a({-href=>$from->{'href'}[$i],
+ -class=>"hash"},
+ substr($diffinfo->{'from_id'}[$i],0,7));
+ } else {
+ $line .= '0' x 7;
+ }
+ # separator
+ $line .= ',' if ($i < $diffinfo->{'nparents'} - 1);
+ }
+ $line .= '..';
+ if ($to->{'href'}) {
+ $line .= $cgi->a({-href=>$to->{'href'}, -class=>"hash"},
+ substr($diffinfo->{'to_id'},0,7));
+ } else {
+ $line .= '0' x 7;
+ }
+
+ } elsif ($line =~ m/^index [0-9a-fA-F]{40}..[0-9a-fA-F]{40}/) {
+ # can match only for ordinary diff
+ my ($from_link, $to_link);
+ if ($from->{'href'}) {
+ $from_link = $cgi->a({-href=>$from->{'href'}, -class=>"hash"},
+ substr($diffinfo->{'from_id'},0,7));
+ } else {
+ $from_link = '0' x 7;
+ }
+ if ($to->{'href'}) {
+ $to_link = $cgi->a({-href=>$to->{'href'}, -class=>"hash"},
+ substr($diffinfo->{'to_id'},0,7));
+ } else {
+ $to_link = '0' x 7;
+ }
+ my ($from_id, $to_id) = ($diffinfo->{'from_id'}, $diffinfo->{'to_id'});
+ $line =~ s!$from_id\.\.$to_id!$from_link..$to_link!;
+ }
+
+ return $line . "<br/>\n";
+}
+
+# format from-file/to-file diff header
+sub format_diff_from_to_header {
+ my ($from_line, $to_line, $diffinfo, $from, $to, @parents) = @_;
+ my $line;
+ my $result = '';
+
+ $line = $from_line;
+ #assert($line =~ m/^---/) if DEBUG;
+ # no extra formatting for "^--- /dev/null"
+ if (! $diffinfo->{'nparents'}) {
+ # ordinary (single parent) diff
+ if ($line =~ m!^--- "?a/!) {
+ if ($from->{'href'}) {
+ $line = '--- a/' .
+ $cgi->a({-href=>$from->{'href'}, -class=>"path"},
+ esc_path($from->{'file'}));
+ } else {
+ $line = '--- a/' .
+ esc_path($from->{'file'});
+ }
+ }
+ $result .= qq!<div class="diff from_file">$line</div>\n!;
+
+ } else {
+ # combined diff (merge commit)
+ for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
+ if ($from->{'href'}[$i]) {
+ $line = '--- ' .
+ $cgi->a({-href=>href(action=>"blobdiff",
+ hash_parent=>$diffinfo->{'from_id'}[$i],
+ hash_parent_base=>$parents[$i],
+ file_parent=>$from->{'file'}[$i],
+ hash=>$diffinfo->{'to_id'},
+ hash_base=>$hash,
+ file_name=>$to->{'file'}),
+ -class=>"path",
+ -title=>"diff" . ($i+1)},
+ $i+1) .
+ '/' .
+ $cgi->a({-href=>$from->{'href'}[$i], -class=>"path"},
+ esc_path($from->{'file'}[$i]));
+ } else {
+ $line = '--- /dev/null';
+ }
+ $result .= qq!<div class="diff from_file">$line</div>\n!;
+ }
+ }
+
+ $line = $to_line;
+ #assert($line =~ m/^\+\+\+/) if DEBUG;
+ # no extra formatting for "^+++ /dev/null"
+ if ($line =~ m!^\+\+\+ "?b/!) {
+ if ($to->{'href'}) {
+ $line = '+++ b/' .
+ $cgi->a({-href=>$to->{'href'}, -class=>"path"},
+ esc_path($to->{'file'}));
+ } else {
+ $line = '+++ b/' .
+ esc_path($to->{'file'});
+ }
+ }
+ $result .= qq!<div class="diff to_file">$line</div>\n!;
+
+ return $result;
+}
+
+# create note for patch simplified by combined diff
+sub format_diff_cc_simplified {
+ my ($diffinfo, @parents) = @_;
+ my $result = '';
+
+ $result .= "<div class=\"diff header\">" .
+ "diff --cc ";
+ if (!is_deleted($diffinfo)) {
+ $result .= $cgi->a({-href => href(action=>"blob",
+ hash_base=>$hash,
+ hash=>$diffinfo->{'to_id'},
+ file_name=>$diffinfo->{'to_file'}),
+ -class => "path"},
+ esc_path($diffinfo->{'to_file'}));
+ } else {
+ $result .= esc_path($diffinfo->{'to_file'});
+ }
+ $result .= "</div>\n" . # class="diff header"
+ "<div class=\"diff nodifferences\">" .
+ "Simple merge" .
+ "</div>\n"; # class="diff nodifferences"
+
+ return $result;
+}
+
+# format patch (diff) line (not to be used for diff headers)
sub format_diff_line {
my $line = shift;
my ($from, $to) = @_;
@@ -1680,6 +1873,48 @@ sub parse_ls_tree_line ($;%) {
return wantarray ? %res : \%res;
}
+# generates _two_ hashes, references to which are passed as 2 and 3 argument
+sub parse_from_to_diffinfo {
+ my ($diffinfo, $from, $to, @parents) = @_;
+
+ if ($diffinfo->{'nparents'}) {
+ # combined diff
+ $from->{'file'} = [];
+ $from->{'href'} = [];
+ fill_from_file_info($diffinfo, @parents)
+ unless exists $diffinfo->{'from_file'};
+ for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
+ $from->{'file'}[$i] = $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'};
+ if ($diffinfo->{'status'}[$i] ne "A") { # not new (added) file
+ $from->{'href'}[$i] = href(action=>"blob",
+ hash_base=>$parents[$i],
+ hash=>$diffinfo->{'from_id'}[$i],
+ file_name=>$from->{'file'}[$i]);
+ } else {
+ $from->{'href'}[$i] = undef;
+ }
+ }
+ } else {
+ $from->{'file'} = $diffinfo->{'from_file'} || $diffinfo->{'file'};
+ if ($diffinfo->{'status'} ne "A") { # not new (added) file
+ $from->{'href'} = href(action=>"blob", hash_base=>$hash_parent,
+ hash=>$diffinfo->{'from_id'},
+ file_name=>$from->{'file'});
+ } else {
+ delete $from->{'href'};
+ }
+ }
+
+ $to->{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
+ if (!is_deleted($diffinfo)) { # file exists in result
+ $to->{'href'} = href(action=>"blob", hash_base=>$hash,
+ hash=>$diffinfo->{'to_id'},
+ file_name=>$to->{'file'});
+ } else {
+ delete $to->{'href'};
+ }
+}
+
## ......................................................................
## parse to array of hashes functions
@@ -2387,6 +2622,11 @@ sub from_ids_eq {
}
}
+sub is_deleted {
+ my $diffinfo = shift;
+
+ return $diffinfo->{'to_id'} eq ('0' x 40);
+}
sub git_difftree_body {
my ($difftree, $hash, @parents) = @_;
@@ -2401,6 +2641,26 @@ sub git_difftree_body {
print "<table class=\"" .
(@parents > 1 ? "combined " : "") .
"diff_tree\">\n";
+
+ # header only for combined diff in 'commitdiff' view
+ my $has_header = @parents > 1 && $action eq 'commitdiff';
+ if ($has_header) {
+ # table header
+ print "<thead><tr>\n" .
+ "<th></th><th></th>\n"; # filename, patchN link
+ for (my $i = 0; $i < @parents; $i++) {
+ my $par = $parents[$i];
+ print "<th>" .
+ $cgi->a({-href => href(action=>"commitdiff",
+ hash=>$hash, hash_parent=>$par),
+ -title => 'commitdiff to parent number ' .
+ ($i+1) . ': ' . substr($par,0,7)},
+ $i+1) .
+ "&nbsp;</th>\n";
+ }
+ print "</tr></thead>\n<tbody>\n";
+ }
+
my $alternate = 1;
my $patchno = 0;
foreach my $line (@{$difftree}) {
@@ -2424,7 +2684,7 @@ sub git_difftree_body {
fill_from_file_info($diff, @parents)
unless exists $diff->{'from_file'};
- if ($diff->{'to_id'} ne ('0' x 40)) {
+ if (!is_deleted($diff)) {
# file exists in the result (child) commit
print "<td>" .
$cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
@@ -2673,6 +2933,7 @@ sub git_difftree_body {
} # we should not encounter Unmerged (U) or Unknown (X) status
print "</tr>\n";
}
+ print "</tbody>" if $has_header;
print "</table>\n";
}
@@ -2737,13 +2998,35 @@ sub git_patchset_body {
# advance raw git-diff output if needed
$patch_idx++ if defined $diffinfo;
- # read and prepare patch information
- if (ref($difftree->[$patch_idx]) eq "HASH") {
- # pre-parsed (or generated by hand)
- $diffinfo = $difftree->[$patch_idx];
- } else {
- $diffinfo = parse_difftree_raw_line($difftree->[$patch_idx]);
+ # compact combined diff output can have some patches skipped
+ # find which patch (using pathname of result) we are at now
+ my $to_name;
+ if ($diff_header[0] =~ m!^diff --cc "?(.*)"?$!) {
+ $to_name = $1;
}
+
+ do {
+ # read and prepare patch information
+ if (ref($difftree->[$patch_idx]) eq "HASH") {
+ # pre-parsed (or generated by hand)
+ $diffinfo = $difftree->[$patch_idx];
+ } else {
+ $diffinfo = parse_difftree_raw_line($difftree->[$patch_idx]);
+ }
+
+ # check if current raw line has no patch (it got simplified)
+ if (defined $to_name && $to_name ne $diffinfo->{'to_file'}) {
+ print "<div class=\"patch\" id=\"patch". ($patch_idx+1) ."\">\n" .
+ format_diff_cc_simplified($diffinfo, @hash_parents) .
+ "</div>\n"; # class="patch"
+
+ $patch_idx++;
+ $patch_number++;
+ }
+ } until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||
+ $patch_idx > $#$difftree);
+ # modifies %from, %to hashes
+ parse_from_to_diffinfo($diffinfo, \%from, \%to, @hash_parents);
if ($diffinfo->{'nparents'}) {
# combined diff
$from{'file'} = [];
@@ -2773,7 +3056,7 @@ sub git_patchset_body {
}
$to{'file'} = $diffinfo->{'to_file'} || $diffinfo->{'file'};
- if ($diffinfo->{'to_id'} ne ('0' x 40)) { # file exists in result
+ if (!is_deleted($diffinfo)) { # file exists in result
$to{'href'} = href(action=>"blob", hash_base=>$hash,
hash=>$diffinfo->{'to_id'},
file_name=>$to{'file'});
@@ -2787,105 +3070,15 @@ sub git_patchset_body {
# print "git diff" header
$patch_line = shift @diff_header;
- if ($diffinfo->{'nparents'}) {
-
- # combined diff
- $patch_line =~ s!^(diff (.*?) )"?.*$!$1!;
- if ($to{'href'}) {
- $patch_line .= $cgi->a({-href => $to{'href'}, -class => "path"},
- esc_path($to{'file'}));
- } else { # file was deleted
- $patch_line .= esc_path($to{'file'});
- }
-
- } else {
-
- $patch_line =~ s!^(diff (.*?) )"?a/.*$!$1!;
- if ($from{'href'}) {
- $patch_line .= $cgi->a({-href => $from{'href'}, -class => "path"},
- 'a/' . esc_path($from{'file'}));
- } else { # file was added
- $patch_line .= 'a/' . esc_path($from{'file'});
- }
- $patch_line .= ' ';
- if ($to{'href'}) {
- $patch_line .= $cgi->a({-href => $to{'href'}, -class => "path"},
- 'b/' . esc_path($to{'file'}));
- } else { # file was deleted
- $patch_line .= 'b/' . esc_path($to{'file'});
- }
-
- }
- print "<div class=\"diff header\">$patch_line</div>\n";
+ print format_git_diff_header_line($patch_line, $diffinfo,
+ \%from, \%to);
# print extended diff header
print "<div class=\"diff extended_header\">\n" if (@diff_header > 0);
EXTENDED_HEADER:
foreach $patch_line (@diff_header) {
- # match <path>
- if ($patch_line =~ s!^((copy|rename) from ).*$!$1! && $from{'href'}) {
- $patch_line .= $cgi->a({-href=>$from{'href'}, -class=>"path"},
- esc_path($from{'file'}));
- }
- if ($patch_line =~ s!^((copy|rename) to ).*$!$1! && $to{'href'}) {
- $patch_line .= $cgi->a({-href=>$to{'href'}, -class=>"path"},
- esc_path($to{'file'}));
- }
- # match single <mode>
- if ($patch_line =~ m/\s(\d{6})$/) {
- $patch_line .= '<span class="info"> (' .
- file_type_long($1) .
- ')</span>';
- }
- # match <hash>
- if ($patch_line =~ m/^index [0-9a-fA-F]{40},[0-9a-fA-F]{40}/) {
- # can match only for combined diff
- $patch_line = 'index ';
- for (my $i = 0; $i < $diffinfo->{'nparents'}; $i++) {
- if ($from{'href'}[$i]) {
- $patch_line .= $cgi->a({-href=>$from{'href'}[$i],
- -class=>"hash"},
- substr($diffinfo->{'from_id'}[$i],0,7));
- } else {
- $patch_line .= '0' x 7;
- }
- # separator
- $patch_line .= ',' if ($i < $diffinfo->{'nparents'} - 1);
- }
- $patch_line .= '..';
- if ($to{'href'}) {
- $patch_line .= $cgi->a({-href=>$to{'href'}, -class=>"hash"},
- substr($diffinfo->{'to_id'},0,7));
- } else {
- $patch_line .= '0' x 7;
- }
-
- } elsif ($patch_line =~ m/^index [0-9a-fA-F]{40}..[0-9a-fA-F]{40}/) {
- # can match only for ordinary diff
- my ($from_link, $to_link);
- if ($from{'href'}) {
- $from_link = $cgi->a({-href=>$from{'href'}, -class=>"hash"},
- substr($diffinfo->{'from_id'},0,7));
- } else {
- $from_link = '0' x 7;
- }
- if ($to{'href'}) {
- $to_link = $cgi->a({-href=>$to{'href'}, -class=>"hash"},
- substr($diffinfo->{'to_id'},0,7));
- } else {
- $to_link = '0' x 7;
- }
- #affirm {
- # my ($from_hash, $to_hash) =
- # ($patch_line =~ m/^index ([0-9a-fA-F]{40})..([0-9a-fA-F]{40})/);
- # my ($from_id, $to_id) =
- # ($diffinfo->{'from_id'}, $diffinfo->{'to_id'});
- # ($from_hash eq $from_id) && ($to_hash eq $to_id);
- #} if DEBUG;
- my ($from_id, $to_id) = ($diffinfo->{'from_id'}, $diffinfo->{'to_id'});
- $patch_line =~ s!$from_id\.\.$to_id!$from_link..$to_link!;
- }
- print $patch_line . "<br/>\n";
+ print format_extended_diff_header_line($patch_line, $diffinfo,
+ \%from, \%to);
}
print "</div>\n" if (@diff_header > 0); # class="diff extended_header"
@@ -2897,24 +3090,15 @@ sub git_patchset_body {
}
next PATCH if ($patch_line =~ m/^diff /);
#assert($patch_line =~ m/^---/) if DEBUG;
- if (!$diffinfo->{'nparents'} && # not from-file line for combined diff
- $from{'href'} && $patch_line =~ m!^--- "?a/!) {
- $patch_line = '--- a/' .
- $cgi->a({-href=>$from{'href'}, -class=>"path"},
- esc_path($from{'file'}));
- }
- print "<div class=\"diff from_file\">$patch_line</div>\n";
+ #assert($patch_line eq $last_patch_line) if DEBUG;
$patch_line = <$fd>;
chomp $patch_line;
+ #assert($patch_line =~ m/^\+\+\+/) if DEBUG;
- #assert($patch_line =~ m/^+++/) if DEBUG;
- if ($to{'href'} && $patch_line =~ m!^\+\+\+ "?b/!) {
- $patch_line = '+++ b/' .
- $cgi->a({-href=>$to{'href'}, -class=>"path"},
- esc_path($to{'file'}));
- }
- print "<div class=\"diff to_file\">$patch_line</div>\n";
+ print format_diff_from_to_header($last_patch_line, $patch_line,
+ $diffinfo, \%from, \%to,
+ @hash_parents);
# the patch itself
LINE:
@@ -2930,6 +3114,27 @@ sub git_patchset_body {
print "</div>\n"; # class="patch"
}
+ # for compact combined (--cc) format, with chunk and patch simpliciaction
+ # patchset might be empty, but there might be unprocessed raw lines
+ for ($patch_idx++ if $patch_number > 0;
+ $patch_idx < @$difftree;
+ $patch_idx++) {
+ # read and prepare patch information
+ if (ref($difftree->[$patch_idx]) eq "HASH") {
+ # pre-parsed (or generated by hand)
+ $diffinfo = $difftree->[$patch_idx];
+ } else {
+ $diffinfo = parse_difftree_raw_line($difftree->[$patch_idx]);
+ }
+
+ # generate anchor for "patch" links in difftree / whatchanged part
+ print "<div class=\"patch\" id=\"patch". ($patch_idx+1) ."\">\n" .
+ format_diff_cc_simplified($diffinfo, @hash_parents) .
+ "</div>\n"; # class="patch"
+
+ $patch_number++;
+ }
+
if ($patch_number == 0) {
if (@hash_parents > 1) {
print "<div class=\"diff nodifferences\">Trivial merge</div>\n";
@@ -4443,7 +4648,11 @@ sub git_commitdiff {
die_error(undef, "Unknown commit object");
}
- # we need to prepare $formats_nav before any parameter munging
+ # choose format for commitdiff for merge
+ if (! defined $hash_parent && @{$co{'parents'}} > 1) {
+ $hash_parent = '--cc';
+ }
+ # we need to prepare $formats_nav before almost any parameter munging
my $formats_nav;
if ($format eq 'html') {
$formats_nav =
@@ -4451,14 +4660,22 @@ sub git_commitdiff {
hash=>$hash, hash_parent=>$hash_parent)},
"raw");
- if (defined $hash_parent) {
+ if (defined $hash_parent &&
+ $hash_parent ne '-c' && $hash_parent ne '--cc') {
# commitdiff with two commits given
my $hash_parent_short = $hash_parent;
if ($hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
$hash_parent_short = substr($hash_parent, 0, 7);
}
$formats_nav .=
- ' (from: ' .
+ ' (from';
+ for (my $i = 0; $i < @{$co{'parents'}}; $i++) {
+ if ($co{'parents'}[$i] eq $hash_parent) {
+ $formats_nav .= ' parent ' . ($i+1);
+ last;
+ }
+ }
+ $formats_nav .= ': ' .
$cgi->a({-href => href(action=>"commitdiff",
hash=>$hash_parent)},
esc_html($hash_parent_short)) .
@@ -4476,6 +4693,17 @@ sub git_commitdiff {
')';
} else {
# merge commit
+ if ($hash_parent eq '--cc') {
+ $formats_nav .= ' | ' .
+ $cgi->a({-href => href(action=>"commitdiff",
+ hash=>$hash, hash_parent=>'-c')},
+ 'combined');
+ } else { # $hash_parent eq '-c'
+ $formats_nav .= ' | ' .
+ $cgi->a({-href => href(action=>"commitdiff",
+ hash=>$hash, hash_parent=>'--cc')},
+ 'compact');
+ }
$formats_nav .=
' (merge: ' .
join(' ', map {
@@ -4488,9 +4716,10 @@ sub git_commitdiff {
}
my $hash_parent_param = $hash_parent;
- if (!defined $hash_parent) {
+ if (!defined $hash_parent_param) {
+ # --cc for multiple parents, --root for parentless
$hash_parent_param =
- @{$co{'parents'}} > 1 ? '-c' : $co{'parent'} || '--root';
+ @{$co{'parents'}} > 1 ? '--cc' : $co{'parent'} || '--root';
}
# read commitdiff
@@ -4567,10 +4796,14 @@ TEXT
# write patch
if ($format eq 'html') {
- git_difftree_body(\@difftree, $hash, $hash_parent || @{$co{'parents'}});
+ my $use_parents = !defined $hash_parent ||
+ $hash_parent eq '-c' || $hash_parent eq '--cc';
+ git_difftree_body(\@difftree, $hash,
+ $use_parents ? @{$co{'parents'}} : $hash_parent);
print "<br/>\n";
- git_patchset_body($fd, \@difftree, $hash, $hash_parent || @{$co{'parents'}});
+ git_patchset_body($fd, \@difftree, $hash,
+ $use_parents ? @{$co{'parents'}} : $hash_parent);
close $fd;
print "</div>\n"; # class="page_body"
git_footer_html();
diff --git a/help.c b/help.c
index 6a9af4d175..1cd33ece6b 100644
--- a/help.c
+++ b/help.c
@@ -219,5 +219,3 @@ int cmd_help(int argc, const char **argv, const char *prefix)
return 0;
}
-
-
diff --git a/http-fetch.c b/http-fetch.c
index 09baedc18a..202fae0ba8 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -828,7 +828,7 @@ static void abort_object_request(struct object_request *obj_req)
}
unlink(obj_req->tmpfile);
if (obj_req->slot) {
- release_active_slot(obj_req->slot);
+ release_active_slot(obj_req->slot);
obj_req->slot = NULL;
}
release_object_request(obj_req);
diff --git a/http-push.c b/http-push.c
index 79d2c38608..7c3720f602 100644
--- a/http-push.c
+++ b/http-push.c
@@ -518,7 +518,7 @@ static void start_put(struct transfer_request *request)
request->buffer.size = stream.total_out;
request->buffer.posn = 0;
- request->url = xmalloc(strlen(remote->url) +
+ request->url = xmalloc(strlen(remote->url) +
strlen(request->lock->token) + 51);
strcpy(request->url, remote->url);
posn = request->url + strlen(remote->url);
diff --git a/http.c b/http.c
index ae27e0c940..c6fb8ace9f 100644
--- a/http.c
+++ b/http.c
@@ -137,7 +137,7 @@ static int http_options(const char *var, const char *value)
return 0;
}
-#ifdef USE_CURL_MULTI
+#ifdef USE_CURL_MULTI
if (!strcmp("http.maxrequests", var)) {
if (max_requests == -1)
max_requests = git_config_int(var, value);
diff --git a/imap-send.c b/imap-send.c
index 4283a4acda..a5a0696084 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1239,7 +1239,7 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs )
msg->data[ msg->len ] = 0;
*ofs += msg->len;
- return 1;
+ return 1;
}
static imap_server_conf_t server =
diff --git a/local-fetch.c b/local-fetch.c
index 4b650efa8b..bf7ec6c2a3 100644
--- a/local-fetch.c
+++ b/local-fetch.c
@@ -114,7 +114,7 @@ static int fetch_pack(const unsigned char *sha1)
return -1;
target = find_sha1_pack(sha1, packs);
if (!target)
- return error("Couldn't find %s: not separate or in any pack",
+ return error("Couldn't find %s: not separate or in any pack",
sha1_to_hex(sha1));
if (get_verbosely) {
fprintf(stderr, "Getting pack %s\n",
@@ -122,11 +122,11 @@ static int fetch_pack(const unsigned char *sha1)
fprintf(stderr, " which contains %s\n",
sha1_to_hex(sha1));
}
- sprintf(filename, "%s/objects/pack/pack-%s.pack",
+ sprintf(filename, "%s/objects/pack/pack-%s.pack",
path, sha1_to_hex(target->sha1));
copy_file(filename, sha1_pack_name(target->sha1),
sha1_to_hex(target->sha1), 1);
- sprintf(filename, "%s/objects/pack/pack-%s.idx",
+ sprintf(filename, "%s/objects/pack/pack-%s.idx",
path, sha1_to_hex(target->sha1));
copy_file(filename, sha1_pack_index_name(target->sha1),
sha1_to_hex(target->sha1), 1);
@@ -141,7 +141,7 @@ static int fetch_file(const unsigned char *sha1)
char *hex = sha1_to_hex(sha1);
char *dest_filename = sha1_file_name(sha1);
- if (object_name_start < 0) {
+ if (object_name_start < 0) {
strcpy(filename, path); /* e.g. git.git */
strcat(filename, "/objects/");
object_name_start = strlen(filename);
diff --git a/lockfile.c b/lockfile.c
index 23db35aff2..5ad2858b48 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -97,4 +97,3 @@ void rollback_lock_file(struct lock_file *lk)
unlink(lk->filename);
lk->filename[0] = 0;
}
-
diff --git a/mailmap.c b/mailmap.c
index cb567a2832..8714167059 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -89,4 +89,3 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)
}
return 0;
}
-
diff --git a/match-trees.c b/match-trees.c
index 23cafe47b4..d7e29c4d1d 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -301,4 +301,3 @@ void shift_tree(const unsigned char *hash1,
splice_tree(hash1, add_prefix, hash2, shifted);
}
-
diff --git a/merge-index.c b/merge-index.c
index 5599fd321b..fa719cb0b1 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -25,7 +25,7 @@ static void run_program(void)
static int merge_entry(int pos, const char *path)
{
int found;
-
+
if (pos >= active_nr)
die("git-merge-index: %s not in the cache", path);
arguments[0] = pgm;
diff --git a/mktag.c b/mktag.c
index 931011121e..b82e377bd8 100644
--- a/mktag.c
+++ b/mktag.c
@@ -11,16 +11,9 @@
* The first three lines are guaranteed to be at least 63 bytes:
* "object <sha1>\n" is 48 bytes, "type tag\n" at 9 bytes is the
* shortest possible type-line, and "tag .\n" at 6 bytes is the
- * shortest single-character-tag line.
- *
- * We also artificially limit the size of the full object to 8kB.
- * Just because I'm a lazy bastard, and if you can't fit a signature
- * in that size, you're doing something wrong.
+ * shortest single-character-tag line.
*/
-/* Some random size */
-#define MAXSIZE (8192)
-
/*
* We refuse to tag something we can't verify. Just because.
*/
diff --git a/mozilla-sha1/sha1.c b/mozilla-sha1/sha1.c
index 847531d19f..3f06b83567 100644
--- a/mozilla-sha1/sha1.c
+++ b/mozilla-sha1/sha1.c
@@ -1,29 +1,29 @@
-/*
+/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
- *
+ *
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
- *
+ *
* The Original Code is SHA 180-1 Reference Implementation (Compact version)
- *
+ *
* The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
+ * Cryptography Research. Portions created by Paul Kocher are
* Copyright (C) 1995-9 by Cryptography Research, Inc. All
* Rights Reserved.
- *
+ *
* Contributor(s):
*
* Paul Kocher
- *
+ *
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
+ * "GPL"), in which case the provisions of the GPL are applicable
+ * instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
@@ -149,4 +149,3 @@ static void shaHashBlock(SHA_CTX *ctx) {
ctx->H[3] += D;
ctx->H[4] += E;
}
-
diff --git a/mozilla-sha1/sha1.h b/mozilla-sha1/sha1.h
index 5d82afa3bd..16f2d3d43c 100644
--- a/mozilla-sha1/sha1.h
+++ b/mozilla-sha1/sha1.h
@@ -1,29 +1,29 @@
-/*
+/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
- *
+ *
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
- *
+ *
* The Original Code is SHA 180-1 Header File
- *
+ *
* The Initial Developer of the Original Code is Paul Kocher of
- * Cryptography Research. Portions created by Paul Kocher are
+ * Cryptography Research. Portions created by Paul Kocher are
* Copyright (C) 1995-9 by Cryptography Research, Inc. All
* Rights Reserved.
- *
+ *
* Contributor(s):
*
* Paul Kocher
- *
+ *
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
- * "GPL"), in which case the provisions of the GPL are applicable
- * instead of those above. If you wish to allow use of your
+ * "GPL"), in which case the provisions of the GPL are applicable
+ * instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
diff --git a/object-refs.c b/object-refs.c
index 022e8d841c..5345671569 100644
--- a/object-refs.c
+++ b/object-refs.c
@@ -85,5 +85,3 @@ void mark_reachable(struct object *obj, unsigned int mask)
mark_reachable(refs->ref[i], mask);
}
}
-
-
diff --git a/object.c b/object.c
index cfc4969ed9..16793d9958 100644
--- a/object.c
+++ b/object.c
@@ -160,8 +160,11 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
parse_tag_buffer(tag, buffer, size);
obj = &tag->object;
} else {
+ warning("object %s has unknown type id %d\n", sha1_to_hex(sha1), type);
obj = NULL;
}
+ if (obj && obj->type == OBJ_NONE)
+ obj->type = type;
*eaten_p = eaten;
return obj;
}
diff --git a/object.h b/object.h
index 94f19eed86..397bbfa090 100644
--- a/object.h
+++ b/object.h
@@ -66,7 +66,7 @@ void set_object_refs(struct object *obj, struct object_refs *refs);
void mark_reachable(struct object *obj, unsigned int mask);
-struct object_list *object_list_insert(struct object *item,
+struct object_list *object_list_insert(struct object *item,
struct object_list **list_p);
void object_list_append(struct object *item,
diff --git a/pack-check.c b/pack-check.c
index 3623c716e3..d7dd62bb83 100644
--- a/pack-check.c
+++ b/pack-check.c
@@ -1,6 +1,23 @@
#include "cache.h"
#include "pack.h"
+struct idx_entry
+{
+ const unsigned char *sha1;
+ off_t offset;
+};
+
+static int compare_entries(const void *e1, const void *e2)
+{
+ const struct idx_entry *entry1 = e1;
+ const struct idx_entry *entry2 = e2;
+ if (entry1->offset < entry2->offset)
+ return -1;
+ if (entry1->offset > entry2->offset)
+ return 1;
+ return 0;
+}
+
static int verify_packfile(struct packed_git *p,
struct pack_window **w_curs)
{
@@ -11,6 +28,7 @@ static int verify_packfile(struct packed_git *p,
off_t offset = 0, pack_sig = p->pack_size - 20;
uint32_t nr_objects, i;
int err;
+ struct idx_entry *entries;
/* Note that the pack header checks are actually performed by
* use_pack when it first opens the pack file. If anything
@@ -41,33 +59,38 @@ static int verify_packfile(struct packed_git *p,
* we do not do scan-streaming check on the pack file.
*/
nr_objects = p->num_objects;
+ entries = xmalloc(nr_objects * sizeof(*entries));
+ /* first sort entries by pack offset, since unpacking them is more efficient that way */
+ for (i = 0; i < nr_objects; i++) {
+ entries[i].sha1 = nth_packed_object_sha1(p, i);
+ if (!entries[i].sha1)
+ die("internal error pack-check nth-packed-object");
+ entries[i].offset = find_pack_entry_one(entries[i].sha1, p);
+ if (!entries[i].offset)
+ die("internal error pack-check find-pack-entry-one");
+ }
+ qsort(entries, nr_objects, sizeof(*entries), compare_entries);
+
for (i = 0, err = 0; i < nr_objects; i++) {
- const unsigned char *sha1;
void *data;
enum object_type type;
unsigned long size;
- off_t offset;
- sha1 = nth_packed_object_sha1(p, i);
- if (!sha1)
- die("internal error pack-check nth-packed-object");
- offset = find_pack_entry_one(sha1, p);
- if (!offset)
- die("internal error pack-check find-pack-entry-one");
- data = unpack_entry(p, offset, &type, &size);
+ data = unpack_entry(p, entries[i].offset, &type, &size);
if (!data) {
err = error("cannot unpack %s from %s",
- sha1_to_hex(sha1), p->pack_name);
+ sha1_to_hex(entries[i].sha1), p->pack_name);
continue;
}
- if (check_sha1_signature(sha1, data, size, typename(type))) {
+ if (check_sha1_signature(entries[i].sha1, data, size, typename(type))) {
err = error("packed %s from %s is corrupt",
- sha1_to_hex(sha1), p->pack_name);
+ sha1_to_hex(entries[i].sha1), p->pack_name);
free(data);
continue;
}
free(data);
}
+ free(entries);
return err;
}
diff --git a/pack-redundant.c b/pack-redundant.c
index 6bc3bdf3f4..f5cd0ac59e 100644
--- a/pack-redundant.c
+++ b/pack-redundant.c
@@ -81,7 +81,7 @@ static struct llist * llist_copy(struct llist *list)
{
struct llist *ret;
struct llist_item *new, *old, *prev;
-
+
llist_init(&ret);
if ((ret->size = list->size) == 0)
@@ -100,7 +100,7 @@ static struct llist * llist_copy(struct llist *list)
}
new->next = NULL;
ret->back = new;
-
+
return ret;
}
diff --git a/patch-id.c b/patch-id.c
index 086d2d9c68..9349bc5580 100644
--- a/patch-id.c
+++ b/patch-id.c
@@ -81,4 +81,4 @@ int main(int argc, char **argv)
generate_id_list();
return 0;
-}
+}
diff --git a/path-list.c b/path-list.c
index caaa5cc57b..dcb4b3ac13 100644
--- a/path-list.c
+++ b/path-list.c
@@ -100,4 +100,3 @@ void print_path_list(const char *text, const struct path_list *p)
for (i = 0; i < p->nr; i++)
printf("%s:%p\n", p->items[i].path, p->items[i].util);
}
-
diff --git a/perl/Makefile b/perl/Makefile
index 0d695fd2f3..5e079ad011 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -40,4 +40,3 @@ endif
# (even though GIT-CFLAGS aren't used yet. If ever)
../GIT-CFLAGS:
$(MAKE) -C .. GIT-CFLAGS
-
diff --git a/pkt-line.c b/pkt-line.c
index b60526869a..355546a1ad 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -5,7 +5,7 @@
* Write a packetized stream, where each line is preceded by
* its length (including the header) as a 4-byte hex number.
* A length of 'zero' means end of stream (and a length of 1-3
- * would be an error).
+ * would be an error).
*
* This is all pretty stupid, but we use this packetized line
* format to make a streaming format possible without ever
diff --git a/ppc/sha1.c b/ppc/sha1.c
index 0820398b00..738e36c1e8 100644
--- a/ppc/sha1.c
+++ b/ppc/sha1.c
@@ -50,7 +50,7 @@ int SHA1_Update(SHA_CTX *c, const void *ptr, unsigned long n)
p += nb;
}
return 0;
-}
+}
int SHA1_Final(unsigned char *hash, SHA_CTX *c)
{
diff --git a/quote.c b/quote.c
index fb9e4ca253..aa440098e1 100644
--- a/quote.c
+++ b/quote.c
@@ -20,7 +20,7 @@ static inline int need_bs_quote(char c)
return (c == '\'' || c == '!');
}
-size_t sq_quote_buf(char *dst, size_t n, const char *src)
+static size_t sq_quote_buf(char *dst, size_t n, const char *src)
{
char c;
char *bp = dst;
@@ -62,18 +62,6 @@ void sq_quote_print(FILE *stream, const char *src)
fputc('\'', stream);
}
-char *sq_quote(const char *src)
-{
- char *buf;
- size_t cnt;
-
- cnt = sq_quote_buf(NULL, 0, src) + 1;
- buf = xmalloc(cnt);
- sq_quote_buf(buf, cnt, src);
-
- return buf;
-}
-
char *sq_quote_argv(const char** argv, int count)
{
char *buf, *to;
diff --git a/quote.h b/quote.h
index bdc3610df5..8a59cc55d1 100644
--- a/quote.h
+++ b/quote.h
@@ -28,9 +28,7 @@
* excluding the final null regardless of the buffer size.
*/
-extern char *sq_quote(const char *src);
extern void sq_quote_print(FILE *stream, const char *src);
-extern size_t sq_quote_buf(char *dst, size_t n, const char *src);
extern char *sq_quote_argv(const char** argv, int count);
/*
diff --git a/read-cache.c b/read-cache.c
index ad4e187537..4362b11f47 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -166,7 +166,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
changed |= MTIME_CHANGED;
if (ce->ce_ctime.nsec != htonl(st->st_ctim.tv_nsec))
changed |= CTIME_CHANGED;
-#endif
+#endif
if (ce->ce_uid != htonl(st->st_uid) ||
ce->ce_gid != htonl(st->st_gid))
@@ -597,7 +597,7 @@ static int has_dir_name(struct index_state *istate,
* is being added, or we already have path and path/file is being
* added. Either one would result in a nonsense tree that has path
* twice when git-write-tree tries to write it out. Prevent it.
- *
+ *
* If ok-to-replace is specified, we remove the conflicting entries
* from the cache so the caller should recompute the insert position.
* When this happens, we return non-zero.
@@ -970,8 +970,8 @@ static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
write_buffer_len = buffered;
len -= partial;
data = (char *) data + partial;
- }
- return 0;
+ }
+ return 0;
}
static int write_index_ext_header(SHA_CTX *context, int fd,
@@ -1037,7 +1037,7 @@ static void ce_smudge_racily_clean_entry(struct cache_entry *ce)
* size to zero here, then the object name recorded
* in index is the 6-byte file but the cached stat information
* becomes zero --- which would then match what we would
- * obtain from the filesystem next time we stat("frotz").
+ * obtain from the filesystem next time we stat("frotz").
*
* However, the second update-index, before calling
* this function, notices that the cached size is 6
diff --git a/remote.c b/remote.c
index d904616cdb..33c8e5055b 100644
--- a/remote.c
+++ b/remote.c
@@ -501,16 +501,16 @@ static struct ref *find_ref_by_name(struct ref *list, const char *name)
return NULL;
}
-static int check_pattern_match(struct refspec *rs, int rs_nr, struct ref *src)
+static const struct refspec *check_pattern_match(const struct refspec *rs,
+ int rs_nr,
+ const struct ref *src)
{
int i;
- if (!rs_nr)
- return 1;
for (i = 0; i < rs_nr; i++) {
if (rs[i].pattern && !prefixcmp(src->name, rs[i].src))
- return 1;
+ return rs + i;
}
- return 0;
+ return NULL;
}
int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
@@ -525,29 +525,44 @@ int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
/* pick the remainder */
for ( ; src; src = src->next) {
struct ref *dst_peer;
+ const struct refspec *pat = NULL;
+ char *dst_name;
if (src->peer_ref)
continue;
- if (!check_pattern_match(rs, nr_refspec, src))
- continue;
+ if (nr_refspec) {
+ pat = check_pattern_match(rs, nr_refspec, src);
+ if (!pat)
+ continue;
+ }
- dst_peer = find_ref_by_name(dst, src->name);
+ if (pat) {
+ dst_name = xmalloc(strlen(pat->dst) +
+ strlen(src->name) -
+ strlen(pat->src) + 2);
+ strcpy(dst_name, pat->dst);
+ strcat(dst_name, src->name + strlen(pat->src));
+ } else
+ dst_name = strdup(src->name);
+ dst_peer = find_ref_by_name(dst, dst_name);
if (dst_peer && dst_peer->peer_ref)
/* We're already sending something to this ref. */
- continue;
+ goto free_name;
if (!dst_peer && !nr_refspec && !all)
/* Remote doesn't have it, and we have no
* explicit pattern, and we don't have
* --all. */
- continue;
+ goto free_name;
if (!dst_peer) {
/* Create a new one and link it */
- int len = strlen(src->name) + 1;
+ int len = strlen(dst_name) + 1;
dst_peer = xcalloc(1, sizeof(*dst_peer) + len);
- memcpy(dst_peer->name, src->name, len);
+ memcpy(dst_peer->name, dst_name, len);
hashcpy(dst_peer->new_sha1, src->new_sha1);
link_dst_tail(dst_peer, dst_tail);
}
dst_peer->peer_ref = src;
+ free_name:
+ free(dst_name);
}
return 0;
}
diff --git a/revision.c b/revision.c
index 0a29b53673..b12c25e2b0 100644
--- a/revision.c
+++ b/revision.c
@@ -114,12 +114,7 @@ void mark_parents_uninteresting(struct commit *commit)
}
}
-void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
-{
- add_pending_object_with_mode(revs, obj, name, S_IFINVALID);
-}
-
-void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)
+static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)
{
if (revs->no_walk && (obj->flags & UNINTERESTING))
die("object ranges do not make sense when not walking revisions");
@@ -129,6 +124,11 @@ void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, con
(struct commit *)obj, name);
}
+void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
+{
+ add_pending_object_with_mode(revs, obj, name, S_IFINVALID);
+}
+
static struct object *get_reference(struct rev_info *revs, const char *name, const unsigned char *sha1, unsigned int flags)
{
struct object *object;
@@ -262,7 +262,7 @@ static void file_change(struct diff_options *options,
options->has_changes = 1;
}
-int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2)
+static int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2)
{
if (!t1)
return REV_TREE_NEW;
@@ -276,7 +276,7 @@ int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2)
return tree_difference;
}
-int rev_same_tree_as_empty(struct rev_info *revs, struct tree *t1)
+static int rev_same_tree_as_empty(struct rev_info *revs, struct tree *t1)
{
int retval;
void *tree;
diff --git a/revision.h b/revision.h
index 2845167746..f46b4d55a2 100644
--- a/revision.h
+++ b/revision.h
@@ -106,8 +106,6 @@ struct rev_info {
#define REV_TREE_DIFFERENT 2
/* revision.c */
-extern int rev_same_tree_as_empty(struct rev_info *, struct tree *t1);
-extern int rev_compare_tree(struct rev_info *, struct tree *t1, struct tree *t2);
extern void init_revisions(struct rev_info *revs, const char *prefix);
extern int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def);
@@ -131,6 +129,5 @@ extern void add_object(struct object *obj,
const char *name);
extern void add_pending_object(struct rev_info *revs, struct object *obj, const char *name);
-extern void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode);
#endif
diff --git a/rsh.h b/rsh.h
index 3b4194239d..ee2f499291 100644
--- a/rsh.h
+++ b/rsh.h
@@ -1,7 +1,7 @@
#ifndef RSH_H
#define RSH_H
-int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,
+int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,
char *url, int rmt_argc, char **rmt_argv);
#endif
diff --git a/setup.c b/setup.c
index a45ea8309a..14f62c42e3 100644
--- a/setup.c
+++ b/setup.c
@@ -39,7 +39,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
if (len) {
int speclen = strlen(path);
char *n = xmalloc(speclen + len + 1);
-
+
memcpy(n, prefix, len);
memcpy(n + len, path, speclen+1);
path = n;
@@ -47,7 +47,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
return path;
}
-/*
+/*
* Unlike prefix_path, this should be used if the named file does
* not have to interact with index entry; i.e. name of a random file
* on the filesystem.
diff --git a/sha1_file.c b/sha1_file.c
index 30bcd46ceb..2b860868f5 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -193,7 +193,7 @@ char *sha1_pack_name(const unsigned char *sha1)
*buf++ = hex[val >> 4];
*buf++ = hex[val & 0xf];
}
-
+
return base;
}
@@ -218,7 +218,7 @@ char *sha1_pack_index_name(const unsigned char *sha1)
*buf++ = hex[val >> 4];
*buf++ = hex[val & 0xf];
}
-
+
return base;
}
@@ -1139,7 +1139,7 @@ static int parse_sha1_header(const char *hdr, unsigned long *sizep)
unsigned long size;
/*
- * The type can be at most ten bytes (including the
+ * The type can be at most ten bytes (including the
* terminating '\0' that we add), and is followed by
* a space.
*/
@@ -1738,7 +1738,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, cons
return 0;
}
-struct packed_git *find_sha1_pack(const unsigned char *sha1,
+struct packed_git *find_sha1_pack(const unsigned char *sha1,
struct packed_git *packs)
{
struct packed_git *p;
diff --git a/sha1_name.c b/sha1_name.c
index 7df01af788..858f08c34a 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -682,8 +682,6 @@ int get_sha1_with_mode(const char *name, unsigned char *sha1, unsigned *mode)
namelen = namelen - (cp - name);
if (!active_cache)
read_cache();
- if (active_nr < 0)
- return -1;
pos = cache_name_pos(cp, namelen);
if (pos < 0)
pos = -pos - 1;
diff --git a/shallow.c b/shallow.c
index d17868929c..dbd9f5ad0a 100644
--- a/shallow.c
+++ b/shallow.c
@@ -101,4 +101,3 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
return result;
}
-
diff --git a/ssh-upload.c b/ssh-upload.c
index 498d41e19b..20c35f03dd 100644
--- a/ssh-upload.c
+++ b/ssh-upload.c
@@ -29,24 +29,24 @@ static int serve_object(int fd_in, int fd_out) {
}
if (!size)
return -1;
-
+
if (verbose)
fprintf(stderr, "Serving %s\n", sha1_to_hex(sha1));
remote = 0;
-
+
if (!has_sha1_file(sha1)) {
fprintf(stderr, "git-ssh-upload: could not find %s\n",
sha1_to_hex(sha1));
remote = -1;
}
-
+
if (write_in_full(fd_out, &remote, 1) != 1)
return 0;
-
+
if (remote < 0)
return 0;
-
+
return write_sha1_to_fd(fd_out, sha1);
}
diff --git a/strbuf.c b/strbuf.c
index 7f14b0fb59..e33d06b87c 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -39,4 +39,3 @@ void read_line(struct strbuf *sb, FILE *fp, int term) {
sb->eof = 1;
strbuf_end(sb);
}
-
diff --git a/t/Makefile b/t/Makefile
index 19e38508a7..b25caca887 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -28,4 +28,3 @@ full-svn-test:
.PHONY: $(T) clean
.NOTPARALLEL:
-
diff --git a/t/lib-read-tree-m-3way.sh b/t/lib-read-tree-m-3way.sh
index d195603dfa..586df2113f 100644
--- a/t/lib-read-tree-m-3way.sh
+++ b/t/lib-read-tree-m-3way.sh
@@ -87,7 +87,7 @@ test_expect_success \
test_expect_success \
'recording branch A tree' \
'tree_A=$(git-write-tree)'
-
+
################################################################
# Branch B
# Start from O
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 186de70243..8bfe8320ea 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -37,7 +37,7 @@ fi
find .git/objects -type f -print >should-be-empty
test_expect_success \
'.git/objects should be empty after git-init in an empty repo.' \
- 'cmp -s /dev/null should-be-empty'
+ 'cmp -s /dev/null should-be-empty'
# also it should have 2 subdirectories; no fan-out anymore, pack, and info.
# 3 is counting "objects" itself
diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index ca2c30f7af..d3f8358485 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -159,4 +159,3 @@ test_expect_success 'git prune-packed' 'git prune-packed'
test_expect_failure '-> only packed objects' 'find -type f .git/objects/[0-9a-f][0-9a-f]'
test_done
-
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 3f3fd2d7f7..7731fa72ce 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -514,4 +514,3 @@ git config --list > result
test_expect_success 'value continued on next line' 'cmp result expect'
test_done
-
diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh
index 03ea4dece4..d556b41f13 100755
--- a/t/t2000-checkout-cache-clash.sh
+++ b/t/t2000-checkout-cache-clash.sh
@@ -49,5 +49,3 @@ test_expect_success \
'test -f path0 && test -d path1 && test -f path1/file1'
test_done
-
-
diff --git a/t/t2001-checkout-cache-clash.sh b/t/t2001-checkout-cache-clash.sh
index 0dcab8f1de..b895a0fe36 100755
--- a/t/t2001-checkout-cache-clash.sh
+++ b/t/t2001-checkout-cache-clash.sh
@@ -84,4 +84,3 @@ test_expect_success \
test ! -h path1/file1 && test -f path1/file1'
test_done
-
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 86ee2b0bd3..607f57ff94 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -525,4 +525,3 @@ test_expect_success 'reset and bind merge' '
'
test_done
-
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index 977c498f00..9e11ed295d 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -54,4 +54,3 @@ test_expect_success 'merge and reference trees equal' \
test_debug 'gitk --all & sleep 1'
test_done
-
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index e72c6fd1b4..b8acca1813 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -41,4 +41,3 @@ test_expect_success \
'git diff expected check'
test_done
-
diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh
index 7b81c32e57..c23341feb5 100755
--- a/t/t4100-apply-stat.sh
+++ b/t/t4100-apply-stat.sh
@@ -44,4 +44,3 @@ test_expect_success \
git diff ../t4100/t-apply-7.expect current'
test_done
-
diff --git a/t/t4110-apply-scan.sh b/t/t4110-apply-scan.sh
index 005f744816..9faef0d66e 100755
--- a/t/t4110-apply-scan.sh
+++ b/t/t4110-apply-scan.sh
@@ -98,4 +98,3 @@ test_expect_success "S = cmp" \
'cmp apply.txt patch.txt'
test_done
-
diff --git a/t/t4112-apply-renames.sh b/t/t4112-apply-renames.sh
index 69e9603c78..9baf810bee 100755
--- a/t/t4112-apply-renames.sh
+++ b/t/t4112-apply-renames.sh
@@ -49,10 +49,10 @@ copy to include/arch/cris/klibc/archsetjmp.h
- * arch/x86_64/include/klibc/archsetjmp.h
+ * arch/cris/include/klibc/archsetjmp.h
*/
-
+
#ifndef _KLIBC_ARCHSETJMP_H
#define _KLIBC_ARCHSETJMP_H
-
+
struct __jmp_buf {
- unsigned long __rbx;
- unsigned long __rsp;
@@ -74,9 +74,9 @@ copy to include/arch/cris/klibc/archsetjmp.h
+ unsigned long __sp;
+ unsigned long __srp;
};
-
+
typedef struct __jmp_buf jmp_buf[1];
-
+
-#endif /* _SETJMP_H */
+#endif /* _KLIBC_ARCHSETJMP_H */
diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h
@@ -90,10 +90,10 @@ rename to include/arch/m32r/klibc/archsetjmp.h
- * arch/x86_64/include/klibc/archsetjmp.h
+ * arch/m32r/include/klibc/archsetjmp.h
*/
-
+
#ifndef _KLIBC_ARCHSETJMP_H
#define _KLIBC_ARCHSETJMP_H
-
+
struct __jmp_buf {
- unsigned long __rbx;
- unsigned long __rsp;
@@ -108,9 +108,9 @@ rename to include/arch/m32r/klibc/archsetjmp.h
unsigned long __r15;
- unsigned long __rip;
};
-
+
typedef struct __jmp_buf jmp_buf[1];
-
+
-#endif /* _SETJMP_H */
+#endif /* _KLIBC_ARCHSETJMP_H */
EOF
diff --git a/t/t4118-apply-empty-context.sh b/t/t4118-apply-empty-context.sh
index 27cc6f2b88..dd88e81e04 100755
--- a/t/t4118-apply-empty-context.sh
+++ b/t/t4118-apply-empty-context.sh
@@ -53,4 +53,3 @@ test_expect_success 'apply --apply' '
'
test_done
-
diff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh
index 620a9207bf..edae7056e4 100755
--- a/t/t4119-apply-config.sh
+++ b/t/t4119-apply-config.sh
@@ -24,7 +24,7 @@ cat >gpatch.file <<\EOF &&
+++ file1+ 2007-02-21 01:07:44.000000000 -0800
@@ -1 +1 @@
-A
-+B
++B
EOF
sed -e 's|file1|sub/&|' gpatch.file >gpatch-sub.file &&
diff --git a/t/t4121-apply-diffs.sh b/t/t4121-apply-diffs.sh
index 2b2f1eda21..b95b89c341 100755
--- a/t/t4121-apply-diffs.sh
+++ b/t/t4121-apply-diffs.sh
@@ -30,4 +30,3 @@ test_expect_success \
'( git diff test~2 test~1; git diff test~1 test~0 )| git apply'
test_done
-
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh
index 3ddfe64b02..841773f75f 100755
--- a/t/t4122-apply-symlink-inside.sh
+++ b/t/t4122-apply-symlink-inside.sh
@@ -53,4 +53,3 @@ test_expect_success 'check result' '
'
test_done
-
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index c64ebbb2e9..a46d7f74be 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -148,5 +148,3 @@ test_expect_success 'old records rest in peace' \
"test ! -f $rr/preimage && test ! -f $rr2/preimage"
test_done
-
-
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index e223c074f0..a6c5bf6ab4 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -108,6 +108,13 @@ test_expect_success \
'git-archive --format=zip' \
'git-archive --format=zip HEAD >d.zip'
+$UNZIP -v >/dev/null 2>&1
+if [ $? -eq 127 ]; then
+ echo "Skipping ZIP tests, because unzip was not found"
+ test_done
+ exit
+fi
+
test_expect_success \
'extract ZIP archive' \
'(mkdir d && cd d && $UNZIP ../d.zip)'
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 477b267599..4eaea8f336 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -66,7 +66,7 @@ test_expect_success 'pack the destination repository' '
'
test_expect_success \
- 'pushing rewound head should not barf but require --force' '
+ 'pushing rewound head should not barf but require --force' '
# should not fail but refuse to update.
if git-send-pack ./victim/.git/ master
then
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
new file mode 100755
index 0000000000..dba018f667
--- /dev/null
+++ b/t/t5516-fetch-push.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+test_description='fetching and pushing, with or without wildcard'
+
+. ./test-lib.sh
+
+D=`pwd`
+
+mk_empty () {
+ rm -fr testrepo &&
+ mkdir testrepo &&
+ (
+ cd testrepo &&
+ git init
+ )
+}
+
+test_expect_success setup '
+
+ : >path1 &&
+ git add path1 &&
+ test_tick &&
+ git commit -a -m repo &&
+ the_commit=$(git show-ref -s --verify refs/heads/master)
+
+'
+
+test_expect_success 'fetch without wildcard' '
+ mk_empty &&
+ (
+ cd testrepo &&
+ git fetch .. refs/heads/master:refs/remotes/origin/master &&
+
+ r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+ test "z$r" = "z$the_commit" &&
+
+ test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+ )
+'
+
+test_expect_success 'fetch with wildcard' '
+ mk_empty &&
+ (
+ cd testrepo &&
+ git config remote.up.url .. &&
+ git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
+ git fetch up &&
+
+ r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+ test "z$r" = "z$the_commit" &&
+
+ test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+ )
+'
+
+test_expect_success 'push without wildcard' '
+ mk_empty &&
+
+ git push testrepo refs/heads/master:refs/remotes/origin/master &&
+ (
+ cd testrepo &&
+ r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+ test "z$r" = "z$the_commit" &&
+
+ test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+ )
+'
+
+test_expect_success 'push with wildcard' '
+ mk_empty &&
+
+ git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
+ (
+ cd testrepo &&
+ r=$(git show-ref -s --verify refs/remotes/origin/master) &&
+ test "z$r" = "z$the_commit" &&
+
+ test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
+ )
+'
+
+test_done
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 243212d3da..93eaf2c154 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -54,4 +54,3 @@ test_expect_success 'the default remote . should not break explicit pull' '
'
test_done
-
diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh
new file mode 100755
index 0000000000..b0933274db
--- /dev/null
+++ b/t/t5701-clone-local.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+test_description='test local clone'
+. ./test-lib.sh
+
+D=`pwd`
+
+test_expect_success 'preparing origin repository' '
+ : >file && git add . && git commit -m1 &&
+ git clone --bare . a.git &&
+ git clone --bare . x
+'
+
+test_expect_success 'local clone without .git suffix' '
+ cd "$D" &&
+ git clone -l -s a b &&
+ cd b &&
+ git fetch
+'
+
+test_expect_success 'local clone with .git suffix' '
+ cd "$D" &&
+ git clone -l -s a.git c &&
+ cd c &&
+ git fetch
+'
+
+test_expect_success 'local clone from x' '
+ cd "$D" &&
+ git clone -l -s x y &&
+ cd y &&
+ git fetch
+'
+
+test_expect_success 'local clone from x.git that does not exist' '
+ cd "$D" &&
+ if git clone -l -s x.git z
+ then
+ echo "Oops, should have failed"
+ false
+ else
+ echo happy
+ fi
+'
+
+test_done
diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh
index 2f8e97cb7e..699df6ebd8 100755
--- a/t/t5710-info-alternate.sh
+++ b/t/t5710-info-alternate.sh
@@ -104,4 +104,3 @@ test_valid_repo'
cd "$base_dir"
test_done
-
diff --git a/t/t6000lib.sh b/t/t6000lib.sh
index d40262159b..d548bf8026 100755
--- a/t/t6000lib.sh
+++ b/t/t6000lib.sh
@@ -17,17 +17,17 @@ unique_commit()
_text=$1
_tree=$2
shift 2
- echo $_text | git-commit-tree $(tag $_tree) "$@"
+ echo $_text | git-commit-tree $(tag $_tree) "$@"
}
# Save the output of a command into the tag specified. Prepend
# a substitution script for the tag onto the front of sed.script
save_tag()
{
- _tag=$1
+ _tag=$1
[ -n "$_tag" ] || error "usage: save_tag tag commit-args ..."
shift 1
- "$@" >.git/refs/tags/$_tag
+ "$@" >.git/refs/tags/$_tag
echo "s/$(tag $_tag)/$_tag/g" > sed.script.tmp
cat sed.script >> sed.script.tmp
@@ -35,7 +35,7 @@ save_tag()
mv sed.script.tmp sed.script
}
-# Replace unhelpful sha1 hashses with their symbolic equivalents
+# Replace unhelpful sha1 hashses with their symbolic equivalents
entag()
{
sed -f sed.script
@@ -62,7 +62,7 @@ as_author()
commit_date()
{
_commit=$1
- git-cat-file commit $_commit | sed -n "s/^committer .*> \([0-9]*\) .*/\1/p"
+ git-cat-file commit $_commit | sed -n "s/^committer .*> \([0-9]*\) .*/\1/p"
}
on_committer_date()
@@ -103,14 +103,14 @@ name_from_description()
# Execute the test described by the first argument, by eval'ing
# command line specified in the 2nd argument. Check the status code
-# is zero and that the output matches the stream read from
+# is zero and that the output matches the stream read from
# stdin.
test_output_expect_success()
-{
+{
_description=$1
_test=$2
[ $# -eq 2 ] || error "usage: test_output_expect_success description test <<EOF ... EOF"
_name=$(echo $_description | name_from_description)
cat > $_name.expected
- test_expect_success "$_description" "check_output $_name \"$_test\""
+ test_expect_success "$_description" "check_output $_name \"$_test\""
}
diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
index fcb3302764..71cbb72e1b 100755
--- a/t/t6002-rev-list-bisect.sh
+++ b/t/t6002-rev-list-bisect.sh
@@ -26,7 +26,7 @@ test_bisection_diff()
# Test if bisection size is close to half of list size within
# tolerance.
- #
+ #
_bisect_err=`expr $_list_size - $_bisection_size \* 2`
test "$_bisect_err" -lt 0 && _bisect_err=`expr 0 - $_bisect_err`
_bisect_err=`expr $_bisect_err / 2` ; # floor
@@ -116,8 +116,8 @@ on_committer_date "1971-08-16 00:00:06" save_tag V unique_commit V tree -p u1 -p
test_sequence()
{
- _bisect_option=$1
-
+ _bisect_option=$1
+
test_bisection_diff 0 $_bisect_option l0 ^root
test_bisection_diff 0 $_bisect_option l1 ^root
test_bisection_diff 0 $_bisect_option l2 ^root
@@ -152,7 +152,7 @@ test_sequence()
test_bisection_diff 0 $_bisect_option u3 ^U
test_bisection_diff 0 $_bisect_option u4 ^U
test_bisection_diff 0 $_bisect_option u5 ^U
-
+
#
# the following illustrates Linus' binary bug blatt idea.
#
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6021-merge-criss-cross.sh
index 499cafb882..0ab14a6e81 100755
--- a/t/t6021-merge-criss-cross.sh
+++ b/t/t6021-merge-criss-cross.sh
@@ -20,7 +20,7 @@ test_expect_success 'prepare repository' \
7
8
9" > file &&
-git add file &&
+git add file &&
git commit -m "Initial commit" file &&
git branch A &&
git branch B &&
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index c76fccfb5a..ecc11c1a84 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -134,5 +134,9 @@ EOF
test_expect_success "expected conflict markers" "git diff expect out"
-test_done
+test_expect_success 'binary files cannot be merged' '
+ ! git merge-file -p orig.txt ../test4012.png new1.txt 2> merge.err &&
+ grep "Cannot merge binary files" merge.err
+'
+test_done
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 30f6ade13f..03cdba5808 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -102,4 +102,3 @@ test_expect_success \
#
#
test_done
-
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index b0252b9413..dd6cc3a55c 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -40,4 +40,3 @@ test_expect_success 'short SHA-1 works' '
test $start = $abbrv'
test_done
-
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 5fa6a45577..ed2e9ee3c6 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -190,4 +190,44 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
fi
'
+test_expect_success 'checkout with ambiguous tag/branch names' '
+
+ git tag both side &&
+ git branch both master &&
+ git reset --hard &&
+ git checkout master &&
+
+ git checkout both &&
+ H=$(git rev-parse --verify HEAD) &&
+ M=$(git show-ref -s --verify refs/heads/master) &&
+ test "z$H" = "z$M" &&
+ name=$(git symbolic-ref HEAD 2>/dev/null) &&
+ test "z$name" = zrefs/heads/both
+
+'
+
+test_expect_success 'checkout with ambiguous tag/branch names' '
+
+ git reset --hard &&
+ git checkout master &&
+
+ git tag frotz side &&
+ git branch frotz master &&
+ git reset --hard &&
+ git checkout master &&
+
+ git checkout tags/frotz &&
+ H=$(git rev-parse --verify HEAD) &&
+ S=$(git show-ref -s --verify refs/heads/side) &&
+ test "z$H" = "z$S" &&
+ if name=$(git symbolic-ref HEAD 2>/dev/null)
+ then
+ echo "Bad -- should have detached"
+ false
+ else
+ : happy
+ fi
+
+'
+
test_done
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 6274729729..3940433b8f 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -40,7 +40,7 @@ test_expect_success 'Prepare submodule testing' '
git-add a lib z &&
git-commit -m "super commit 1" &&
mv lib .subrepo &&
- GIT_CONFIG=.gitmodules git-config module.lib.url ./.subrepo
+ GIT_CONFIG=.gitmodules git-config module.lib.url git://example.com/lib.git
'
test_expect_success 'status should only print one line' '
@@ -52,41 +52,55 @@ test_expect_success 'status should initially be "missing"' '
git-submodule status | grep "^-$rev1"
'
-test_expect_success 'init should fail when path is used by a file' '
+test_expect_success 'init should register submodule url in .git/config' '
+ git-submodule init &&
+ url=$(git-config submodule.lib.url) &&
+ if test "$url" != "git://example.com/lib.git"
+ then
+ echo "[OOPS] init succeeded but submodule url is wrong"
+ false
+ elif ! git-config submodule.lib.url ./.subrepo
+ then
+ echo "[OOPS] init succeeded but update of url failed"
+ false
+ fi
+'
+
+test_expect_success 'update should fail when path is used by a file' '
echo "hello" >lib &&
- if git-submodule init
+ if git-submodule update
then
- echo "[OOPS] init should have failed"
+ echo "[OOPS] update should have failed"
false
elif test -f lib && test "$(cat lib)" != "hello"
then
- echo "[OOPS] init failed but lib file was molested"
+ echo "[OOPS] update failed but lib file was molested"
false
else
rm lib
fi
'
-test_expect_success 'init should fail when path is used by a nonempty directory' '
+test_expect_success 'update should fail when path is used by a nonempty directory' '
mkdir lib &&
echo "hello" >lib/a &&
- if git-submodule init
+ if git-submodule update
then
- echo "[OOPS] init should have failed"
+ echo "[OOPS] update should have failed"
false
elif test "$(cat lib/a)" != "hello"
then
- echo "[OOPS] init failed but lib/a was molested"
+ echo "[OOPS] update failed but lib/a was molested"
false
else
rm lib/a
fi
'
-test_expect_success 'init should work when path is an empty dir' '
+test_expect_success 'update should work when path is an empty dir' '
rm -rf lib &&
mkdir lib &&
- git-submodule init &&
+ git-submodule update &&
head=$(cd lib && git-rev-parse HEAD) &&
if test -z "$head"
then
@@ -99,7 +113,7 @@ test_expect_success 'init should work when path is an empty dir' '
fi
'
-test_expect_success 'status should be "up-to-date" after init' '
+test_expect_success 'status should be "up-to-date" after update' '
git-submodule status | grep "^ $rev1"
'
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index dc2afdaa45..d549665400 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -109,4 +109,3 @@ test_expect_success ".rev_db auto-converted to .rev_db.UUID" "
"
test_done
-
diff --git a/t/t9111/svnsync.dump b/t/t9111/svnsync.dump
index a9a46eeb29..499fa9594f 100644
--- a/t/t9111/svnsync.dump
+++ b/t/t9111/svnsync.dump
@@ -558,5 +558,3 @@ Text-content-md5: 7abb78de7f2756ca8b511cbc879fd5e7
Content-length: 4
cba
-
-
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index e9ef315173..41dcf646d1 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -110,6 +110,40 @@ test_expect_success 'pserver authentication failure (login/non-anonymous user)'
tail -n1 log | grep -q "^I HATE YOU$"'
+# misuse pserver authentication for testing of req_Root
+
+cat >request-relative <<EOF
+BEGIN AUTH REQUEST
+gitcvs.git
+anonymous
+
+END AUTH REQUEST
+EOF
+
+cat >request-conflict <<EOF
+BEGIN AUTH REQUEST
+$SERVERDIR
+anonymous
+
+END AUTH REQUEST
+Root $WORKDIR
+EOF
+
+test_expect_success 'req_Root failure (relative pathname)' \
+ 'if cat request-relative | git-cvsserver pserver >log 2>&1
+ then
+ echo unexpected success
+ false
+ else
+ true
+ fi &&
+ tail log | grep -q "^error 1 Root must be an absolute pathname$"'
+
+test_expect_success 'req_Root failure (conflicting roots)' \
+ 'cat request-conflict | git-cvsserver pserver >log 2>&1 &&
+ tail log | grep -q "^error 1 Conflicting roots specified$"'
+
+
#--------------
# CONFIG TESTS
#--------------
diff --git a/t/test-lib.sh b/t/test-lib.sh
index dee3ad7621..8bf4cf49a2 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -232,7 +232,7 @@ test_create_repo () {
mv .git/hooks .git/hooks-disabled
cd "$owd"
}
-
+
test_done () {
trap - exit
case "$test_failure" in
diff --git a/templates/Makefile b/templates/Makefile
index b8352e731b..aaa39d30fa 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -7,7 +7,7 @@ endif
INSTALL ?= install
TAR ?= tar
prefix ?= $(HOME)
-template_dir ?= $(prefix)/share/git-core/templates/
+template_dir ?= $(prefix)/share/git-core/templates
# DESTDIR=
# Shell quote (do not use $(call) to accommodate ancient setups);
diff --git a/templates/hooks--commit-msg b/templates/hooks--commit-msg
index 9b04f2d69c..c5cdb9d7ee 100644
--- a/templates/hooks--commit-msg
+++ b/templates/hooks--commit-msg
@@ -19,4 +19,3 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
-
diff --git a/templates/hooks--post-receive b/templates/hooks--post-receive
index 190de2688c..b70c8fd364 100644
--- a/templates/hooks--post-receive
+++ b/templates/hooks--post-receive
@@ -14,4 +14,3 @@
#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
-
diff --git a/templates/hooks--pre-applypatch b/templates/hooks--pre-applypatch
index 5f56ce8053..eeccc934ca 100644
--- a/templates/hooks--pre-applypatch
+++ b/templates/hooks--pre-applypatch
@@ -12,4 +12,3 @@
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
:
-
diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index 723a9ef210..18b87309f6 100644
--- a/templates/hooks--pre-commit
+++ b/templates/hooks--pre-commit
@@ -68,4 +68,3 @@ perl -e '
}
exit($found_bad);
'
-
diff --git a/tree-walk.c b/tree-walk.c
index cbb24eb3f6..8d4b67317f 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -206,4 +206,3 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
free(tree);
return retval;
}
-
diff --git a/tree.c b/tree.c
index a3728270b4..04fe653a8e 100644
--- a/tree.c
+++ b/tree.c
@@ -173,8 +173,13 @@ static void track_tree_refs(struct tree *item)
continue;
if (S_ISDIR(entry.mode))
obj = &lookup_tree(entry.sha1)->object;
- else
+ else if (S_ISREG(entry.mode) || S_ISLNK(entry.mode))
obj = &lookup_blob(entry.sha1)->object;
+ else {
+ warning("in tree %s: entry %s has bad mode %.6o\n",
+ sha1_to_hex(item->object.sha1), entry.path, entry.mode);
+ obj = lookup_unknown_object(entry.sha1);
+ }
refs->ref[i++] = obj;
}
set_object_refs(&item->object, refs);
diff --git a/upload-pack.c b/upload-pack.c
index d3a09e78d5..fe96ef15c4 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -62,7 +62,7 @@ static ssize_t send_client_data(int fd, const char *data, ssize_t sz)
return safe_write(fd, data, sz);
}
-FILE *pack_pipe = NULL;
+static FILE *pack_pipe = NULL;
static void show_commit(struct commit *commit)
{
if (commit->object.flags & BOUNDARY)
@@ -678,7 +678,7 @@ int main(int argc, char **argv)
break;
}
}
-
+
if (i != argc-1)
usage(upload_pack_usage);
dir = argv[i];
diff --git a/var.c b/var.c
index e585e59d31..4127031910 100644
--- a/var.c
+++ b/var.c
@@ -67,8 +67,8 @@ int main(int argc, char **argv)
val = read_var(argv[1]);
if (!val)
usage(var_usage);
-
+
printf("%s\n", val);
-
+
return 0;
}
diff --git a/wt-status.c b/wt-status.c
index 4bfe8f15d8..52054201c2 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -198,7 +198,7 @@ static void wt_read_cache(struct wt_status *s)
read_cache();
}
-void wt_status_print_initial(struct wt_status *s)
+static void wt_status_print_initial(struct wt_status *s)
{
int i;
char buf[PATH_MAX];
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 963bb89b08..e407cf11b1 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -129,5 +129,3 @@ int buffer_is_binary(const char *ptr, unsigned long size)
size = FIRST_FEW_BYTES;
return !!memchr(ptr, 0, size);
}
-
-
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index e874a7c46a..9402bb0799 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -103,4 +103,3 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
#endif /* #ifdef __cplusplus */
#endif /* #if !defined(XDIFF_H) */
-
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 9aeebc473b..5cb7171a8f 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -565,4 +565,3 @@ int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
return 0;
}
-
diff --git a/xdiff/xdiffi.h b/xdiff/xdiffi.h
index 472aeaecfa..3e099dc445 100644
--- a/xdiff/xdiffi.h
+++ b/xdiff/xdiffi.h
@@ -57,4 +57,3 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
xdemitconf_t const *xecfg);
#endif /* #if !defined(XDIFFI_H) */
-
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index e291dc7608..4b6e639112 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -99,8 +99,8 @@ static void xdl_find_func(xdfile_t *xf, long i, char *buf, long sz, long *ll) {
}
-int xdl_emit_common(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
- xdemitconf_t const *xecfg) {
+static int xdl_emit_common(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
+ xdemitconf_t const *xecfg) {
xdfile_t *xdf = &xe->xdf1;
const char *rchg = xdf->rchg;
long ix;
@@ -194,4 +194,3 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
return 0;
}
-
diff --git a/xdiff/xemit.h b/xdiff/xemit.h
index e629417dd2..440a7390fa 100644
--- a/xdiff/xemit.h
+++ b/xdiff/xemit.h
@@ -31,4 +31,3 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
#endif /* #if !defined(XEMIT_H) */
-
diff --git a/xdiff/xinclude.h b/xdiff/xinclude.h
index 04a9da82c9..526ccb344d 100644
--- a/xdiff/xinclude.h
+++ b/xdiff/xinclude.h
@@ -40,4 +40,3 @@
#endif /* #if !defined(XINCLUDE_H) */
-
diff --git a/xdiff/xmacros.h b/xdiff/xmacros.h
index e2cd2023b3..8ef232cfad 100644
--- a/xdiff/xmacros.h
+++ b/xdiff/xmacros.h
@@ -51,4 +51,3 @@ do { \
#endif /* #if !defined(XMACROS_H) */
-
diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c
index 1be7b31950..e87ab57c65 100644
--- a/xdiff/xprepare.c
+++ b/xdiff/xprepare.c
@@ -466,4 +466,3 @@ static int xdl_optimize_ctxs(xdfile_t *xdf1, xdfile_t *xdf2) {
return 0;
}
-
diff --git a/xdiff/xprepare.h b/xdiff/xprepare.h
index 344c569e8b..8fb06a5374 100644
--- a/xdiff/xprepare.h
+++ b/xdiff/xprepare.h
@@ -32,4 +32,3 @@ void xdl_free_env(xdfenv_t *xe);
#endif /* #if !defined(XPREPARE_H) */
-
diff --git a/xdiff/xtypes.h b/xdiff/xtypes.h
index 3593a664fc..2511aef8d8 100644
--- a/xdiff/xtypes.h
+++ b/xdiff/xtypes.h
@@ -65,4 +65,3 @@ typedef struct s_xdfenv {
#endif /* #if !defined(XTYPES_H) */
-
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index bf91c0f73c..2ade97b257 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -380,4 +380,3 @@ int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
return 0;
}
-
diff --git a/xdiff/xutils.h b/xdiff/xutils.h
index 70d8b9838a..d5de8292e0 100644
--- a/xdiff/xutils.h
+++ b/xdiff/xutils.h
@@ -45,4 +45,3 @@ int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
#endif /* #if !defined(XUTILS_H) */
-