Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes-1.5.2.txt2
-rw-r--r--Documentation/RelNotes-1.5.3.txt6
-rw-r--r--Documentation/RelNotes-1.5.4.4.txt2
-rw-r--r--Documentation/RelNotes-1.5.4.5.txt2
-rw-r--r--Documentation/RelNotes-1.5.6.5.txt29
-rw-r--r--Documentation/RelNotes-1.6.0.1.txt36
-rw-r--r--Documentation/RelNotes-1.6.0.txt53
-rw-r--r--Documentation/RelNotes-1.6.1.txt58
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/config.txt22
-rw-r--r--Documentation/diff-options.txt6
-rw-r--r--Documentation/git-am.txt7
-rw-r--r--Documentation/git-cat-file.txt2
-rw-r--r--Documentation/git-checkout.txt17
-rw-r--r--Documentation/git-clean.txt6
-rw-r--r--Documentation/git-clone.txt5
-rw-r--r--Documentation/git-commit-tree.txt10
-rw-r--r--Documentation/git-count-objects.txt5
-rw-r--r--Documentation/git-cvsserver.txt8
-rw-r--r--Documentation/git-describe.txt4
-rw-r--r--Documentation/git-diff-tree.txt21
-rw-r--r--Documentation/git-fast-export.txt9
-rw-r--r--Documentation/git-filter-branch.txt23
-rw-r--r--Documentation/git-for-each-ref.txt4
-rw-r--r--Documentation/git-format-patch.txt6
-rw-r--r--Documentation/git-hash-object.txt20
-rw-r--r--Documentation/git-imap-send.txt78
-rw-r--r--Documentation/git-log.txt6
-rw-r--r--Documentation/git-merge-base.txt77
-rw-r--r--Documentation/git-merge.txt28
-rw-r--r--Documentation/git-mergetool.txt2
-rw-r--r--Documentation/git-name-rev.txt3
-rw-r--r--Documentation/git-push.txt17
-rw-r--r--Documentation/git-rerere.txt6
-rw-r--r--Documentation/git-rev-parse.txt5
-rw-r--r--Documentation/git-revert.txt9
-rw-r--r--Documentation/git-rm.txt3
-rw-r--r--Documentation/git-send-email.txt2
-rw-r--r--Documentation/git-show-ref.txt2
-rw-r--r--Documentation/git-show.txt4
-rw-r--r--Documentation/git-stash.txt13
-rw-r--r--Documentation/git-submodule.txt30
-rw-r--r--Documentation/git-svn.txt37
-rw-r--r--Documentation/git-verify-tag.txt4
-rw-r--r--Documentation/git.txt14
-rw-r--r--Documentation/gitattributes.txt19
-rw-r--r--Documentation/gitcore-tutorial.txt15
-rw-r--r--Documentation/gitk.txt2
-rw-r--r--Documentation/merge-config.txt4
-rw-r--r--Documentation/pull-fetch-param.txt2
-rw-r--r--Documentation/rev-list-options.txt162
-rw-r--r--Documentation/user-manual.txt45
-rwxr-xr-xGIT-VERSION-GEN3
-rw-r--r--INSTALL4
-rw-r--r--Makefile62
l---------RelNotes2
-rw-r--r--archive.c110
-rw-r--r--builtin-add.c112
-rw-r--r--builtin-blame.c10
-rw-r--r--builtin-checkout.c23
-rw-r--r--builtin-clone.c37
-rw-r--r--builtin-commit-tree.c5
-rw-r--r--builtin-commit.c29
-rw-r--r--builtin-count-objects.c7
-rw-r--r--builtin-diff-tree.c56
-rw-r--r--builtin-fast-export.c31
-rw-r--r--builtin-for-each-ref.c4
-rw-r--r--builtin-fsck.c2
-rw-r--r--builtin-log.c16
-rw-r--r--builtin-ls-tree.c13
-rw-r--r--builtin-mailinfo.c25
-rw-r--r--builtin-merge-base.c24
-rw-r--r--builtin-merge-recursive.c36
-rw-r--r--builtin-merge.c27
-rw-r--r--builtin-name-rev.c81
-rw-r--r--builtin-pack-objects.c1
-rw-r--r--builtin-prune.c9
-rw-r--r--builtin-push.c13
-rw-r--r--builtin-reflog.c12
-rw-r--r--builtin-remote.c2
-rw-r--r--builtin-rev-list.c3
-rw-r--r--builtin-revert.c4
-rw-r--r--builtin-rm.c2
-rw-r--r--builtin-tag.c3
-rw-r--r--builtin-update-index.c5
-rw-r--r--builtin-verify-pack.c3
-rw-r--r--cache.h7
-rw-r--r--combine-diff.c20
-rw-r--r--commit.h1
-rw-r--r--compat/mingw.c36
-rw-r--r--compat/mingw.h21
-rw-r--r--compat/snprintf.c4
-rw-r--r--config.mak.in1
-rwxr-xr-xcontrib/completion/git-completion.bash218
-rwxr-xr-xcontrib/examples/git-commit.sh6
-rwxr-xr-xcontrib/examples/git-tag.sh2
-rwxr-xr-xcontrib/fast-import/git-p4126
-rw-r--r--contrib/fast-import/git-p4.txt133
-rw-r--r--ctype.c5
-rw-r--r--daemon.c1
-rw-r--r--decorate.c11
-rw-r--r--decorate.h6
-rw-r--r--diff.c78
-rw-r--r--dir.c8
-rwxr-xr-xgit-am.sh21
-rwxr-xr-xgit-bisect.sh3
-rw-r--r--git-compat-util.h11
-rwxr-xr-xgit-cvsimport.perl2
-rwxr-xr-xgit-filter-branch.sh26
-rwxr-xr-xgit-gui/GIT-VERSION-GEN2
-rw-r--r--git-gui/Makefile5
-rwxr-xr-xgit-gui/git-gui.sh19
-rw-r--r--git-gui/lib/diff.tcl18
-rw-r--r--git-gui/po/README17
-rw-r--r--git-gui/po/de.po102
-rw-r--r--git-gui/po/git-gui.pot513
-rw-r--r--git-gui/po/it.po530
-rw-r--r--git-gui/po/ja.po527
-rw-r--r--git-gui/po/sv.po515
-rw-r--r--git-gui/windows/git-gui.sh11
-rwxr-xr-xgit-merge-octopus.sh11
-rwxr-xr-xgit-rebase--interactive.sh20
-rwxr-xr-xgit-rebase.sh21
-rwxr-xr-xgit-stash.sh8
-rwxr-xr-xgit-submodule.sh91
-rwxr-xr-xgit-svn.perl164
-rw-r--r--gitk-git/gitk162
-rw-r--r--gitk-git/po/de.po106
-rw-r--r--gitk-git/po/sv.po492
-rw-r--r--hash-object.c159
-rw-r--r--ident.c2
-rw-r--r--imap-send.c922
-rw-r--r--index-pack.c2
-rw-r--r--log-tree.c4
-rw-r--r--pack-revindex.c12
-rw-r--r--pack-revindex.h1
-rw-r--r--pack-write.c1
-rw-r--r--pager.c55
-rw-r--r--parse-options.c12
-rw-r--r--parse-options.h2
-rw-r--r--path.c2
-rw-r--r--perl/Git.pm143
-rw-r--r--perl/Makefile8
-rw-r--r--read-cache.c96
-rw-r--r--remote.c30
-rw-r--r--remote.h1
-rw-r--r--revision.c36
-rw-r--r--revision.h5
-rw-r--r--run-command.c6
-rw-r--r--run-command.h1
-rw-r--r--sha1_file.c74
-rw-r--r--sha1_name.c5
-rw-r--r--shell.c8
-rw-r--r--t/.gitignore2
-rw-r--r--t/Makefile8
-rw-r--r--t/lib-httpd.sh2
-rwxr-xr-xt/t0022-crlf-rename.sh4
-rwxr-xr-xt/t0023-crlf-am.sh2
-rwxr-xr-xt/t0040-parse-options.sh11
-rwxr-xr-xt/t0055-beyond-symlinks.sh25
-rwxr-xr-xt/t1000-read-tree-m-3way.sh2
-rwxr-xr-xt/t1002-read-tree-m-u-2way.sh10
-rwxr-xr-xt/t1007-hash-object.sh56
-rwxr-xr-xt/t1410-reflog.sh20
-rwxr-xr-xt/t3030-merge-recursive.sh11
-rwxr-xr-xt/t3300-funny-names.sh2
-rwxr-xr-xt/t3404-rebase-interactive.sh18
-rwxr-xr-xt/t3504-cherry-pick-rerere.sh45
-rwxr-xr-xt/t3700-add.sh8
-rwxr-xr-xt/t3900-i18n-commit.sh18
-rwxr-xr-xt/t3901-i18n-patch.sh28
-rwxr-xr-xt/t3902-quoted.sh8
-rwxr-xr-xt/t4000-diff-format.sh2
-rwxr-xr-xt/t4001-diff-rename.sh2
-rwxr-xr-xt/t4002-diff-basic.sh16
-rwxr-xr-xt/t4003-diff-rename-1.sh6
-rwxr-xr-xt/t4004-diff-rename-symlink.sh2
-rwxr-xr-xt/t4005-diff-rename-2.sh6
-rwxr-xr-xt/t4007-rename-3.sh4
-rwxr-xr-xt/t4008-diff-break-rewrite.sh6
-rwxr-xr-xt/t4009-diff-rename-4.sh6
-rwxr-xr-xt/t4010-diff-pathspec.sh2
-rwxr-xr-xt/t4011-diff-symlink.sh2
-rwxr-xr-xt/t4012-diff-binary.sh2
-rwxr-xr-xt/t4013-diff-various.sh2
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..master6
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..master^4
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..side2
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master6
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..master6
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..master^4
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..master^^2
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..side2
-rwxr-xr-xt/t4014-format-patch.sh25
-rwxr-xr-xt/t4015-diff-whitespace.sh29
-rwxr-xr-xt/t4016-diff-quote.sh4
-rwxr-xr-xt/t4019-diff-wserror.sh20
-rwxr-xr-xt/t4020-diff-external.sh2
-rwxr-xr-xt/t4022-diff-rewrite.sh4
-rwxr-xr-xt/t4023-diff-rename-typechange.sh14
-rwxr-xr-xt/t4027-diff-submodule.sh2
-rwxr-xr-xt/t4029-diff-trailing-space.sh39
-rwxr-xr-xt/t4100-apply-stat.sh4
-rwxr-xr-xt/t4101-apply-nonl.sh7
-rwxr-xr-xt/t4202-log.sh22
-rwxr-xr-xt/t5100-mailinfo.sh36
-rw-r--r--t/t5100/info-from.expect5
-rw-r--r--t/t5100/info-from.in8
-rw-r--r--t/t5100/info00115
-rw-r--r--t/t5100/msg00112
-rw-r--r--t/t5100/patch001122
-rw-r--r--t/t5100/sample.mbox36
-rwxr-xr-xt/t5300-pack-object.sh6
-rwxr-xr-xt/t5304-prune.sh8
-rwxr-xr-xt/t5500-fetch-pack.sh2
-rwxr-xr-xt/t5515-fetch-merge-logic.sh4
-rwxr-xr-xt/t5540-http-push.sh4
-rwxr-xr-xt/t5601-clone.sh37
-rwxr-xr-xt/t6002-rev-list-bisect.sh2
-rwxr-xr-xt/t6003-rev-list-topo-order.sh2
-rwxr-xr-xt/t6010-merge-base.sh48
-rwxr-xr-xt/t6023-merge-file.sh2
-rwxr-xr-xt/t6027-merge-binary.sh2
-rwxr-xr-xt/t6101-rev-parse-parents.sh2
-rwxr-xr-xt/t6200-fmt-merge-msg.sh4
-rwxr-xr-xt/t6300-for-each-ref.sh10
-rwxr-xr-xt/t7001-mv.sh4
-rwxr-xr-xt/t7003-filter-branch.sh8
-rwxr-xr-xt/t7004-tag.sh22
-rwxr-xr-xt/t7101-reset.sh10
-rwxr-xr-xt/t7201-co.sh32
-rwxr-xr-xt/t7500-commit.sh70
-rwxr-xr-xt/t7502-commit.sh4
-rwxr-xr-xt/t7600-merge.sh19
-rwxr-xr-xt/t7605-merge-resolve.sh4
-rwxr-xr-xt/t8001-annotate.sh2
-rwxr-xr-xt/t8002-blame.sh2
-rwxr-xr-xt/t9108-git-svn-glob.sh39
-rwxr-xr-xt/t9108-git-svn-multi-glob.sh160
-rwxr-xr-xt/t9110-git-svn-use-svm-props.sh2
-rwxr-xr-xt/t9111-git-svn-use-svnsync-props.sh2
-rwxr-xr-xt/t9113-git-svn-dcommit-new-file.sh1
-rwxr-xr-xt/t9115-git-svn-dcommit-funky-renames.sh2
-rwxr-xr-xt/t9119-git-svn-info.sh84
-rwxr-xr-xt/t9121-git-svn-fetch-renamed-dir.sh2
-rwxr-xr-xt/t9125-git-svn-multi-glob-branch-names.sh37
-rwxr-xr-xt/t9200-git-cvsexportcommit.sh14
-rwxr-xr-xt/t9300-fast-import.sh6
-rwxr-xr-xt/t9301-fast-export.sh48
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh16
-rwxr-xr-xt/t9700-perl-git.sh2
-rwxr-xr-xt/t9700/test.pl3
-rw-r--r--t/test-lib.sh10
-rw-r--r--templates/Makefile6
-rw-r--r--test-parse-options.c10
-rw-r--r--transport.c13
-rw-r--r--unpack-trees.c1
-rw-r--r--var.c2
-rw-r--r--xdiff-interface.c60
-rw-r--r--xdiff-interface.h13
260 files changed, 5865 insertions, 3032 deletions
diff --git a/Documentation/RelNotes-1.5.2.txt b/Documentation/RelNotes-1.5.2.txt
index 6195715dc7..e8328d090a 100644
--- a/Documentation/RelNotes-1.5.2.txt
+++ b/Documentation/RelNotes-1.5.2.txt
@@ -36,7 +36,7 @@ Updates since v1.5.1
expansion). These conversions apply when checking files in
or out, and exporting via git-archive.
-* The packfile format now optionally suports 64-bit index.
+* The packfile format now optionally supports 64-bit index.
This release supports the "version 2" format of the .idx
file. This is automatically enabled when a huge packfile
diff --git a/Documentation/RelNotes-1.5.3.txt b/Documentation/RelNotes-1.5.3.txt
index d03894b926..0668d3c0ca 100644
--- a/Documentation/RelNotes-1.5.3.txt
+++ b/Documentation/RelNotes-1.5.3.txt
@@ -86,7 +86,7 @@ Updates since v1.5.2
- "git rev-list" learned --regexp-ignore-case and
--extended-regexp options to tweak its matching logic used
- for --grep fitering.
+ for --grep filtering.
- "git describe --contains" is a handier way to call more
obscure command "git name-rev --tags".
@@ -243,7 +243,7 @@ Updates since v1.5.2
- We used to have core.legacyheaders configuration, when
set to false, allowed git to write loose objects in a format
- that mimicks the format used by objects stored in packs. It
+ that mimics the format used by objects stored in packs. It
turns out that this was not so useful. Although we will
continue to read objects written in that format, we do not
honor that configuration anymore and create loose objects in
@@ -302,7 +302,7 @@ Updates since v1.5.2
small enough delta results it creates while looking for the
best delta candidates.
- - "git pack-objects" learned a new heuristcs to prefer delta
+ - "git pack-objects" learned a new heuristic to prefer delta
that is shallower in depth over the smallest delta
possible. This improves both overall packfile access
performance and packfile density.
diff --git a/Documentation/RelNotes-1.5.4.4.txt b/Documentation/RelNotes-1.5.4.4.txt
index 89fa6d03bc..323c1a88c7 100644
--- a/Documentation/RelNotes-1.5.4.4.txt
+++ b/Documentation/RelNotes-1.5.4.4.txt
@@ -55,7 +55,7 @@ Fixes since v1.5.4.3
* "git log --merge" did not work well with --left-right option.
- * "git svn" promprted for client cert password every time it accessed the
+ * "git svn" prompted for client cert password every time it accessed the
server.
* The reset command in "git fast-import" data stream was documented to
diff --git a/Documentation/RelNotes-1.5.4.5.txt b/Documentation/RelNotes-1.5.4.5.txt
index 0282341398..bbd130e36d 100644
--- a/Documentation/RelNotes-1.5.4.5.txt
+++ b/Documentation/RelNotes-1.5.4.5.txt
@@ -9,7 +9,7 @@ Fixes since v1.5.4.4
1.5.4).
* Bogus refspec configuration such as "remote.there.fetch = =" were not
- detected as errors (regressionin 1.5.4).
+ detected as errors (regression in 1.5.4).
* You couldn't specify a custom editor whose path contains a whitespace
via GIT_EDITOR (and core.editor).
diff --git a/Documentation/RelNotes-1.5.6.5.txt b/Documentation/RelNotes-1.5.6.5.txt
new file mode 100644
index 0000000000..47ca172462
--- /dev/null
+++ b/Documentation/RelNotes-1.5.6.5.txt
@@ -0,0 +1,29 @@
+GIT v1.5.6.5 Release Notes
+==========================
+
+Fixes since v1.5.6.4
+--------------------
+
+* "git cvsimport" used to spit out "UNKNOWN LINE..." diagnostics to stdout.
+
+* "git commit -F filename" and "git tag -F filename" run from subdirectories
+ did not read the right file.
+
+* "git init --template=" with blank "template" parameter linked files
+ under root directories to .git, which was a total nonsense. Instead, it
+ means "I do not want to use anything from the template directory".
+
+* "git diff-tree" and other diff plumbing ignored diff.renamelimit configuration
+ variable when the user explicitly asked for rename detection.
+
+* "git name-rev --name-only" did not work when "--stdin" option was in effect.
+
+* "git show-branch" mishandled its 8th branch.
+
+* Addition of "git update-index --ignore-submodules" that happened during
+ 1.5.6 cycle broke "git update-index --ignore-missing".
+
+* "git send-email" did not parse charset from an existing Content-type:
+ header properly.
+
+Contains other various documentation fixes.
diff --git a/Documentation/RelNotes-1.6.0.1.txt b/Documentation/RelNotes-1.6.0.1.txt
new file mode 100644
index 0000000000..49d7a1cafa
--- /dev/null
+++ b/Documentation/RelNotes-1.6.0.1.txt
@@ -0,0 +1,36 @@
+GIT v1.6.0.1 Release Notes
+==========================
+
+Fixes since v1.6.0
+------------------
+
+* "git diff --cc" did not honor content mangling specified by
+ gitattributes and core.autocrlf when reading from the work tree.
+
+* "git diff --check" incorrectly detected new trailing blank lines when
+ whitespace check was in effect.
+
+* "git for-each-ref" tried to dereference NULL when asked for '%(body)" on
+ a tag with a single incomplete line as its payload.
+
+* "git format-patch" peeked before the beginning of a string when
+ "format.headers" variable is empty (a misconfiguration).
+
+* "git help help" did not work correctly.
+
+* "git mailinfo" (hence "git am") was unhappy when MIME multipart message
+ contained garbage after the finishing boundary.
+
+* "git mailinfo" also was unhappy when the "From: " line only had a bare
+ e-mail address.
+
+* "git merge" did not refresh the index correctly when a merge resulted in
+ a fast-forward.
+
+* "git merge" did not resolve a truly trivial merges that can be done
+ without content level merges.
+
+* "git svn dcommit" to a repository with URL that has embedded usernames
+ did not work correctly.
+
+Contains other various documentation fixes.
diff --git a/Documentation/RelNotes-1.6.0.txt b/Documentation/RelNotes-1.6.0.txt
index 2542cf53d2..de7ef166b6 100644
--- a/Documentation/RelNotes-1.6.0.txt
+++ b/Documentation/RelNotes-1.6.0.txt
@@ -5,7 +5,7 @@ User visible changes
--------------------
With the default Makefile settings, most of the programs are now
-installed outside your $PATH, except for "git", "gitk", "git-gui" and
+installed outside your $PATH, except for "git", "gitk" and
some server side programs that need to be accessible for technical
reasons. Invoking a git subcommand as "git-xyzzy" from the command
line has been deprecated since early 2006 (and officially announced in
@@ -28,6 +28,16 @@ introduced in v1.5.2 and v1.4.4.5. If you want to keep your repositories
backwards compatible past these versions, set repack.useDeltaBaseOffset
to false or pack.indexVersion to 1, respectively.
+We used to prevent sample hook scripts shipped in templates/ from
+triggering by default by relying on the fact that we install them as
+unexecutable, but on some filesystems, this approach does not work.
+They are now shipped with ".sample" suffix. If you want to activate
+any of these samples as-is, rename them to drop the ".sample" suffix,
+instead of running "chmod +x" on them. For example, you can rename
+hooks/post-update.sample to hooks/post-update to enable the sample
+hook that runs update-server-info, in order to make repositories
+friendly to dumb protocols (i.e. HTTP).
+
GIT_CONFIG, which was only documented as affecting "git config", but
actually affected all git commands, now only affects "git config".
GIT_LOCAL_CONFIG, also only documented as affecting "git config" and
@@ -56,11 +66,7 @@ Updates since v1.5.6
gangs.
* Sample hook scripts shipped in templates/ are now suffixed with
- *.sample. We used to prevent them from triggering by default by
- relying on the fact that we install them as unexecutable, but on
- some filesystems this approach does not work. Instead of running
- "chmod +x" on them, the users who want to activate these samples
- as-is can now rename them dropping *.sample suffix.
+ *.sample.
* perl's in-place edit (-i) does not work well without backup files on Windows;
some tests are rewritten to cope with this.
@@ -142,6 +148,10 @@ Updates since v1.5.6
* git-archive uses the zlib default compression level when creating
zip archive.
+* git-archive's command line options --exec and --remote can take their
+ parameters as separate command line arguments, similar to other commands.
+ IOW, both "--exec=path" and "--exec path" are now supported.
+
* With -v option, git-branch describes the remote tracking statistics
similar to the way git-checkout reports by how many commits your branch
is ahead/behind.
@@ -161,10 +171,16 @@ Updates since v1.5.6
* git-clone can clone from a remote whose URL would be rewritten by
configuration stored in $HOME/.gitconfig now.
+* "git-clone --mirror" is a handy way to set up a bare mirror repository.
+
* git-cvsserver learned to respond to "cvs co -c".
* git-diff --check now checks leftover merge conflict markers.
+* "git-diff -p" learned to grab a better hunk header lines in
+ BibTex, Pascal/Delphi, and Ruby files and also pays attention to
+ chapter and part boundary in TeX documents.
+
* When remote side used to have branch 'foo' and git-fetch finds that now
it has branch 'foo/bar', it refuses to lose the existing remote tracking
branch and its reflog. The error message has been improved to suggest
@@ -176,6 +192,10 @@ Updates since v1.5.6
* fast-import and fast-export learned to export and import gitlinks.
+* "gitk" left background process behind after being asked to dig very deep
+ history and the user killed the UI; the process is killed when the UI goes
+ away now.
+
* git-rebase records the original tip of branch in ORIG_HEAD before it is
rewound.
@@ -187,7 +207,7 @@ Updates since v1.5.6
command internally uses rev-parse to interpret its arguments.
* git-rev-list learned --children option to show child commits it
- encountered during the traversal, instead of shoing parent commits.
+ encountered during the traversal, instead of showing parent commits.
* git-send-mail can talk not just over SSL but over TLS now.
@@ -225,15 +245,14 @@ Fixes since v1.5.6
All of the fixes in v1.5.6 maintenance series are included in
this release, unless otherwise noted.
-* git-clone ignored its -u option; the fix needs to be backported to
- 'maint';
+ * git-clone ignored its -u option; the fix needs to be backported to
+ 'maint';
+
+ * git-mv used to lose the distinction between changes that are staged
+ and that are only in the working tree, by staging both in the index
+ after moving such a path.
-* git-mv used to lose the distinction between changes that are staged
- and that are only in the working tree, by staging both in the index
- after moving such a path.
+ * "git-rebase -i -p" rewrote the parents to wrong ones when amending
+ (either edit or squash) was involved, and did not work correctly
+ when fast forwarding.
----
-exec >/var/tmp/1
-O=v1.6.0-rc0-104-g81dc230
-echo O=$(git describe refs/heads/master)
-git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint
diff --git a/Documentation/RelNotes-1.6.1.txt b/Documentation/RelNotes-1.6.1.txt
new file mode 100644
index 0000000000..d37da039f6
--- /dev/null
+++ b/Documentation/RelNotes-1.6.1.txt
@@ -0,0 +1,58 @@
+GIT v1.6.1 Release Notes
+========================
+
+Updates since v1.6.0
+--------------------
+
+When some commands (e.g. "git log", "git diff") spawn pager internally, we
+used to make the pager the parent process of the git command that produces
+output. This meant that the exit status of the whole thing comes from the
+pager, not the underlying git command. We swapped the order of the
+processes around and you will see the exit code from the command from now
+on.
+
+(subsystems)
+
+* ...
+
+(portability)
+
+* ...
+
+(documentation)
+
+* ...
+
+(performance)
+
+* The underlying diff machinery to produce textual output has been
+ optimized, which would result in faster "git blame" processing.
+
+(usability, bells and whistles)
+
+* "git checkout --track origin/hack" used to be a syntax error. It now
+ DWIMs to create a corresponding local branch "hack", i.e. acts as if you
+ said "git checkout --track -b hack origin/hack".
+
+* "git diff" learned to mimick --suppress-blank-empty from GNU diff via a
+ configuration option.
+
+* "git imap-send" can optionally talk SSL.
+
+(internal)
+
+* "git hash-object" learned to lie about the path being hashed, so that
+ correct gitattributes processing can be done while hashing contents
+ stored in a temporary file.
+
+Fixes since v1.6.0
+------------------
+
+All of the fixes in v1.6.0.X maintenance series are included in this
+release, unless otherwise noted.
+
+--
+exec >/var/tmp/1
+O=v1.6.0-48-ge28a867
+echo O=$(git describe master)
+git shortlog --no-merges $O..master ^maint
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 841bead9db..a1e9100f9e 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -71,7 +71,7 @@ run git diff --check on your changes before you commit.
(1a) Try to be nice to older C compilers
-We try to support wide range of C compilers to compile
+We try to support a wide range of C compilers to compile
git with. That means that you should not use C99 initializers, even
if a lot of compilers grok it.
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 61c376057c..af57d94304 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -358,8 +358,13 @@ core.editor::
`EDITOR` environment variables and then finally `vi`.
core.pager::
- The command that git will use to paginate output. Can be overridden
- with the `GIT_PAGER` environment variable.
+ The command that git will use to paginate output. Can
+ be overridden with the `GIT_PAGER` environment
+ variable. Note that git sets the `LESS` environment
+ variable to `FRSX` if it is unset when it runs the
+ pager. One can change these settings by setting the
+ `LESS` variable to some other value or by giving the
+ `core.pager` option a value such as "`less -+FRSX`".
core.whitespace::
A comma separated list of common whitespace problems to
@@ -567,6 +572,10 @@ diff.autorefreshindex::
affects only 'git-diff' Porcelain, and not lower level
'diff' commands, such as 'git-diff-files'.
+diff.suppress-blank-empty::
+ A boolean to inhibit the standard behavior of printing a space
+ before each empty output line. Defaults to false.
+
diff.external::
If this config variable is set, diff generation is not
performed using the internal diff machinery, but using the
@@ -693,7 +702,7 @@ gitcvs.usecrlfattr
files to determine the '-k' modes to use. If `crlf` is set,
the '-k' mode will be left blank, so cvs clients will
treat it as text. If `crlf` is explicitly unset, the file
- will be set with '-kb' mode, which supresses any newline munging
+ will be set with '-kb' mode, which suppresses any newline munging
the client might otherwise do. If `crlf` is not specified,
then 'gitcvs.allbinary' is used. See linkgit:gitattributes[5].
@@ -978,6 +987,13 @@ pack.packSizeLimit::
can be overridden by the `\--max-pack-size` option of
linkgit:git-repack[1].
+pager.<cmd>::
+ Allows turning on or off pagination of the output of a
+ particular git subcommand when writing to a tty. If
+ `\--paginate` or `\--no-pager` is specified on the command line,
+ it takes precedence over this option. To disable pagination for
+ all commands, set `core.pager` or 'GIT_PAGER' to "`cat`".
+
pull.octopus::
The default merge strategy to use when pulling multiple branches
at once.
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index cba90fd27c..1759386404 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -107,9 +107,9 @@ endif::git-format-patch[]
--exit-code.
--full-index::
- Instead of the first handful characters, show full
- object name of pre- and post-image blob on the "index"
- line when generating a patch format output.
+ Instead of the first handful of characters, show the full
+ pre- and post-image blob object names on the "index"
+ line when generating patch format output.
--binary::
In addition to --full-index, output "binary diff" that
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index c45c53ec24..b9c6fac748 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
- [--3way] [--interactive] [--binary]
+ [--3way] [--interactive]
[--whitespace=<option>] [-C<n>] [-p<n>]
[<mbox> | <Maildir>...]
'git am' (--skip | --resolved | --abort)
@@ -59,11 +59,6 @@ default. You could use `--no-utf8` to override this.
it is supposed to apply to, and we have those blobs
available locally.
--b::
---binary::
- Pass `--allow-binary-replacement` flag to 'git-apply'
- (see linkgit:git-apply[1]).
-
--whitespace=<option>::
This flag is passed to the 'git-apply' (see linkgit:git-apply[1])
program that applies
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index d35e8a04fe..668f697c2a 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -81,7 +81,7 @@ object specified on stdin:
------------
If '--batch-check' is specified, output of the following form is printed for
-each object specified fon stdin:
+each object specified on stdin:
------------
<sha1> SP <type> SP <size> LF
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 5aa69c0e12..be54a0299f 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -8,7 +8,7 @@ git-checkout - Checkout a branch or paths to the working tree
SYNOPSIS
--------
[verse]
-'git checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
+'git checkout' [-q] [-f] [--track | --no-track] [-b <new_branch> [-l]] [-m] [<branch>]
'git checkout' [<tree-ish>] [--] <paths>...
DESCRIPTION
@@ -21,6 +21,10 @@ specified, <new_branch>. Using -b will cause <new_branch> to
be created; in this case you can use the --track or --no-track
options, which will be passed to `git branch`.
+As a convenience, --track will default to create a branch whose
+name is constructed from the specified branch name by stripping
+the first namespace level.
+
When <paths> are given, this command does *not* switch
branches. It updates the named paths in the working tree from
the index file (i.e. it runs `git checkout-index -f -u`), or
@@ -59,6 +63,17 @@ OPTIONS
'git-checkout' and 'git-branch' to always behave as if '--no-track' were
given. Set it to `always` if you want this behavior when the
start-point is either a local or remote branch.
++
+If no '-b' option was given, the name of the new branch will be
+derived from the remote branch, by attempting to guess the name
+of the branch on remote system. If "remotes/" or "refs/remotes/"
+are prefixed, it is stripped away, and then the part up to the
+next slash (which would be the nickname of the remote) is removed.
+This would tell us to use "hack" as the local branch when branching
+off of "origin/hack" (or "remotes/origin/hack", or even
+"refs/remotes/origin/hack"). If the given name has no slash, or the above
+guessing results in an empty name, the guessing is aborted. You can
+exlicitly give a name with '-b' in such a case.
--no-track::
Ignore the branch.autosetupmerge configuration variable.
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index 7dcc1ba58c..8a114509f4 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -8,7 +8,7 @@ git-clean - Remove untracked files from the working tree
SYNOPSIS
--------
[verse]
-'git clean' [-d] [-f] [-n] [-q] [-x | -X] [--] <paths>...
+'git clean' [-d] [-f] [-n] [-q] [-x | -X] [--] <path>...
DESCRIPTION
-----------
@@ -16,8 +16,8 @@ Removes files unknown to git. This allows to clean the working tree
from files that are not under version control. If the '-x' option is
specified, ignored files are also removed, allowing to remove all
build products.
-When optional `<paths>...` arguments are given, the paths
-affected are further limited to those that match them.
+If any optional `<path>...` arguments are given, only those paths
+are affected.
OPTIONS
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 26fd1b1117..0e14e732fd 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git clone' [--template=<template_directory>]
- [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
+ [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
[--depth <depth>] [--] <repository> [<directory>]
@@ -106,6 +106,9 @@ then the cloned repository will become corrupt.
used, neither remote-tracking branches nor the related
configuration variables are created.
+--mirror::
+ Set up a mirror of the remote repository. This implies --bare.
+
--origin <name>::
-o <name>::
Instead of using the remote name 'origin' to keep track
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index feec58400b..92ab3ab4a8 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -16,12 +16,12 @@ This is usually not what an end user wants to run directly. See
linkgit:git-commit[1] instead.
Creates a new commit object based on the provided tree object and
-emits the new commit object id on stdout. If no parent is given then
-it is considered to be an initial tree.
+emits the new commit object id on stdout.
-A commit object usually has 1 parent (a commit after a change) or up
-to 16 parents. More than one parent represents a merge of branches
-that led to them.
+A commit object may have any number of parents. With exactly one
+parent, it is an ordinary commit. Having more than one parent makes
+the commit a merge between several lines of history. Initial (root)
+commits have no parents.
While a tree represents a particular directory state of a working
directory, a commit represents that state in "time", and explains how
diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt
index 75a8da1ca9..6bc1c21e62 100644
--- a/Documentation/git-count-objects.txt
+++ b/Documentation/git-count-objects.txt
@@ -21,8 +21,9 @@ OPTIONS
--verbose::
In addition to the number of loose objects and disk
space consumed, it reports the number of in-pack
- objects, number of packs, and number of objects that can be
- removed by running `git prune-packed`.
+ objects, number of packs, disk space consumed by those packs,
+ and number of objects that can be removed by running
+ `git prune-packed`.
Author
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index c2d3c90d27..785779e221 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -11,7 +11,7 @@ SYNOPSIS
SSH:
[verse]
-export CVS_SERVER=git-cvsserver
+export CVS_SERVER="git cvsserver"
'cvs' -d :ext:user@server/path/repo.git co <HEAD_name>
pserver (/etc/inetd.conf):
@@ -109,7 +109,7 @@ Note: Newer CVS versions (>= 1.12.11) also support specifying
CVS_SERVER directly in CVSROOT like
------
-cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co <HEAD_name>
+cvs -d ":ext;CVS_SERVER=git cvsserver:user@server/path/repo.git" co <HEAD_name>
------
This has the advantage that it will be saved in your 'CVS/Root' files and
you don't need to worry about always setting the correct environment
@@ -158,7 +158,7 @@ allowing access over SSH.
--
------
export CVSROOT=:ext:user@server:/var/git/project.git
- export CVS_SERVER=git-cvsserver
+ export CVS_SERVER="git cvsserver"
------
--
4. For SSH clients that will make commits, make sure their server-side
@@ -283,7 +283,7 @@ To get a checkout with the Eclipse CVS client:
Protocol notes: If you are using anonymous access via pserver, just select that.
Those using SSH access should choose the 'ext' protocol, and configure 'ext'
access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to
-'git-cvsserver'. Note that password support is not good when using 'ext',
+"'git cvsserver'". Note that password support is not good when using 'ext',
you will definitely want to have SSH keys setup.
Alternatively, you can just use the non-standard extssh protocol that Eclipse
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index 7fdda04bae..c4dbc2ae34 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -21,8 +21,8 @@ abbreviated object name of the most recent commit.
OPTIONS
-------
-<committish>::
- The object name of the committish.
+<committish>...::
+ Committish object names to describe.
--all::
Instead of using only the annotated tags, use any ref
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 8c8f35b7a7..5d48664e62 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -49,13 +49,22 @@ include::diff-options.txt[]
--stdin::
When '--stdin' is specified, the command does not take
<tree-ish> arguments from the command line. Instead, it
- reads either one <commit> or a pair of <tree-ish>
- separated with a single space from its standard input.
+ reads lines containing either two <tree>, one <commit>, or a
+ list of <commit> from its standard input. (Use a single space
+ as separator.)
+
-When a single commit is given on one line of such input, it compares
-the commit with its parents. The following flags further affects its
-behavior. This does not apply to the case where two <tree-ish>
-separated with a single space are given.
+When two trees are given, it compares the first tree with the second.
+When a single commit is given, it compares the commit with its
+parents. The remaining commits, when given, are used as if they are
+parents of the first commit.
++
+When comparing two trees, the ID of both trees (separated by a space
+and terminated by a newline) is printed before the difference. When
+comparing commits, the ID of the first (or only) commit, followed by a
+newline, is printed.
++
+The following flags further affects the behavior when comparing
+commits (but not trees).
-m::
By default, 'git-diff-tree --stdin' does not show
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 4956964d85..b974e2115b 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -36,6 +36,15 @@ when encountering a signed tag. With 'strip', the tags will be made
unsigned, with 'verbatim', they will be silently exported
and with 'warn', they will be exported, but you will see a warning.
+-M::
+-C::
+ Perform move and/or copy detection, as described in the
+ linkgit:git-diff[1] manual page, and use it to generate
+ rename and copy commands in the output dump.
++
+Note that earlier versions of this command did not complain and
+produced incorrect results if you gave these options.
+
--export-marks=<file>::
Dumps the internal marks table to <file> when complete.
Marks are written one per line as `:markid SHA-1`. Only marks
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 7ba9dab5e6..b0e710d5f9 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -13,7 +13,7 @@ SYNOPSIS
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
[--original <namespace>] [-d <directory>] [-f | --force]
- [<rev-list options>...]
+ [--] [<rev-list options>...]
DESCRIPTION
-----------
@@ -167,11 +167,11 @@ to other tags will be rewritten to point to the underlying commit.
directory or when there are already refs starting with
'refs/original/', unless forced.
-<rev-list-options>::
- When options are given after the new branch name, they will
- be passed to 'git-rev-list'. Only commits in the resulting
- output will be filtered, although the filtered commits can still
- reference parents which are outside of that set.
+<rev-list options>...::
+ Arguments for 'git-rev-list'. All positive refs included by
+ these options are rewritten. You may also specify options
+ such as '--all', but you must use '--' to separate them from
+ the 'git-filter-branch' options.
Examples
@@ -196,6 +196,17 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD
Now, you will get the rewritten history saved in HEAD.
+To rewrite the repository to look as if `foodir/` had been its project
+root, and discard all other history:
+
+-------------------------------------------------------
+git filter-branch --subdirectory-filter foodir -- --all
+-------------------------------------------------------
+
+Thus you can, e.g., turn a library subdirectory into a repository of
+its own. Note the `\--` that separates 'filter-branch' options from
+revision options, and the `\--all` to rewrite all branches and tags.
+
To set a commit (which typically is at the tip of another
history) to be the parent of the current initial commit, in
order to paste the other history behind the current history:
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 727d84e673..eae6c0e7bc 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -47,9 +47,9 @@ OPTIONS
`xx`; for example `%00` interpolates to `\0` (NUL),
`%09` to `\t` (TAB) and `%0a` to `\n` (LF).
-<pattern>::
+<pattern>...::
If one or more patterns are given, only refs are shown that
- match againt at least one pattern, either using fnmatch(3) or
+ match against at least one pattern, either using fnmatch(3) or
literally, in the latter case matching completely or from the
beginning up to a slash.
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 010d9e4322..adb4ea7b1b 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -147,9 +147,9 @@ include::diff-options.txt[]
to any configured headers, and may be used multiple times.
--cover-letter::
- Generate a cover letter template. You still have to fill in
- a description, but the shortlog and the diffstat will be
- generated for you.
+ In addition to the patches, generate a cover letter file
+ containing the shortlog and the overall diffstat. You can
+ fill in a description in the file before sending it out.
--suffix=.<sfx>::
Instead of using `.patch` as the suffix for generated
diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt
index ac928e198e..0af40cfb85 100644
--- a/Documentation/git-hash-object.txt
+++ b/Documentation/git-hash-object.txt
@@ -8,7 +8,9 @@ git-hash-object - Compute object ID and optionally creates a blob from a file
SYNOPSIS
--------
-'git hash-object' [-t <type>] [-w] [--stdin | --stdin-paths] [--] <file>...
+[verse]
+'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin] [--] <file>...
+'git hash-object' [-t <type>] [-w] --stdin-paths < <list-of-paths>
DESCRIPTION
-----------
@@ -35,6 +37,22 @@ OPTIONS
--stdin-paths::
Read file names from stdin instead of from the command-line.
+--path::
+ Hash object as it were located at the given path. The location of
+ file does not directly influence on the hash value, but path is
+ used to determine what git filters should be applied to the object
+ before it can be placed to the object database, and, as result of
+ applying filters, the actual blob put into the object database may
+ differ from the given file. This option is mainly useful for hashing
+ temporary files located outside of the working directory or files
+ read from stdin.
+
+--no-filters::
+ Hash the contents as is, ignoring any input filter that would
+ have been chosen by the attributes mechanism, including crlf
+ conversion. If the file is read from standard input then this
+ is always implied, unless the --path option is given.
+
Author
------
Written by Junio C Hamano <gitster@pobox.com>
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index b3d8da33ee..bd49a0aee8 100644
--- a/Documentation/git-imap-send.txt
+++ b/Documentation/git-imap-send.txt
@@ -3,7 +3,7 @@ git-imap-send(1)
NAME
----
-git-imap-send - Dump a mailbox from stdin into an imap folder
+git-imap-send - Send a collection of patches from stdin to an IMAP folder
SYNOPSIS
@@ -13,9 +13,9 @@ SYNOPSIS
DESCRIPTION
-----------
-This command uploads a mailbox generated with git-format-patch
-into an imap drafts folder. This allows patches to be sent as
-other email is sent with mail clients that cannot read mailbox
+This command uploads a mailbox generated with 'git-format-patch'
+into an IMAP drafts folder. This allows patches to be sent as
+other email is when using mail clients that cannot read mailbox
files directly.
Typical usage is something like:
@@ -26,21 +26,75 @@ git format-patch --signoff --stdout --attach origin | git imap-send
CONFIGURATION
-------------
-'git-imap-send' requires the following values in the repository
-configuration file (shown with examples):
+To use the tool, imap.folder and either imap.tunnel or imap.host must be set
+to appropriate values.
+
+Variables
+~~~~~~~~~
+
+imap.folder::
+ The folder to drop the mails into, which is typically the Drafts
+ folder. For example: "INBOX.Drafts", "INBOX/Drafts" or
+ "[Gmail]/Drafts". Required to use imap-send.
+
+imap.tunnel::
+ Command used to setup a tunnel to the IMAP server through which
+ commands will be piped instead of using a direct network connection
+ to the server. Required when imap.host is not set to use imap-send.
+
+imap.host::
+ A URL identifying the server. Use a `imap://` prefix for non-secure
+ connections and a `imaps://` prefix for secure connections.
+ Ignored when imap.tunnel is set, but required to use imap-send
+ otherwise.
+
+imap.user::
+ The username to use when logging in to the server.
+
+imap.password::
+ The password to use when logging in to the server.
+
+imap.port::
+ An integer port number to connect to on the server.
+ Defaults to 143 for imap:// hosts and 993 for imaps:// hosts.
+ Ignored when imap.tunnel is set.
+
+imap.sslverify::
+ A boolean to enable/disable verification of the server certificate
+ used by the SSL/TLS connection. Default is `true`. Ignored when
+ imap.tunnel is set.
+
+Examples
+~~~~~~~~
+
+Using tunnel mode:
..........................
[imap]
- Folder = "INBOX.Drafts"
+ folder = "INBOX.Drafts"
+ tunnel = "ssh -q -C user@example.com /usr/bin/imapd ./Maildir 2> /dev/null"
+..........................
+Using direct mode:
+
+.........................
[imap]
- Tunnel = "ssh -q user@server.com /usr/bin/imapd ./Maildir 2> /dev/null"
+ folder = "INBOX.Drafts"
+ host = imap://imap.example.com
+ user = bob
+ pass = p4ssw0rd
+..........................
+
+Using direct mode with SSL:
+.........................
[imap]
- Host = imap.server.com
- User = bob
- Pass = pwd
- Port = 143
+ folder = "INBOX.Drafts"
+ host = imaps://imap.example.com
+ user = bob
+ pass = p4ssw0rd
+ port = 123
+ sslverify = false
..........................
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 05cbac56ac..0446bad7e5 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -41,10 +41,10 @@ include::diff-options.txt[]
Print out the ref names of any commits that are shown.
--full-diff::
- Without this flag, "git log -p <paths>..." shows commits that
+ Without this flag, "git log -p <path>..." shows commits that
touch the specified paths, and diffs about the same specified
paths. With this, the full diff is shown for commits that touch
- the specified paths; this means that "<paths>..." limits only
+ the specified paths; this means that "<path>..." limits only
commits, and doesn't limit diff for those commits.
--follow::
@@ -57,7 +57,7 @@ include::diff-options.txt[]
Note that only message is considered, if also a diff is shown
its size is not included.
-<paths>...::
+<path>...::
Show only commits that affect any of the specified paths.
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 1a7ecbf8f3..2f0c5259e0 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -8,26 +8,81 @@ git-merge-base - Find as good common ancestors as possible for a merge
SYNOPSIS
--------
-'git merge-base' [--all] <commit> <commit>
+'git merge-base' [--all] <commit> <commit>...
DESCRIPTION
-----------
-'git-merge-base' finds as good a common ancestor as possible between
-the two commits. That is, given two commits A and B, `git merge-base A
-B` will output a commit which is reachable from both A and B through
-the parent relationship.
+'git-merge-base' finds best common ancestor(s) between two commits to use
+in a three-way merge. One common ancestor is 'better' than another common
+ancestor if the latter is an ancestor of the former. A common ancestor
+that does not have any better common ancestor than it is a 'best common
+ancestor', i.e. a 'merge base'. Note that there can be more than one
+merge bases between two commits.
-Given a selection of equally good common ancestors it should not be
-relied on to decide in any particular way.
-
-The 'git-merge-base' algorithm is still in flux - use the source...
+Among the two commits to compute their merge bases, one is specified by
+the first commit argument on the command line; the other commit is a
+(possibly hypothetical) commit that is a merge across all the remaining
+commits on the command line. As the most common special case, giving only
+two commits from the command line means computing the merge base between
+the given two commits.
OPTIONS
-------
--all::
- Output all common ancestors for the two commits instead of
- just one.
+ Output all merge bases for the commits, instead of just one.
+
+DISCUSSION
+----------
+
+Given two commits 'A' and 'B', `git merge-base A B` will output a commit
+which is reachable from both 'A' and 'B' through the parent relationship.
+
+For example, with this topology:
+
+ o---o---o---B
+ /
+ ---o---1---o---o---o---A
+
+the merge base between 'A' and 'B' is '1'.
+
+Given three commits 'A', 'B' and 'C', `git merge-base A B C` will compute the
+merge base between 'A' and an hypothetical commit 'M', which is a merge
+between 'B' and 'C'. For example, with this topology:
+
+ o---o---o---o---C
+ /
+ / o---o---o---B
+ / /
+ ---2---1---o---o---o---A
+
+the result of `git merge-base A B C` is '1'. This is because the
+equivalent topology with a merge commit 'M' between 'B' and 'C' is:
+
+
+ o---o---o---o---o
+ / \
+ / o---o---o---o---M
+ / /
+ ---2---1---o---o---o---A
+
+and the result of `git merge-base A M` is '1'. Commit '2' is also a
+common ancestor between 'A' and 'M', but '1' is a better common ancestor,
+because '2' is an ancestor of '1'. Hence, '2' is not a merge base.
+
+When the history involves criss-cross merges, there can be more than one
+'best' common ancestors between two commits. For example, with this
+topology:
+
+ ---1---o---A
+ \ /
+ X
+ / \
+ ---2---o---o---B
+
+both '1' and '2' are merge-base of A and B. Neither one is better than
+the other (both are 'best' merge base). When `--all` option is not given,
+it is unspecified which best one is output.
Author
------
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 2db8880989..685e1fed58 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -32,8 +32,8 @@ include::merge-options.txt[]
it is created). The 'git-fmt-merge-msg' script can be used
to give a good default for automated 'git-merge' invocations.
-<remote>::
- Other branch head merged into our branch. You need at
+<remote>...::
+ Other branch heads to merge into our branch. You need at
least one <remote>. Specifying more than one <remote>
obviously means you are trying an Octopus.
@@ -126,13 +126,25 @@ After seeing a conflict, you can do two things:
up working tree changes made by 2. and 3.; 'git-reset --hard' can
be used for this.
- * Resolve the conflicts. `git diff` would report only the
- conflicting paths because of the above 2. and 3.
- Edit the working tree files into a desirable shape
- ('git mergetool' can ease this task), 'git-add' or 'git-rm'
- them, to make the index file contain what the merge result
- should be, and run 'git-commit' to commit the result.
+ * Resolve the conflicts. Git will mark the conflicts in
+ the working tree. Edit the files into shape and
+ 'git-add' to the index. 'git-commit' to seal the deal.
+You can work through the conflict with a number of tools:
+
+ * Use a mergetool. 'git mergetool' to launch a graphical
+ mergetool which will work you through the merge.
+
+ * Look at the diffs. 'git diff' will show a three-way diff,
+ highlighting changes from both the HEAD and remote versions.
+
+ * Look at the diffs on their own. 'git log --merge -p <path>'
+ will show diffs first for the HEAD version and then the
+ remote version.
+
+ * Look at the originals. 'git show :1:filename' shows the
+ common ancestor, 'git show :2:filename' shows the HEAD
+ version and 'git show :3:filename' shows the remote version.
SEE ALSO
--------
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index 31570b1e27..e0b2703b38 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -40,7 +40,7 @@ tool is available in PATH.
+
Instead of running one of the known merge tool programs
'git-mergetool' can be customized to run an alternative program
-by specifying the command line to invoke in a configration
+by specifying the command line to invoke in a configuration
variable `mergetool.<tool>.cmd`.
+
When 'git-mergetool' is invoked with this tool (either through the
diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt
index 6e77ab1353..abd2237e51 100644
--- a/Documentation/git-name-rev.txt
+++ b/Documentation/git-name-rev.txt
@@ -38,8 +38,7 @@ OPTIONS
Instead of printing both the SHA-1 and the name, print only
the name. If given with --tags the usual tag prefix of
"tags/" is also omitted from the name, matching the output
- of 'git-describe' more closely. This option
- cannot be combined with --stdin.
+ of `git-describe` more closely.
--no-undefined::
Die with error code != 0 when a reference is undefined,
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 94d07ab812..45c96435fa 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -10,7 +10,8 @@ SYNOPSIS
--------
[verse]
'git push' [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]
- [--repo=all] [-f | --force] [-v | --verbose] [<repository> <refspec>...]
+ [--repo=all] [-f | --force] [-v | --verbose]
+ [<repository> <refspec>...]
DESCRIPTION
-----------
@@ -29,9 +30,9 @@ OPTIONS
The "remote" repository that is destination of a push
operation. See the section <<URLS,GIT URLS>> below.
-<refspec>::
+<refspec>...::
The canonical format of a <refspec> parameter is
- `+?<src>:<dst>`; that is, an optional plus `+`, followed
+ `+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
by the source ref, followed by a colon `:`, followed by
the destination ref.
+
@@ -180,11 +181,11 @@ git push origin :experimental::
Find a ref that matches `experimental` in the `origin` repository
(e.g. `refs/heads/experimental`), and delete it.
-git push origin master:satellite/master::
- Find a ref that matches `master` in the source repository
- (most likely, it would find `refs/heads/master`), and update
- the ref that matches `satellite/master` (most likely, it would
- be `refs/remotes/satellite/master`) in `origin` repository with it.
+git push origin master:satellite/master dev:satellite/dev::
+ Use the source ref that matches `master` (e.g. `refs/heads/master`)
+ to update the ref that matches `satellite/master` (most probably
+ `refs/remotes/satellite/master`) in the `origin` repository, then
+ do the same for `dev` and `satellite/dev`.
git push origin master:refs/heads/experimental::
Create the branch `experimental` in the `origin` repository
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index 89f321b414..64715c17da 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -90,15 +90,15 @@ One way to do it is to pull master into the topic branch:
The commits marked with `*` touch the same area in the same
file; you need to resolve the conflicts when creating the commit
-marked with `+`. Then you can test the result to make sure your
+marked with `{plus}`. Then you can test the result to make sure your
work-in-progress still works with what is in the latest master.
After this test merge, there are two ways to continue your work
on the topic. The easiest is to build on top of the test merge
-commit `+`, and when your work in the topic branch is finally
+commit `{plus}`, and when your work in the topic branch is finally
ready, pull the topic branch into master, and/or ask the
upstream to pull from you. By that time, however, the master or
-the upstream might have been advanced since the test merge `+`,
+the upstream might have been advanced since the test merge `{plus}`,
in which case the final commit graph would look like this:
------------
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 5c936693d3..2921da320d 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -155,8 +155,9 @@ blobs contained in a commit.
name the same commit object if there are no other object in
your repository whose object name starts with dae86e.
-* An output from 'git-describe'; i.e. a closest tag, followed by a
- dash, a `g`, and an abbreviated object name.
+* An output from 'git-describe'; i.e. a closest tag, optionally
+ followed by a dash and a number of commits, followed by a dash, a
+ `g`, and an abbreviated object name.
* A symbolic ref name. E.g. 'master' typically means the commit
object referenced by $GIT_DIR/refs/heads/master. If you
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 98cfa3c0d0..caa07298a6 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -15,6 +15,15 @@ Given one existing commit, revert the change the patch introduces, and record a
new commit that records it. This requires your working tree to be clean (no
modifications from the HEAD commit).
+Note: 'git revert' is used to record a new commit to reverse the
+effect of an earlier commit (often a faulty one). If you want to
+throw away all uncommitted changes in your working directory, you
+should see linkgit:git-reset[1], particularly the '--hard' option. If
+you want to extract specific files as they were in another commit, you
+should see linkgit:git-checkout[1], specifically the 'git checkout
+<commit> -- <filename>' syntax. Take care with these alternatives as
+both will discard uncommitted changes in your working directory.
+
OPTIONS
-------
<commit>::
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 4d0c495bc3..5afb1e7428 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -7,7 +7,7 @@ git-rm - Remove files from the working tree and from the index
SYNOPSIS
--------
-'git rm' [-f] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file>...
+'git rm' [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file>...
DESCRIPTION
-----------
@@ -36,6 +36,7 @@ OPTIONS
but this requires the `-r` option to be explicitly given.
-f::
+--force::
Override the up-to-date check.
-n::
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index afbb294a7f..e2437f30ca 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -56,7 +56,7 @@ The --cc option must be repeated for each user you want on the cc list.
--from::
Specify the sender of the emails. This will default to
- the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
+ the value GIT_COMMITTER_IDENT, as returned by "git var -l".
The user will still be prompted to confirm this entry.
--in-reply-to::
diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt
index 9a4389981c..2f173fff35 100644
--- a/Documentation/git-show-ref.txt
+++ b/Documentation/git-show-ref.txt
@@ -84,7 +84,7 @@ OPTIONS
(5) otherwise output the line.
-<pattern>::
+<pattern>...::
Show references matching one or more patterns.
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 1642cfd823..48b612e2ae 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -33,8 +33,8 @@ This manual page describes only the most frequently used options.
OPTIONS
-------
-<object>::
- The name of the object to show.
+<object>...::
+ The names of objects to show.
For a more complete list of ways to spell object names, see
"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 7d50d74cc9..49e2296a24 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -8,11 +8,13 @@ git-stash - Stash the changes in a dirty working directory away
SYNOPSIS
--------
[verse]
-'git stash' list
-'git stash' (show | apply | drop | pop ) [<stash>]
+'git stash' list [<options>]
+'git stash' (show | drop | pop ) [<stash>]
+'git stash' apply [--index] [<stash>]
'git stash' branch <branchname> [<stash>]
-'git stash' [save [<message>]]
+'git stash' [save [--keep-index] [<message>]]
'git stash' clear
+'git stash' create
DESCRIPTION
-----------
@@ -116,6 +118,11 @@ pop [<stash>]::
of the current working tree state. When no `<stash>` is given,
`stash@\{0}` is assumed. See also `apply`.
+create::
+
+ Create a stash (which is a regular commit object) and return its
+ object name, without storing it anywhere in the ref namespace.
+
DISCUSSION
----------
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
index 35efeefb30..babaa9bc46 100644
--- a/Documentation/git-submodule.txt
+++ b/Documentation/git-submodule.txt
@@ -14,6 +14,8 @@ SYNOPSIS
'git submodule' [--quiet] init [--] [<path>...]
'git submodule' [--quiet] update [--init] [--] [<path>...]
'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...]
+'git submodule' [--quiet] foreach <command>
+'git submodule' [--quiet] sync [--] [<path>...]
DESCRIPTION
@@ -123,6 +125,30 @@ summary::
in the submodule between the given super project commit and the
index or working tree (switched by --cached) are shown.
+foreach::
+ Evaluates an arbitrary shell command in each checked out submodule.
+ The command has access to the variables $path and $sha1:
+ $path is the name of the submodule directory relative to the
+ superproject, and $sha1 is the commit as recorded in the superproject.
+ Any submodules defined in the superproject but not checked out are
+ ignored by this command. Unless given --quiet, foreach prints the name
+ of each submodule before evaluating the command.
+ A non-zero return from the command in any submodule causes
+ the processing to terminate. This can be overridden by adding '|| :'
+ to the end of the command.
++
+As an example, "git submodule foreach 'echo $path `git rev-parse HEAD`' will
+show the path and currently checked out commit for each submodule.
+
+sync::
+ Synchronizes submodules' remote URL configuration setting
+ to the value specified in .gitmodules. This is useful when
+ submodule URLs change upstream and you need to update your local
+ repositories accordingly.
++
+"git submodule sync" synchronizes all submodules while
+"git submodule sync -- A" synchronizes submodule "A" only.
+
OPTIONS
-------
-q::
@@ -146,8 +172,8 @@ OPTIONS
(the default). This limit only applies to modified submodules. The
size is always limited to 1 for added/deleted/typechanged submodules.
-<path>::
- Path to submodule(s). When specified this will restrict the command
+<path>...::
+ Paths to submodule(s). When specified this will restrict the command
to only operate on the submodules found at the specified paths.
(This argument is required with add).
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index e7c0f1c959..1e644ca6dc 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -12,18 +12,18 @@ SYNOPSIS
DESCRIPTION
-----------
'git-svn' is a simple conduit for changesets between Subversion and git.
-It is not to be confused with linkgit:git-svnimport[1], which is
-read-only.
+It provides a bidirectional flow of changes between a Subversion and a git
+repository.
-'git-svn' was originally designed for an individual developer who wants a
-bidirectional flow of changesets between a single branch in Subversion
-and an arbitrary number of branches in git. Since its inception,
-'git-svn' has gained the ability to track multiple branches in a manner
-similar to 'git-svnimport'.
+'git-svn' can track a single Subversion branch simply by using a
+URL to the branch, follow branches laid out in the Subversion recommended
+method (trunk, branches, tags directories) with the --stdlayout option, or
+follow branches in any layout with the -T/-t/-b options (see options to
+'init' below, and also the 'clone' command).
-'git-svn' is especially useful when it comes to tracking repositories
-not organized in the way Subversion developers recommend (trunk,
-branches, tags directories).
+Once tracking a Subversion branch (with any of the above methods), the git
+repository can be updated from Subversion by the 'fetch' command and
+Subversion updated from git by the 'dcommit' command.
COMMANDS
--------
@@ -138,6 +138,15 @@ and have no uncommitted changes.
+
--no-rebase;;
After committing, do not rebase or reset.
+--commit-url <URL>;;
+ Commit to this SVN URL (the full path). This is intended to
+ allow existing git-svn repositories created with one transport
+ method (e.g. `svn://` or `http://` for anonymous read) to be
+ reused if a user is later given access to an alternate transport
+ method (e.g. `svn+ssh://` or `https://`) for commit.
+
+ Using this option for any other purpose (don't ask)
+ is very strongly discouraged.
--
'log'::
@@ -209,7 +218,7 @@ Any other arguments are passed directly to 'git-log'
Recursively finds the svn:ignore property on directories and
creates matching .gitignore files. The resulting files are staged to
be committed, but are not committed. Use -r/--revision to refer to a
- specfic revision.
+ specific revision.
'show-ignore'::
Recursively finds and lists the svn:ignore property on
@@ -218,8 +227,7 @@ Any other arguments are passed directly to 'git-log'
'commit-diff'::
Commits the diff of two tree-ish arguments from the
- command-line. This command is intended for interoperability with
- 'git-svnimport' and does not rely on being inside an `git-svn
+ command-line. This command does not rely on being inside an `git-svn
init`-ed repository. This command takes three arguments, (a) the
original tree to diff against, (b) the new tree result, (c) the
URL of the target Subversion repository. The final argument
@@ -317,8 +325,7 @@ config key: svn.findcopiesharder
-A<filename>::
--authors-file=<filename>::
-Syntax is compatible with the files used by 'git-svnimport' and
-'git-cvsimport':
+Syntax is compatible with the file used by 'git-cvsimport':
------------------------------------------------------------------------
loginname = Joe User <user@example.com>
diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt
index ba837df4bc..84e70a0234 100644
--- a/Documentation/git-verify-tag.txt
+++ b/Documentation/git-verify-tag.txt
@@ -15,8 +15,8 @@ Validates the gpg signature created by 'git-tag'.
OPTIONS
-------
-<tag>::
- SHA1 identifier of a git tag object.
+<tag>...::
+ SHA1 identifiers of git tag objects.
Author
------
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 44ea35e949..e178fb5813 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -43,9 +43,16 @@ unreleased) version of git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
-* link:v1.5.6.4/git.html[documentation for release 1.5.6.4]
+* link:v1.6.1/git.html[documentation for release 1.6.1]
* release notes for
+ link:RelNotes-1.6.1.txt[1.6.1],
+ link:RelNotes-1.6.0.txt[1.6.0].
+
+* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
+
+* release notes for
+ link:RelNotes-1.5.6.5.txt[1.5.6.5],
link:RelNotes-1.5.6.4.txt[1.5.6.4],
link:RelNotes-1.5.6.3.txt[1.5.6.3],
link:RelNotes-1.5.6.2.txt[1.5.6.2],
@@ -491,7 +498,8 @@ other
'GIT_PAGER'::
This environment variable overrides `$PAGER`. If it is set
to an empty string or to the value "cat", git will not launch
- a pager.
+ a pager. See also the `core.pager` option in
+ linkgit:git-config[1].
'GIT_SSH'::
If this environment variable is set then 'git-fetch'
@@ -602,7 +610,7 @@ contributors on the git-list <git@vger.kernel.org>.
SEE ALSO
--------
linkgit:gittutorial[7], linkgit:gittutorial-2[7],
-linkgit:everyday[7], linkgit:gitcvs-migration[7],
+link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7],
linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
linkgit:gitcli[7], link:user-manual.html[The Git User's Manual]
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index d7b41142d2..5495d695c6 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -307,9 +307,22 @@ backslash, and zero or more occurrences of `sub` followed by
There are a few built-in patterns to make this easier, and `tex`
is one of them, so you do not have to write the above in your
configuration file (you still need to enable this with the
-attribute mechanism, via `.gitattributes`). Another built-in
-pattern is defined for `java` that defines a pattern suitable
-for program text in Java language.
+attribute mechanism, via `.gitattributes`). The following built in
+patterns are available:
+
+- `bibtex` suitable for files with BibTeX coded references.
+
+- `java` suitable for source code in the Java lanugage.
+
+- `pascal` suitable for source code in the Pascal/Delphi language.
+
+- `python` suitable for source code in the Python language.
+
+- `ruby` suitable for source code in the Ruby language.
+
+- `tex` suitable for source code for LaTeX documents.
+
+- `html` suitable for HTML/XHTML documents.
Performing a three-way merge
diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt
index 49179b0a00..a417e592ac 100644
--- a/Documentation/gitcore-tutorial.txt
+++ b/Documentation/gitcore-tutorial.txt
@@ -1366,8 +1366,9 @@ your login shell is 'bash', only `.bashrc` is read and not
[NOTE]
If you plan to publish this repository to be accessed over http,
-you should do `chmod +x my-git.git/hooks/post-update` at this
-point. This makes sure that every time you push into this
+you should do `mv my-git.git/hooks/post-update.sample
+my-git.git/hooks/post-update` at this point.
+This makes sure that every time you push into this
repository, `git update-server-info` is run.
Your "public repository" is now ready to accept your changes.
@@ -1486,11 +1487,11 @@ A recommended workflow for a "project lead" goes like this:
If other people are pulling from your repository over dumb
transport protocols (HTTP), you need to keep this repository
'dumb transport friendly'. After `git init`,
-`$GIT_DIR/hooks/post-update` copied from the standard templates
-would contain a call to 'git-update-server-info' but the
-`post-update` hook itself is disabled by default -- enable it
-with `chmod +x post-update`. This makes sure 'git-update-server-info'
-keeps the necessary files up-to-date.
+`$GIT_DIR/hooks/post-update.sample` copied from the standard templates
+would contain a call to 'git-update-server-info'
+but you need to manually enable the hook with
+`mv post-update.sample post-update`. This makes sure
+'git-update-server-info' keeps the necessary files up-to-date.
3. Push into the public repository from your primary
repository.
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index e02ecf5744..6e827cd11c 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -58,7 +58,7 @@ frequently used options.
For a more complete list of ways to spell object names, see
"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
-<path>::
+<path>...::
Limit commits to the ones touching files in the given paths. Note, to
avoid ambiguity wrt. revision names use "--" to separate the paths
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 48ce747cf4..00277e0613 100644
--- a/Documentation/merge-config.txt
+++ b/Documentation/merge-config.txt
@@ -1,5 +1,5 @@
merge.stat::
- Whether to print the diffstat berween ORIG_HEAD and merge result
+ Whether to print the diffstat between ORIG_HEAD and merge result
at the end of the merge. True by default.
merge.log::
@@ -16,7 +16,7 @@ merge.tool::
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
"tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
"opendiff". Any other value is treated is custom merge tool
- and there must be a corresponing mergetool.<tool>.cmd option.
+ and there must be a corresponding mergetool.<tool>.cmd option.
merge.verbosity::
Controls the amount of output shown by the recursive merge
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 00a8d21047..ebdd948cd2 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -6,7 +6,7 @@
<refspec>::
The canonical format of a <refspec> parameter is
- `+?<src>:<dst>`; that is, an optional plus `+`, followed
+ `+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
by the source ref, followed by a colon `:`, followed by
the destination ref.
+
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 3aa38097e6..735cf07b20 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -43,11 +43,13 @@ endif::git-rev-list[]
--parents::
- Print the parents of the commit.
+ Print the parents of the commit. Also enables parent
+ rewriting, see 'History Simplification' below.
--children::
- Print the children of the commit.
+ Print the children of the commit. Also enables parent
+ rewriting, see 'History Simplification' below.
ifdef::git-rev-list[]
--timestamp::
@@ -71,7 +73,7 @@ For example, if you have this topology:
o---x---a---a branch A
-----------------------------------------------------------------------
+
-you would get an output line this:
+you would get an output like this:
+
-----------------------------------------------------------------------
$ git rev-list --left-right --boundary --pretty=oneline A...B
@@ -94,6 +96,7 @@ you would get an output line this:
This implies the '--topo-order' option by default, but the
'--date-order' option may also be specified.
+ifndef::git-rev-list[]
Diff Formatting
~~~~~~~~~~~~~~~
@@ -123,6 +126,7 @@ options may be given. See linkgit:git-diff-files[1] for more options.
-t::
Show the tree objects in the diff output. This implies '-r'.
+endif::git-rev-list[]
Commit Limiting
~~~~~~~~~~~~~~~
@@ -191,14 +195,6 @@ endif::git-rev-list[]
Stop when a given path disappears from the tree.
---full-history::
-
- Show also parts of history irrelevant to current state of a given
- path. This turns off history simplification, which removed merges
- which didn't change anything at all at some child. It will still actually
- simplify away merges that didn't change anything at all into either
- child.
-
--no-merges::
Do not print commits with more than one parent.
@@ -264,11 +260,10 @@ With '\--pretty' format other than oneline (for obvious reasons),
this causes the output to have two extra lines of information
taken from the reflog. By default, 'commit@\{Nth}' notation is
used in the output. When the starting commit is specified as
-'commit@{now}', output also uses 'commit@\{timestamp}' notation
+'commit@\{now}', output also uses 'commit@\{timestamp}' notation
instead. Under '\--pretty=oneline', the commit message is
prefixed with this information on the same line.
-
-Cannot be combined with '\--reverse'.
+This option cannot be combined with '\--reverse'.
See also linkgit:git-reflog[1].
--merge::
@@ -281,18 +276,144 @@ See also linkgit:git-reflog[1].
Output uninteresting commits at the boundary, which are usually
not shown.
+--
+
+History Simplification
+~~~~~~~~~~~~~~~~~~~~~~
+
+When optional paths are given, 'git-rev-list' simplifies commits with
+various strategies, according to the options you have selected.
+
+Suppose you specified `foo` as the <paths>. We shall call commits
+that modify `foo` !TREESAME, and the rest TREESAME. (In a diff
+filtered for `foo`, they look different and equal, respectively.)
+
+In the following, we will always refer to the same example history to
+illustrate the differences between simplification settings. We assume
+that you are filtering for a file `foo` in this commit graph:
+-----------------------------------------------------------------------
+ .-A---M---N---O---P
+ / / / / /
+ I B C D E
+ \ / / / /
+ `-------------'
+-----------------------------------------------------------------------
+The horizontal line of history A--P is taken to be the first parent of
+each merge. The commits are:
+
+* `I` is the initial commit, in which `foo` exists with contents
+ "asdf", and a file `quux` exists with contents "quux". Initial
+ commits are compared to an empty tree, so `I` is !TREESAME.
+
+* In `A`, `foo` contains just "foo".
+
+* `B` contains the same change as `A`. Its merge `M` is trivial and
+ hence TREESAME to all parents.
+
+* `C` does not change `foo`, but its merge `N` changes it to "foobar",
+ so it is not TREESAME to any parent.
+
+* `D` sets `foo` to "baz". Its merge `O` combines the strings from
+ `N` and `D` to "foobarbaz"; i.e., it is not TREESAME to any parent.
+
+* `E` changes `quux` to "xyzzy", and its merge `P` combines the
+ strings to "quux xyzzy". Despite appearing interesting, `P` is
+ TREESAME to all parents.
+
+'rev-list' walks backwards through history, including or excluding
+commits based on whether '\--full-history' and/or parent rewriting
+(via '\--parents' or '\--children') are used. The following settings
+are available.
+
+Default mode::
+
+ Commits are included if they are not TREESAME to any parent
+ (though this can be changed, see '\--sparse' below). If the
+ commit was a merge, and it was TREESAME to one parent, follow
+ only that parent. (Even if there are several TREESAME
+ parents, follow only one of them.) Otherwise, follow all
+ parents.
++
+This results in:
++
+-----------------------------------------------------------------------
+ .-A---N---O
+ / /
+ I---------D
+-----------------------------------------------------------------------
++
+Note how the rule to only follow the TREESAME parent, if one is
+available, removed `B` from consideration entirely. `C` was
+considered via `N`, but is TREESAME. Root commits are compared to an
+empty tree, so `I` is !TREESAME.
++
+Parent/child relations are only visible with --parents, but that does
+not affect the commits selected in default mode, so we have shown the
+parent lines.
+
+--full-history without parent rewriting::
+
+ This mode differs from the default in one point: always follow
+ all parents of a merge, even if it is TREESAME to one of them.
+ Even if more than one side of the merge has commits that are
+ included, this does not imply that the merge itself is! In
+ the example, we get
++
+-----------------------------------------------------------------------
+ I A B N D O
+-----------------------------------------------------------------------
++
+`P` and `M` were excluded because they are TREESAME to a parent. `E`,
+`C` and `B` were all walked, but only `B` was !TREESAME, so the others
+do not appear.
++
+Note that without parent rewriting, it is not really possible to talk
+about the parent/child relationships between the commits, so we show
+them disconnected.
+
+--full-history with parent rewriting::
+
+ Ordinary commits are only included if they are !TREESAME
+ (though this can be changed, see '\--sparse' below).
++
+Merges are always included. However, their parent list is rewritten:
+Along each parent, prune away commits that are not included
+themselves. This results in
++
+-----------------------------------------------------------------------
+ .-A---M---N---O---P
+ / / / / /
+ I B / D /
+ \ / / / /
+ `-------------'
+-----------------------------------------------------------------------
++
+Compare to '\--full-history' without rewriting above. Note that `E`
+was pruned away because it is TREESAME, but the parent list of P was
+rewritten to contain `E`'s parent `I`. The same happened for `C` and
+`N`. Note also that `P` was included despite being TREESAME.
+
+In addition to the above settings, you can change whether TREESAME
+affects inclusion:
+
--dense::
+
+ Commits that are walked are included if they are not TREESAME
+ to any parent.
+
--sparse::
-When optional paths are given, the default behaviour ('--dense') is to
-only output commits that changes at least one of them, and also ignore
-merges that do not touch the given paths.
+ All commits that are walked are included.
++
+Note that without '\--full-history', this still simplifies merges: if
+one of the parents is TREESAME, we follow only that one, so the other
+sides of the merge are never walked.
-Use the '--sparse' flag to makes the command output all eligible commits
-(still subject to count and age limitation), but apply merge
-simplification nevertheless.
ifdef::git-rev-list[]
+Bisection Helpers
+~~~~~~~~~~~~~~~~~
+
--bisect::
Limit output to the one commit object which is roughly halfway between
@@ -342,7 +463,6 @@ after all the sorted commit objects, there will be the same text as if
`--bisect-vars` had been used alone.
endif::git-rev-list[]
---
Commit Ordering
~~~~~~~~~~~~~~~
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index c5641af190..08d1310bf5 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -479,10 +479,10 @@ Bisecting: 3537 revisions left to test after this
-------------------------------------------------
If you run "git branch" at this point, you'll see that git has
-temporarily moved you to a new branch named "bisect". This branch
-points to a commit (with commit id 65934...) that is reachable from
-"master" but not from v2.6.18. Compile and test it, and see whether
-it crashes. Assume it does crash. Then:
+temporarily moved you in "(no branch)". HEAD is now detached from any
+branch and points directly to a commit (with commit id 65934...) that
+is reachable from "master" but not from v2.6.18. Compile and test it,
+and see whether it crashes. Assume it does crash. Then:
-------------------------------------------------
$ git bisect bad
@@ -504,8 +504,7 @@ report with the commit id. Finally, run
$ git bisect reset
-------------------------------------------------
-to return you to the branch you were on before and delete the
-temporary "bisect" branch.
+to return you to the branch you were on before.
Note that the version which git-bisect checks out for you at each
point is just a suggestion, and you're free to try a different
@@ -528,6 +527,22 @@ $ git reset --hard fb47ddb2db...
then test, run "bisect good" or "bisect bad" as appropriate, and
continue.
+Instead of "git bisect visualize" and then "git reset --hard
+fb47ddb2db...", you might just want to tell git that you want to skip
+the current commit:
+
+-------------------------------------------------
+$ git bisect skip
+-------------------------------------------------
+
+In this case, though, git may not eventually be able to tell the first
+bad one between some first skipped commits and a latter bad commit.
+
+There are also ways to automate the bisecting process if you have a
+test script that can tell a good from a bad commit. See
+linkgit:git-bisect[1] for more information about this and other "git
+bisect" features.
+
[[naming-commits]]
Naming commits
--------------
@@ -1113,8 +1128,8 @@ This typically includes files generated by a build process or temporary
backup files made by your editor. Of course, 'not' tracking files with git
is just a matter of 'not' calling "`git-add`" on them. But it quickly becomes
annoying to have these untracked files lying around; e.g. they make
-"`git add .`" and "`git commit -a`" practically useless, and they keep
-showing up in the output of "`git status`".
+"`git add .`" practically useless, and they keep showing up in the output of
+"`git status`".
You can tell git to ignore certain files by creating a file called .gitignore
in the top level of your working directory, with contents such as:
@@ -1875,7 +1890,7 @@ adjustments to give web clients some extra information they need:
$ mv proj.git /home/you/public_html/proj.git
$ cd proj.git
$ git --bare update-server-info
-$ chmod a+x hooks/post-update
+$ mv hooks/post-update.sample hooks/post-update
-------------------------------------------------
(For an explanation of the last two lines, see
@@ -2810,8 +2825,8 @@ You can also add a "+" to force the update each time:
$ git config remote.example.fetch +master:ref/remotes/example/master
-------------------------------------------------
-Don't do this unless you're sure you won't mind "git-fetch" possibly
-throwing away commits on mybranch.
+Don't do this unless you're sure you won't mind "git fetch" possibly
+throwing away commits on 'example/master'.
Also note that all of the above configuration can be performed by
directly editing the file .git/config instead of using
@@ -3458,7 +3473,7 @@ $ cd super
$ git init
$ for i in a b c d
do
- git submodule add ~/git/$i
+ git submodule add ~/git/$i $i
done
-------------------------------------------------
@@ -3471,10 +3486,10 @@ $ ls -a
. .. .git .gitmodules a b c d
-------------------------------------------------
-The `git-submodule add` command does a couple of things:
+The `git-submodule add <repo> <path>` command does a couple of things:
-- It clones the submodule under the current directory and by default checks out
- the master branch.
+- It clones the submodule from <repo> to the given <path> under the
+ current directory and by default checks out the master branch.
- It adds the submodule's clone path to the linkgit:gitmodules[5] file and
adds this file to the index, ready to be committed.
- It adds the submodule's current commit ID to the index, ready to be
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index cb7cd4b538..156dc13733 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v1.5.6.GIT
+DEF_VER=v1.6.0.GIT
LF='
'
@@ -16,6 +16,7 @@ elif test -d .git -o -f .git &&
case "$VN" in
*$LF*) (exit 1) ;;
v[0-9]*)
+ git update-index -q --refresh
test -z "$(git diff-index --name-only HEAD --)" ||
VN="$VN-dirty" ;;
esac
diff --git a/INSTALL b/INSTALL
index 7d0c2c2f86..2bae53fcbb 100644
--- a/INSTALL
+++ b/INSTALL
@@ -30,7 +30,7 @@ Issues of note:
around 1997), it changed its name to gnuit and the name conflict is no
longer a problem.
- NOTE: When compiled with backward compatiblity option, the GNU
+ NOTE: When compiled with backward compatibility option, the GNU
Interactive Tools package still can install "git", but you can build it
with --disable-transition option to avoid this.
@@ -73,7 +73,7 @@ Issues of note:
- "ssh" is used to push and pull over the net
- "perl" and POSIX-compliant shells are needed to use most of
- the barebone Porcelainish scripts.
+ the bare-bones Porcelainish scripts.
- Some platform specific issues are dealt with Makefile rules,
but depending on your specific installation, you may not
diff --git a/Makefile b/Makefile
index 3bb7c774b7..bf400e64f3 100644
--- a/Makefile
+++ b/Makefile
@@ -124,6 +124,9 @@ all::
# Define USE_STDEV below if you want git to care about the underlying device
# change being considered an inode change from the update-index perspective.
#
+# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
+# field that counts the on-disk footprint in 512-byte blocks.
+#
# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
#
# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
@@ -333,7 +336,6 @@ endif
export PERL_PATH
LIB_FILE=libgit.a
-COMPAT_LIB = compat/lib.a
XDIFF_LIB=xdiff/lib.a
LIB_H += archive.h
@@ -577,9 +579,11 @@ EXTLIBS =
ifeq ($(uname_S),Linux)
NO_STRLCPY = YesPlease
+ THREADED_DELTA_SEARCH = YesPlease
endif
ifeq ($(uname_S),GNU/kFreeBSD)
NO_STRLCPY = YesPlease
+ THREADED_DELTA_SEARCH = YesPlease
endif
ifeq ($(uname_S),UnixWare)
CC = cc
@@ -677,6 +681,7 @@ ifeq ($(uname_S),FreeBSD)
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
+ THREADED_DELTA_SEARCH = YesPlease
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
@@ -684,6 +689,7 @@ ifeq ($(uname_S),OpenBSD)
NEEDS_LIBICONV = YesPlease
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
+ THREADED_DELTA_SEARCH = YesPlease
endif
ifeq ($(uname_S),NetBSD)
ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
@@ -692,6 +698,7 @@ ifeq ($(uname_S),NetBSD)
BASIC_CFLAGS += -I/usr/pkg/include
BASIC_LDFLAGS += -L/usr/pkg/lib
ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
+ THREADED_DELTA_SEARCH = YesPlease
endif
ifeq ($(uname_S),AIX)
NO_STRCASESTR=YesPlease
@@ -729,6 +736,7 @@ ifeq ($(uname_S),HP-UX)
NO_UNSETENV = YesPlease
NO_HSTRERROR = YesPlease
NO_SYS_SELECT_H = YesPlease
+ SNPRINTF_RETURNS_BOGUS = YesPlease
endif
ifneq (,$(findstring MINGW,$(uname_S)))
NO_MMAP = YesPlease
@@ -751,6 +759,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_SVN_TESTS = YesPlease
NO_PERL_MAKEMAKER = YesPlease
NO_POSIX_ONLY_PROGRAMS = YesPlease
+ NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
@@ -865,6 +874,9 @@ endif
ifdef NO_D_INO_IN_DIRENT
BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
endif
+ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
+ BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
+endif
ifdef NO_C99_FORMAT
BASIC_CFLAGS += -DNO_C99_FORMAT
endif
@@ -1062,9 +1074,11 @@ export TAR INSTALL DESTDIR SHELL_PATH
### Build rules
-all:: $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
+SHELL = $(SHELL_PATH)
+
+all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
ifneq (,$X)
- $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';)
+ $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
endif
all::
@@ -1075,6 +1089,11 @@ endif
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
+please_set_SHELL_PATH_to_a_more_modern_shell:
+ @$$(:)
+
+shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
+
strip: $(PROGRAMS) git$X
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
@@ -1093,7 +1112,10 @@ builtin-help.o: builtin-help.c common-cmds.h GIT-CFLAGS
'-DGIT_INFO_PATH="$(infodir_SQ)"' $<
$(BUILT_INS): git$X
- $(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@
+ $(QUIET_BUILT_IN)$(RM) $@ && \
+ ln git$X $@ 2>/dev/null || \
+ ln -s git$X $@ 2>/dev/null || \
+ cp git$X $@
common-cmds.h: ./generate-cmdlist.sh command-list.txt
@@ -1210,7 +1232,9 @@ endif
git-%$X: %.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
-git-imap-send$X: imap-send.o $(LIB_FILE)
+git-imap-send$X: imap-send.o $(GITLIBS)
+ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
+ $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
http.o http-walker.o http-push.o transport.o: http.h
@@ -1218,12 +1242,6 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-$(COMPAT_LIB): $(COMPAT_OBJS)
- $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(COMPAT_OBJS)
-
-git-shell$X: abspath.o ctype.o exec_cmd.o quote.o strbuf.o usage.o wrapper.o shell.o $(COMPAT_LIB)
- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(COMPAT_LIB)
-
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
builtin-revert.o wt-status.o: wt-status.h
@@ -1346,7 +1364,7 @@ install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
- $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)'
+ $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X '$(DESTDIR_SQ)$(bindir_SQ)'
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
ifndef NO_TCLTK
@@ -1358,16 +1376,13 @@ ifneq (,$X)
endif
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
- if test "z$$bindir" != "z$$execdir"; \
- then \
- ln -f "$$bindir/git$X" "$$execdir/git$X" || \
- cp "$$bindir/git$X" "$$execdir/git$X"; \
- fi && \
- { $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git$X" "$$execdir/$p" ;) } && \
- if test "z$$bindir" != "z$$execdir"; \
- then \
- $(RM) "$$execdir/git$X"; \
- fi && \
+ { $(RM) "$$execdir/git-add$X" && \
+ ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
+ cp git-add$X "$$execdir/git-add$X"; } && \
+ { $(foreach p,$(filter-out git-add,$(BUILT_INS)), $(RM) "$$execdir/$p" && \
+ ln "$$execdir/git-add$X" "$$execdir/$p" 2>/dev/null || \
+ ln -s "git-add$X" "$$execdir/$p" 2>/dev/null || \
+ cp "$$execdir/git-add$X" "$$execdir/$p" || exit;) } && \
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
install-doc:
@@ -1436,7 +1451,7 @@ distclean: clean
clean:
$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
- $(LIB_FILE) $(XDIFF_LIB) $(COMPAT_LIB)
+ $(LIB_FILE) $(XDIFF_LIB)
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
$(RM) $(TEST_PROGRAMS)
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
@@ -1457,6 +1472,7 @@ endif
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
.PHONY: all install clean strip
+.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
.PHONY: .FORCE-GIT-BUILD-OPTIONS
diff --git a/RelNotes b/RelNotes
index b9a53c3416..3d420845b1 120000
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes-1.6.0.txt \ No newline at end of file
+Documentation/RelNotes-1.6.1.txt \ No newline at end of file
diff --git a/archive.c b/archive.c
index f834b5f51f..5b40e261f1 100644
--- a/archive.c
+++ b/archive.c
@@ -3,9 +3,15 @@
#include "tree-walk.h"
#include "attr.h"
#include "archive.h"
-
-static const char archive_usage[] = \
-"git archive --format=<fmt> [--prefix=<prefix>/] [--verbose] [<extra>] <tree-ish> [path...]";
+#include "parse-options.h"
+
+static char const * const archive_usage[] = {
+ "git archive [options] <tree-ish> [path...]",
+ "git archive --list",
+ "git archive --remote <repo> [--exec <cmd>] [options] <tree-ish> [path...]",
+ "git archive --remote <repo> [--exec <cmd>] --list",
+ NULL
+};
#define USES_ZLIB_COMPRESSION 1
@@ -175,6 +181,9 @@ static const struct archiver *lookup_archiver(const char *name)
{
int i;
+ if (!name)
+ return NULL;
+
for (i = 0; i < ARRAY_SIZE(archivers); i++) {
if (!strcmp(name, archivers[i].name))
return &archivers[i];
@@ -232,51 +241,70 @@ static void parse_treeish_arg(const char **argv,
ar_args->time = archive_time;
}
+#define OPT__COMPR(s, v, h, p) \
+ { OPTION_SET_INT, (s), NULL, (v), NULL, (h), \
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, (p) }
+#define OPT__COMPR_HIDDEN(s, v, p) \
+ { OPTION_SET_INT, (s), NULL, (v), NULL, "", \
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN, NULL, (p) }
+
static int parse_archive_args(int argc, const char **argv,
const struct archiver **ar, struct archiver_args *args)
{
const char *format = "tar";
- const char *base = "";
+ const char *base = NULL;
+ const char *remote = NULL;
+ const char *exec = NULL;
int compression_level = -1;
int verbose = 0;
int i;
-
- for (i = 1; i < argc; i++) {
- const char *arg = argv[i];
-
- if (!strcmp(arg, "--list") || !strcmp(arg, "-l")) {
- for (i = 0; i < ARRAY_SIZE(archivers); i++)
- printf("%s\n", archivers[i].name);
- exit(0);
- }
- if (!strcmp(arg, "--verbose") || !strcmp(arg, "-v")) {
- verbose = 1;
- continue;
- }
- if (!prefixcmp(arg, "--format=")) {
- format = arg + 9;
- continue;
- }
- if (!prefixcmp(arg, "--prefix=")) {
- base = arg + 9;
- continue;
- }
- if (!strcmp(arg, "--")) {
- i++;
- break;
- }
- if (arg[0] == '-' && isdigit(arg[1]) && arg[2] == '\0') {
- compression_level = arg[1] - '0';
- continue;
- }
- if (arg[0] == '-')
- die("Unknown argument: %s", arg);
- break;
+ int list = 0;
+ struct option opts[] = {
+ OPT_GROUP(""),
+ OPT_STRING(0, "format", &format, "fmt", "archive format"),
+ OPT_STRING(0, "prefix", &base, "prefix",
+ "prepend prefix to each pathname in the archive"),
+ OPT__VERBOSE(&verbose),
+ OPT__COMPR('0', &compression_level, "store only", 0),
+ OPT__COMPR('1', &compression_level, "compress faster", 1),
+ OPT__COMPR_HIDDEN('2', &compression_level, 2),
+ OPT__COMPR_HIDDEN('3', &compression_level, 3),
+ OPT__COMPR_HIDDEN('4', &compression_level, 4),
+ OPT__COMPR_HIDDEN('5', &compression_level, 5),
+ OPT__COMPR_HIDDEN('6', &compression_level, 6),
+ OPT__COMPR_HIDDEN('7', &compression_level, 7),
+ OPT__COMPR_HIDDEN('8', &compression_level, 8),
+ OPT__COMPR('9', &compression_level, "compress better", 9),
+ OPT_GROUP(""),
+ OPT_BOOLEAN('l', "list", &list,
+ "list supported archive formats"),
+ OPT_GROUP(""),
+ OPT_STRING(0, "remote", &remote, "repo",
+ "retrieve the archive from remote repository <repo>"),
+ OPT_STRING(0, "exec", &exec, "cmd",
+ "path to the remote git-upload-archive command"),
+ OPT_END()
+ };
+
+ argc = parse_options(argc, argv, opts, archive_usage, 0);
+
+ if (remote)
+ die("Unexpected option --remote");
+ if (exec)
+ die("Option --exec can only be used together with --remote");
+
+ if (!base)
+ base = "";
+
+ if (list) {
+ for (i = 0; i < ARRAY_SIZE(archivers); i++)
+ printf("%s\n", archivers[i].name);
+ exit(0);
}
/* We need at least one parameter -- tree-ish */
- if (argc - 1 < i)
- usage(archive_usage);
+ if (argc < 1)
+ usage_with_options(archive_usage, opts);
*ar = lookup_archiver(format);
if (!*ar)
die("Unknown archive format '%s'", format);
@@ -294,7 +322,7 @@ static int parse_archive_args(int argc, const char **argv,
args->base = base;
args->baselen = strlen(base);
- return i;
+ return argc;
}
int write_archive(int argc, const char **argv, const char *prefix,
@@ -302,13 +330,11 @@ int write_archive(int argc, const char **argv, const char *prefix,
{
const struct archiver *ar = NULL;
struct archiver_args args;
- int tree_idx;
- tree_idx = parse_archive_args(argc, argv, &ar, &args);
+ argc = parse_archive_args(argc, argv, &ar, &args);
if (setup_prefix && prefix == NULL)
prefix = setup_git_directory();
- argv += tree_idx;
parse_treeish_arg(argv, &args, prefix);
parse_pathspec_arg(argv + 1, &args);
diff --git a/builtin-add.c b/builtin-add.c
index fc3f96eaef..7c874e3115 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -8,10 +8,6 @@
#include "dir.h"
#include "exec_cmd.h"
#include "cache-tree.h"
-#include "diff.h"
-#include "diffcore.h"
-#include "commit.h"
-#include "revision.h"
#include "run-command.h"
#include "parse-options.h"
@@ -22,6 +18,27 @@ static const char * const builtin_add_usage[] = {
static int patch_interactive = 0, add_interactive = 0;
static int take_worktree_changes;
+static void fill_pathspec_matches(const char **pathspec, char *seen, int specs)
+{
+ int num_unmatched = 0, i;
+
+ /*
+ * Since we are walking the index as if we are warlking the directory,
+ * we have to mark the matched pathspec as seen; otherwise we will
+ * mistakenly think that the user gave a pathspec that did not match
+ * anything.
+ */
+ for (i = 0; i < specs; i++)
+ if (!seen[i])
+ num_unmatched++;
+ if (!num_unmatched)
+ return;
+ for (i = 0; i < active_nr; i++) {
+ struct cache_entry *ce = active_cache[i];
+ match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen);
+ }
+}
+
static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix)
{
char *seen;
@@ -41,6 +58,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
*dst++ = entry;
}
dir->nr = dst - dir->entries;
+ fill_pathspec_matches(pathspec, seen, specs);
for (i = 0; i < specs; i++) {
if (!seen[i] && !file_exists(pathspec[i]))
@@ -79,59 +97,6 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
prune_directory(dir, pathspec, baselen);
}
-struct update_callback_data
-{
- int flags;
- int add_errors;
-};
-
-static void update_callback(struct diff_queue_struct *q,
- struct diff_options *opt, void *cbdata)
-{
- int i;
- struct update_callback_data *data = cbdata;
-
- for (i = 0; i < q->nr; i++) {
- struct diff_filepair *p = q->queue[i];
- const char *path = p->one->path;
- switch (p->status) {
- default:
- die("unexpected diff status %c", p->status);
- case DIFF_STATUS_UNMERGED:
- case DIFF_STATUS_MODIFIED:
- case DIFF_STATUS_TYPE_CHANGED:
- if (add_file_to_cache(path, data->flags)) {
- if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
- die("updating files failed");
- data->add_errors++;
- }
- break;
- case DIFF_STATUS_DELETED:
- if (!(data->flags & ADD_CACHE_PRETEND))
- remove_file_from_cache(path);
- if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
- printf("remove '%s'\n", path);
- break;
- }
- }
-}
-
-int add_files_to_cache(const char *prefix, const char **pathspec, int flags)
-{
- struct update_callback_data data;
- struct rev_info rev;
- init_revisions(&rev, prefix);
- setup_revisions(0, NULL, &rev, NULL);
- rev.prune_data = pathspec;
- rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
- rev.diffopt.format_callback = update_callback;
- data.flags = flags;
- data.add_errors = 0;
- rev.diffopt.format_callback_data = &data;
- run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
- return !!data.add_errors;
-}
-
static void refresh(int verbose, const char **pathspec)
{
char *seen;
@@ -153,6 +118,16 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p
{
const char **pathspec = get_pathspec(prefix, argv);
+ if (pathspec) {
+ const char **p;
+ for (p = pathspec; *p; p++) {
+ if (has_symlink_leading_path(strlen(*p), *p)) {
+ int len = prefix ? strlen(prefix) : 0;
+ die("'%s' is beyond a symbolic link", *p + len);
+ }
+ }
+ }
+
return pathspec;
}
@@ -258,7 +233,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
if (addremove && take_worktree_changes)
die("-A and -u are mutually incompatible");
- if (addremove && !argc) {
+ if ((addremove || take_worktree_changes) && !argc) {
static const char *here[2] = { ".", NULL };
argc = 1;
argv = here;
@@ -271,33 +246,30 @@ int cmd_add(int argc, const char **argv, const char *prefix)
flags = ((verbose ? ADD_CACHE_VERBOSE : 0) |
(show_only ? ADD_CACHE_PRETEND : 0) |
- (ignore_add_errors ? ADD_CACHE_IGNORE_ERRORS : 0));
+ (ignore_add_errors ? ADD_CACHE_IGNORE_ERRORS : 0) |
+ (!(addremove || take_worktree_changes)
+ ? ADD_CACHE_IGNORE_REMOVAL : 0));
if (require_pathspec && argc == 0) {
fprintf(stderr, "Nothing specified, nothing added.\n");
fprintf(stderr, "Maybe you wanted to say 'git add .'?\n");
return 0;
}
- pathspec = get_pathspec(prefix, argv);
-
- /*
- * If we are adding new files, we need to scan the working
- * tree to find the ones that match pathspecs; this needs
- * to be done before we read the index.
- */
- if (add_new_files)
- fill_directory(&dir, pathspec, ignored_too);
+ pathspec = validate_pathspec(argc, argv, prefix);
if (read_cache() < 0)
die("index file corrupt");
+ if (add_new_files)
+ /* This picks up the paths that are not tracked */
+ fill_directory(&dir, pathspec, ignored_too);
+
if (refresh_only) {
refresh(verbose, pathspec);
goto finish;
}
- if (take_worktree_changes || addremove)
- exit_status |= add_files_to_cache(prefix, pathspec, flags);
+ exit_status |= add_files_to_cache(prefix, pathspec, flags);
if (add_new_files)
exit_status |= add_files(&dir, flags);
diff --git a/builtin-blame.c b/builtin-blame.c
index 8b6b09b10b..e4d12de8a9 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -465,7 +465,6 @@ struct patch {
};
struct blame_diff_state {
- struct xdiff_emit_state xm;
struct patch *ret;
unsigned hunk_post_context;
unsigned hunk_in_pre_context : 1;
@@ -528,15 +527,12 @@ static struct patch *compare_buffer(mmfile_t *file_p, mmfile_t *file_o,
xpp.flags = xdl_opts;
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = context;
- ecb.outf = xdiff_outf;
- ecb.priv = &state;
memset(&state, 0, sizeof(state));
- state.xm.consume = process_u_diff;
state.ret = xmalloc(sizeof(struct patch));
state.ret->chunks = NULL;
state.ret->num = 0;
- xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(file_p, file_o, process_u_diff, &state, &xpp, &xecfg, &ecb);
if (state.ret->num) {
struct chunk *chunk;
@@ -2346,6 +2342,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);
+ if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
+ opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
+ PICKAXE_BLAME_COPY_HARDER);
+
if (!blame_move_score)
blame_move_score = BLAME_DEFAULT_MOVE_SCORE;
if (!blame_copy_score)
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 411cc513c6..b380ad6e80 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -157,7 +157,7 @@ struct checkout_opts {
int force;
int writeout_error;
- char *new_branch;
+ const char *new_branch;
int new_branch_log;
enum branch_track track;
};
@@ -437,13 +437,28 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
- opts.track = git_branch_track;
+ opts.track = BRANCH_TRACK_UNSPECIFIED;
argc = parse_options(argc, argv, options, checkout_usage,
PARSE_OPT_KEEP_DASHDASH);
- if (!opts.new_branch && (opts.track != git_branch_track))
- die("git checkout: --track and --no-track require -b");
+ /* --track without -b should DWIM */
+ if (0 < opts.track && !opts.new_branch) {
+ const char *argv0 = argv[0];
+ if (!argc || !strcmp(argv0, "--"))
+ die ("--track needs a branch name");
+ if (!prefixcmp(argv0, "refs/"))
+ argv0 += 5;
+ if (!prefixcmp(argv0, "remotes/"))
+ argv0 += 8;
+ argv0 = strchr(argv0, '/');
+ if (!argv0 || !argv0[1])
+ die ("Missing branch name; try -b");
+ opts.new_branch = argv0 + 1;
+ }
+
+ if (opts.track == BRANCH_TRACK_UNSPECIFIED)
+ opts.track = git_branch_track;
if (opts.force && opts.merge)
die("git checkout: -f and -m are incompatible");
diff --git a/builtin-clone.c b/builtin-clone.c
index e086a40b41..c0e3086437 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -33,7 +33,7 @@ static const char * const builtin_clone_usage[] = {
NULL
};
-static int option_quiet, option_no_checkout, option_bare;
+static int option_quiet, option_no_checkout, option_bare, option_mirror;
static int option_local, option_no_hardlinks, option_shared;
static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
@@ -45,6 +45,8 @@ static struct option builtin_clone_options[] = {
"don't create a checkout"),
OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
OPT_BOOLEAN(0, "naked", &option_bare, "create a bare repository"),
+ OPT_BOOLEAN(0, "mirror", &option_mirror,
+ "create a mirror repository (implies bare)"),
OPT_BOOLEAN('l', "local", &option_local,
"to clone from a local repository"),
OPT_BOOLEAN(0, "no-hardlinks", &option_no_hardlinks,
@@ -93,7 +95,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
return NULL;
}
-static char *guess_dir_name(const char *repo, int is_bundle)
+static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
{
const char *end = repo + strlen(repo), *start;
@@ -129,6 +131,12 @@ static char *guess_dir_name(const char *repo, int is_bundle)
end -= 4;
}
+ if (is_bare) {
+ char *result = xmalloc(end - start + 5);
+ sprintf(result, "%.*s.git", (int)(end - start), start);
+ return result;
+ }
+
return xstrndup(start, end - start);
}
@@ -322,7 +330,8 @@ static struct ref *write_remote_refs(const struct ref *refs,
struct ref *r;
get_fetch_map(refs, refspec, &tail, 0);
- get_fetch_map(refs, tag_refspec, &tail, 0);
+ if (!option_mirror)
+ get_fetch_map(refs, tag_refspec, &tail, 0);
for (r = local_refs; r; r = r->next)
add_extra_ref(r->peer_ref->name, r->old_sha1, 0);
@@ -345,6 +354,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
char branch_top[256], key[256], value[256];
struct strbuf reflog_msg;
struct transport *transport = NULL;
+ char *src_ref_prefix = "refs/heads/";
struct refspec refspec;
@@ -359,6 +369,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_no_hardlinks)
use_local_hardlinks = 0;
+ if (option_mirror)
+ option_bare = 1;
+
if (option_bare) {
if (option_origin)
die("--bare and --origin %s options are incompatible.",
@@ -383,7 +396,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (argc == 2)
dir = xstrdup(argv[1]);
else
- dir = guess_dir_name(repo_name, is_bundle);
+ dir = guess_dir_name(repo_name, is_bundle, option_bare);
if (!stat(dir, &buf))
die("destination directory '%s' already exists.", dir);
@@ -440,26 +453,36 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
if (option_bare) {
- strcpy(branch_top, "refs/heads/");
+ if (option_mirror)
+ src_ref_prefix = "refs/";
+ strcpy(branch_top, src_ref_prefix);
git_config_set("core.bare", "true");
} else {
snprintf(branch_top, sizeof(branch_top),
"refs/remotes/%s/", option_origin);
+ }
+ if (option_mirror || !option_bare) {
/* Configure the remote */
+ if (option_mirror) {
+ snprintf(key, sizeof(key),
+ "remote.%s.mirror", option_origin);
+ git_config_set(key, "true");
+ }
+
snprintf(key, sizeof(key), "remote.%s.url", option_origin);
git_config_set(key, repo);
snprintf(key, sizeof(key), "remote.%s.fetch", option_origin);
snprintf(value, sizeof(value),
- "+refs/heads/*:%s*", branch_top);
+ "+%s*:%s*", src_ref_prefix, branch_top);
git_config_set_multivar(key, value, "^$", 0);
}
refspec.force = 0;
refspec.pattern = 1;
- refspec.src = "refs/heads/";
+ refspec.src = src_ref_prefix;
refspec.dst = branch_top;
if (path && !is_bundle)
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index 7a9a309be0..f773db596c 100644
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
@@ -48,6 +48,7 @@ static const char commit_utf8_warn[] =
int commit_tree(const char *msg, unsigned char *tree,
struct commit_list *parents, unsigned char *ret)
{
+ int result;
int encoding_is_utf8;
struct strbuf buffer;
@@ -86,7 +87,9 @@ int commit_tree(const char *msg, unsigned char *tree,
if (encoding_is_utf8 && !is_utf8(buffer.buf))
fprintf(stderr, commit_utf8_warn);
- return write_sha1_file(buffer.buf, buffer.len, commit_type, ret);
+ result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret);
+ strbuf_release(&buffer);
+ return result;
}
int cmd_commit_tree(int argc, const char **argv, const char *prefix)
diff --git a/builtin-commit.c b/builtin-commit.c
index 9a11ca0bcd..649c8beb3e 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -46,7 +46,7 @@ static enum {
COMMIT_PARTIAL,
} commit_style;
-static char *logfile, *force_author;
+static const char *logfile, *force_author;
static const char *template_file;
static char *edit_message, *use_message;
static char *author_name, *author_email, *author_date;
@@ -554,13 +554,18 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
fprintf(fp,
"\n"
- "# Please enter the commit message for your changes.\n"
- "# (Comment lines starting with '#' will ");
+ "# Please enter the commit message for your changes.");
if (cleanup_mode == CLEANUP_ALL)
- fprintf(fp, "not be included)\n");
+ fprintf(fp,
+ " Lines starting\n"
+ "# with '#' will be ignored, and an empty"
+ " message aborts the commit.\n");
else /* CLEANUP_SPACE, that is. */
- fprintf(fp, "be kept.\n"
- "# You can remove them yourself if you want to)\n");
+ fprintf(fp,
+ " Lines starting\n"
+ "# with '#' will be kept; you may remove them"
+ " yourself if you want to.\n"
+ "# An empty message aborts the commit.\n");
if (only_include_assumed)
fprintf(fp, "# %s\n", only_include_assumed);
@@ -706,11 +711,14 @@ static int message_is_empty(struct strbuf *sb, int start)
}
static int parse_and_validate_options(int argc, const char *argv[],
- const char * const usage[])
+ const char * const usage[],
+ const char *prefix)
{
int f = 0;
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
+ logfile = parse_options_fix_filename(prefix, logfile);
+ template_file = parse_options_fix_filename(prefix, template_file);
if (logfile || message.len || use_message)
use_editor = 0;
@@ -831,7 +839,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
if (wt_status_use_color == -1)
wt_status_use_color = git_use_color_default;
- argc = parse_and_validate_options(argc, argv, builtin_status_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
@@ -924,7 +932,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
git_config(git_commit_config, NULL);
- argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
@@ -1003,7 +1011,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
stripspace(&sb, cleanup_mode == CLEANUP_ALL);
if (sb.len < header_len || message_is_empty(&sb, header_len)) {
rollback_index_files();
- die("no commit message? aborting commit.");
+ fprintf(stderr, "Aborting commit due to empty commit message.\n");
+ exit(1);
}
strbuf_addch(&sb, '\0');
if (is_encoding_utf8(git_commit_encoding) && !is_utf8(sb.buf))
diff --git a/builtin-count-objects.c b/builtin-count-objects.c
index 91b5487478..6e80fe7c01 100644
--- a/builtin-count-objects.c
+++ b/builtin-count-objects.c
@@ -43,7 +43,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose,
if (lstat(path, &st) || !S_ISREG(st.st_mode))
bad = 1;
else
- (*loose_size) += xsize_t(st.st_blocks);
+ (*loose_size) += xsize_t(on_disk_bytes(st));
}
if (bad) {
if (verbose) {
@@ -104,6 +104,7 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
if (verbose) {
struct packed_git *p;
unsigned long num_pack = 0;
+ unsigned long size_pack = 0;
if (!packed_git)
prepare_packed_git();
for (p = packed_git; p; p = p->next) {
@@ -112,12 +113,14 @@ int cmd_count_objects(int argc, const char **argv, const char *prefix)
if (open_pack_index(p))
continue;
packed += p->num_objects;
+ size_pack += p->pack_size + p->index_size;
num_pack++;
}
printf("count: %lu\n", loose);
- printf("size: %lu\n", loose_size / 2);
+ printf("size: %lu\n", loose_size / 1024);
printf("in-pack: %lu\n", packed);
printf("packs: %lu\n", num_pack);
+ printf("size-pack: %lu\n", size_pack / 1024);
printf("prune-packable: %lu\n", packed_loose);
printf("garbage: %lu\n", garbage);
}
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index 415cb1612f..1138c2da73 100644
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
@@ -14,20 +14,10 @@ static int diff_tree_commit_sha1(const unsigned char *sha1)
return log_tree_commit(&log_tree_opt, commit);
}
-static int diff_tree_stdin(char *line)
+/* Diff one or more commits. */
+static int stdin_diff_commit(struct commit *commit, char *line, int len)
{
- int len = strlen(line);
unsigned char sha1[20];
- struct commit *commit;
-
- if (!len || line[len-1] != '\n')
- return -1;
- line[len-1] = 0;
- if (get_sha1_hex(line, sha1))
- return -1;
- commit = lookup_commit(sha1);
- if (!commit || parse_commit(commit))
- return -1;
if (isspace(line[40]) && !get_sha1_hex(line+41, sha1)) {
/* Graft the fake parents locally to the commit */
int pos = 41;
@@ -52,6 +42,48 @@ static int diff_tree_stdin(char *line)
return log_tree_commit(&log_tree_opt, commit);
}
+/* Diff two trees. */
+static int stdin_diff_trees(struct tree *tree1, char *line, int len)
+{
+ unsigned char sha1[20];
+ struct tree *tree2;
+ if (len != 82 || !isspace(line[40]) || get_sha1_hex(line + 41, sha1))
+ return error("Need exactly two trees, separated by a space");
+ tree2 = lookup_tree(sha1);
+ if (!tree2 || parse_tree(tree2))
+ return -1;
+ printf("%s %s\n", sha1_to_hex(tree1->object.sha1),
+ sha1_to_hex(tree2->object.sha1));
+ diff_tree_sha1(tree1->object.sha1, tree2->object.sha1,
+ "", &log_tree_opt.diffopt);
+ log_tree_diff_flush(&log_tree_opt);
+ return 0;
+}
+
+static int diff_tree_stdin(char *line)
+{
+ int len = strlen(line);
+ unsigned char sha1[20];
+ struct object *obj;
+
+ if (!len || line[len-1] != '\n')
+ return -1;
+ line[len-1] = 0;
+ if (get_sha1_hex(line, sha1))
+ return -1;
+ obj = lookup_object(sha1);
+ obj = obj ? obj : parse_object(sha1);
+ if (!obj)
+ return -1;
+ if (obj->type == OBJ_COMMIT)
+ return stdin_diff_commit((struct commit *)obj, line, len);
+ if (obj->type == OBJ_TREE)
+ return stdin_diff_trees((struct tree *)obj, line, len);
+ error("Object %s is a %s, not a commit or tree",
+ sha1_to_hex(sha1), typename(obj->type));
+ return -1;
+}
+
static const char diff_tree_usage[] =
"git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] "
"[<common diff options>] <tree-ish> [<tree-ish>] [<path>...]\n"
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index e508ced6ba..7c93eb878d 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -132,10 +132,27 @@ static void show_filemodify(struct diff_queue_struct *q,
{
int i;
for (i = 0; i < q->nr; i++) {
+ struct diff_filespec *ospec = q->queue[i]->one;
struct diff_filespec *spec = q->queue[i]->two;
- if (is_null_sha1(spec->sha1))
+
+ switch (q->queue[i]->status) {
+ case DIFF_STATUS_DELETED:
printf("D %s\n", spec->path);
- else {
+ break;
+
+ case DIFF_STATUS_COPIED:
+ case DIFF_STATUS_RENAMED:
+ printf("%c \"%s\" \"%s\"\n", q->queue[i]->status,
+ ospec->path, spec->path);
+
+ if (!hashcmp(ospec->sha1, spec->sha1) &&
+ ospec->mode == spec->mode)
+ break;
+ /* fallthrough */
+
+ case DIFF_STATUS_TYPE_CHANGED:
+ case DIFF_STATUS_MODIFIED:
+ case DIFF_STATUS_ADDED:
/*
* Links refer to objects in another repositories;
* output the SHA-1 verbatim.
@@ -148,6 +165,13 @@ static void show_filemodify(struct diff_queue_struct *q,
printf("M %06o :%d %s\n", spec->mode,
get_object_mark(object), spec->path);
}
+ break;
+
+ default:
+ die("Unexpected comparison status '%c' for %s, %s",
+ q->queue[i]->status,
+ ospec->path ? ospec->path : "none",
+ spec->path ? spec->path : "none");
}
}
}
@@ -393,7 +417,8 @@ static void export_marks(char *file)
for (i = 0; i < idnums.size; i++) {
if (deco->base && deco->base->type == 1) {
mark = ptr_to_mark(deco->decoration);
- fprintf(f, ":%u %s\n", mark, sha1_to_hex(deco->base->sha1));
+ fprintf(f, ":%"PRIu32" %s\n", mark,
+ sha1_to_hex(deco->base->sha1));
}
deco++;
}
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index 445039e19c..4d25ec51d0 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -459,8 +459,10 @@ static void find_subpos(const char *buf, unsigned long sz, const char **sub, con
return;
*sub = buf; /* first non-empty line */
buf = strchr(buf, '\n');
- if (!buf)
+ if (!buf) {
+ *body = "";
return; /* no body */
+ }
while (*buf == '\n')
buf++; /* skip blank between subject and body */
*body = buf;
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 6eb7da88d3..d3f3de9446 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -385,7 +385,7 @@ static void fsck_dir(int i, char *path)
add_sha1_list(sha1, DIRENT_SORT_HINT(de));
continue;
}
- if (prefixcmp(de->d_name, "tmp_obj_"))
+ if (!prefixcmp(de->d_name, "tmp_obj_"))
continue;
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
diff --git a/builtin-log.c b/builtin-log.c
index f4975cf35f..1d3c5cbf58 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -217,6 +217,11 @@ static int cmd_log_walk(struct rev_info *rev)
if (rev->early_output)
finish_early_output(rev);
+ /*
+ * For --check and --exit-code, the exit code is based on CHECK_FAILED
+ * and HAS_CHANGES being accumulated in rev->diffopt, so be careful to
+ * retain that state information if replacing rev->diffopt in this loop
+ */
while ((commit = get_revision(rev)) != NULL) {
log_tree_commit(rev, commit);
if (!rev->reflog_info) {
@@ -227,7 +232,11 @@ static int cmd_log_walk(struct rev_info *rev)
free_commit_list(commit->parents);
commit->parents = NULL;
}
- return 0;
+ if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF &&
+ DIFF_OPT_TST(&rev->diffopt, CHECK_FAILED)) {
+ return 02;
+ }
+ return diff_result_code(&rev->diffopt, 0);
}
static int git_log_config(const char *var, const char *value, void *cb)
@@ -461,7 +470,7 @@ static int extra_cc_alloc;
static void add_header(const char *value)
{
int len = strlen(value);
- while (value[len - 1] == '\n')
+ while (len && value[len - 1] == '\n')
len--;
if (!strncasecmp(value, "to: ", 4)) {
ALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);
@@ -923,7 +932,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);
- if (!rev.diffopt.output_format)
+ if (!rev.diffopt.output_format
+ || rev.diffopt.output_format == DIFF_FORMAT_PATCH)
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)
diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c
index d25767a1f7..cb61717685 100644
--- a/builtin-ls-tree.c
+++ b/builtin-ls-tree.c
@@ -66,17 +66,16 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen,
/*
* Maybe we want to have some recursive version here?
*
- * Something like:
+ * Something similar to this incomplete example:
*
if (show_subprojects(base, baselen, pathname)) {
- if (fork()) {
- chdir(base);
- exec ls-tree;
- }
- waitpid();
+ struct child_process ls_tree;
+
+ ls_tree.dir = base;
+ ls_tree.argv = ls-tree;
+ start_command(&ls_tree);
}
*
- * ..or similar..
*/
type = commit_type;
} else if (S_ISDIR(mode)) {
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index f974b9df96..e890f7a6d1 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -107,7 +107,7 @@ static void handle_from(const struct strbuf *from)
el = strcspn(at, " \n\t\r\v\f>");
strbuf_reset(&email);
strbuf_add(&email, at, el);
- strbuf_remove(&f, at - f.buf, el + 1);
+ strbuf_remove(&f, at - f.buf, el + (at[el] ? 1 : 0));
/* The remainder is name. It could be "John Doe <john.doe@xz>"
* or "john.doe@xz (John Doe)", but we have removed the
@@ -175,7 +175,7 @@ static void handle_content_type(struct strbuf *line)
message_type = TYPE_OTHER;
if (slurp_attr(line->buf, "boundary=", boundary)) {
strbuf_insert(boundary, 0, "--", 2);
- if (content_top++ >= &content[MAX_BOUNDARIES]) {
+ if (++content_top > &content[MAX_BOUNDARIES]) {
fprintf(stderr, "Too many boundaries to handle\n");
exit(1);
}
@@ -203,7 +203,8 @@ static void handle_content_transfer_encoding(const struct strbuf *line)
static int is_multipart_boundary(const struct strbuf *line)
{
- return !strbuf_cmp(line, *content_top);
+ return (((*content_top)->len <= line->len) &&
+ !memcmp(line->buf, (*content_top)->buf, (*content_top)->len));
}
static void cleanup_subject(struct strbuf *subject)
@@ -602,7 +603,7 @@ static void handle_filter(struct strbuf *line);
static int find_boundary(void)
{
while (!strbuf_getline(&line, fin, '\n')) {
- if (is_multipart_boundary(&line))
+ if (*content_top && is_multipart_boundary(&line))
return 1;
}
return 0;
@@ -625,7 +626,7 @@ again:
/* technically won't happen as is_multipart_boundary()
will fail first. But just in case..
*/
- if (content_top-- < content) {
+ if (--content_top < content) {
fprintf(stderr, "Detected mismatched boundaries, "
"can't recover\n");
exit(1);
@@ -649,8 +650,11 @@ again:
check_header(&line, p_hdr_data, 0);
strbuf_release(&newline);
- /* eat the blank line after section info */
- return (strbuf_getline(&line, fin, '\n') == 0);
+ /* replenish line */
+ if (strbuf_getline(&line, fin, '\n'))
+ return 0;
+ strbuf_addch(&line, '\n');
+ return 1;
}
static inline int patchbreak(const struct strbuf *line)
@@ -757,9 +761,10 @@ static void handle_body(void)
/* process any boundary lines */
if (*content_top && is_multipart_boundary(&line)) {
/* flush any leftover */
- if (line.len)
- handle_filter(&line);
-
+ if (prev.len) {
+ handle_filter(&prev);
+ strbuf_reset(&prev);
+ }
if (!handle_boundary())
goto handle_body_out;
}
diff --git a/builtin-merge-base.c b/builtin-merge-base.c
index 3382b1382a..b08da516e4 100644
--- a/builtin-merge-base.c
+++ b/builtin-merge-base.c
@@ -2,9 +2,11 @@
#include "cache.h"
#include "commit.h"
-static int show_merge_base(struct commit *rev1, struct commit *rev2, int show_all)
+static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
{
- struct commit_list *result = get_merge_bases(rev1, rev2, 0);
+ struct commit_list *result;
+
+ result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1, 0);
if (!result)
return 1;
@@ -20,7 +22,7 @@ static int show_merge_base(struct commit *rev1, struct commit *rev2, int show_al
}
static const char merge_base_usage[] =
-"git merge-base [--all] <commit-id> <commit-id>";
+"git merge-base [--all] <commit-id> <commit-id>...";
static struct commit *get_commit_reference(const char *arg)
{
@@ -38,7 +40,8 @@ static struct commit *get_commit_reference(const char *arg)
int cmd_merge_base(int argc, const char **argv, const char *prefix)
{
- struct commit *rev1, *rev2;
+ struct commit **rev;
+ int rev_nr = 0;
int show_all = 0;
git_config(git_default_config, NULL);
@@ -51,10 +54,15 @@ int cmd_merge_base(int argc, const char **argv, const char *prefix)
usage(merge_base_usage);
argc--; argv++;
}
- if (argc != 3)
+ if (argc < 3)
usage(merge_base_usage);
- rev1 = get_commit_reference(argv[1]);
- rev2 = get_commit_reference(argv[2]);
- return show_merge_base(rev1, rev2, show_all);
+ rev = xmalloc((argc - 1) * sizeof(*rev));
+
+ do {
+ rev[rev_nr++] = get_commit_reference(argv[1]);
+ argc--; argv++;
+ } while (argc > 1);
+
+ return show_merge_base(rev, rev_nr, show_all);
}
diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c
index 43e55bf901..dfb363ee2f 100644
--- a/builtin-merge-recursive.c
+++ b/builtin-merge-recursive.c
@@ -729,13 +729,13 @@ static void conflict_rename_rename(struct rename *ren1,
const char *dst_name2 = ren2_dst;
if (string_list_has_string(&current_directory_set, ren1_dst)) {
dst_name1 = del[delp++] = unique_path(ren1_dst, branch1);
- output(1, "%s is a directory in %s added as %s instead",
+ output(1, "%s is a directory in %s adding as %s instead",
ren1_dst, branch2, dst_name1);
remove_file(0, ren1_dst, 0);
}
if (string_list_has_string(&current_directory_set, ren2_dst)) {
dst_name2 = del[delp++] = unique_path(ren2_dst, branch2);
- output(1, "%s is a directory in %s added as %s instead",
+ output(1, "%s is a directory in %s adding as %s instead",
ren2_dst, branch1, dst_name2);
remove_file(0, ren2_dst, 0);
}
@@ -760,7 +760,7 @@ static void conflict_rename_dir(struct rename *ren1,
const char *branch1)
{
char *new_path = unique_path(ren1->pair->two->path, branch1);
- output(1, "Renamed %s to %s instead", ren1->pair->one->path, new_path);
+ output(1, "Renaming %s to %s instead", ren1->pair->one->path, new_path);
remove_file(0, ren1->pair->two->path, 0);
update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, new_path);
free(new_path);
@@ -773,7 +773,7 @@ static void conflict_rename_rename_2(struct rename *ren1,
{
char *new_path1 = unique_path(ren1->pair->two->path, branch1);
char *new_path2 = unique_path(ren2->pair->two->path, branch2);
- output(1, "Renamed %s to %s and %s to %s instead",
+ output(1, "Renaming %s to %s and %s to %s instead",
ren1->pair->one->path, new_path1,
ren2->pair->one->path, new_path2);
remove_file(0, ren1->pair->two->path, 0);
@@ -887,10 +887,10 @@ static int process_renames(struct string_list *a_renames,
branch1,
branch2);
if (mfi.merge || !mfi.clean)
- output(1, "Renamed %s->%s", src, ren1_dst);
+ output(1, "Renaming %s->%s", src, ren1_dst);
if (mfi.merge)
- output(2, "Auto-merged %s", ren1_dst);
+ output(2, "Auto-merging %s", ren1_dst);
if (!mfi.clean) {
output(1, "CONFLICT (content): merge conflict in %s",
@@ -924,14 +924,14 @@ static int process_renames(struct string_list *a_renames,
if (string_list_has_string(&current_directory_set, ren1_dst)) {
clean_merge = 0;
- output(1, "CONFLICT (rename/directory): Renamed %s->%s in %s "
+ output(1, "CONFLICT (rename/directory): Rename %s->%s in %s "
" directory %s added in %s",
ren1_src, ren1_dst, branch1,
ren1_dst, branch2);
conflict_rename_dir(ren1, branch1);
} else if (sha_eq(src_other.sha1, null_sha1)) {
clean_merge = 0;
- output(1, "CONFLICT (rename/delete): Renamed %s->%s in %s "
+ output(1, "CONFLICT (rename/delete): Rename %s->%s in %s "
"and deleted in %s",
ren1_src, ren1_dst, branch1,
branch2);
@@ -940,19 +940,19 @@ static int process_renames(struct string_list *a_renames,
const char *new_path;
clean_merge = 0;
try_merge = 1;
- output(1, "CONFLICT (rename/add): Renamed %s->%s in %s. "
+ output(1, "CONFLICT (rename/add): Rename %s->%s in %s. "
"%s added in %s",
ren1_src, ren1_dst, branch1,
ren1_dst, branch2);
new_path = unique_path(ren1_dst, branch2);
- output(1, "Added as %s instead", new_path);
+ output(1, "Adding as %s instead", new_path);
update_file(0, dst_other.sha1, dst_other.mode, new_path);
} else if ((item = string_list_lookup(ren1_dst, renames2Dst))) {
ren2 = item->util;
clean_merge = 0;
ren2->processed = 1;
- output(1, "CONFLICT (rename/rename): Renamed %s->%s in %s. "
- "Renamed %s->%s in %s",
+ output(1, "CONFLICT (rename/rename): Rename %s->%s in %s. "
+ "Rename %s->%s in %s",
ren1_src, ren1_dst, branch1,
ren2->pair->one->path, ren2->pair->two->path, branch2);
conflict_rename_rename_2(ren1, branch1, ren2, branch2);
@@ -986,9 +986,9 @@ static int process_renames(struct string_list *a_renames,
output(3, "Skipped %s (merged same as existing)", ren1_dst);
else {
if (mfi.merge || !mfi.clean)
- output(1, "Renamed %s => %s", ren1_src, ren1_dst);
+ output(1, "Renaming %s => %s", ren1_src, ren1_dst);
if (mfi.merge)
- output(2, "Auto-merged %s", ren1_dst);
+ output(2, "Auto-merging %s", ren1_dst);
if (!mfi.clean) {
output(1, "CONFLICT (rename/modify): Merge conflict in %s",
ren1_dst);
@@ -1039,7 +1039,7 @@ static int process_entry(const char *path, struct stage_data *entry,
/* Deleted in both or deleted in one and
* unchanged in the other */
if (a_sha)
- output(2, "Removed %s", path);
+ output(2, "Removing %s", path);
/* do not touch working file if it did not exist */
remove_file(1, path, !a_sha);
} else {
@@ -1086,12 +1086,12 @@ static int process_entry(const char *path, struct stage_data *entry,
const char *new_path = unique_path(path, add_branch);
clean_merge = 0;
output(1, "CONFLICT (%s): There is a directory with name %s in %s. "
- "Added %s as %s",
+ "Adding %s as %s",
conf, path, other_branch, path, new_path);
remove_file(0, path, 0);
update_file(0, sha, mode, new_path);
} else {
- output(2, "Added %s", path);
+ output(2, "Adding %s", path);
update_file(1, sha, mode, path);
}
} else if (a_sha && b_sha) {
@@ -1105,7 +1105,7 @@ static int process_entry(const char *path, struct stage_data *entry,
reason = "add/add";
o_sha = (unsigned char *)null_sha1;
}
- output(2, "Auto-merged %s", path);
+ output(2, "Auto-merging %s", path);
o.path = a.path = b.path = (char *)path;
hashcpy(o.sha1, o_sha);
o.mode = o_mode;
diff --git a/builtin-merge.c b/builtin-merge.c
index 3e8db0d383..d6bcbec705 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -432,12 +432,12 @@ static void merge_name(const char *remote, struct strbuf *msg)
struct strbuf truname = STRBUF_INIT;
strbuf_addstr(&truname, "refs/heads/");
strbuf_addstr(&truname, remote);
- strbuf_setlen(&truname, len+11);
+ strbuf_setlen(&truname, truname.len - len);
if (resolve_ref(truname.buf, buf_sha, 0, 0)) {
strbuf_addf(msg,
"%s\t\tbranch '%s'%s of .\n",
sha1_to_hex(remote_head->sha1),
- truname.buf,
+ truname.buf + 11,
(early ? " (early part)" : ""));
return;
}
@@ -600,8 +600,7 @@ static int checkout_fast_forward(unsigned char *head, unsigned char *remote)
struct dir_struct dir;
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
- if (read_cache_unmerged())
- die("you need to resolve your current index first");
+ refresh_cache(REFRESH_QUIET);
fd = hold_locked_index(lock_file, 1);
@@ -686,13 +685,15 @@ static void add_strategies(const char *string, unsigned attr)
static int merge_trivial(void)
{
unsigned char result_tree[20], result_commit[20];
- struct commit_list parent;
+ struct commit_list *parent = xmalloc(sizeof(struct commit_list *));
write_tree_trivial(result_tree);
printf("Wonderful.\n");
- parent.item = remoteheads->item;
- parent.next = NULL;
- commit_tree(merge_msg.buf, result_tree, &parent, result_commit);
+ parent->item = lookup_commit(head);
+ parent->next = xmalloc(sizeof(struct commit_list *));
+ parent->next->item = remoteheads->item;
+ parent->next->next = NULL;
+ commit_tree(merge_msg.buf, result_tree, parent, result_commit);
finish(result_commit, "In-index merge");
drop_save();
return 0;
@@ -778,6 +779,7 @@ static int evaluate_result(void)
int cnt = 0;
struct rev_info rev;
+ discard_cache();
if (read_cache() < 0)
die("failed to read the cache");
@@ -811,7 +813,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
struct commit_list **remotes = &remoteheads;
setup_work_tree();
- if (unmerged_cache())
+ if (read_cache_unmerged())
die("You are in the middle of a conflicted merge.");
/*
@@ -868,6 +870,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (argc != 1)
die("Can merge only exactly one commit into "
"empty head");
+ if (squash)
+ die("Squash commit into empty head not supported yet");
+ if (!allow_fast_forward)
+ die("Non-fast-forward commit does not make sense into "
+ "an empty head");
remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);
if (!remote_head)
die("%s - not something we can merge", argv[0]);
@@ -972,7 +979,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
hex,
find_unique_abbrev(remoteheads->item->object.sha1,
DEFAULT_ABBREV));
- refresh_cache(REFRESH_QUIET);
strbuf_init(&msg, 0);
strbuf_addstr(&msg, "Fast forward");
if (have_message)
@@ -1109,6 +1115,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
/* Automerge succeeded. */
+ discard_cache();
write_tree_trivial(result_tree);
automerge_was_ok = 1;
break;
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index 85612c4dcb..08c8aabf94 100644
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
@@ -176,6 +176,48 @@ static char const * const name_rev_usage[] = {
NULL
};
+static void name_rev_line(char *p, struct name_ref_data *data)
+{
+ int forty = 0;
+ char *p_start;
+ for (p_start = p; *p; p++) {
+#define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
+ if (!ishex(*p))
+ forty = 0;
+ else if (++forty == 40 &&
+ !ishex(*(p+1))) {
+ unsigned char sha1[40];
+ const char *name = NULL;
+ char c = *(p+1);
+ int p_len = p - p_start + 1;
+
+ forty = 0;
+
+ *(p+1) = 0;
+ if (!get_sha1(p - 39, sha1)) {
+ struct object *o =
+ lookup_object(sha1);
+ if (o)
+ name = get_rev_name(o);
+ }
+ *(p+1) = c;
+
+ if (!name)
+ continue;
+
+ if (data->name_only)
+ printf("%.*s%s", p_len - 40, p_start, name);
+ else
+ printf("%.*s (%s)", p_len, p_start, name);
+ p_start = p + 1;
+ }
+ }
+
+ /* flush */
+ if (p_start != p)
+ fwrite(p_start, p - p_start, 1, stdout);
+}
+
int cmd_name_rev(int argc, const char **argv, const char *prefix)
{
struct object_array revs = { 0, 0, NULL };
@@ -234,47 +276,12 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
if (transform_stdin) {
char buffer[2048];
- char *p, *p_start;
while (!feof(stdin)) {
- int forty = 0;
- p = fgets(buffer, sizeof(buffer), stdin);
+ char *p = fgets(buffer, sizeof(buffer), stdin);
if (!p)
break;
-
- for (p_start = p; *p; p++) {
-#define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
- if (!ishex(*p))
- forty = 0;
- else if (++forty == 40 &&
- !ishex(*(p+1))) {
- unsigned char sha1[40];
- const char *name = NULL;
- char c = *(p+1);
-
- forty = 0;
-
- *(p+1) = 0;
- if (!get_sha1(p - 39, sha1)) {
- struct object *o =
- lookup_object(sha1);
- if (o)
- name = get_rev_name(o);
- }
- *(p+1) = c;
-
- if (!name)
- continue;
-
- fwrite(p_start, p - p_start + 1, 1, stdout);
- printf(" (%s)", name);
- p_start = p + 1;
- }
- }
-
- /* flush */
- if (p_start != p)
- fwrite(p_start, p - p_start, 1, stdout);
+ name_rev_line(p, &data);
}
} else if (all) {
int i, max;
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2dadec1630..d394c494a5 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -499,7 +499,6 @@ static void write_pack_file(void)
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);
- fsync_or_die(fd, pack_tmp_name);
close(fd);
}
diff --git a/builtin-prune.c b/builtin-prune.c
index 947de8cf25..c767a0ac89 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -69,11 +69,6 @@ static int prune_dir(int i, char *path)
if (de->d_name[0] != '.')
break;
continue;
- case 14:
- if (prefixcmp(de->d_name, "tmp_obj_"))
- break;
- prune_tmp_object(path, de->d_name);
- continue;
case 38:
sprintf(name, "%02x", i);
memcpy(name+2, de->d_name, len+1);
@@ -90,6 +85,10 @@ static int prune_dir(int i, char *path)
prune_object(path, de->d_name, sha1);
continue;
}
+ if (!prefixcmp(de->d_name, "tmp_obj_")) {
+ prune_tmp_object(path, de->d_name);
+ continue;
+ }
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
if (!show_only)
diff --git a/builtin-push.c b/builtin-push.c
index c1ed68d938..cc6666f75e 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -59,8 +59,17 @@ static int do_push(const char *repo, int flags)
if (remote->mirror)
flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);
- if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) && refspec)
- return -1;
+ if ((flags & TRANSPORT_PUSH_ALL) && refspec) {
+ if (!strcmp(*refspec, "refs/tags/*"))
+ return error("--all and --tags are incompatible");
+ return error("--all can't be combined with refspecs");
+ }
+
+ if ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {
+ if (!strcmp(*refspec, "refs/tags/*"))
+ return error("--mirror and --tags are incompatible");
+ return error("--mirror can't be combined with refspecs");
+ }
if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==
(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 0c34e37819..6b3667ef0e 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -540,11 +540,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
free(collected.e);
}
- while (i < argc) {
- const char *ref = argv[i++];
+ for (; i < argc; i++) {
+ char *ref;
unsigned char sha1[20];
- if (!resolve_ref(ref, sha1, 1, NULL)) {
- status |= error("%s points nowhere!", ref);
+ if (!dwim_log(argv[i], strlen(argv[i]), sha1, &ref)) {
+ status |= error("%s points nowhere!", argv[i]);
continue;
}
set_reflog_expiry_param(&cb, explicit_expiry, ref);
@@ -604,8 +604,8 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
continue;
}
- if (!dwim_ref(argv[i], spec - argv[i], sha1, &ref)) {
- status |= error("%s points nowhere!", argv[i]);
+ if (!dwim_log(argv[i], spec - argv[i], sha1, &ref)) {
+ status |= error("no reflog for '%s'", argv[i]);
continue;
}
diff --git a/builtin-remote.c b/builtin-remote.c
index 54d1c3e3d1..01945a8651 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -115,7 +115,7 @@ static int add(int argc, const char **argv)
if (mirror) {
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.mirror", name);
- if (git_config_set(buf.buf, "yes"))
+ if (git_config_set(buf.buf, "true"))
return 1;
}
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 893762c80f..c023003b2b 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -645,7 +645,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
revs.diff)
usage(rev_list_usage);
- save_commit_buffer = revs.verbose_header || revs.grep_filter;
+ save_commit_buffer = revs.verbose_header ||
+ revs.grep_filter.pattern_list;
if (bisect_list)
revs.limited = 1;
diff --git a/builtin-revert.c b/builtin-revert.c
index e9da870d22..36677053f8 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -11,6 +11,7 @@
#include "cache-tree.h"
#include "diff.h"
#include "revision.h"
+#include "rerere.h"
/*
* This implements the builtins revert and cherry-pick.
@@ -180,7 +181,7 @@ static void set_author_ident_env(const char *message)
email++;
timestamp = strchr(email, '>');
if (!timestamp)
- die ("Could not extract author email from %s",
+ die ("Could not extract author time from %s",
sha1_to_hex(commit->object.sha1));
*timestamp = '\0';
for (timestamp++; *timestamp && isspace(*timestamp);
@@ -395,6 +396,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
die ("Error wrapping up %s", defmsg);
fprintf(stderr, "Automatic %s failed.%s\n",
me, help_msg(commit->object.sha1));
+ rerere();
exit(1);
}
if (commit_lock_file(&msg_file) < 0)
diff --git a/builtin-rm.c b/builtin-rm.c
index ee8247b08c..0ed26bb8f1 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -131,7 +131,7 @@ static struct option builtin_rm_options[] = {
OPT__DRY_RUN(&show_only),
OPT__QUIET(&quiet),
OPT_BOOLEAN( 0 , "cached", &index_only, "only remove from the index"),
- OPT_BOOLEAN('f', NULL, &force, "override the up-to-date check"),
+ OPT_BOOLEAN('f', "force", &force, "override the up-to-date check"),
OPT_BOOLEAN('r', NULL, &recursive, "allow recursive removal"),
OPT_BOOLEAN( 0 , "ignore-unmatch", &ignore_unmatch,
"exit with a zero status even if nothing matched"),
diff --git a/builtin-tag.c b/builtin-tag.c
index 325b1b2632..f2853d08c7 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -346,7 +346,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
int annotate = 0, sign = 0, force = 0, lines = 0,
list = 0, delete = 0, verify = 0;
- char *msgfile = NULL, *keyid = NULL;
+ const char *msgfile = NULL, *keyid = NULL;
struct msg_arg msg = { 0, STRBUF_INIT };
struct option options[] = {
OPT_BOOLEAN('l', NULL, &list, "list tag names"),
@@ -372,6 +372,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
git_config(git_tag_config, NULL);
argc = parse_options(argc, argv, options, git_tag_usage, 0);
+ msgfile = parse_options_fix_filename(prefix, msgfile);
if (keyid) {
sign = 1;
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 38eb53ccba..434cb8e4a0 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -194,6 +194,10 @@ static int process_path(const char *path)
int len;
struct stat st;
+ len = strlen(path);
+ if (has_symlink_leading_path(len, path))
+ return error("'%s' is beyond a symbolic link", path);
+
/*
* First things first: get the stat information, to decide
* what to do about the pathname!
@@ -201,7 +205,6 @@ static int process_path(const char *path)
if (lstat(path, &st) < 0)
return process_lstat_error(path, errno);
- len = strlen(path);
if (S_ISDIR(st.st_mode))
return process_directory(path, len, &st);
diff --git a/builtin-verify-pack.c b/builtin-verify-pack.c
index f4ac595695..25a29f11a4 100644
--- a/builtin-verify-pack.c
+++ b/builtin-verify-pack.c
@@ -1,7 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "pack.h"
-
+#include "pack-revindex.h"
#define MAX_CHAIN 50
@@ -129,6 +129,7 @@ int cmd_verify_pack(int argc, const char **argv, const char *prefix)
else {
if (verify_one_pack(argv[1], verbose))
err = 1;
+ discard_revindex();
nothing_done = 0;
}
argc--; argv++;
diff --git a/cache.h b/cache.h
index 2475de9fa8..de8c2b6266 100644
--- a/cache.h
+++ b/cache.h
@@ -126,6 +126,7 @@ struct cache_entry {
#define CE_NAMEMASK (0x0fff)
#define CE_STAGEMASK (0x3000)
+#define CE_EXTENDED (0x4000)
#define CE_VALID (0x8000)
#define CE_STAGESHIFT 12
@@ -222,7 +223,8 @@ struct index_state {
struct cache_tree *cache_tree;
time_t timestamp;
void *alloc;
- unsigned name_hash_initialized : 1;
+ unsigned name_hash_initialized : 1,
+ initialized : 1;
struct hash_table name_hash;
};
@@ -377,6 +379,7 @@ extern int remove_file_from_index(struct index_state *, const char *path);
#define ADD_CACHE_VERBOSE 1
#define ADD_CACHE_PRETEND 2
#define ADD_CACHE_IGNORE_ERRORS 4
+#define ADD_CACHE_IGNORE_REMOVAL 8
extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
extern int add_file_to_index(struct index_state *, const char *path, int flags);
extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh);
@@ -391,7 +394,6 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
extern int ce_path_match(const struct cache_entry *ce, const char **pathspec);
extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path);
-extern int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object);
extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object);
extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
@@ -451,6 +453,7 @@ enum safe_crlf {
extern enum safe_crlf safe_crlf;
enum branch_track {
+ BRANCH_TRACK_UNSPECIFIED = -1,
BRANCH_TRACK_NEVER = 0,
BRANCH_TRACK_REMOTE,
BRANCH_TRACK_ALWAYS,
diff --git a/combine-diff.c b/combine-diff.c
index 9f80a1c5e3..0cf2a830b5 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -143,8 +143,6 @@ static void append_lost(struct sline *sline, int n, const char *line, int len)
}
struct combine_diff_state {
- struct xdiff_emit_state xm;
-
unsigned int lno;
int ob, on, nb, nn;
unsigned long nmask;
@@ -217,17 +215,15 @@ static void combine_diff(const unsigned char *parent, mmfile_t *result_file,
parent_file.size = sz;
xpp.flags = XDF_NEED_MINIMAL;
memset(&xecfg, 0, sizeof(xecfg));
- ecb.outf = xdiff_outf;
- ecb.priv = &state;
memset(&state, 0, sizeof(state));
- state.xm.consume = consume_line;
state.nmask = nmask;
state.sline = sline;
state.lno = 1;
state.num_parent = num_parent;
state.n = n;
- xdi_diff(&parent_file, result_file, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(&parent_file, result_file, consume_line, &state,
+ &xpp, &xecfg, &ecb);
free(parent_file.ptr);
/* Assign line numbers for this parent.
@@ -727,6 +723,18 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
die("early EOF '%s'", elem->path);
result[len] = 0;
+
+ /* If not a fake symlink, apply filters, e.g. autocrlf */
+ if (is_file) {
+ struct strbuf buf;
+
+ strbuf_init(&buf, 0);
+ if (convert_to_git(elem->path, result, len, &buf, safe_crlf)) {
+ free(result);
+ result = strbuf_detach(&buf, &len);
+ result_size = len;
+ }
+ }
}
else {
deleted_file:
diff --git a/commit.h b/commit.h
index 77de9621d9..d163c7487b 100644
--- a/commit.h
+++ b/commit.h
@@ -121,6 +121,7 @@ int read_graft_file(const char *graft_file);
struct commit_graft *lookup_commit_graft(const unsigned char *sha1);
extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup);
+extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup);
extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
extern int register_shallow(const unsigned char *sha1);
diff --git a/compat/mingw.c b/compat/mingw.c
index 772cad510d..ccfa2a0a3d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -31,11 +31,6 @@ static inline time_t filetime_to_time_t(const FILETIME *ft)
return (time_t)winTime;
}
-static inline size_t size_to_blocks(size_t s)
-{
- return (s+511)/512;
-}
-
extern int _getdrive( void );
/* We keep the do_lstat code in a separate function to avoid recursion.
* When a path ends with a slash, the stat will fail with ENOENT. In
@@ -57,10 +52,10 @@ static int do_lstat(const char *file_name, struct stat *buf)
buf->st_ino = 0;
buf->st_gid = 0;
buf->st_uid = 0;
+ buf->st_nlink = 1;
buf->st_mode = fMode;
buf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */
- buf->st_blocks = size_to_blocks(buf->st_size);
- buf->st_dev = _getdrive() - 1;
+ buf->st_dev = buf->st_rdev = (_getdrive() - 1);
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
@@ -94,7 +89,7 @@ static int do_lstat(const char *file_name, struct stat *buf)
* complete. Note that Git stat()s are redirected to mingw_lstat()
* too, since Windows doesn't really handle symlinks that well.
*/
-int mingw_lstat(const char *file_name, struct mingw_stat *buf)
+int mingw_lstat(const char *file_name, struct stat *buf)
{
int namelen;
static char alt_name[PATH_MAX];
@@ -122,8 +117,7 @@ int mingw_lstat(const char *file_name, struct mingw_stat *buf)
}
#undef fstat
-#undef stat
-int mingw_fstat(int fd, struct mingw_stat *buf)
+int mingw_fstat(int fd, struct stat *buf)
{
HANDLE fh = (HANDLE)_get_osfhandle(fd);
BY_HANDLE_FILE_INFORMATION fdata;
@@ -133,22 +127,8 @@ int mingw_fstat(int fd, struct mingw_stat *buf)
return -1;
}
/* direct non-file handles to MS's fstat() */
- if (GetFileType(fh) != FILE_TYPE_DISK) {
- struct stat st;
- if (fstat(fd, &st))
- return -1;
- buf->st_ino = st.st_ino;
- buf->st_gid = st.st_gid;
- buf->st_uid = st.st_uid;
- buf->st_mode = st.st_mode;
- buf->st_size = st.st_size;
- buf->st_blocks = size_to_blocks(buf->st_size);
- buf->st_dev = st.st_dev;
- buf->st_atime = st.st_atime;
- buf->st_mtime = st.st_mtime;
- buf->st_ctime = st.st_ctime;
- return 0;
- }
+ if (GetFileType(fh) != FILE_TYPE_DISK)
+ return fstat(fd, buf);
if (GetFileInformationByHandle(fh, &fdata)) {
int fMode = S_IREAD;
@@ -162,10 +142,10 @@ int mingw_fstat(int fd, struct mingw_stat *buf)
buf->st_ino = 0;
buf->st_gid = 0;
buf->st_uid = 0;
+ buf->st_nlink = 1;
buf->st_mode = fMode;
buf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */
- buf->st_blocks = size_to_blocks(buf->st_size);
- buf->st_dev = _getdrive() - 1;
+ buf->st_dev = buf->st_rdev = (_getdrive() - 1);
buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
diff --git a/compat/mingw.h b/compat/mingw.h
index 290a9e6f82..4f275cb8e6 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -162,22 +162,12 @@ int mingw_rename(const char*, const char*);
/* Use mingw_lstat() instead of lstat()/stat() and
* mingw_fstat() instead of fstat() on Windows.
- * struct stat is redefined because it lacks the st_blocks member.
*/
-struct mingw_stat {
- unsigned st_mode;
- time_t st_mtime, st_atime, st_ctime;
- unsigned st_dev, st_ino, st_uid, st_gid;
- size_t st_size;
- size_t st_blocks;
-};
-int mingw_lstat(const char *file_name, struct mingw_stat *buf);
-int mingw_fstat(int fd, struct mingw_stat *buf);
+int mingw_lstat(const char *file_name, struct stat *buf);
+int mingw_fstat(int fd, struct stat *buf);
#define fstat mingw_fstat
#define lstat mingw_lstat
-#define stat mingw_stat
-static inline int mingw_stat(const char *file_name, struct mingw_stat *buf)
-{ return mingw_lstat(file_name, buf); }
+#define stat(x,y) mingw_lstat(x,y)
int mingw_utime(const char *file_name, const struct utimbuf *times);
#define utime mingw_utime
@@ -228,9 +218,10 @@ char **env_setenv(char **env, const char *name);
* A replacement of main() that ensures that argv[0] has a path
*/
-#define main(c,v) main(int argc, const char **argv) \
+#define main(c,v) dummy_decl_mingw_main(); \
+static int mingw_main(); \
+int main(int argc, const char **argv) \
{ \
- static int mingw_main(); \
argv[0] = xstrdup(_pgmptr); \
return mingw_main(argc, argv); \
} \
diff --git a/compat/snprintf.c b/compat/snprintf.c
index 580966e56a..357e733074 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -17,6 +17,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
if (maxsize > 0) {
ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
/* Windows does not NUL-terminate if result fills buffer */
str[maxsize-1] = 0;
}
@@ -34,6 +36,8 @@ int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
break;
s = str;
ret = vsnprintf(str, maxsize-SNPRINTF_SIZE_CORR, format, ap);
+ if (ret == maxsize-1)
+ ret = -1;
}
free(s);
return ret;
diff --git a/config.mak.in b/config.mak.in
index b776149531..f67d673d01 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -3,6 +3,7 @@
CC = @CC@
CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
AR = @AR@
TAR = @TAR@
#INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 30d870187e..89858c237e 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -271,15 +271,17 @@ __git_merge_strategies ()
echo "$__git_merge_strategylist"
return
fi
- sed -n "/^all_strategies='/{
- s/^all_strategies='//
- s/'//
+ git merge -s help 2>&1 |
+ sed -n -e '/[Aa]vailable strategies are: /,/^$/{
+ s/\.$//
+ s/.*://
+ s/^[ ]*//
+ s/[ ]*$//
p
- q
- }" "$(git --exec-path)/git-merge"
+ }'
}
__git_merge_strategylist=
-__git_merge_strategylist="$(__git_merge_strategies 2>/dev/null)"
+__git_merge_strategylist=$(__git_merge_strategies 2>/dev/null)
__git_complete_file ()
{
@@ -501,7 +503,7 @@ __git_has_doubledash ()
return 1
}
-__git_whitespacelist="nowarn warn error error-all strip"
+__git_whitespacelist="nowarn warn error error-all fix"
_git_am ()
{
@@ -561,6 +563,29 @@ _git_add ()
COMPREPLY=()
}
+_git_archive ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --format=*)
+ __gitcomp "$(git archive --list)" "" "${cur##--format=}"
+ return
+ ;;
+ --remote=*)
+ __gitcomp "$(__git_remotes)" "" "${cur##--remote=}"
+ return
+ ;;
+ --*)
+ __gitcomp "
+ --format= --list --verbose
+ --prefix= --remote= --exec=
+ "
+ return
+ ;;
+ esac
+ __git_complete_file
+}
+
_git_bisect ()
{
__git_has_doubledash && return
@@ -667,6 +692,45 @@ _git_cherry_pick ()
esac
}
+_git_clean ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "--dry-run --quiet"
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
+_git_clone ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "
+ --local
+ --no-hardlinks
+ --shared
+ --reference
+ --quiet
+ --no-checkout
+ --bare
+ --mirror
+ --origin
+ --upload-pack
+ --template=
+ --depth
+ "
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_commit ()
{
__git_has_doubledash && return
@@ -707,7 +771,7 @@ _git_diff ()
__gitcomp "--cached --stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
- --full-index --binary --abbrev --diff-filter
+ --full-index --binary --abbrev --diff-filter=
--find-copies-harder --pickaxe-all --pickaxe-regex
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --exit-code --quiet --ext-diff
@@ -721,11 +785,6 @@ _git_diff ()
__git_complete_file
}
-_git_diff_tree ()
-{
- __gitcomp "$(__git_refs)"
-}
-
_git_fetch ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -796,6 +855,29 @@ _git_gc ()
COMPREPLY=()
}
+_git_grep ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "
+ --cached
+ --text --ignore-case --word-regexp --invert-match
+ --full-name
+ --extended-regexp --basic-regexp --fixed-strings
+ --files-with-matches --name-only
+ --files-without-match
+ --count
+ --and --or --not --all-match
+ "
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_help ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -805,7 +887,49 @@ _git_help ()
return
;;
esac
- __gitcomp "$(__git_all_commands)"
+ __gitcomp "$(__git_all_commands)
+ attributes cli core-tutorial cvs-migration
+ diffcore gitk glossary hooks ignore modules
+ repository-layout tutorial tutorial-2
+ "
+}
+
+_git_init ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --shared=*)
+ __gitcomp "
+ false true umask group all world everybody
+ " "" "${cur##--shared=}"
+ return
+ ;;
+ --*)
+ __gitcomp "--quiet --bare --template= --shared --shared="
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
+_git_ls_files ()
+{
+ __git_has_doubledash && return
+
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "--cached --deleted --modified --others --ignored
+ --stage --directory --no-empty-directory --unmerged
+ --killed --exclude= --exclude-from=
+ --exclude-per-directory= --exclude-standard
+ --error-unmatch --with-tree= --full-name
+ --abbrev --ignored --exclude-per-directory
+ "
+ return
+ ;;
+ esac
+ COMPREPLY=()
}
_git_ls_remote ()
@@ -853,6 +977,8 @@ _git_log ()
--stat --numstat --shortstat
--decorate --diff-filter=
--color-words --walk-reflogs
+ --parents --children --full-history
+ --merge
"
return
;;
@@ -882,11 +1008,42 @@ _git_merge ()
__gitcomp "$(__git_refs)"
}
+_git_mergetool ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --tool=*)
+ __gitcomp "
+ kdiff3 tkdiff meld xxdiff emerge
+ vimdiff gvimdiff ecmerge opendiff
+ " "" "${cur##--tool=}"
+ return
+ ;;
+ --*)
+ __gitcomp "--tool="
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_merge_base ()
{
__gitcomp "$(__git_refs)"
}
+_git_mv ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "--dry-run"
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_name_rev ()
{
__gitcomp "--tags --all --stdin"
@@ -1211,6 +1368,18 @@ _git_reset ()
__gitcomp "$(__git_refs)"
}
+_git_revert ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --*)
+ __gitcomp "--edit --mainline --no-edit --no-commit --signoff"
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
_git_rm ()
{
__git_has_doubledash && return
@@ -1283,7 +1452,7 @@ _git_show_branch ()
_git_stash ()
{
- local subcommands='save list show apply clear drop pop create'
+ local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
@@ -1293,6 +1462,16 @@ _git_stash ()
save,--*)
__gitcomp "--keep-index"
;;
+ apply,--*)
+ __gitcomp "--index"
+ ;;
+ show,--*|drop,--*|pop,--*|branch,--*)
+ COMPREPLY=()
+ ;;
+ show,*|apply,*|drop,*|pop,*|branch,*)
+ __gitcomp "$(git --git-dir="$(__gitdir)" stash list \
+ | sed -n -e 's/:.*//p')"
+ ;;
*)
COMPREPLY=()
;;
@@ -1473,12 +1652,15 @@ _git ()
am) _git_am ;;
add) _git_add ;;
apply) _git_apply ;;
+ archive) _git_archive ;;
bisect) _git_bisect ;;
bundle) _git_bundle ;;
branch) _git_branch ;;
checkout) _git_checkout ;;
cherry) _git_cherry ;;
cherry-pick) _git_cherry_pick ;;
+ clean) _git_clean ;;
+ clone) _git_clone ;;
commit) _git_commit ;;
config) _git_config ;;
describe) _git_describe ;;
@@ -1486,18 +1668,24 @@ _git ()
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
gc) _git_gc ;;
+ grep) _git_grep ;;
help) _git_help ;;
+ init) _git_init ;;
log) _git_log ;;
+ ls-files) _git_ls_files ;;
ls-remote) _git_ls_remote ;;
ls-tree) _git_ls_tree ;;
merge) _git_merge;;
+ mergetool) _git_mergetool;;
merge-base) _git_merge_base ;;
+ mv) _git_mv ;;
name-rev) _git_name_rev ;;
pull) _git_pull ;;
push) _git_push ;;
rebase) _git_rebase ;;
remote) _git_remote ;;
reset) _git_reset ;;
+ revert) _git_revert ;;
rm) _git_rm ;;
send-email) _git_send_email ;;
shortlog) _git_shortlog ;;
diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 2c4a4062a5..5c72f655c7 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -443,7 +443,7 @@ fi | git stripspace >"$GIT_DIR"/COMMIT_EDITMSG
case "$signoff" in
t)
- sign=$(git-var GIT_COMMITTER_IDENT | sed -e '
+ sign=$(git var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /
')
@@ -535,8 +535,8 @@ esac
case "$no_edit" in
'')
- git-var GIT_AUTHOR_IDENT > /dev/null || die
- git-var GIT_COMMITTER_IDENT > /dev/null || die
+ git var GIT_AUTHOR_IDENT > /dev/null || die
+ git var GIT_COMMITTER_IDENT > /dev/null || die
git_editor "$GIT_DIR/COMMIT_EDITMSG"
;;
esac
diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh
index e9f3a228af..2c15bc955b 100755
--- a/contrib/examples/git-tag.sh
+++ b/contrib/examples/git-tag.sh
@@ -164,7 +164,7 @@ git check-ref-format "tags/$name" ||
object=$(git rev-parse --verify --default HEAD "$@") || exit 1
type=$(git cat-file -t $object) || exit 1
-tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
+tagger=$(git var GIT_COMMITTER_IDENT) || exit 1
test -n "$username" ||
username=$(git config user.signingkey) ||
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 6ae0429c2d..c1d24b38f3 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -16,6 +16,46 @@ from sets import Set;
verbose = False
+
+def p4_build_cmd(cmd):
+ """Build a suitable p4 command line.
+
+ This consolidates building and returning a p4 command line into one
+ location. It means that hooking into the environment, or other configuration
+ can be done more easily.
+ """
+ real_cmd = "%s " % "p4"
+
+ user = gitConfig("git-p4.user")
+ if len(user) > 0:
+ real_cmd += "-u %s " % user
+
+ password = gitConfig("git-p4.password")
+ if len(password) > 0:
+ real_cmd += "-P %s " % password
+
+ port = gitConfig("git-p4.port")
+ if len(port) > 0:
+ real_cmd += "-p %s " % port
+
+ host = gitConfig("git-p4.host")
+ if len(host) > 0:
+ real_cmd += "-h %s " % host
+
+ client = gitConfig("git-p4.client")
+ if len(client) > 0:
+ real_cmd += "-c %s " % client
+
+ real_cmd += "%s" % (cmd)
+ if verbose:
+ print real_cmd
+ return real_cmd
+
+def chdir(dir):
+ if os.name == 'nt':
+ os.environ['PWD']=dir
+ os.chdir(dir)
+
def die(msg):
if verbose:
raise Exception(msg)
@@ -34,6 +74,10 @@ def write_pipe(c, str):
return val
+def p4_write_pipe(c, str):
+ real_cmd = p4_build_cmd(c)
+ return write_pipe(real_cmd, str)
+
def read_pipe(c, ignore_error=False):
if verbose:
sys.stderr.write('Reading pipe: %s\n' % c)
@@ -45,6 +89,9 @@ def read_pipe(c, ignore_error=False):
return val
+def p4_read_pipe(c, ignore_error=False):
+ real_cmd = p4_build_cmd(c)
+ return read_pipe(real_cmd, ignore_error)
def read_pipe_lines(c):
if verbose:
@@ -57,12 +104,22 @@ def read_pipe_lines(c):
return val
+def p4_read_pipe_lines(c):
+ """Specifically invoke p4 on the command supplied. """
+ real_cmd = p4_build_cmd(c)
+ return read_pipe_lines(real_cmd)
+
def system(cmd):
if verbose:
sys.stderr.write("executing %s\n" % cmd)
if os.system(cmd) != 0:
die("command failed: %s" % cmd)
+def p4_system(cmd):
+ """Specifically invoke p4 as the system command. """
+ real_cmd = p4_build_cmd(cmd)
+ return system(real_cmd)
+
def isP4Exec(kind):
"""Determine if a Perforce 'kind' should have execute permission
@@ -84,12 +141,12 @@ def setP4ExecBit(file, mode):
if p4Type[-1] == "+":
p4Type = p4Type[0:-1]
- system("p4 reopen -t %s %s" % (p4Type, file))
+ p4_system("reopen -t %s %s" % (p4Type, file))
def getP4OpenedType(file):
# Returns the perforce file type for the given file.
- result = read_pipe("p4 opened %s" % file)
+ result = p4_read_pipe("opened %s" % file)
match = re.match(".*\((.+)\)\r?$", result)
if match:
return match.group(1)
@@ -145,7 +202,7 @@ def isModeExecChanged(src_mode, dst_mode):
return isModeExec(src_mode) != isModeExec(dst_mode)
def p4CmdList(cmd, stdin=None, stdin_mode='w+b'):
- cmd = "p4 -G %s" % cmd
+ cmd = p4_build_cmd("-G %s" % (cmd))
if verbose:
sys.stderr.write("Opening pipe: %s\n" % cmd)
@@ -364,7 +421,7 @@ def originP4BranchesExist():
def p4ChangesForPaths(depotPaths, changeRange):
assert depotPaths
- output = read_pipe_lines("p4 changes " + ' '.join (["%s...%s" % (p, changeRange)
+ output = p4_read_pipe_lines("changes " + ' '.join (["%s...%s" % (p, changeRange)
for p in depotPaths]))
changes = []
@@ -512,7 +569,7 @@ class P4Submit(Command):
# remove lines in the Files section that show changes to files outside the depot path we're committing into
template = ""
inFilesSection = False
- for line in read_pipe_lines("p4 change -o"):
+ for line in p4_read_pipe_lines("change -o"):
if line.endswith("\r\n"):
line = line[:-2] + "\n"
if inFilesSection:
@@ -547,7 +604,7 @@ class P4Submit(Command):
modifier = diff['status']
path = diff['src']
if modifier == "M":
- system("p4 edit \"%s\"" % path)
+ p4_system("edit \"%s\"" % path)
if isModeExecChanged(diff['src_mode'], diff['dst_mode']):
filesToChangeExecBit[path] = diff['dst_mode']
editedFiles.add(path)
@@ -562,8 +619,8 @@ class P4Submit(Command):
filesToAdd.remove(path)
elif modifier == "R":
src, dest = diff['src'], diff['dst']
- system("p4 integrate -Dt \"%s\" \"%s\"" % (src, dest))
- system("p4 edit \"%s\"" % (dest))
+ p4_system("integrate -Dt \"%s\" \"%s\"" % (src, dest))
+ p4_system("edit \"%s\"" % (dest))
if isModeExecChanged(diff['src_mode'], diff['dst_mode']):
filesToChangeExecBit[dest] = diff['dst_mode']
os.unlink(dest)
@@ -587,7 +644,7 @@ class P4Submit(Command):
if response == "s":
print "Skipping! Good luck with the next patches..."
for f in editedFiles:
- system("p4 revert \"%s\"" % f);
+ p4_system("revert \"%s\"" % f);
for f in filesToAdd:
system("rm %s" %f)
return
@@ -610,10 +667,10 @@ class P4Submit(Command):
system(applyPatchCmd)
for f in filesToAdd:
- system("p4 add \"%s\"" % f)
+ p4_system("add \"%s\"" % f)
for f in filesToDelete:
- system("p4 revert \"%s\"" % f)
- system("p4 delete \"%s\"" % f)
+ p4_system("revert \"%s\"" % f)
+ p4_system("delete \"%s\"" % f)
# Set/clear executable bits
for f in filesToChangeExecBit.keys():
@@ -629,7 +686,7 @@ class P4Submit(Command):
submitTemplate = self.prepareLogMessage(template, logMessage)
if os.environ.has_key("P4DIFF"):
del(os.environ["P4DIFF"])
- diff = read_pipe("p4 diff -du ...")
+ diff = p4_read_pipe("diff -du ...")
newdiff = ""
for newFile in filesToAdd:
@@ -651,6 +708,7 @@ class P4Submit(Command):
newdiff = newdiff.replace("\n", "\r\n")
tmpFile.write(submitTemplate + separatorLine + diff + newdiff)
tmpFile.close()
+ mtime = os.stat(fileName).st_mtime
defaultEditor = "vi"
if platform.system() == "Windows":
defaultEditor = "notepad"
@@ -659,15 +717,29 @@ class P4Submit(Command):
else:
editor = os.environ.get("EDITOR", defaultEditor);
system(editor + " " + fileName)
- tmpFile = open(fileName, "rb")
- message = tmpFile.read()
- tmpFile.close()
- os.remove(fileName)
- submitTemplate = message[:message.index(separatorLine)]
- if self.isWindows:
- submitTemplate = submitTemplate.replace("\r\n", "\n")
- write_pipe("p4 submit -i", submitTemplate)
+ response = "y"
+ if os.stat(fileName).st_mtime <= mtime:
+ response = "x"
+ while response != "y" and response != "n":
+ response = raw_input("Submit template unchanged. Submit anyway? [y]es, [n]o (skip this patch) ")
+
+ if response == "y":
+ tmpFile = open(fileName, "rb")
+ message = tmpFile.read()
+ tmpFile.close()
+ submitTemplate = message[:message.index(separatorLine)]
+ if self.isWindows:
+ submitTemplate = submitTemplate.replace("\r\n", "\n")
+ p4_write_pipe("submit -i", submitTemplate)
+ else:
+ for f in editedFiles:
+ p4_system("revert \"%s\"" % f);
+ for f in filesToAdd:
+ p4_system("revert \"%s\"" % f);
+ system("rm %s" %f)
+
+ os.remove(fileName)
else:
fileName = "submit.txt"
file = open(fileName, "w+")
@@ -712,9 +784,9 @@ class P4Submit(Command):
print "Perforce checkout for depot path %s located at %s" % (self.depotPath, self.clientPath)
self.oldWorkingDirectory = os.getcwd()
- os.chdir(self.clientPath)
+ chdir(self.clientPath)
print "Syncronizing p4 checkout..."
- system("p4 sync ...")
+ p4_system("sync ...")
self.check()
@@ -732,7 +804,7 @@ class P4Submit(Command):
if len(commits) == 0:
print "All changes applied!"
- os.chdir(self.oldWorkingDirectory)
+ chdir(self.oldWorkingDirectory)
sync = P4Sync()
sync.run([])
@@ -1399,7 +1471,7 @@ class P4Sync(Command):
if not gitBranchExists(self.refPrefix + "HEAD") and self.importIntoRemotes and gitBranchExists(self.branch):
system("git symbolic-ref %sHEAD %s" % (self.refPrefix, self.branch))
- if self.useClientSpec or gitConfig("p4.useclientspec") == "true":
+ if self.useClientSpec or gitConfig("git-p4.useclientspec") == "true":
self.getClientSpec()
# TODO: should always look at previous commits,
@@ -1670,7 +1742,7 @@ class P4Clone(P4Sync):
print "Importing from %s into %s" % (', '.join(depotPaths), self.cloneDestination)
if not os.path.exists(self.cloneDestination):
os.makedirs(self.cloneDestination)
- os.chdir(self.cloneDestination)
+ chdir(self.cloneDestination)
system("git init")
self.gitdir = os.getcwd() + "/.git"
if not P4Sync.run(self, depotPaths):
@@ -1782,7 +1854,7 @@ def main():
if os.path.exists(cmd.gitdir):
cdup = read_pipe("git rev-parse --show-cdup").strip()
if len(cdup) > 0:
- os.chdir(cdup);
+ chdir(cdup);
if not isValidGitDir(cmd.gitdir):
if isValidGitDir(cmd.gitdir + "/.git"):
diff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt
index b16a8384bc..49b335921a 100644
--- a/contrib/fast-import/git-p4.txt
+++ b/contrib/fast-import/git-p4.txt
@@ -3,14 +3,16 @@ git-p4 - Perforce <-> Git converter using git-fast-import
Usage
=====
-git-p4 supports two main modes: Importing from Perforce to a Git repository is
-done using "git-p4 sync" or "git-p4 rebase". Submitting changes from Git back
-to Perforce is done using "git-p4 submit".
+git-p4 can be used in two different ways:
+
+1) To import changes from Perforce to a Git repository, using "git-p4 sync".
+
+2) To submit changes from Git back to Perforce, using "git-p4 submit".
Importing
=========
-You can simply start with
+Simply start with
git-p4 clone //depot/path/project
@@ -18,11 +20,18 @@ or
git-p4 clone //depot/path/project myproject
-This will create an empty git repository in a subdirectory called "project" (or
-"myproject" with the second command), import the head revision from the
-specified perforce path into a git "p4" branch (remotes/p4 actually), create a
-master branch off it and check it out. If you want the entire history (not just
-the head revision) then you can simply append a "@all" to the depot path:
+This will:
+
+1) Create an empty git repository in a subdirectory called "project" (or
+"myproject" with the second command)
+
+2) Import the head revision from the given Perforce path into a git branch
+called "p4" (remotes/p4 actually)
+
+3) Create a master branch based on it and check it out.
+
+If you want the entire history (not just the head revision) then you can simply
+append a "@all" to the depot path:
git-p4 clone //depot/project/main@all myproject
@@ -37,43 +46,40 @@ If you want more control you can also use the git-p4 sync command directly:
This will import the current head revision of the specified depot path into a
"remotes/p4/master" branch of your git repository. You can use the
---branch=mybranch option to use a different branch.
+--branch=mybranch option to import into a different branch.
-If you want to import the entire history of a given depot path just use
+If you want to import the entire history of a given depot path simply use:
git-p4 sync //path/in/depot@all
+
+Note:
+
To achieve optimal compression you may want to run 'git repack -a -d -f' after
a big import. This may take a while.
-Support for Perforce integrations is still work in progress. Don't bother
-trying it unless you want to hack on it :)
-
Incremental Imports
===================
-After an initial import you can easily synchronize your git repository with
-newer changes from the Perforce depot by just calling
+After an initial import you can continue to synchronize your git repository
+with newer changes from the Perforce depot by just calling
git-p4 sync
in your git repository. By default the "remotes/p4/master" branch is updated.
-It is recommended to run 'git repack -a -d -f' from time to time when using
-incremental imports to optimally combine the individual git packs that each
-incremental import creates through the use of git-fast-import.
-
+Advanced Setup
+==============
-A useful setup may be that you have a periodically updated git repository
-somewhere that contains a complete import of a Perforce project. That git
-repository can be used to clone the working repository from and one would
-import from Perforce directly after cloning using git-p4. If the connection to
-the Perforce server is slow and the working repository hasn't been synced for a
-while it may be desirable to fetch changes from the origin git repository using
-the efficient git protocol. git-p4 supports this setup by calling "git fetch origin"
-by default if there is an origin branch. You can disable this using
+Suppose you have a periodically updated git repository somewhere, containing a
+complete import of a Perforce project. This repository can be cloned and used
+with git-p4. When updating the cloned repository with the "sync" command,
+git-p4 will try to fetch changes from the original repository first. The git
+protocol used with this is usually faster than importing from Perforce
+directly.
- git config git-p4.syncFromOrigin false
+This behaviour can be disabled by setting the "git-p4.syncFromOrigin" git
+configuration variable to "false".
Updating
========
@@ -91,7 +97,7 @@ Submitting
==========
git-p4 has support for submitting changes from a git repository back to the
-Perforce depot. This requires a Perforce checkout separate to your git
+Perforce depot. This requires a Perforce checkout separate from your git
repository. To submit all changes that are in the current git branch but not in
the "p4" branch (or "origin" if "p4" doesn't exist) simply call
@@ -109,17 +115,6 @@ continue importing the remaining changes with
git-p4 submit --continue
-After submitting you should sync your perforce import branch ("p4" or "origin")
-from Perforce using git-p4's sync command.
-
-If you have changes in your working directory that you haven't committed into
-git yet but that you want to commit to Perforce directly ("quick fixes") then
-you do not have to go through the intermediate step of creating a git commit
-first but you can just call
-
- git-p4 submit --direct
-
-
Example
=======
@@ -140,6 +135,62 @@ Example
git-p4 rebase
+Configuration parameters
+========================
+
+git-p4.user ($P4USER)
+
+Allows you to specify the username to use to connect to the Perforce repository.
+
+ git config [--global] git-p4.user public
+
+git-p4.password ($P4PASS)
+
+Allows you to specify the password to use to connect to the Perforce repository.
+Warning this password will be visible on the command-line invocation of the p4 binary.
+
+ git config [--global] git-p4.password public1234
+
+git-p4.port ($P4PORT)
+
+Specify the port to be used to contact the Perforce server. As this will be passed
+directly to the p4 binary, it may be in the format host:port as well.
+
+ git config [--global] git-p4.port codes.zimbra.com:2666
+
+git-p4.host ($P4HOST)
+
+Specify the host to contact for a Perforce repository.
+
+ git config [--global] git-p4.host perforce.example.com
+
+git-p4.client ($P4CLIENT)
+
+Specify the client name to use
+
+ git config [--global] git-p4.client public-view
+
+git-p4.allowSubmit
+
+ git config [--global] git-p4.allowSubmit false
+
+git-p4.syncFromOrigin
+
+A useful setup may be that you have a periodically updated git repository
+somewhere that contains a complete import of a Perforce project. That git
+repository can be used to clone the working repository from and one would
+import from Perforce directly after cloning using git-p4. If the connection to
+the Perforce server is slow and the working repository hasn't been synced for a
+while it may be desirable to fetch changes from the origin git repository using
+the efficient git protocol. git-p4 supports this setup by calling "git fetch origin"
+by default if there is an origin branch. You can disable this using:
+
+ git config [--global] git-p4.syncFromOrigin false
+
+git-p4.useclientspec
+
+ git config [--global] git-p4.useclientspec false
+
Implementation Details...
=========================
diff --git a/ctype.c b/ctype.c
index ee06eb7f48..d2bd38e901 100644
--- a/ctype.c
+++ b/ctype.c
@@ -5,6 +5,11 @@
*/
#include "cache.h"
+/* Just so that no insane platform contaminate namespace with these symbols */
+#undef SS
+#undef AA
+#undef DD
+
#define SS GIT_SPACE
#define AA GIT_ALPHA
#define DD GIT_DIGIT
diff --git a/daemon.c b/daemon.c
index 4540e8df5a..8dcde73200 100644
--- a/daemon.c
+++ b/daemon.c
@@ -794,6 +794,7 @@ static void child_handler(int signo)
}
break;
}
+ signal(SIGCHLD, child_handler);
}
static int set_reuse_addr(int sockfd)
diff --git a/decorate.c b/decorate.c
index d9668d2ef9..82d9e221ea 100644
--- a/decorate.c
+++ b/decorate.c
@@ -6,13 +6,13 @@
#include "object.h"
#include "decorate.h"
-static unsigned int hash_obj(struct object *obj, unsigned int n)
+static unsigned int hash_obj(const struct object *obj, unsigned int n)
{
unsigned int hash = *(unsigned int *)obj->sha1;
return hash % n;
}
-static void *insert_decoration(struct decoration *n, struct object *base, void *decoration)
+static void *insert_decoration(struct decoration *n, const struct object *base, void *decoration)
{
int size = n->size;
struct object_decoration *hash = n->hash;
@@ -44,7 +44,7 @@ static void grow_decoration(struct decoration *n)
n->nr = 0;
for (i = 0; i < old_size; i++) {
- struct object *base = old_hash[i].base;
+ const struct object *base = old_hash[i].base;
void *decoration = old_hash[i].decoration;
if (!base)
@@ -55,7 +55,8 @@ static void grow_decoration(struct decoration *n)
}
/* Add a decoration pointer, return any old one */
-void *add_decoration(struct decoration *n, struct object *obj, void *decoration)
+void *add_decoration(struct decoration *n, const struct object *obj,
+ void *decoration)
{
int nr = n->nr + 1;
@@ -65,7 +66,7 @@ void *add_decoration(struct decoration *n, struct object *obj, void *decoration)
}
/* Lookup a decoration pointer */
-void *lookup_decoration(struct decoration *n, struct object *obj)
+void *lookup_decoration(struct decoration *n, const struct object *obj)
{
int j;
diff --git a/decorate.h b/decorate.h
index 1fa4ad9beb..e7328044ff 100644
--- a/decorate.h
+++ b/decorate.h
@@ -2,7 +2,7 @@
#define DECORATE_H
struct object_decoration {
- struct object *base;
+ const struct object *base;
void *decoration;
};
@@ -12,7 +12,7 @@ struct decoration {
struct object_decoration *hash;
};
-extern void *add_decoration(struct decoration *n, struct object *obj, void *decoration);
-extern void *lookup_decoration(struct decoration *n, struct object *obj);
+extern void *add_decoration(struct decoration *n, const struct object *obj, void *decoration);
+extern void *lookup_decoration(struct decoration *n, const struct object *obj);
#endif
diff --git a/diff.c b/diff.c
index a07812c5c7..18fa7a712c 100644
--- a/diff.c
+++ b/diff.c
@@ -20,6 +20,7 @@
static int diff_detect_rename_default;
static int diff_rename_limit_default = 200;
+static int diff_suppress_blank_empty;
int diff_use_color_default = -1;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
@@ -131,10 +132,6 @@ static int parse_funcname_pattern(const char *var, const char *ep, const char *v
*/
int git_diff_ui_config(const char *var, const char *value, void *cb)
{
- if (!strcmp(var, "diff.renamelimit")) {
- diff_rename_limit_default = git_config_int(var, value);
- return 0;
- }
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value, -1);
return 0;
@@ -167,6 +164,11 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
int git_diff_basic_config(const char *var, const char *value, void *cb)
{
+ if (!strcmp(var, "diff.renamelimit")) {
+ diff_rename_limit_default = git_config_int(var, value);
+ return 0;
+ }
+
if (!prefixcmp(var, "diff.color.") || !prefixcmp(var, "color.diff.")) {
int slot = parse_diff_color_slot(var, 11);
if (!value)
@@ -175,6 +177,12 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
return 0;
}
+ /* like GNU diff's --suppress-blank-empty option */
+ if (!strcmp(var, "diff.suppress-blank-empty")) {
+ diff_suppress_blank_empty = git_config_bool(var, value);
+ return 0;
+ }
+
if (!prefixcmp(var, "diff.")) {
const char *ep = strrchr(var, '.');
if (ep != var + 4) {
@@ -368,7 +376,6 @@ static void diff_words_append(char *line, unsigned long len,
}
struct diff_words_data {
- struct xdiff_emit_state xm;
struct diff_words_buffer minus, plus;
FILE *file;
};
@@ -458,11 +465,8 @@ static void diff_words_show(struct diff_words_data *diff_words)
xpp.flags = XDF_NEED_MINIMAL;
xecfg.ctxlen = diff_words->minus.alloc + diff_words->plus.alloc;
- ecb.outf = xdiff_outf;
- ecb.priv = diff_words;
- diff_words->xm.consume = fn_out_diff_words_aux;
- xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
-
+ xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
+ &xpp, &xecfg, &ecb);
free(minus.ptr);
free(plus.ptr);
diff_words->minus.text.size = diff_words->plus.text.size = 0;
@@ -476,7 +480,6 @@ static void diff_words_show(struct diff_words_data *diff_words)
typedef unsigned long (*sane_truncate_fn)(char *line, unsigned long len);
struct emit_callback {
- struct xdiff_emit_state xm;
int nparents, color_diff;
unsigned ws_rule;
sane_truncate_fn truncate;
@@ -579,6 +582,12 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
ecbdata->label_path[0] = ecbdata->label_path[1] = NULL;
}
+ if (diff_suppress_blank_empty
+ && len == 2 && line[0] == ' ' && line[1] == '\n') {
+ line[0] = '\n';
+ len = 1;
+ }
+
/* This is not really necessary for now because
* this codepath only deals with two-way diffs.
*/
@@ -707,8 +716,6 @@ static char *pprint_rename(const char *a, const char *b)
}
struct diffstat_t {
- struct xdiff_emit_state xm;
-
int nr;
int alloc;
struct diffstat_file {
@@ -1130,7 +1137,6 @@ static void free_diffstat_info(struct diffstat_t *diffstat)
}
struct checkdiff_t {
- struct xdiff_emit_state xm;
const char *filename;
int lineno;
struct diff_options *o;
@@ -1375,12 +1381,22 @@ static struct builtin_funcname_pattern {
const char *name;
const char *pattern;
} builtin_funcname_pattern[] = {
+ { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
+ { "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$" },
{ "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
"new\\|return\\|switch\\|throw\\|while\\)\n"
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*\\)$" },
- { "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+ { "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
+ "destructor\\|interface\\|implementation\\|"
+ "initialization\\|finalization\\)[ \t]*.*\\)$"
+ "\\|"
+ "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
+ },
+ { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" },
+ { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
+ { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
};
static const char *diff_funcname_pattern(struct diff_filespec *one)
@@ -1512,15 +1528,13 @@ static void builtin_diff(const char *name_a,
xecfg.ctxlen = strtoul(diffopts + 10, NULL, 10);
else if (!prefixcmp(diffopts, "-u"))
xecfg.ctxlen = strtoul(diffopts + 2, NULL, 10);
- ecb.outf = xdiff_outf;
- ecb.priv = &ecbdata;
- ecbdata.xm.consume = fn_out_consume;
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS)) {
ecbdata.diff_words =
xcalloc(1, sizeof(struct diff_words_data));
ecbdata.diff_words->file = o->file;
}
- xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata,
+ &xpp, &xecfg, &ecb);
if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
free_diff_words_data(&ecbdata);
}
@@ -1571,9 +1585,8 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
memset(&xecfg, 0, sizeof(xecfg));
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
- ecb.outf = xdiff_outf;
- ecb.priv = diffstat;
- xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
+ &xpp, &xecfg, &ecb);
}
free_and_return:
@@ -1594,7 +1607,6 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
return;
memset(&data, 0, sizeof(data));
- data.xm.consume = checkdiff_consume;
data.filename = name_b ? name_b : name_a;
data.lineno = 0;
data.o = o;
@@ -1618,12 +1630,13 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
xdemitcb_t ecb;
memset(&xecfg, 0, sizeof(xecfg));
+ xecfg.ctxlen = 1; /* at least one context line */
xpp.flags = XDF_NEED_MINIMAL;
- ecb.outf = xdiff_outf;
- ecb.priv = &data;
- xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
+ &xpp, &xecfg, &ecb);
- if (data.trailing_blanks_start) {
+ if ((data.ws_rule & WS_TRAILING_SPACE) &&
+ data.trailing_blanks_start) {
fprintf(o->file, "%s:%d: ends with blank lines.\n",
data.filename, data.trailing_blanks_start);
data.status = 1; /* report errors */
@@ -3008,7 +3021,6 @@ static void diff_summary(FILE *file, struct diff_filepair *p)
}
struct patch_id_t {
- struct xdiff_emit_state xm;
SHA_CTX *ctx;
int patchlen;
};
@@ -3053,7 +3065,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
SHA1_Init(&ctx);
memset(&data, 0, sizeof(struct patch_id_t));
data.ctx = &ctx;
- data.xm.consume = patch_id_consume;
for (i = 0; i < q->nr; i++) {
xpparam_t xpp;
@@ -3118,9 +3129,8 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
xpp.flags = XDF_NEED_MINIMAL;
xecfg.ctxlen = 3;
xecfg.flags = XDL_EMIT_FUNCNAMES;
- ecb.outf = xdiff_outf;
- ecb.priv = &data;
- xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
+ xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
+ &xpp, &xecfg, &ecb);
}
SHA1_Final(sha1, &ctx);
@@ -3197,7 +3207,6 @@ void diff_flush(struct diff_options *options)
struct diffstat_t diffstat;
memset(&diffstat, 0, sizeof(struct diffstat_t));
- diffstat.xm.consume = diffstat_consume;
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
if (check_pair_status(p))
@@ -3223,11 +3232,10 @@ void diff_flush(struct diff_options *options)
if (output_format & DIFF_FORMAT_PATCH) {
if (separator) {
+ putc(options->line_termination, options->file);
if (options->stat_sep) {
/* attach patch instead of inline */
fputs(options->stat_sep, options->file);
- } else {
- putc(options->line_termination, options->file);
}
}
diff --git a/dir.c b/dir.c
index 29d1d5ba31..92452eb5ef 100644
--- a/dir.c
+++ b/dir.c
@@ -54,7 +54,7 @@ int common_prefix(const char **pathspec)
static inline int special_char(unsigned char c1)
{
- return !c1 || c1 == '*' || c1 == '[' || c1 == '?';
+ return !c1 || c1 == '*' || c1 == '[' || c1 == '?' || c1 == '\\';
}
/*
@@ -727,8 +727,12 @@ static void free_simplify(struct path_simplify *simplify)
int read_directory(struct dir_struct *dir, const char *path, const char *base, int baselen, const char **pathspec)
{
- struct path_simplify *simplify = create_simplify(pathspec);
+ struct path_simplify *simplify;
+ if (has_symlink_leading_path(strlen(path), path))
+ return dir->nr;
+
+ simplify = create_simplify(pathspec);
read_directory_recursive(dir, path, base, baselen, 0, simplify);
free_simplify(simplify);
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);
diff --git a/git-am.sh b/git-am.sh
index 6aa819280e..aa602618e6 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -10,7 +10,7 @@ git am [options] (--resolved | --skip | --abort)
--
d,dotest= (removed -- do not use)
i,interactive run interactively
-b,binary pass --allow-binary-replacement to git-apply
+b,binary (historical option -- no-op)
3,3way allow fall back on 3way merging if needed
s,signoff add a Signed-off-by line to the commit message
u,utf8 recode into utf8 (default)
@@ -87,7 +87,7 @@ fall_back_3way () {
echo Using index info to reconstruct a base tree...
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
- git apply $binary --cached <"$dotest/patch"
+ git apply --cached <"$dotest/patch"
then
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
prec=4
dotest="$GIT_DIR/rebase-apply"
-sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
+sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
resolvemsg= resume=
git_apply_opt=
@@ -131,7 +131,7 @@ do
-i|--interactive)
interactive=t ;;
-b|--binary)
- binary=t ;;
+ : ;;
-3|--3way)
threeway=t ;;
-s|--signoff)
@@ -149,7 +149,7 @@ do
--abort)
abort=t ;;
--rebasing)
- rebasing=t threeway=t keep=t binary=t ;;
+ rebasing=t threeway=t keep=t ;;
-d|--dotest)
die "-d option is no longer supported. Do not use."
;;
@@ -247,10 +247,9 @@ else
exit 1
}
- # -b, -s, -u, -k and --whitespace flags are kept for the
+ # -s, -u, -k and --whitespace flags are kept for the
# resuming session after a patch failure.
# -3 and -i can and must be given when resuming.
- echo "$binary" >"$dotest/binary"
echo " $ws" >"$dotest/whitespace"
echo "$sign" >"$dotest/sign"
echo "$utf8" >"$dotest/utf8"
@@ -274,10 +273,6 @@ case "$resolved" in
fi
esac
-if test "$(cat "$dotest/binary")" = t
-then
- binary=--allow-binary-replacement
-fi
if test "$(cat "$dotest/utf8")" = t
then
utf8=-u
@@ -291,7 +286,7 @@ fi
ws=`cat "$dotest/whitespace"`
if test "$(cat "$dotest/sign")" = t
then
- SIGNOFF=`git-var GIT_COMMITTER_IDENT | sed -e '
+ SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /'
`
@@ -459,7 +454,7 @@ do
case "$resolved" in
'')
- git apply $git_apply_opt $binary --index "$dotest/patch"
+ git apply $git_apply_opt --index "$dotest/patch"
apply_status=$?
;;
t)
diff --git a/git-bisect.sh b/git-bisect.sh
index 3cac20db79..97ac600873 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -220,7 +220,8 @@ bisect_next_check() {
if test -t 0
then
printf >&2 'Are you sure [Y/n]? '
- case "$(read yesno)" in [Nn]*) exit 1 ;; esac
+ read yesno
+ case "$yesno" in [Nn]*) exit 1 ;; esac
fi
: bisect without good...
;;
diff --git a/git-compat-util.h b/git-compat-util.h
index cf89cdf459..6ee325546e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -99,6 +99,11 @@
#include <iconv.h>
#endif
+#ifndef NO_OPENSSL
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#endif
+
/* On most systems <limits.h> would have given us this, but
* not on some systems (e.g. GNU/Hurd).
*/
@@ -192,6 +197,12 @@ extern int git_munmap(void *start, size_t length);
#endif /* NO_MMAP */
+#ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
+#define on_disk_bytes(st) ((st).st_size)
+#else
+#define on_disk_bytes(st) ((st).st_blocks * 512)
+#endif
+
#define DEFAULT_PACKED_GIT_LIMIT \
((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e2664ef013..e439202961 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -952,7 +952,7 @@ while (<CVS>) {
} elsif (/^-+$/) { # end of unknown-line processing
$state = 1;
} elsif ($state != 11) { # ignore stuff when skipping
- print "* UNKNOWN LINE * $_\n";
+ print STDERR "* UNKNOWN LINE * $_\n";
}
}
commit() if $branch and $state != 11;
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 182822a24e..2871a59e32 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -361,9 +361,17 @@ do
;;
$_x40)
echo "Ref '$ref' was rewritten"
- git update-ref -m "filter-branch: rewrite" \
- "$ref" $rewritten $sha1 ||
- die "Could not rewrite $ref"
+ if ! git update-ref -m "filter-branch: rewrite" \
+ "$ref" $rewritten $sha1 2>/dev/null; then
+ if test $(git cat-file -t "$ref") = tag; then
+ if test -z "$filter_tag_name"; then
+ warn "WARNING: You said to rewrite tagged commits, but not the corresponding tag."
+ warn "WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag."
+ fi
+ else
+ die "Could not rewrite $ref"
+ fi
+ fi
;;
*)
# NEEDSWORK: possibly add -Werror, making this an error
@@ -408,15 +416,17 @@ if [ "$filter_tag_name" ]; then
echo "$ref -> $new_ref ($sha1 -> $new_sha1)"
if [ "$type" = "tag" ]; then
- new_sha1=$(git cat-file tag "$ref" |
+ new_sha1=$( ( printf 'object %s\ntype commit\ntag %s\n' \
+ "$new_sha1" "$new_ref"
+ git cat-file tag "$ref" |
sed -n \
-e "1,/^$/{
- s/^object .*/object $new_sha1/
- s/^type .*/type commit/
- s/^tag .*/tag $new_ref/
+ /^object /d
+ /^type /d
+ /^tag /d
}" \
-e '/^-----BEGIN PGP SIGNATURE-----/q' \
- -e 'p' |
+ -e 'p' ) |
git mktag) ||
die "Could not create new tag object for $ref"
if git cat-file tag "$ref" | \
diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN
index 0ab478ef90..4e709ebe77 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.10.GITGUI
+DEF_VER=0.11.GITGUI
LF='
'
diff --git a/git-gui/Makefile b/git-gui/Makefile
index b19fb2d64e..55765c8a3a 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -34,8 +34,12 @@ ifndef gitexecdir
endif
ifndef sharedir
+ifeq (git-core,$(notdir $(gitexecdir)))
+ sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share
+else
sharedir := $(dir $(gitexecdir))share
endif
+endif
ifndef INSTALL
INSTALL = install
@@ -156,6 +160,7 @@ endif
ifneq (,$(findstring MINGW,$(uname_S)))
NO_MSGFMT=1
GITGUI_WINDOWS_WRAPPER := YesPlease
+ GITGUI_RELATIVE := 1
endif
ifdef GITGUI_MACOSXAPP
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 7c27a43a5d..ad65aaad5a 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...
set oguilib {@@GITGUI_LIBDIR@@}
set oguirel {@@GITGUI_RELATIVE@@}
if {$oguirel eq {1}} {
- set oguilib [file dirname [file dirname [file normalize $argv0]]]
+ set oguilib [file dirname [file normalize $argv0]]
+ if {[file tail $oguilib] eq {git-core}} {
+ set oguilib [file dirname $oguilib]
+ }
+ set oguilib [file dirname $oguilib]
set oguilib [file join $oguilib share git-gui lib]
set oguimsg [file join $oguilib msgs]
} elseif {[string match @@* $oguirel]} {
@@ -317,7 +321,7 @@ proc _git_cmd {name} {
return $v
}
-proc _which {what} {
+proc _which {what args} {
global env _search_exe _search_path
if {$_search_path eq {}} {
@@ -340,8 +344,14 @@ proc _which {what} {
}
}
+ if {[is_Windows] && [lsearch -exact $args -script] >= 0} {
+ set suffix {}
+ } else {
+ set suffix $_search_exe
+ }
+
foreach p $_search_path {
- set p [file join $p $what$_search_exe]
+ set p [file join $p $what$suffix]
if {[file exists $p]} {
return [file normalize $p]
}
@@ -1686,7 +1696,7 @@ proc do_gitk {revs} {
# -- Always start gitk through whatever we were loaded with. This
# lets us bypass using shell process on Windows systems.
#
- set exe [_which gitk]
+ set exe [_which gitk -script]
set cmd [list [info nameofexecutable] $exe]
if {$exe eq {}} {
error_popup [mc "Couldn't find gitk in PATH"]
@@ -2925,6 +2935,7 @@ if {[is_enabled transport]} {
populate_fetch_menu
set n [expr {[.mbar.remote index end] - $n}]
if {$n > 0} {
+ if {[.mbar.remote type 0] eq "tearoff"} { incr n }
.mbar.remote insert $n separator
}
unset n
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index 77990c537c..52b79e4a1f 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -19,6 +19,7 @@ proc clear_diff {} {
proc reshow_diff {} {
global file_states file_lists
global current_diff_path current_diff_side
+ global ui_diff
set p $current_diff_path
if {$p eq {}} {
@@ -28,7 +29,8 @@ proc reshow_diff {} {
|| [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} {
clear_diff
} else {
- show_diff $p $current_diff_side
+ set save_pos [lindex [$ui_diff yview] 0]
+ show_diff $p $current_diff_side {} $save_pos
}
}
@@ -52,7 +54,7 @@ A rescan will be automatically started to find other files which may have the sa
rescan ui_ready 0
}
-proc show_diff {path w {lno {}}} {
+proc show_diff {path w {lno {}} {scroll_pos {}}} {
global file_states file_lists
global is_3way_diff diff_active repo_config
global ui_diff ui_index ui_workdir
@@ -151,6 +153,10 @@ proc show_diff {path w {lno {}}} {
$ui_diff conf -state disabled
set diff_active 0
unlock_index
+ if {$scroll_pos ne {}} {
+ update
+ $ui_diff yview moveto $scroll_pos
+ }
ui_ready
return
}
@@ -190,10 +196,10 @@ proc show_diff {path w {lno {}}} {
-blocking 0 \
-encoding binary \
-translation binary
- fileevent $fd readable [list read_diff $fd]
+ fileevent $fd readable [list read_diff $fd $scroll_pos]
}
-proc read_diff {fd} {
+proc read_diff {fd scroll_pos} {
global ui_diff diff_active
global is_3way_diff current_diff_header
@@ -282,6 +288,10 @@ proc read_diff {fd} {
close $fd
set diff_active 0
unlock_index
+ if {$scroll_pos ne {}} {
+ update
+ $ui_diff yview moveto $scroll_pos
+ }
ui_ready
if {[$ui_diff index end] eq {2.0}} {
diff --git a/git-gui/po/README b/git-gui/po/README
index 5e77a7d7d2..595bbf5dee 100644
--- a/git-gui/po/README
+++ b/git-gui/po/README
@@ -101,7 +101,7 @@ matching msgid lines. A few tips:
"printf()"-like functions. Make sure "%s", "%d", and "%%" in your
translated messages match the original.
- When you have to change the order of words, you can add "<number>\$"
+ When you have to change the order of words, you can add "<number>$"
between '%' and the conversion ('s', 'd', etc.) to say "<number>-th
parameter to the format string is used at this point". For example,
if the original message is like this:
@@ -111,12 +111,17 @@ matching msgid lines. A few tips:
and if for whatever reason your translation needs to say weight first
and then length, you can say something like:
- "WEIGHT IS %2\$d, LENGTH IS %1\$d"
+ "WEIGHT IS %2$d, LENGTH IS %1$d"
- The reason you need a backslash before dollar sign is because
- this is a double quoted string in Tcl language, and without
- it the letter introduces a variable interpolation, which you
- do not want here.
+ A format specification with a '*' (asterisk) refers to *two* arguments
+ instead of one, hence the succeeding argument number is two higher
+ instead of one. So, a message like this
+
+ "%s ... %*i of %*i %s (%3i%%)"
+
+ is equivalent to
+
+ "%1$s ... %2$*i of %4$*i %6$s (%7$3i%%)"
- A long message can be split across multiple lines by ending the
string with a double quote, and starting another string on the next
diff --git a/git-gui/po/de.po b/git-gui/po/de.po
index f20955c185..fa43947ad0 100644
--- a/git-gui/po/de.po
+++ b/git-gui/po/de.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
-"PO-Revision-Date: 2008-05-01 11:51+0200\n"
+"POT-Creation-Date: 2008-08-02 08:58+0200\n"
+"PO-Revision-Date: 2008-08-02 09:09+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
@@ -134,18 +134,11 @@ msgstr "Konfliktauflösung nötig"
msgid "Starting gitk... please wait..."
msgstr "Gitk wird gestartet... bitte warten."
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
-msgstr ""
-"Gitk kann nicht gestartet werden:\n"
-"\n"
-"%s existiert nicht"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
+msgstr "Gitk kann im PATH nicht gefunden werden."
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Projektarchiv"
@@ -294,7 +287,15 @@ msgstr "Aus der Bereitstellung herausnehmen"
msgid "Revert Changes"
msgstr "Änderungen verwerfen"
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr "Weniger Zeilen anzeigen"
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr "Mehr Zeilen anzeigen"
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "Abzeichnen"
@@ -314,11 +315,7 @@ msgstr "Zusammenführen abbrechen..."
msgid "Push..."
msgstr "Versenden..."
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr "Apple"
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
@@ -403,15 +400,11 @@ msgstr "Datei:"
msgid "Apply/Reverse Hunk"
msgstr "Kontext anwenden/umkehren"
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr "Weniger Zeilen anzeigen"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
+msgstr "Zeile anwenden/umkehren"
-#: git-gui.sh:2602
-msgid "Show More Context"
-msgstr "Mehr Zeilen anzeigen"
-
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr "Aktualisieren"
@@ -427,11 +420,19 @@ msgstr "Schriftgröße vergrößern"
msgid "Unstage Hunk From Commit"
msgstr "Kontext aus Bereitstellung herausnehmen"
-#: git-gui.sh:2648
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr "Zeile aus der Bereitstellung herausnehmen"
+
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "Kontext zur Bereitstellung hinzufügen"
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr "Zeile zur Bereitstellung hinzufügen"
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr "Initialisieren..."
@@ -493,7 +494,11 @@ msgstr "Version:"
msgid "Copy Commit"
msgstr "Version kopieren"
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr "Volle Kopie-Erkennung"
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "%s lesen..."
@@ -514,7 +519,19 @@ msgstr "Annotierungen für ursprünglichen Ort werden geladen..."
msgid "Annotation complete."
msgstr "Annotierung vollständig."
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr "Verarbeitung läuft"
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr "Annotierung läuft bereits."
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr "Intensive Kopie-Erkennung läuft..."
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "Annotierung laden..."
@@ -759,7 +776,12 @@ msgstr "Schließen"
msgid "Branch '%s' does not exist."
msgstr "Zweig »%s« existiert nicht."
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "Fehler beim Einrichten der vereinfachten git-pull für »%s«."
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -1485,6 +1507,14 @@ msgstr ""
msgid "Failed to stage selected hunk."
msgstr "Fehler beim Bereitstellen des gewählten Kontexts."
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr "Fehler beim Herausnehmen der gewählten Zeile aus der Bereitstellung."
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr "Fehler beim Bereitstellen der gewählten Zeile."
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "Fehler"
@@ -1750,6 +1780,14 @@ msgid "Match Tracking Branches"
msgstr "Passend zu Übernahmezweig"
#: lib/option.tcl:126
+msgid "Blame Copy Only On Changed Files"
+msgstr "Kopie-Annotieren nur bei geänderten Dateien"
+
+#: lib/option.tcl:127
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Mindestzahl Zeichen für Kopie-Annotieren"
+
+#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "Anzahl der Kontextzeilen beim Vergleich"
diff --git a/git-gui/po/git-gui.pot b/git-gui/po/git-gui.pot
index 813199f782..e295000e77 100644
--- a/git-gui/po/git-gui.pot
+++ b/git-gui/po/git-gui.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
+"POT-Creation-Date: 2008-08-02 14:45-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,33 +16,33 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: git-gui.sh:41 git-gui.sh:634 git-gui.sh:648 git-gui.sh:661 git-gui.sh:744
-#: git-gui.sh:763
+#: git-gui.sh:41 git-gui.sh:688 git-gui.sh:702 git-gui.sh:715 git-gui.sh:798
+#: git-gui.sh:817
msgid "git-gui: fatal error"
msgstr ""
-#: git-gui.sh:593
+#: git-gui.sh:644
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr ""
-#: git-gui.sh:620
+#: git-gui.sh:674
msgid "Main Font"
msgstr ""
-#: git-gui.sh:621
+#: git-gui.sh:675
msgid "Diff/Console Font"
msgstr ""
-#: git-gui.sh:635
+#: git-gui.sh:689
msgid "Cannot find git in PATH."
msgstr ""
-#: git-gui.sh:662
+#: git-gui.sh:716
msgid "Cannot parse Git version string:"
msgstr ""
-#: git-gui.sh:680
+#: git-gui.sh:734
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
@@ -54,375 +54,379 @@ msgid ""
"Assume '%s' is version 1.5.0?\n"
msgstr ""
-#: git-gui.sh:918
+#: git-gui.sh:972
msgid "Git directory not found:"
msgstr ""
-#: git-gui.sh:925
+#: git-gui.sh:979
msgid "Cannot move to top of working directory:"
msgstr ""
-#: git-gui.sh:932
+#: git-gui.sh:986
msgid "Cannot use funny .git directory:"
msgstr ""
-#: git-gui.sh:937
+#: git-gui.sh:991
msgid "No working directory"
msgstr ""
-#: git-gui.sh:1084 lib/checkout_op.tcl:283
+#: git-gui.sh:1138 lib/checkout_op.tcl:305
msgid "Refreshing file status..."
msgstr ""
-#: git-gui.sh:1149
+#: git-gui.sh:1194
msgid "Scanning for modified files ..."
msgstr ""
-#: git-gui.sh:1324 lib/browser.tcl:246
+#: git-gui.sh:1369 lib/browser.tcl:246
msgid "Ready."
msgstr ""
-#: git-gui.sh:1590
+#: git-gui.sh:1635
msgid "Unmodified"
msgstr ""
-#: git-gui.sh:1592
+#: git-gui.sh:1637
msgid "Modified, not staged"
msgstr ""
-#: git-gui.sh:1593 git-gui.sh:1598
+#: git-gui.sh:1638 git-gui.sh:1643
msgid "Staged for commit"
msgstr ""
-#: git-gui.sh:1594 git-gui.sh:1599
+#: git-gui.sh:1639 git-gui.sh:1644
msgid "Portions staged for commit"
msgstr ""
-#: git-gui.sh:1595 git-gui.sh:1600
+#: git-gui.sh:1640 git-gui.sh:1645
msgid "Staged for commit, missing"
msgstr ""
-#: git-gui.sh:1597
+#: git-gui.sh:1642
msgid "Untracked, not staged"
msgstr ""
-#: git-gui.sh:1602
+#: git-gui.sh:1647
msgid "Missing"
msgstr ""
-#: git-gui.sh:1603
+#: git-gui.sh:1648
msgid "Staged for removal"
msgstr ""
-#: git-gui.sh:1604
+#: git-gui.sh:1649
msgid "Staged for removal, still present"
msgstr ""
-#: git-gui.sh:1606 git-gui.sh:1607 git-gui.sh:1608 git-gui.sh:1609
+#: git-gui.sh:1651 git-gui.sh:1652 git-gui.sh:1653 git-gui.sh:1654
msgid "Requires merge resolution"
msgstr ""
-#: git-gui.sh:1644
+#: git-gui.sh:1689
msgid "Starting gitk... please wait..."
msgstr ""
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
msgstr ""
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr ""
-#: git-gui.sh:1861
+#: git-gui.sh:1949
msgid "Edit"
msgstr ""
-#: git-gui.sh:1863 lib/choose_rev.tcl:561
+#: git-gui.sh:1951 lib/choose_rev.tcl:561
msgid "Branch"
msgstr ""
-#: git-gui.sh:1866 lib/choose_rev.tcl:548
+#: git-gui.sh:1954 lib/choose_rev.tcl:548
msgid "Commit@@noun"
msgstr ""
-#: git-gui.sh:1869 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
+#: git-gui.sh:1957 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
msgid "Merge"
msgstr ""
-#: git-gui.sh:1870 lib/choose_rev.tcl:557
+#: git-gui.sh:1958 lib/choose_rev.tcl:557
msgid "Remote"
msgstr ""
-#: git-gui.sh:1879
+#: git-gui.sh:1967
msgid "Browse Current Branch's Files"
msgstr ""
-#: git-gui.sh:1883
+#: git-gui.sh:1971
msgid "Browse Branch Files..."
msgstr ""
-#: git-gui.sh:1888
+#: git-gui.sh:1976
msgid "Visualize Current Branch's History"
msgstr ""
-#: git-gui.sh:1892
+#: git-gui.sh:1980
msgid "Visualize All Branch History"
msgstr ""
-#: git-gui.sh:1899
+#: git-gui.sh:1987
#, tcl-format
msgid "Browse %s's Files"
msgstr ""
-#: git-gui.sh:1901
+#: git-gui.sh:1989
#, tcl-format
msgid "Visualize %s's History"
msgstr ""
-#: git-gui.sh:1906 lib/database.tcl:27 lib/database.tcl:67
+#: git-gui.sh:1994 lib/database.tcl:27 lib/database.tcl:67
msgid "Database Statistics"
msgstr ""
-#: git-gui.sh:1909 lib/database.tcl:34
+#: git-gui.sh:1997 lib/database.tcl:34
msgid "Compress Database"
msgstr ""
-#: git-gui.sh:1912
+#: git-gui.sh:2000
msgid "Verify Database"
msgstr ""
-#: git-gui.sh:1919 git-gui.sh:1923 git-gui.sh:1927 lib/shortcut.tcl:7
+#: git-gui.sh:2007 git-gui.sh:2011 git-gui.sh:2015 lib/shortcut.tcl:7
#: lib/shortcut.tcl:39 lib/shortcut.tcl:71
msgid "Create Desktop Icon"
msgstr ""
-#: git-gui.sh:1932 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
+#: git-gui.sh:2023 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
msgid "Quit"
msgstr ""
-#: git-gui.sh:1939
+#: git-gui.sh:2031
msgid "Undo"
msgstr ""
-#: git-gui.sh:1942
+#: git-gui.sh:2034
msgid "Redo"
msgstr ""
-#: git-gui.sh:1946 git-gui.sh:2443
+#: git-gui.sh:2038 git-gui.sh:2545
msgid "Cut"
msgstr ""
-#: git-gui.sh:1949 git-gui.sh:2446 git-gui.sh:2520 git-gui.sh:2614
+#: git-gui.sh:2041 git-gui.sh:2548 git-gui.sh:2622 git-gui.sh:2715
#: lib/console.tcl:69
msgid "Copy"
msgstr ""
-#: git-gui.sh:1952 git-gui.sh:2449
+#: git-gui.sh:2044 git-gui.sh:2551
msgid "Paste"
msgstr ""
-#: git-gui.sh:1955 git-gui.sh:2452 lib/branch_delete.tcl:26
+#: git-gui.sh:2047 git-gui.sh:2554 lib/branch_delete.tcl:26
#: lib/remote_branch_delete.tcl:38
msgid "Delete"
msgstr ""
-#: git-gui.sh:1959 git-gui.sh:2456 git-gui.sh:2618 lib/console.tcl:71
+#: git-gui.sh:2051 git-gui.sh:2558 git-gui.sh:2719 lib/console.tcl:71
msgid "Select All"
msgstr ""
-#: git-gui.sh:1968
+#: git-gui.sh:2060
msgid "Create..."
msgstr ""
-#: git-gui.sh:1974
+#: git-gui.sh:2066
msgid "Checkout..."
msgstr ""
-#: git-gui.sh:1980
+#: git-gui.sh:2072
msgid "Rename..."
msgstr ""
-#: git-gui.sh:1985 git-gui.sh:2085
+#: git-gui.sh:2077 git-gui.sh:2187
msgid "Delete..."
msgstr ""
-#: git-gui.sh:1990
+#: git-gui.sh:2082
msgid "Reset..."
msgstr ""
-#: git-gui.sh:2002 git-gui.sh:2389
+#: git-gui.sh:2094 git-gui.sh:2491
msgid "New Commit"
msgstr ""
-#: git-gui.sh:2010 git-gui.sh:2396
+#: git-gui.sh:2102 git-gui.sh:2498
msgid "Amend Last Commit"
msgstr ""
-#: git-gui.sh:2019 git-gui.sh:2356 lib/remote_branch_delete.tcl:99
+#: git-gui.sh:2111 git-gui.sh:2458 lib/remote_branch_delete.tcl:99
msgid "Rescan"
msgstr ""
-#: git-gui.sh:2025
+#: git-gui.sh:2117
msgid "Stage To Commit"
msgstr ""
-#: git-gui.sh:2031
+#: git-gui.sh:2123
msgid "Stage Changed Files To Commit"
msgstr ""
-#: git-gui.sh:2037
+#: git-gui.sh:2129
msgid "Unstage From Commit"
msgstr ""
-#: git-gui.sh:2042 lib/index.tcl:395
+#: git-gui.sh:2134 lib/index.tcl:395
msgid "Revert Changes"
msgstr ""
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr ""
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr ""
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr ""
-#: git-gui.sh:2053 git-gui.sh:2372
+#: git-gui.sh:2155 git-gui.sh:2474
msgid "Commit@@verb"
msgstr ""
-#: git-gui.sh:2064
+#: git-gui.sh:2166
msgid "Local Merge..."
msgstr ""
-#: git-gui.sh:2069
+#: git-gui.sh:2171
msgid "Abort Merge..."
msgstr ""
-#: git-gui.sh:2081
+#: git-gui.sh:2183
msgid "Push..."
msgstr ""
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr ""
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
msgstr ""
-#: git-gui.sh:2099
+#: git-gui.sh:2201
msgid "Preferences..."
msgstr ""
-#: git-gui.sh:2107 git-gui.sh:2639
+#: git-gui.sh:2209 git-gui.sh:2740
msgid "Options..."
msgstr ""
-#: git-gui.sh:2113 lib/choose_repository.tcl:47
+#: git-gui.sh:2215 lib/choose_repository.tcl:47
msgid "Help"
msgstr ""
-#: git-gui.sh:2154
+#: git-gui.sh:2256
msgid "Online Documentation"
msgstr ""
-#: git-gui.sh:2238
+#: git-gui.sh:2340
#, tcl-format
msgid "fatal: cannot stat path %s: No such file or directory"
msgstr ""
-#: git-gui.sh:2271
+#: git-gui.sh:2373
msgid "Current Branch:"
msgstr ""
-#: git-gui.sh:2292
+#: git-gui.sh:2394
msgid "Staged Changes (Will Commit)"
msgstr ""
-#: git-gui.sh:2312
+#: git-gui.sh:2414
msgid "Unstaged Changes"
msgstr ""
-#: git-gui.sh:2362
+#: git-gui.sh:2464
msgid "Stage Changed"
msgstr ""
-#: git-gui.sh:2378 lib/transport.tcl:93 lib/transport.tcl:182
+#: git-gui.sh:2480 lib/transport.tcl:93 lib/transport.tcl:182
msgid "Push"
msgstr ""
-#: git-gui.sh:2408
+#: git-gui.sh:2510
msgid "Initial Commit Message:"
msgstr ""
-#: git-gui.sh:2409
+#: git-gui.sh:2511
msgid "Amended Commit Message:"
msgstr ""
-#: git-gui.sh:2410
+#: git-gui.sh:2512
msgid "Amended Initial Commit Message:"
msgstr ""
-#: git-gui.sh:2411
+#: git-gui.sh:2513
msgid "Amended Merge Commit Message:"
msgstr ""
-#: git-gui.sh:2412
+#: git-gui.sh:2514
msgid "Merge Commit Message:"
msgstr ""
-#: git-gui.sh:2413
+#: git-gui.sh:2515
msgid "Commit Message:"
msgstr ""
-#: git-gui.sh:2459 git-gui.sh:2622 lib/console.tcl:73
+#: git-gui.sh:2561 git-gui.sh:2723 lib/console.tcl:73
msgid "Copy All"
msgstr ""
-#: git-gui.sh:2483 lib/blame.tcl:107
+#: git-gui.sh:2585 lib/blame.tcl:100
msgid "File:"
msgstr ""
-#: git-gui.sh:2589
+#: git-gui.sh:2691
msgid "Apply/Reverse Hunk"
msgstr ""
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr ""
-
-#: git-gui.sh:2602
-msgid "Show More Context"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
msgstr ""
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr ""
-#: git-gui.sh:2631
+#: git-gui.sh:2732
msgid "Decrease Font Size"
msgstr ""
-#: git-gui.sh:2635
+#: git-gui.sh:2736
msgid "Increase Font Size"
msgstr ""
-#: git-gui.sh:2646
+#: git-gui.sh:2747
msgid "Unstage Hunk From Commit"
msgstr ""
-#: git-gui.sh:2648
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr ""
+
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr ""
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr ""
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr ""
-#: git-gui.sh:2762
+#: git-gui.sh:2876
#, tcl-format
msgid ""
"Possible environment issues exist.\n"
@@ -433,14 +437,14 @@ msgid ""
"\n"
msgstr ""
-#: git-gui.sh:2792
+#: git-gui.sh:2906
msgid ""
"\n"
"This is due to a known issue with the\n"
"Tcl binary distributed by Cygwin."
msgstr ""
-#: git-gui.sh:2797
+#: git-gui.sh:2911
#, tcl-format
msgid ""
"\n"
@@ -455,64 +459,80 @@ msgstr ""
msgid "git-gui - a graphical user interface for Git."
msgstr ""
-#: lib/blame.tcl:77
+#: lib/blame.tcl:70
msgid "File Viewer"
msgstr ""
-#: lib/blame.tcl:81
+#: lib/blame.tcl:74
msgid "Commit:"
msgstr ""
-#: lib/blame.tcl:264
+#: lib/blame.tcl:257
msgid "Copy Commit"
msgstr ""
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr ""
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr ""
-#: lib/blame.tcl:488
+#: lib/blame.tcl:492
msgid "Loading copy/move tracking annotations..."
msgstr ""
-#: lib/blame.tcl:508
+#: lib/blame.tcl:512
msgid "lines annotated"
msgstr ""
-#: lib/blame.tcl:689
+#: lib/blame.tcl:704
msgid "Loading original location annotations..."
msgstr ""
-#: lib/blame.tcl:692
+#: lib/blame.tcl:707
msgid "Annotation complete."
msgstr ""
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr ""
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr ""
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr ""
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr ""
-#: lib/blame.tcl:802
+#: lib/blame.tcl:883
msgid "Author:"
msgstr ""
-#: lib/blame.tcl:806
+#: lib/blame.tcl:887
msgid "Committer:"
msgstr ""
-#: lib/blame.tcl:811
+#: lib/blame.tcl:892
msgid "Original File:"
msgstr ""
-#: lib/blame.tcl:925
+#: lib/blame.tcl:1006
msgid "Originally By:"
msgstr ""
-#: lib/blame.tcl:931
+#: lib/blame.tcl:1012
msgid "In File:"
msgstr ""
-#: lib/blame.tcl:936
+#: lib/blame.tcl:1017
msgid "Copied Or Moved Here By:"
msgstr ""
@@ -526,7 +546,7 @@ msgstr ""
#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282
-#: lib/checkout_op.tcl:522 lib/choose_font.tcl:43 lib/merge.tcl:171
+#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:171
#: lib/option.tcl:103 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97
msgid "Cancel"
msgstr ""
@@ -535,7 +555,7 @@ msgstr ""
msgid "Revision"
msgstr ""
-#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:242
+#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:244
msgid "Options"
msgstr ""
@@ -587,7 +607,7 @@ msgstr ""
msgid "Fast Forward Only"
msgstr ""
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514
+#: lib/branch_create.tcl:85 lib/checkout_op.tcl:536
msgid "Reset"
msgstr ""
@@ -672,7 +692,7 @@ msgstr ""
msgid "Please select a branch to rename."
msgstr ""
-#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179
+#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:201
#, tcl-format
msgid "Branch '%s' already exists."
msgstr ""
@@ -704,31 +724,36 @@ msgid "Browse Branch Files"
msgstr ""
#: lib/browser.tcl:278 lib/choose_repository.tcl:387
-#: lib/choose_repository.tcl:474 lib/choose_repository.tcl:484
-#: lib/choose_repository.tcl:987
+#: lib/choose_repository.tcl:472 lib/choose_repository.tcl:482
+#: lib/choose_repository.tcl:985
msgid "Browse"
msgstr ""
-#: lib/checkout_op.tcl:79
+#: lib/checkout_op.tcl:84
#, tcl-format
msgid "Fetching %s from %s"
msgstr ""
-#: lib/checkout_op.tcl:127
+#: lib/checkout_op.tcl:132
#, tcl-format
msgid "fatal: Cannot resolve %s"
msgstr ""
-#: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31
+#: lib/checkout_op.tcl:145 lib/console.tcl:81 lib/database.tcl:31
msgid "Close"
msgstr ""
-#: lib/checkout_op.tcl:169
+#: lib/checkout_op.tcl:174
#, tcl-format
msgid "Branch '%s' does not exist."
msgstr ""
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr ""
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -737,21 +762,21 @@ msgid ""
"A merge is required."
msgstr ""
-#: lib/checkout_op.tcl:220
+#: lib/checkout_op.tcl:242
#, tcl-format
msgid "Merge strategy '%s' not supported."
msgstr ""
-#: lib/checkout_op.tcl:239
+#: lib/checkout_op.tcl:261
#, tcl-format
msgid "Failed to update '%s'."
msgstr ""
-#: lib/checkout_op.tcl:251
+#: lib/checkout_op.tcl:273
msgid "Staging area (index) is already locked."
msgstr ""
-#: lib/checkout_op.tcl:266
+#: lib/checkout_op.tcl:288
msgid ""
"Last scanned state does not match repository state.\n"
"\n"
@@ -761,30 +786,30 @@ msgid ""
"The rescan will be automatically started now.\n"
msgstr ""
-#: lib/checkout_op.tcl:322
+#: lib/checkout_op.tcl:344
#, tcl-format
msgid "Updating working directory to '%s'..."
msgstr ""
-#: lib/checkout_op.tcl:323
+#: lib/checkout_op.tcl:345
msgid "files checked out"
msgstr ""
-#: lib/checkout_op.tcl:353
+#: lib/checkout_op.tcl:375
#, tcl-format
msgid "Aborted checkout of '%s' (file level merging is required)."
msgstr ""
-#: lib/checkout_op.tcl:354
+#: lib/checkout_op.tcl:376
msgid "File level merge required."
msgstr ""
-#: lib/checkout_op.tcl:358
+#: lib/checkout_op.tcl:380
#, tcl-format
msgid "Staying on branch '%s'."
msgstr ""
-#: lib/checkout_op.tcl:429
+#: lib/checkout_op.tcl:451
msgid ""
"You are no longer on a local branch.\n"
"\n"
@@ -792,30 +817,30 @@ msgid ""
"Checkout'."
msgstr ""
-#: lib/checkout_op.tcl:446 lib/checkout_op.tcl:450
+#: lib/checkout_op.tcl:468 lib/checkout_op.tcl:472
#, tcl-format
msgid "Checked out '%s'."
msgstr ""
-#: lib/checkout_op.tcl:478
+#: lib/checkout_op.tcl:500
#, tcl-format
msgid "Resetting '%s' to '%s' will lose the following commits:"
msgstr ""
-#: lib/checkout_op.tcl:500
+#: lib/checkout_op.tcl:522
msgid "Recovering lost commits may not be easy."
msgstr ""
-#: lib/checkout_op.tcl:505
+#: lib/checkout_op.tcl:527
#, tcl-format
msgid "Reset '%s'?"
msgstr ""
-#: lib/checkout_op.tcl:510 lib/merge.tcl:163
+#: lib/checkout_op.tcl:532 lib/merge.tcl:163
msgid "Visualize"
msgstr ""
-#: lib/checkout_op.tcl:578
+#: lib/checkout_op.tcl:600
#, tcl-format
msgid ""
"Failed to set current branch.\n"
@@ -860,7 +885,7 @@ msgstr ""
msgid "New..."
msgstr ""
-#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:460
+#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:458
msgid "Clone Existing Repository"
msgstr ""
@@ -868,7 +893,7 @@ msgstr ""
msgid "Clone..."
msgstr ""
-#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:976
+#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:974
msgid "Open Existing Repository"
msgstr ""
@@ -890,183 +915,183 @@ msgstr ""
msgid "Failed to create repository %s:"
msgstr ""
-#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:478
+#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:476
msgid "Directory:"
msgstr ""
-#: lib/choose_repository.tcl:412 lib/choose_repository.tcl:537
-#: lib/choose_repository.tcl:1011
+#: lib/choose_repository.tcl:410 lib/choose_repository.tcl:535
+#: lib/choose_repository.tcl:1007
msgid "Git Repository"
msgstr ""
-#: lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:435
#, tcl-format
msgid "Directory %s already exists."
msgstr ""
-#: lib/choose_repository.tcl:441
+#: lib/choose_repository.tcl:439
#, tcl-format
msgid "File %s already exists."
msgstr ""
-#: lib/choose_repository.tcl:455
+#: lib/choose_repository.tcl:453
msgid "Clone"
msgstr ""
-#: lib/choose_repository.tcl:468
+#: lib/choose_repository.tcl:466
msgid "URL:"
msgstr ""
-#: lib/choose_repository.tcl:489
+#: lib/choose_repository.tcl:487
msgid "Clone Type:"
msgstr ""
-#: lib/choose_repository.tcl:495
+#: lib/choose_repository.tcl:493
msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
msgstr ""
-#: lib/choose_repository.tcl:501
+#: lib/choose_repository.tcl:499
msgid "Full Copy (Slower, Redundant Backup)"
msgstr ""
-#: lib/choose_repository.tcl:507
+#: lib/choose_repository.tcl:505
msgid "Shared (Fastest, Not Recommended, No Backup)"
msgstr ""
-#: lib/choose_repository.tcl:543 lib/choose_repository.tcl:590
-#: lib/choose_repository.tcl:736 lib/choose_repository.tcl:806
-#: lib/choose_repository.tcl:1017 lib/choose_repository.tcl:1025
+#: lib/choose_repository.tcl:541 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:734 lib/choose_repository.tcl:804
+#: lib/choose_repository.tcl:1013 lib/choose_repository.tcl:1021
#, tcl-format
msgid "Not a Git repository: %s"
msgstr ""
-#: lib/choose_repository.tcl:579
+#: lib/choose_repository.tcl:577
msgid "Standard only available for local repository."
msgstr ""
-#: lib/choose_repository.tcl:583
+#: lib/choose_repository.tcl:581
msgid "Shared only available for local repository."
msgstr ""
-#: lib/choose_repository.tcl:604
+#: lib/choose_repository.tcl:602
#, tcl-format
msgid "Location %s already exists."
msgstr ""
-#: lib/choose_repository.tcl:615
+#: lib/choose_repository.tcl:613
msgid "Failed to configure origin"
msgstr ""
-#: lib/choose_repository.tcl:627
+#: lib/choose_repository.tcl:625
msgid "Counting objects"
msgstr ""
-#: lib/choose_repository.tcl:628
+#: lib/choose_repository.tcl:626
msgid "buckets"
msgstr ""
-#: lib/choose_repository.tcl:652
+#: lib/choose_repository.tcl:650
#, tcl-format
msgid "Unable to copy objects/info/alternates: %s"
msgstr ""
-#: lib/choose_repository.tcl:688
+#: lib/choose_repository.tcl:686
#, tcl-format
msgid "Nothing to clone from %s."
msgstr ""
-#: lib/choose_repository.tcl:690 lib/choose_repository.tcl:904
-#: lib/choose_repository.tcl:916
+#: lib/choose_repository.tcl:688 lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:914
msgid "The 'master' branch has not been initialized."
msgstr ""
-#: lib/choose_repository.tcl:703
+#: lib/choose_repository.tcl:701
msgid "Hardlinks are unavailable. Falling back to copying."
msgstr ""
-#: lib/choose_repository.tcl:715
+#: lib/choose_repository.tcl:713
#, tcl-format
msgid "Cloning from %s"
msgstr ""
-#: lib/choose_repository.tcl:746
+#: lib/choose_repository.tcl:744
msgid "Copying objects"
msgstr ""
-#: lib/choose_repository.tcl:747
+#: lib/choose_repository.tcl:745
msgid "KiB"
msgstr ""
-#: lib/choose_repository.tcl:771
+#: lib/choose_repository.tcl:769
#, tcl-format
msgid "Unable to copy object: %s"
msgstr ""
-#: lib/choose_repository.tcl:781
+#: lib/choose_repository.tcl:779
msgid "Linking objects"
msgstr ""
-#: lib/choose_repository.tcl:782
+#: lib/choose_repository.tcl:780
msgid "objects"
msgstr ""
-#: lib/choose_repository.tcl:790
+#: lib/choose_repository.tcl:788
#, tcl-format
msgid "Unable to hardlink object: %s"
msgstr ""
-#: lib/choose_repository.tcl:845
+#: lib/choose_repository.tcl:843
msgid "Cannot fetch branches and objects. See console output for details."
msgstr ""
-#: lib/choose_repository.tcl:856
+#: lib/choose_repository.tcl:854
msgid "Cannot fetch tags. See console output for details."
msgstr ""
-#: lib/choose_repository.tcl:880
+#: lib/choose_repository.tcl:878
msgid "Cannot determine HEAD. See console output for details."
msgstr ""
-#: lib/choose_repository.tcl:889
+#: lib/choose_repository.tcl:887
#, tcl-format
msgid "Unable to cleanup %s"
msgstr ""
-#: lib/choose_repository.tcl:895
+#: lib/choose_repository.tcl:893
msgid "Clone failed."
msgstr ""
-#: lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:900
msgid "No default branch obtained."
msgstr ""
-#: lib/choose_repository.tcl:913
+#: lib/choose_repository.tcl:911
#, tcl-format
msgid "Cannot resolve %s as a commit."
msgstr ""
-#: lib/choose_repository.tcl:925
+#: lib/choose_repository.tcl:923
msgid "Creating working directory"
msgstr ""
-#: lib/choose_repository.tcl:926 lib/index.tcl:65 lib/index.tcl:127
+#: lib/choose_repository.tcl:924 lib/index.tcl:65 lib/index.tcl:127
#: lib/index.tcl:193
msgid "files"
msgstr ""
-#: lib/choose_repository.tcl:955
+#: lib/choose_repository.tcl:953
msgid "Initial file checkout failed."
msgstr ""
-#: lib/choose_repository.tcl:971
+#: lib/choose_repository.tcl:969
msgid "Open"
msgstr ""
-#: lib/choose_repository.tcl:981
+#: lib/choose_repository.tcl:979
msgid "Repository:"
msgstr ""
-#: lib/choose_repository.tcl:1031
+#: lib/choose_repository.tcl:1027
#, tcl-format
msgid "Failed to open repository %s:"
msgstr ""
@@ -1314,7 +1339,7 @@ msgstr ""
msgid "Invalid date from Git: %s"
msgstr ""
-#: lib/diff.tcl:42
+#: lib/diff.tcl:44
#, tcl-format
msgid ""
"No differences detected.\n"
@@ -1328,40 +1353,48 @@ msgid ""
"the same state."
msgstr ""
-#: lib/diff.tcl:81
+#: lib/diff.tcl:83
#, tcl-format
msgid "Loading diff of %s..."
msgstr ""
-#: lib/diff.tcl:114 lib/diff.tcl:184
+#: lib/diff.tcl:116 lib/diff.tcl:190
#, tcl-format
msgid "Unable to display %s"
msgstr ""
-#: lib/diff.tcl:115
+#: lib/diff.tcl:117
msgid "Error loading file:"
msgstr ""
-#: lib/diff.tcl:122
+#: lib/diff.tcl:124
msgid "Git Repository (subproject)"
msgstr ""
-#: lib/diff.tcl:134
+#: lib/diff.tcl:136
msgid "* Binary file (not showing content)."
msgstr ""
-#: lib/diff.tcl:185
+#: lib/diff.tcl:191
msgid "Error loading diff:"
msgstr ""
-#: lib/diff.tcl:303
+#: lib/diff.tcl:313
msgid "Failed to unstage selected hunk."
msgstr ""
-#: lib/diff.tcl:310
+#: lib/diff.tcl:320
msgid "Failed to stage selected hunk."
msgstr ""
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr ""
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr ""
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr ""
@@ -1527,11 +1560,11 @@ msgstr ""
msgid "files reset"
msgstr ""
-#: lib/merge.tcl:265
+#: lib/merge.tcl:266
msgid "Abort failed."
msgstr ""
-#: lib/merge.tcl:267
+#: lib/merge.tcl:268
msgid "Abort completed. Ready."
msgstr ""
@@ -1585,42 +1618,62 @@ msgid "Match Tracking Branches"
msgstr ""
#: lib/option.tcl:126
-msgid "Number of Diff Context Lines"
+msgid "Blame Copy Only On Changed Files"
msgstr ""
#: lib/option.tcl:127
-msgid "Commit Message Text Width"
+msgid "Minimum Letters To Blame Copy On"
msgstr ""
#: lib/option.tcl:128
+msgid "Number of Diff Context Lines"
+msgstr ""
+
+#: lib/option.tcl:129
+msgid "Commit Message Text Width"
+msgstr ""
+
+#: lib/option.tcl:130
msgid "New Branch Name Template"
msgstr ""
-#: lib/option.tcl:192
+#: lib/option.tcl:194
msgid "Spelling Dictionary:"
msgstr ""
-#: lib/option.tcl:216
+#: lib/option.tcl:218
msgid "Change Font"
msgstr ""
-#: lib/option.tcl:220
+#: lib/option.tcl:222
#, tcl-format
msgid "Choose %s"
msgstr ""
-#: lib/option.tcl:226
+#: lib/option.tcl:228
msgid "pt."
msgstr ""
-#: lib/option.tcl:240
+#: lib/option.tcl:242
msgid "Preferences"
msgstr ""
-#: lib/option.tcl:275
+#: lib/option.tcl:277
msgid "Failed to completely save options:"
msgstr ""
+#: lib/remote.tcl:165
+msgid "Prune from"
+msgstr ""
+
+#: lib/remote.tcl:170
+msgid "Fetch from"
+msgstr ""
+
+#: lib/remote.tcl:213
+msgid "Push to"
+msgstr ""
+
#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
msgid "Delete Remote Branch"
msgstr ""
@@ -1697,18 +1750,6 @@ msgstr ""
msgid "Scanning %s..."
msgstr ""
-#: lib/remote.tcl:165
-msgid "Prune from"
-msgstr ""
-
-#: lib/remote.tcl:170
-msgid "Fetch from"
-msgstr ""
-
-#: lib/remote.tcl:213
-msgid "Push to"
-msgstr ""
-
#: lib/shortcut.tcl:20 lib/shortcut.tcl:61
msgid "Cannot write shortcut:"
msgstr ""
@@ -1742,15 +1783,15 @@ msgstr ""
msgid "Unrecognized spell checker"
msgstr ""
-#: lib/spellcheck.tcl:180
+#: lib/spellcheck.tcl:186
msgid "No Suggestions"
msgstr ""
-#: lib/spellcheck.tcl:381
+#: lib/spellcheck.tcl:387
msgid "Unexpected EOF from spell checker"
msgstr ""
-#: lib/spellcheck.tcl:385
+#: lib/spellcheck.tcl:391
msgid "Spell Checker Failed"
msgstr ""
diff --git a/git-gui/po/it.po b/git-gui/po/it.po
index 11cc79bb5e..3db4fb68c5 100644
--- a/git-gui/po/it.po
+++ b/git-gui/po/it.po
@@ -3,47 +3,47 @@
# This file is distributed under the same license as the git-gui package.
# Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>, 2007
# Michele Ballabio <barra_cuda@katamail.com>, 2007.
-#
-#
+#
+#
msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
-"PO-Revision-Date: 2008-03-12 22:12+0100\n"
+"POT-Creation-Date: 2008-08-02 14:45-0700\n"
+"PO-Revision-Date: 2008-08-03 16:04+0200\n"
"Last-Translator: Michele Ballabio <barra_cuda@katamail.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: git-gui.sh:41 git-gui.sh:634 git-gui.sh:648 git-gui.sh:661 git-gui.sh:744
-#: git-gui.sh:763
+#: git-gui.sh:41 git-gui.sh:688 git-gui.sh:702 git-gui.sh:715 git-gui.sh:798
+#: git-gui.sh:817
msgid "git-gui: fatal error"
msgstr "git-gui: errore grave"
-#: git-gui.sh:593
+#: git-gui.sh:644
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr "Caratteri non validi specificati in %s:"
-#: git-gui.sh:620
+#: git-gui.sh:674
msgid "Main Font"
msgstr "Caratteri principali"
-#: git-gui.sh:621
+#: git-gui.sh:675
msgid "Diff/Console Font"
msgstr "Caratteri per confronti e terminale"
-#: git-gui.sh:635
+#: git-gui.sh:689
msgid "Cannot find git in PATH."
msgstr "Impossibile trovare git nel PATH"
-#: git-gui.sh:662
+#: git-gui.sh:716
msgid "Cannot parse Git version string:"
msgstr "Impossibile determinare la versione di Git:"
-#: git-gui.sh:680
+#: git-gui.sh:734
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
@@ -62,380 +62,381 @@ msgstr ""
"\n"
"Assumere che '%s' sia alla versione 1.5.0?\n"
-#: git-gui.sh:918
+#: git-gui.sh:972
msgid "Git directory not found:"
msgstr "Non trovo la directory di git: "
-#: git-gui.sh:925
+#: git-gui.sh:979
msgid "Cannot move to top of working directory:"
msgstr "Impossibile spostarsi sulla directory principale del progetto:"
-#: git-gui.sh:932
+#: git-gui.sh:986
msgid "Cannot use funny .git directory:"
msgstr "Impossibile usare una .git directory strana:"
-#: git-gui.sh:937
+#: git-gui.sh:991
msgid "No working directory"
msgstr "Nessuna directory di lavoro"
-#: git-gui.sh:1084 lib/checkout_op.tcl:283
+#: git-gui.sh:1138 lib/checkout_op.tcl:305
msgid "Refreshing file status..."
msgstr "Controllo dello stato dei file in corso..."
-#: git-gui.sh:1149
+#: git-gui.sh:1194
msgid "Scanning for modified files ..."
msgstr "Ricerca di file modificati in corso..."
-#: git-gui.sh:1324 lib/browser.tcl:246
+#: git-gui.sh:1369 lib/browser.tcl:246
msgid "Ready."
msgstr "Pronto."
-#: git-gui.sh:1590
+#: git-gui.sh:1635
msgid "Unmodified"
msgstr "Non modificato"
-#: git-gui.sh:1592
+#: git-gui.sh:1637
msgid "Modified, not staged"
msgstr "Modificato, non preparato per una nuova revisione"
-#: git-gui.sh:1593 git-gui.sh:1598
+#: git-gui.sh:1638 git-gui.sh:1643
msgid "Staged for commit"
msgstr "Preparato per una nuova revisione"
-#: git-gui.sh:1594 git-gui.sh:1599
+#: git-gui.sh:1639 git-gui.sh:1644
msgid "Portions staged for commit"
msgstr "Parti preparate per una nuova revisione"
-#: git-gui.sh:1595 git-gui.sh:1600
+#: git-gui.sh:1640 git-gui.sh:1645
msgid "Staged for commit, missing"
msgstr "Preparato per una nuova revisione, mancante"
-#: git-gui.sh:1597
+#: git-gui.sh:1642
msgid "Untracked, not staged"
msgstr "Non tracciato, non preparato per una nuova revisione"
-#: git-gui.sh:1602
+#: git-gui.sh:1647
msgid "Missing"
msgstr "Mancante"
-#: git-gui.sh:1603
+#: git-gui.sh:1648
msgid "Staged for removal"
msgstr "Preparato per la rimozione"
-#: git-gui.sh:1604
+#: git-gui.sh:1649
msgid "Staged for removal, still present"
msgstr "Preparato alla rimozione, ancora presente"
-#: git-gui.sh:1606 git-gui.sh:1607 git-gui.sh:1608 git-gui.sh:1609
+#: git-gui.sh:1651 git-gui.sh:1652 git-gui.sh:1653 git-gui.sh:1654
msgid "Requires merge resolution"
msgstr "Richiede risoluzione dei conflitti"
-#: git-gui.sh:1644
+#: git-gui.sh:1689
msgid "Starting gitk... please wait..."
msgstr "Avvio di gitk... attendere..."
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
-msgstr ""
-"Impossibile avviare gitk:\n"
-"\n"
-"%s non esiste"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
+msgstr "Impossibile trovare gitk nel PATH"
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Archivio"
-#: git-gui.sh:1861
+#: git-gui.sh:1949
msgid "Edit"
msgstr "Modifica"
-#: git-gui.sh:1863 lib/choose_rev.tcl:561
+#: git-gui.sh:1951 lib/choose_rev.tcl:561
msgid "Branch"
msgstr "Ramo"
-#: git-gui.sh:1866 lib/choose_rev.tcl:548
+#: git-gui.sh:1954 lib/choose_rev.tcl:548
msgid "Commit@@noun"
msgstr "Revisione"
-#: git-gui.sh:1869 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
+#: git-gui.sh:1957 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
msgid "Merge"
msgstr "Fusione (Merge)"
-#: git-gui.sh:1870 lib/choose_rev.tcl:557
+#: git-gui.sh:1958 lib/choose_rev.tcl:557
msgid "Remote"
msgstr "Remoto"
-#: git-gui.sh:1879
+#: git-gui.sh:1967
msgid "Browse Current Branch's Files"
msgstr "Esplora i file del ramo attuale"
-#: git-gui.sh:1883
+#: git-gui.sh:1971
msgid "Browse Branch Files..."
msgstr "Esplora i file del ramo..."
-#: git-gui.sh:1888
+#: git-gui.sh:1976
msgid "Visualize Current Branch's History"
msgstr "Visualizza la cronologia del ramo attuale"
-#: git-gui.sh:1892
+#: git-gui.sh:1980
msgid "Visualize All Branch History"
msgstr "Visualizza la cronologia di tutti i rami"
-#: git-gui.sh:1899
+#: git-gui.sh:1987
#, tcl-format
msgid "Browse %s's Files"
msgstr "Esplora i file di %s"
-#: git-gui.sh:1901
+#: git-gui.sh:1989
#, tcl-format
msgid "Visualize %s's History"
msgstr "Visualizza la cronologia di %s"
-#: git-gui.sh:1906 lib/database.tcl:27 lib/database.tcl:67
+#: git-gui.sh:1994 lib/database.tcl:27 lib/database.tcl:67
msgid "Database Statistics"
msgstr "Statistiche dell'archivio"
-#: git-gui.sh:1909 lib/database.tcl:34
+#: git-gui.sh:1997 lib/database.tcl:34
msgid "Compress Database"
msgstr "Comprimi l'archivio"
-#: git-gui.sh:1912
+#: git-gui.sh:2000
msgid "Verify Database"
msgstr "Verifica l'archivio"
-#: git-gui.sh:1919 git-gui.sh:1923 git-gui.sh:1927 lib/shortcut.tcl:7
+#: git-gui.sh:2007 git-gui.sh:2011 git-gui.sh:2015 lib/shortcut.tcl:7
#: lib/shortcut.tcl:39 lib/shortcut.tcl:71
msgid "Create Desktop Icon"
msgstr "Crea icona desktop"
-#: git-gui.sh:1932 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
+#: git-gui.sh:2023 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
msgid "Quit"
msgstr "Esci"
-#: git-gui.sh:1939
+#: git-gui.sh:2031
msgid "Undo"
msgstr "Annulla"
-#: git-gui.sh:1942
+#: git-gui.sh:2034
msgid "Redo"
msgstr "Ripeti"
-#: git-gui.sh:1946 git-gui.sh:2443
+#: git-gui.sh:2038 git-gui.sh:2545
msgid "Cut"
msgstr "Taglia"
-#: git-gui.sh:1949 git-gui.sh:2446 git-gui.sh:2520 git-gui.sh:2614
+#: git-gui.sh:2041 git-gui.sh:2548 git-gui.sh:2622 git-gui.sh:2715
#: lib/console.tcl:69
msgid "Copy"
msgstr "Copia"
-#: git-gui.sh:1952 git-gui.sh:2449
+#: git-gui.sh:2044 git-gui.sh:2551
msgid "Paste"
msgstr "Incolla"
-#: git-gui.sh:1955 git-gui.sh:2452 lib/branch_delete.tcl:26
+#: git-gui.sh:2047 git-gui.sh:2554 lib/branch_delete.tcl:26
#: lib/remote_branch_delete.tcl:38
msgid "Delete"
msgstr "Elimina"
-#: git-gui.sh:1959 git-gui.sh:2456 git-gui.sh:2618 lib/console.tcl:71
+#: git-gui.sh:2051 git-gui.sh:2558 git-gui.sh:2719 lib/console.tcl:71
msgid "Select All"
msgstr "Seleziona tutto"
-#: git-gui.sh:1968
+#: git-gui.sh:2060
msgid "Create..."
msgstr "Crea..."
-#: git-gui.sh:1974
+#: git-gui.sh:2066
msgid "Checkout..."
msgstr "Attiva..."
-#: git-gui.sh:1980
+#: git-gui.sh:2072
msgid "Rename..."
msgstr "Rinomina"
-#: git-gui.sh:1985 git-gui.sh:2085
+#: git-gui.sh:2077 git-gui.sh:2187
msgid "Delete..."
msgstr "Elimina..."
-#: git-gui.sh:1990
+#: git-gui.sh:2082
msgid "Reset..."
msgstr "Ripristina..."
-#: git-gui.sh:2002 git-gui.sh:2389
+#: git-gui.sh:2094 git-gui.sh:2491
msgid "New Commit"
msgstr "Nuova revisione"
-#: git-gui.sh:2010 git-gui.sh:2396
+#: git-gui.sh:2102 git-gui.sh:2498
msgid "Amend Last Commit"
msgstr "Correggi l'ultima revisione"
-#: git-gui.sh:2019 git-gui.sh:2356 lib/remote_branch_delete.tcl:99
+#: git-gui.sh:2111 git-gui.sh:2458 lib/remote_branch_delete.tcl:99
msgid "Rescan"
msgstr "Analizza nuovamente"
-#: git-gui.sh:2025
+#: git-gui.sh:2117
msgid "Stage To Commit"
msgstr "Prepara per una nuova revisione"
-#: git-gui.sh:2031
+#: git-gui.sh:2123
msgid "Stage Changed Files To Commit"
msgstr "Prepara i file modificati per una nuova revisione"
-#: git-gui.sh:2037
+#: git-gui.sh:2129
msgid "Unstage From Commit"
msgstr "Annulla preparazione"
-#: git-gui.sh:2042 lib/index.tcl:395
+#: git-gui.sh:2134 lib/index.tcl:395
msgid "Revert Changes"
msgstr "Annulla modifiche"
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr "Mostra meno contesto"
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr "Mostra più contesto"
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "Sign Off"
-#: git-gui.sh:2053 git-gui.sh:2372
+#: git-gui.sh:2155 git-gui.sh:2474
msgid "Commit@@verb"
msgstr "Nuova revisione"
-#: git-gui.sh:2064
+#: git-gui.sh:2166
msgid "Local Merge..."
msgstr "Fusione locale..."
-#: git-gui.sh:2069
+#: git-gui.sh:2171
msgid "Abort Merge..."
msgstr "Interrompi fusione..."
-#: git-gui.sh:2081
+#: git-gui.sh:2183
msgid "Push..."
msgstr "Propaga..."
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr "Apple"
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
msgstr "Informazioni su %s"
-#: git-gui.sh:2099
+#: git-gui.sh:2201
msgid "Preferences..."
msgstr "Preferenze..."
-#: git-gui.sh:2107 git-gui.sh:2639
+#: git-gui.sh:2209 git-gui.sh:2740
msgid "Options..."
msgstr "Opzioni..."
-#: git-gui.sh:2113 lib/choose_repository.tcl:47
+#: git-gui.sh:2215 lib/choose_repository.tcl:47
msgid "Help"
msgstr "Aiuto"
-#: git-gui.sh:2154
+#: git-gui.sh:2256
msgid "Online Documentation"
msgstr "Documentazione sul web"
-#: git-gui.sh:2238
+#: git-gui.sh:2340
#, tcl-format
msgid "fatal: cannot stat path %s: No such file or directory"
msgstr ""
"errore grave: impossibile effettuare lo stat del path %s: file o directory "
"non trovata"
-#: git-gui.sh:2271
+#: git-gui.sh:2373
msgid "Current Branch:"
msgstr "Ramo attuale:"
-#: git-gui.sh:2292
+#: git-gui.sh:2394
msgid "Staged Changes (Will Commit)"
msgstr "Modifiche preparate (saranno nella nuova revisione)"
-#: git-gui.sh:2312
+#: git-gui.sh:2414
msgid "Unstaged Changes"
msgstr "Modifiche non preparate"
-#: git-gui.sh:2362
+#: git-gui.sh:2464
msgid "Stage Changed"
msgstr "Prepara modificati"
-#: git-gui.sh:2378 lib/transport.tcl:93 lib/transport.tcl:182
+#: git-gui.sh:2480 lib/transport.tcl:93 lib/transport.tcl:182
msgid "Push"
msgstr "Propaga (Push)"
-#: git-gui.sh:2408
+#: git-gui.sh:2510
msgid "Initial Commit Message:"
msgstr "Messaggio di revisione iniziale:"
-#: git-gui.sh:2409
+#: git-gui.sh:2511
msgid "Amended Commit Message:"
msgstr "Messaggio di revisione corretto:"
-#: git-gui.sh:2410
+#: git-gui.sh:2512
msgid "Amended Initial Commit Message:"
msgstr "Messaggio iniziale di revisione corretto:"
-#: git-gui.sh:2411
+#: git-gui.sh:2513
msgid "Amended Merge Commit Message:"
msgstr "Messaggio di fusione corretto:"
-#: git-gui.sh:2412
+#: git-gui.sh:2514
msgid "Merge Commit Message:"
msgstr "Messaggio di fusione:"
-#: git-gui.sh:2413
+#: git-gui.sh:2515
msgid "Commit Message:"
msgstr "Messaggio di revisione:"
-#: git-gui.sh:2459 git-gui.sh:2622 lib/console.tcl:73
+#: git-gui.sh:2561 git-gui.sh:2723 lib/console.tcl:73
msgid "Copy All"
msgstr "Copia tutto"
-#: git-gui.sh:2483 lib/blame.tcl:107
+#: git-gui.sh:2585 lib/blame.tcl:100
msgid "File:"
msgstr "File:"
-#: git-gui.sh:2589
+#: git-gui.sh:2691
msgid "Apply/Reverse Hunk"
msgstr "Applica/Inverti sezione"
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr "Mostra meno contesto"
-
-#: git-gui.sh:2602
-msgid "Show More Context"
-msgstr "Mostra più contesto"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
+msgstr "Applica/Inverti riga"
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr "Rinfresca"
-#: git-gui.sh:2631
+#: git-gui.sh:2732
msgid "Decrease Font Size"
msgstr "Diminuisci dimensione caratteri"
-#: git-gui.sh:2635
+#: git-gui.sh:2736
msgid "Increase Font Size"
msgstr "Aumenta dimensione caratteri"
-#: git-gui.sh:2646
+#: git-gui.sh:2747
msgid "Unstage Hunk From Commit"
-msgstr "Sezione non preparata per una nuova revisione"
+msgstr "Annulla preparazione della sezione per una nuova revisione"
+
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr "Annulla preparazione della linea per una nuova revisione"
-#: git-gui.sh:2648
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "Prepara sezione per una nuova revisione"
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr "Prepara linea per una nuova revisione"
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr "Inizializzazione..."
-#: git-gui.sh:2762
+#: git-gui.sh:2876
#, tcl-format
msgid ""
"Possible environment issues exist.\n"
@@ -452,7 +453,7 @@ msgstr ""
"da %s:\n"
"\n"
-#: git-gui.sh:2792
+#: git-gui.sh:2906
msgid ""
"\n"
"This is due to a known issue with the\n"
@@ -462,7 +463,7 @@ msgstr ""
"Ciò è dovuto a un problema conosciuto\n"
"causato dall'eseguibile Tcl distribuito da Cygwin."
-#: git-gui.sh:2797
+#: git-gui.sh:2911
#, tcl-format
msgid ""
"\n"
@@ -482,64 +483,80 @@ msgstr ""
msgid "git-gui - a graphical user interface for Git."
msgstr "git-gui - un'interfaccia grafica per Git."
-#: lib/blame.tcl:77
+#: lib/blame.tcl:70
msgid "File Viewer"
msgstr "Mostra file"
-#: lib/blame.tcl:81
+#: lib/blame.tcl:74
msgid "Commit:"
msgstr "Revisione:"
-#: lib/blame.tcl:264
+#: lib/blame.tcl:257
msgid "Copy Commit"
msgstr "Copia revisione"
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr "Ricerca accurata delle copie"
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "Lettura di %s..."
-#: lib/blame.tcl:488
+#: lib/blame.tcl:492
msgid "Loading copy/move tracking annotations..."
msgstr "Caricamento annotazioni per copie/spostamenti..."
-#: lib/blame.tcl:508
+#: lib/blame.tcl:512
msgid "lines annotated"
msgstr "linee annotate"
-#: lib/blame.tcl:689
+#: lib/blame.tcl:704
msgid "Loading original location annotations..."
msgstr "Caricamento annotazioni per posizione originaria..."
-#: lib/blame.tcl:692
+#: lib/blame.tcl:707
msgid "Annotation complete."
msgstr "Annotazione completata."
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr "Occupato"
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr "Il processo di annotazione è già in corso."
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr "Ricerca accurata delle copie in corso..."
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "Caricamento annotazioni..."
-#: lib/blame.tcl:802
+#: lib/blame.tcl:883
msgid "Author:"
msgstr "Autore:"
-#: lib/blame.tcl:806
+#: lib/blame.tcl:887
msgid "Committer:"
msgstr "Revisione creata da:"
-#: lib/blame.tcl:811
+#: lib/blame.tcl:892
msgid "Original File:"
msgstr "File originario:"
-#: lib/blame.tcl:925
+#: lib/blame.tcl:1006
msgid "Originally By:"
msgstr "In origine da:"
-#: lib/blame.tcl:931
+#: lib/blame.tcl:1012
msgid "In File:"
msgstr "Nel file:"
-#: lib/blame.tcl:936
+#: lib/blame.tcl:1017
msgid "Copied Or Moved Here By:"
msgstr "Copiato o spostato qui da:"
@@ -553,7 +570,7 @@ msgstr "Attiva"
#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282
-#: lib/checkout_op.tcl:522 lib/choose_font.tcl:43 lib/merge.tcl:171
+#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:171
#: lib/option.tcl:103 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97
msgid "Cancel"
msgstr "Annulla"
@@ -562,7 +579,7 @@ msgstr "Annulla"
msgid "Revision"
msgstr "Revisione"
-#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:242
+#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:244
msgid "Options"
msgstr "Opzioni"
@@ -614,7 +631,7 @@ msgstr "No"
msgid "Fast Forward Only"
msgstr "Solo fast forward"
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514
+#: lib/branch_create.tcl:85 lib/checkout_op.tcl:536
msgid "Reset"
msgstr "Ripristina"
@@ -705,7 +722,7 @@ msgstr "Nuovo Nome:"
msgid "Please select a branch to rename."
msgstr "Scegliere un ramo da rinominare."
-#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179
+#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:201
#, tcl-format
msgid "Branch '%s' already exists."
msgstr "Il ramo '%s' esiste già."
@@ -737,31 +754,36 @@ msgid "Browse Branch Files"
msgstr "Esplora i file del ramo"
#: lib/browser.tcl:278 lib/choose_repository.tcl:387
-#: lib/choose_repository.tcl:474 lib/choose_repository.tcl:484
-#: lib/choose_repository.tcl:987
+#: lib/choose_repository.tcl:472 lib/choose_repository.tcl:482
+#: lib/choose_repository.tcl:985
msgid "Browse"
msgstr "Esplora"
-#: lib/checkout_op.tcl:79
+#: lib/checkout_op.tcl:84
#, tcl-format
msgid "Fetching %s from %s"
msgstr "Recupero %s da %s"
-#: lib/checkout_op.tcl:127
+#: lib/checkout_op.tcl:132
#, tcl-format
msgid "fatal: Cannot resolve %s"
msgstr "errore grave: impossibile risolvere %s"
-#: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31
+#: lib/checkout_op.tcl:145 lib/console.tcl:81 lib/database.tcl:31
msgid "Close"
msgstr "Chiudi"
-#: lib/checkout_op.tcl:169
+#: lib/checkout_op.tcl:174
#, tcl-format
msgid "Branch '%s' does not exist."
msgstr "Il ramo '%s' non esiste."
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "Impossibile configurare git-pull semplificato per '%s'."
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -774,22 +796,22 @@ msgstr ""
"Non può effettuare un 'fast-forward' a %s.\n"
"E' necessaria una fusione."
-#: lib/checkout_op.tcl:220
+#: lib/checkout_op.tcl:242
#, tcl-format
msgid "Merge strategy '%s' not supported."
msgstr "La strategia di fusione '%s' non è supportata."
-#: lib/checkout_op.tcl:239
+#: lib/checkout_op.tcl:261
#, tcl-format
msgid "Failed to update '%s'."
msgstr "Impossibile aggiornare '%s'."
-#: lib/checkout_op.tcl:251
+#: lib/checkout_op.tcl:273
msgid "Staging area (index) is already locked."
msgstr ""
"L'area di preparazione per una nuova revisione (indice) è già bloccata."
-#: lib/checkout_op.tcl:266
+#: lib/checkout_op.tcl:288
msgid ""
"Last scanned state does not match repository state.\n"
"\n"
@@ -806,30 +828,30 @@ msgstr ""
"\n"
"La nuova analisi comincerà ora.\n"
-#: lib/checkout_op.tcl:322
+#: lib/checkout_op.tcl:344
#, tcl-format
msgid "Updating working directory to '%s'..."
msgstr "Aggiornamento della directory di lavoro a '%s' in corso..."
-#: lib/checkout_op.tcl:323
+#: lib/checkout_op.tcl:345
msgid "files checked out"
msgstr "file presenti nella directory di lavoro"
-#: lib/checkout_op.tcl:353
+#: lib/checkout_op.tcl:375
#, tcl-format
msgid "Aborted checkout of '%s' (file level merging is required)."
msgstr "Attivazione di '%s' fallita (richiesta una fusione a livello file)."
-#: lib/checkout_op.tcl:354
+#: lib/checkout_op.tcl:376
msgid "File level merge required."
msgstr "E' richiesta una fusione a livello file."
-#: lib/checkout_op.tcl:358
+#: lib/checkout_op.tcl:380
#, tcl-format
msgid "Staying on branch '%s'."
msgstr "Si rimarrà sul ramo '%s'."
-#: lib/checkout_op.tcl:429
+#: lib/checkout_op.tcl:451
msgid ""
"You are no longer on a local branch.\n"
"\n"
@@ -841,31 +863,31 @@ msgstr ""
"Se si vuole rimanere su un ramo, crearne uno ora a partire da 'Questa "
"revisione attiva staccata'."
-#: lib/checkout_op.tcl:446 lib/checkout_op.tcl:450
+#: lib/checkout_op.tcl:468 lib/checkout_op.tcl:472
#, tcl-format
msgid "Checked out '%s'."
msgstr "Attivazione di '%s' completata."
-#: lib/checkout_op.tcl:478
+#: lib/checkout_op.tcl:500
#, tcl-format
msgid "Resetting '%s' to '%s' will lose the following commits:"
msgstr ""
"Ripristinare '%s' a '%s' comporterà la perdita delle seguenti revisioni:"
-#: lib/checkout_op.tcl:500
+#: lib/checkout_op.tcl:522
msgid "Recovering lost commits may not be easy."
msgstr "Ricomporre le revisioni perdute potrebbe non essere semplice."
-#: lib/checkout_op.tcl:505
+#: lib/checkout_op.tcl:527
#, tcl-format
msgid "Reset '%s'?"
msgstr "Ripristinare '%s'?"
-#: lib/checkout_op.tcl:510 lib/merge.tcl:163
+#: lib/checkout_op.tcl:532 lib/merge.tcl:163
msgid "Visualize"
msgstr "Visualizza"
-#: lib/checkout_op.tcl:578
+#: lib/checkout_op.tcl:600
#, tcl-format
msgid ""
"Failed to set current branch.\n"
@@ -919,7 +941,7 @@ msgstr "Crea nuovo archivio"
msgid "New..."
msgstr "Nuovo..."
-#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:460
+#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:458
msgid "Clone Existing Repository"
msgstr "Clona archivio esistente"
@@ -927,7 +949,7 @@ msgstr "Clona archivio esistente"
msgid "Clone..."
msgstr "Clona..."
-#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:976
+#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:974
msgid "Open Existing Repository"
msgstr "Apri archivio esistente"
@@ -949,188 +971,188 @@ msgstr "Apri archivio recente:"
msgid "Failed to create repository %s:"
msgstr "Impossibile creare l'archivio %s:"
-#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:478
+#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:476
msgid "Directory:"
msgstr "Directory:"
-#: lib/choose_repository.tcl:412 lib/choose_repository.tcl:537
-#: lib/choose_repository.tcl:1011
+#: lib/choose_repository.tcl:410 lib/choose_repository.tcl:535
+#: lib/choose_repository.tcl:1007
msgid "Git Repository"
msgstr "Archivio Git"
-#: lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:435
#, tcl-format
msgid "Directory %s already exists."
msgstr "La directory %s esiste già."
-#: lib/choose_repository.tcl:441
+#: lib/choose_repository.tcl:439
#, tcl-format
msgid "File %s already exists."
msgstr "Il file %s esiste già."
-#: lib/choose_repository.tcl:455
+#: lib/choose_repository.tcl:453
msgid "Clone"
msgstr "Clona"
-#: lib/choose_repository.tcl:468
+#: lib/choose_repository.tcl:466
msgid "URL:"
msgstr "URL:"
-#: lib/choose_repository.tcl:489
+#: lib/choose_repository.tcl:487
msgid "Clone Type:"
msgstr "Tipo di clone:"
-#: lib/choose_repository.tcl:495
+#: lib/choose_repository.tcl:493
msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
msgstr "Standard (veloce, semi-ridondante, con hardlink)"
-#: lib/choose_repository.tcl:501
+#: lib/choose_repository.tcl:499
msgid "Full Copy (Slower, Redundant Backup)"
msgstr "Copia completa (più lento, backup ridondante)"
-#: lib/choose_repository.tcl:507
+#: lib/choose_repository.tcl:505
msgid "Shared (Fastest, Not Recommended, No Backup)"
msgstr "Shared (il più veloce, non raccomandato, nessun backup)"
-#: lib/choose_repository.tcl:543 lib/choose_repository.tcl:590
-#: lib/choose_repository.tcl:736 lib/choose_repository.tcl:806
-#: lib/choose_repository.tcl:1017 lib/choose_repository.tcl:1025
+#: lib/choose_repository.tcl:541 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:734 lib/choose_repository.tcl:804
+#: lib/choose_repository.tcl:1013 lib/choose_repository.tcl:1021
#, tcl-format
msgid "Not a Git repository: %s"
msgstr "%s non è un archivio Git."
-#: lib/choose_repository.tcl:579
+#: lib/choose_repository.tcl:577
msgid "Standard only available for local repository."
msgstr "Standard è disponibile solo per archivi locali."
-#: lib/choose_repository.tcl:583
+#: lib/choose_repository.tcl:581
msgid "Shared only available for local repository."
msgstr "Shared è disponibile solo per archivi locali."
-#: lib/choose_repository.tcl:604
+#: lib/choose_repository.tcl:602
#, tcl-format
msgid "Location %s already exists."
msgstr "Il file/directory %s esiste già."
-#: lib/choose_repository.tcl:615
+#: lib/choose_repository.tcl:613
msgid "Failed to configure origin"
msgstr "Impossibile configurare origin"
-#: lib/choose_repository.tcl:627
+#: lib/choose_repository.tcl:625
msgid "Counting objects"
msgstr "Calcolo oggetti"
-#: lib/choose_repository.tcl:628
+#: lib/choose_repository.tcl:626
msgid "buckets"
msgstr ""
-#: lib/choose_repository.tcl:652
+#: lib/choose_repository.tcl:650
#, tcl-format
msgid "Unable to copy objects/info/alternates: %s"
msgstr "Impossibile copiare oggetti/info/alternate: %s"
-#: lib/choose_repository.tcl:688
+#: lib/choose_repository.tcl:686
#, tcl-format
msgid "Nothing to clone from %s."
msgstr "Niente da clonare da %s."
-#: lib/choose_repository.tcl:690 lib/choose_repository.tcl:904
-#: lib/choose_repository.tcl:916
+#: lib/choose_repository.tcl:688 lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:914
msgid "The 'master' branch has not been initialized."
msgstr "Il ramo 'master' non è stato inizializzato."
-#: lib/choose_repository.tcl:703
+#: lib/choose_repository.tcl:701
msgid "Hardlinks are unavailable. Falling back to copying."
msgstr "Impossibile utilizzare gli hardlink. Si ricorrerà alla copia."
-#: lib/choose_repository.tcl:715
+#: lib/choose_repository.tcl:713
#, tcl-format
msgid "Cloning from %s"
msgstr "Clonazione da %s"
-#: lib/choose_repository.tcl:746
+#: lib/choose_repository.tcl:744
msgid "Copying objects"
msgstr "Copia degli oggetti"
-#: lib/choose_repository.tcl:747
+#: lib/choose_repository.tcl:745
msgid "KiB"
msgstr "KiB"
-#: lib/choose_repository.tcl:771
+#: lib/choose_repository.tcl:769
#, tcl-format
msgid "Unable to copy object: %s"
msgstr "Impossibile copiare oggetto: %s"
-#: lib/choose_repository.tcl:781
+#: lib/choose_repository.tcl:779
msgid "Linking objects"
msgstr "Collegamento oggetti"
-#: lib/choose_repository.tcl:782
+#: lib/choose_repository.tcl:780
msgid "objects"
msgstr "oggetti"
-#: lib/choose_repository.tcl:790
+#: lib/choose_repository.tcl:788
#, tcl-format
msgid "Unable to hardlink object: %s"
msgstr "Hardlink impossibile sull'oggetto: %s"
-#: lib/choose_repository.tcl:845
+#: lib/choose_repository.tcl:843
msgid "Cannot fetch branches and objects. See console output for details."
msgstr ""
"Impossibile recuperare rami e oggetti. Controllare i dettagli forniti dalla "
"console."
-#: lib/choose_repository.tcl:856
+#: lib/choose_repository.tcl:854
msgid "Cannot fetch tags. See console output for details."
msgstr ""
"Impossibile recuperare le etichette. Controllare i dettagli forniti dalla "
"console."
-#: lib/choose_repository.tcl:880
+#: lib/choose_repository.tcl:878
msgid "Cannot determine HEAD. See console output for details."
msgstr ""
"Impossibile determinare HEAD. Controllare i dettagli forniti dalla console."
-#: lib/choose_repository.tcl:889
+#: lib/choose_repository.tcl:887
#, tcl-format
msgid "Unable to cleanup %s"
msgstr "Impossibile ripulire %s"
-#: lib/choose_repository.tcl:895
+#: lib/choose_repository.tcl:893
msgid "Clone failed."
msgstr "Clonazione non riuscita."
-#: lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:900
msgid "No default branch obtained."
msgstr "Non è stato trovato un ramo predefinito."
-#: lib/choose_repository.tcl:913
+#: lib/choose_repository.tcl:911
#, tcl-format
msgid "Cannot resolve %s as a commit."
msgstr "Impossibile risolvere %s come una revisione."
-#: lib/choose_repository.tcl:925
+#: lib/choose_repository.tcl:923
msgid "Creating working directory"
msgstr "Creazione directory di lavoro"
-#: lib/choose_repository.tcl:926 lib/index.tcl:65 lib/index.tcl:127
+#: lib/choose_repository.tcl:924 lib/index.tcl:65 lib/index.tcl:127
#: lib/index.tcl:193
msgid "files"
msgstr "file"
-#: lib/choose_repository.tcl:955
+#: lib/choose_repository.tcl:953
msgid "Initial file checkout failed."
msgstr "Attivazione iniziale non riuscita."
-#: lib/choose_repository.tcl:971
+#: lib/choose_repository.tcl:969
msgid "Open"
msgstr "Apri"
-#: lib/choose_repository.tcl:981
+#: lib/choose_repository.tcl:979
msgid "Repository:"
msgstr "Archivio:"
-#: lib/choose_repository.tcl:1031
+#: lib/choose_repository.tcl:1027
#, tcl-format
msgid "Failed to open repository %s:"
msgstr "Impossibile accedere all'archivio %s:"
@@ -1423,7 +1445,7 @@ msgstr ""
msgid "Invalid date from Git: %s"
msgstr "Git ha restituito una data non valida: %s"
-#: lib/diff.tcl:42
+#: lib/diff.tcl:44
#, tcl-format
msgid ""
"No differences detected.\n"
@@ -1446,40 +1468,48 @@ msgstr ""
"Si procederà automaticamente ad una nuova analisi per trovare altri file che "
"potrebbero avere lo stesso stato."
-#: lib/diff.tcl:81
+#: lib/diff.tcl:83
#, tcl-format
msgid "Loading diff of %s..."
msgstr "Caricamento delle differenze di %s..."
-#: lib/diff.tcl:114 lib/diff.tcl:184
+#: lib/diff.tcl:116 lib/diff.tcl:190
#, tcl-format
msgid "Unable to display %s"
msgstr "Impossibile visualizzare %s"
-#: lib/diff.tcl:115
+#: lib/diff.tcl:117
msgid "Error loading file:"
msgstr "Errore nel caricamento del file:"
-#: lib/diff.tcl:122
+#: lib/diff.tcl:124
msgid "Git Repository (subproject)"
msgstr "Archivio Git (sottoprogetto)"
-#: lib/diff.tcl:134
+#: lib/diff.tcl:136
msgid "* Binary file (not showing content)."
msgstr "* File binario (il contenuto non sarà mostrato)."
-#: lib/diff.tcl:185
+#: lib/diff.tcl:191
msgid "Error loading diff:"
msgstr "Errore nel caricamento delle differenze:"
-#: lib/diff.tcl:303
+#: lib/diff.tcl:313
msgid "Failed to unstage selected hunk."
msgstr "Impossibile rimuovere la sezione scelta dalla nuova revisione."
-#: lib/diff.tcl:310
+#: lib/diff.tcl:320
msgid "Failed to stage selected hunk."
msgstr "Impossibile preparare la sezione scelta per una nuova revisione."
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr "Impossibile rimuovere la riga scelta dalla nuova revisione."
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr "Impossibile preparare la riga scelta per una nuova revisione."
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "errore"
@@ -1689,11 +1719,11 @@ msgstr "Interruzione"
msgid "files reset"
msgstr "ripristino file"
-#: lib/merge.tcl:265
+#: lib/merge.tcl:266
msgid "Abort failed."
msgstr "Interruzione non riuscita."
-#: lib/merge.tcl:267
+#: lib/merge.tcl:268
msgid "Abort completed. Ready."
msgstr "Interruzione completata. Pronto."
@@ -1748,42 +1778,62 @@ msgid "Match Tracking Branches"
msgstr "Appaia duplicati locali di rami remoti"
#: lib/option.tcl:126
+msgid "Blame Copy Only On Changed Files"
+msgstr "Ricerca copie solo nei file modificati"
+
+#: lib/option.tcl:127
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Numero minimo di lettere che attivano la ricerca delle copie"
+
+#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "Numero di linee di contesto nelle differenze"
-#: lib/option.tcl:127
+#: lib/option.tcl:129
msgid "Commit Message Text Width"
msgstr "Larghezza del messaggio di revisione"
-#: lib/option.tcl:128
+#: lib/option.tcl:130
msgid "New Branch Name Template"
msgstr "Modello per il nome di un nuovo ramo"
-#: lib/option.tcl:192
+#: lib/option.tcl:194
msgid "Spelling Dictionary:"
msgstr "Lingua dizionario:"
-#: lib/option.tcl:216
+#: lib/option.tcl:218
msgid "Change Font"
msgstr "Cambia caratteri"
-#: lib/option.tcl:220
+#: lib/option.tcl:222
#, tcl-format
msgid "Choose %s"
msgstr "Scegli %s"
-#: lib/option.tcl:226
+#: lib/option.tcl:228
msgid "pt."
msgstr "pt."
-#: lib/option.tcl:240
+#: lib/option.tcl:242
msgid "Preferences"
msgstr "Preferenze"
-#: lib/option.tcl:275
+#: lib/option.tcl:277
msgid "Failed to completely save options:"
msgstr "Impossibile salvare completamente le opzioni:"
+#: lib/remote.tcl:165
+msgid "Prune from"
+msgstr "Effettua potatura da"
+
+#: lib/remote.tcl:170
+msgid "Fetch from"
+msgstr "Recupera da"
+
+#: lib/remote.tcl:213
+msgid "Push to"
+msgstr "Propaga verso"
+
#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
msgid "Delete Remote Branch"
msgstr "Cancella ramo remoto"
@@ -1868,18 +1918,6 @@ msgstr "Nessun archivio selezionato."
msgid "Scanning %s..."
msgstr "Analisi in corso %s..."
-#: lib/remote.tcl:165
-msgid "Prune from"
-msgstr "Effettua potatura da"
-
-#: lib/remote.tcl:170
-msgid "Fetch from"
-msgstr "Recupera da"
-
-#: lib/remote.tcl:213
-msgid "Push to"
-msgstr "Propaga verso"
-
#: lib/shortcut.tcl:20 lib/shortcut.tcl:61
msgid "Cannot write shortcut:"
msgstr "Impossibile scrivere shortcut:"
@@ -1911,17 +1949,17 @@ msgstr "Il correttore ortografico ha riportato un errore all'avvio"
#: lib/spellcheck.tcl:80
msgid "Unrecognized spell checker"
-msgstr "Correttore ortografico sconosciuto"
+msgstr "Correttore ortografico non riconosciuto"
-#: lib/spellcheck.tcl:180
+#: lib/spellcheck.tcl:186
msgid "No Suggestions"
msgstr "Nessun suggerimento"
-#: lib/spellcheck.tcl:381
+#: lib/spellcheck.tcl:387
msgid "Unexpected EOF from spell checker"
msgstr "Il correttore ortografico ha mandato un EOF inaspettato"
-#: lib/spellcheck.tcl:385
+#: lib/spellcheck.tcl:391
msgid "Spell Checker Failed"
msgstr "Errore nel correttore ortografico"
diff --git a/git-gui/po/ja.po b/git-gui/po/ja.po
index 28e6d6246b..5db44a4ada 100644
--- a/git-gui/po/ja.po
+++ b/git-gui/po/ja.po
@@ -8,41 +8,41 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
-"PO-Revision-Date: 2008-03-15 20:12+0900\n"
-"Last-Translator: しらいし ななこ <nanako3@bluebottle.com>\n"
+"POT-Creation-Date: 2008-08-02 14:45-0700\n"
+"PO-Revision-Date: 2008-08-03 17:00+0900\n"
+"Last-Translator: しらいし ななこ <nanako3@lavabit.com>\n"
"Language-Team: Japanese\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: git-gui.sh:41 git-gui.sh:634 git-gui.sh:648 git-gui.sh:661 git-gui.sh:744
-#: git-gui.sh:763
+#: git-gui.sh:41 git-gui.sh:688 git-gui.sh:702 git-gui.sh:715 git-gui.sh:798
+#: git-gui.sh:817
msgid "git-gui: fatal error"
msgstr "git-gui: 致命的なエラー"
-#: git-gui.sh:593
+#: git-gui.sh:644
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr "%s に無効なフォントが指定されています:"
-#: git-gui.sh:620
+#: git-gui.sh:674
msgid "Main Font"
msgstr "主フォント"
-#: git-gui.sh:621
+#: git-gui.sh:675
msgid "Diff/Console Font"
msgstr "diff/コンソール・フォント"
-#: git-gui.sh:635
+#: git-gui.sh:689
msgid "Cannot find git in PATH."
msgstr "PATH 中に git が見つかりません"
-#: git-gui.sh:662
+#: git-gui.sh:716
msgid "Cannot parse Git version string:"
msgstr "Git バージョン名が理解できません:"
-#: git-gui.sh:680
+#: git-gui.sh:734
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
@@ -61,380 +61,381 @@ msgstr ""
"\n"
"'%s' はバージョン 1.5.0 と思って良いですか?\n"
-#: git-gui.sh:918
+#: git-gui.sh:972
msgid "Git directory not found:"
msgstr "Git ディレクトリが見つかりません:"
-#: git-gui.sh:925
+#: git-gui.sh:979
msgid "Cannot move to top of working directory:"
msgstr "作業ディレクトリの最上位に移動できません"
-#: git-gui.sh:932
+#: git-gui.sh:986
msgid "Cannot use funny .git directory:"
msgstr "変な .git ディレクトリは使えません"
-#: git-gui.sh:937
+#: git-gui.sh:991
msgid "No working directory"
msgstr "作業ディレクトリがありません"
-#: git-gui.sh:1084 lib/checkout_op.tcl:283
+#: git-gui.sh:1138 lib/checkout_op.tcl:305
msgid "Refreshing file status..."
msgstr "ファイル状態を更新しています…"
-#: git-gui.sh:1149
+#: git-gui.sh:1194
msgid "Scanning for modified files ..."
msgstr "変更されたファイルをスキャンしています…"
-#: git-gui.sh:1324 lib/browser.tcl:246
+#: git-gui.sh:1369 lib/browser.tcl:246
msgid "Ready."
msgstr "準備完了"
-#: git-gui.sh:1590
+#: git-gui.sh:1635
msgid "Unmodified"
msgstr "変更無し"
-#: git-gui.sh:1592
+#: git-gui.sh:1637
msgid "Modified, not staged"
msgstr "変更あり、コミット未予定"
-#: git-gui.sh:1593 git-gui.sh:1598
+#: git-gui.sh:1638 git-gui.sh:1643
msgid "Staged for commit"
msgstr "コミット予定済"
-#: git-gui.sh:1594 git-gui.sh:1599
+#: git-gui.sh:1639 git-gui.sh:1644
msgid "Portions staged for commit"
msgstr "部分的にコミット予定済"
-#: git-gui.sh:1595 git-gui.sh:1600
+#: git-gui.sh:1640 git-gui.sh:1645
msgid "Staged for commit, missing"
msgstr "コミット予定済、ファイル無し"
-#: git-gui.sh:1597
+#: git-gui.sh:1642
msgid "Untracked, not staged"
msgstr "管理外、コミット未予定"
-#: git-gui.sh:1602
+#: git-gui.sh:1647
msgid "Missing"
msgstr "ファイル無し"
-#: git-gui.sh:1603
+#: git-gui.sh:1648
msgid "Staged for removal"
msgstr "削除予定済"
-#: git-gui.sh:1604
+#: git-gui.sh:1649
msgid "Staged for removal, still present"
msgstr "削除予定済、ファイル未削除"
-#: git-gui.sh:1606 git-gui.sh:1607 git-gui.sh:1608 git-gui.sh:1609
+#: git-gui.sh:1651 git-gui.sh:1652 git-gui.sh:1653 git-gui.sh:1654
msgid "Requires merge resolution"
msgstr "要マージ解決"
-#: git-gui.sh:1644
+#: git-gui.sh:1689
msgid "Starting gitk... please wait..."
msgstr "gitk を起動中…お待ち下さい…"
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
-msgstr ""
-"gitk を起動できません:\n"
-"\n"
-"%s がありません"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
+msgstr "PATH 中に gitk が見つかりません"
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "リポジトリ"
-#: git-gui.sh:1861
+#: git-gui.sh:1949
msgid "Edit"
msgstr "編集"
-#: git-gui.sh:1863 lib/choose_rev.tcl:561
+#: git-gui.sh:1951 lib/choose_rev.tcl:561
msgid "Branch"
msgstr "ブランチ"
-#: git-gui.sh:1866 lib/choose_rev.tcl:548
+#: git-gui.sh:1954 lib/choose_rev.tcl:548
msgid "Commit@@noun"
msgstr "コミット"
-#: git-gui.sh:1869 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
+#: git-gui.sh:1957 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
msgid "Merge"
msgstr "マージ"
-#: git-gui.sh:1870 lib/choose_rev.tcl:557
+#: git-gui.sh:1958 lib/choose_rev.tcl:557
msgid "Remote"
msgstr "リモート"
-#: git-gui.sh:1879
+#: git-gui.sh:1967
msgid "Browse Current Branch's Files"
msgstr "現在のブランチのファイルを見る"
-#: git-gui.sh:1883
+#: git-gui.sh:1971
msgid "Browse Branch Files..."
msgstr "ブランチのファイルを見る…"
-#: git-gui.sh:1888
+#: git-gui.sh:1976
msgid "Visualize Current Branch's History"
msgstr "現在のブランチの履歴を見る"
-#: git-gui.sh:1892
+#: git-gui.sh:1980
msgid "Visualize All Branch History"
msgstr "全てのブランチの履歴を見る"
-#: git-gui.sh:1899
+#: git-gui.sh:1987
#, tcl-format
msgid "Browse %s's Files"
msgstr "ブランチ %s のファイルを見る"
-#: git-gui.sh:1901
+#: git-gui.sh:1989
#, tcl-format
msgid "Visualize %s's History"
msgstr "ブランチ %s の履歴を見る"
-#: git-gui.sh:1906 lib/database.tcl:27 lib/database.tcl:67
+#: git-gui.sh:1994 lib/database.tcl:27 lib/database.tcl:67
msgid "Database Statistics"
msgstr "データベース統計"
-#: git-gui.sh:1909 lib/database.tcl:34
+#: git-gui.sh:1997 lib/database.tcl:34
msgid "Compress Database"
msgstr "データベース圧縮"
-#: git-gui.sh:1912
+#: git-gui.sh:2000
msgid "Verify Database"
msgstr "データベース検証"
-#: git-gui.sh:1919 git-gui.sh:1923 git-gui.sh:1927 lib/shortcut.tcl:7
+#: git-gui.sh:2007 git-gui.sh:2011 git-gui.sh:2015 lib/shortcut.tcl:7
#: lib/shortcut.tcl:39 lib/shortcut.tcl:71
msgid "Create Desktop Icon"
msgstr "デスクトップ・アイコンを作る"
-#: git-gui.sh:1932 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
+#: git-gui.sh:2023 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
msgid "Quit"
msgstr "終了"
-#: git-gui.sh:1939
+#: git-gui.sh:2031
msgid "Undo"
msgstr "元に戻す"
-#: git-gui.sh:1942
+#: git-gui.sh:2034
msgid "Redo"
msgstr "やり直し"
-#: git-gui.sh:1946 git-gui.sh:2443
+#: git-gui.sh:2038 git-gui.sh:2545
msgid "Cut"
msgstr "切り取り"
-#: git-gui.sh:1949 git-gui.sh:2446 git-gui.sh:2520 git-gui.sh:2614
+#: git-gui.sh:2041 git-gui.sh:2548 git-gui.sh:2622 git-gui.sh:2715
#: lib/console.tcl:69
msgid "Copy"
msgstr "コピー"
-#: git-gui.sh:1952 git-gui.sh:2449
+#: git-gui.sh:2044 git-gui.sh:2551
msgid "Paste"
msgstr "貼り付け"
-#: git-gui.sh:1955 git-gui.sh:2452 lib/branch_delete.tcl:26
+#: git-gui.sh:2047 git-gui.sh:2554 lib/branch_delete.tcl:26
#: lib/remote_branch_delete.tcl:38
msgid "Delete"
msgstr "削除"
-#: git-gui.sh:1959 git-gui.sh:2456 git-gui.sh:2618 lib/console.tcl:71
+#: git-gui.sh:2051 git-gui.sh:2558 git-gui.sh:2719 lib/console.tcl:71
msgid "Select All"
msgstr "全て選択"
-#: git-gui.sh:1968
+#: git-gui.sh:2060
msgid "Create..."
msgstr "作成…"
-#: git-gui.sh:1974
+#: git-gui.sh:2066
msgid "Checkout..."
msgstr "チェックアウト"
-#: git-gui.sh:1980
+#: git-gui.sh:2072
msgid "Rename..."
msgstr "名前変更…"
-#: git-gui.sh:1985 git-gui.sh:2085
+#: git-gui.sh:2077 git-gui.sh:2187
msgid "Delete..."
msgstr "削除…"
-#: git-gui.sh:1990
+#: git-gui.sh:2082
msgid "Reset..."
msgstr "リセット…"
-#: git-gui.sh:2002 git-gui.sh:2389
+#: git-gui.sh:2094 git-gui.sh:2491
msgid "New Commit"
msgstr "新規コミット"
-#: git-gui.sh:2010 git-gui.sh:2396
+#: git-gui.sh:2102 git-gui.sh:2498
msgid "Amend Last Commit"
msgstr "最新コミットを訂正"
-#: git-gui.sh:2019 git-gui.sh:2356 lib/remote_branch_delete.tcl:99
+#: git-gui.sh:2111 git-gui.sh:2458 lib/remote_branch_delete.tcl:99
msgid "Rescan"
msgstr "再スキャン"
-#: git-gui.sh:2025
+#: git-gui.sh:2117
msgid "Stage To Commit"
msgstr "コミット予定する"
-#: git-gui.sh:2031
+#: git-gui.sh:2123
msgid "Stage Changed Files To Commit"
msgstr "変更されたファイルをコミット予定"
-#: git-gui.sh:2037
+#: git-gui.sh:2129
msgid "Unstage From Commit"
msgstr "コミットから降ろす"
-#: git-gui.sh:2042 lib/index.tcl:395
+#: git-gui.sh:2134 lib/index.tcl:395
msgid "Revert Changes"
msgstr "変更を元に戻す"
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr "文脈を少なく"
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr "文脈を多く"
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "署名"
-#: git-gui.sh:2053 git-gui.sh:2372
+#: git-gui.sh:2155 git-gui.sh:2474
msgid "Commit@@verb"
msgstr "コミット"
-#: git-gui.sh:2064
+#: git-gui.sh:2166
msgid "Local Merge..."
msgstr "ローカル・マージ…"
-#: git-gui.sh:2069
+#: git-gui.sh:2171
msgid "Abort Merge..."
msgstr "マージ中止…"
-#: git-gui.sh:2081
+#: git-gui.sh:2183
msgid "Push..."
msgstr "プッシュ…"
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr "りんご"
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
msgstr "%s について"
-#: git-gui.sh:2099
+#: git-gui.sh:2201
msgid "Preferences..."
msgstr "設定…"
-#: git-gui.sh:2107 git-gui.sh:2639
+#: git-gui.sh:2209 git-gui.sh:2740
msgid "Options..."
msgstr "オプション…"
-#: git-gui.sh:2113 lib/choose_repository.tcl:47
+#: git-gui.sh:2215 lib/choose_repository.tcl:47
msgid "Help"
msgstr "ヘルプ"
-#: git-gui.sh:2154
+#: git-gui.sh:2256
msgid "Online Documentation"
msgstr "オンライン・ドキュメント"
-#: git-gui.sh:2238
+#: git-gui.sh:2340
#, tcl-format
msgid "fatal: cannot stat path %s: No such file or directory"
msgstr ""
"致命的: パス %s が stat できません。そのようなファイルやディレクトリはありま"
"せん"
-#: git-gui.sh:2271
+#: git-gui.sh:2373
msgid "Current Branch:"
msgstr "現在のブランチ"
-#: git-gui.sh:2292
+#: git-gui.sh:2394
msgid "Staged Changes (Will Commit)"
msgstr "ステージングされた(コミット予定済の)変更"
-#: git-gui.sh:2312
+#: git-gui.sh:2414
msgid "Unstaged Changes"
msgstr "コミット予定に入っていない変更"
-#: git-gui.sh:2362
+#: git-gui.sh:2464
msgid "Stage Changed"
msgstr "変更をコミット予定に入れる"
-#: git-gui.sh:2378 lib/transport.tcl:93 lib/transport.tcl:182
+#: git-gui.sh:2480 lib/transport.tcl:93 lib/transport.tcl:182
msgid "Push"
msgstr "プッシュ"
-#: git-gui.sh:2408
+#: git-gui.sh:2510
msgid "Initial Commit Message:"
msgstr "最初のコミットメッセージ:"
-#: git-gui.sh:2409
+#: git-gui.sh:2511
msgid "Amended Commit Message:"
msgstr "訂正したコミットメッセージ:"
-#: git-gui.sh:2410
+#: git-gui.sh:2512
msgid "Amended Initial Commit Message:"
msgstr "訂正した最初のコミットメッセージ:"
-#: git-gui.sh:2411
+#: git-gui.sh:2513
msgid "Amended Merge Commit Message:"
msgstr "訂正したマージコミットメッセージ:"
-#: git-gui.sh:2412
+#: git-gui.sh:2514
msgid "Merge Commit Message:"
msgstr "マージコミットメッセージ:"
-#: git-gui.sh:2413
+#: git-gui.sh:2515
msgid "Commit Message:"
msgstr "コミットメッセージ:"
-#: git-gui.sh:2459 git-gui.sh:2622 lib/console.tcl:73
+#: git-gui.sh:2561 git-gui.sh:2723 lib/console.tcl:73
msgid "Copy All"
msgstr "全てコピー"
-#: git-gui.sh:2483 lib/blame.tcl:107
+#: git-gui.sh:2585 lib/blame.tcl:100
msgid "File:"
msgstr "ファイル:"
-#: git-gui.sh:2589
+#: git-gui.sh:2691
msgid "Apply/Reverse Hunk"
msgstr "パッチを適用/取り消す"
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr "文脈を少なく"
-
-#: git-gui.sh:2602
-msgid "Show More Context"
-msgstr "文脈を多く"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
+msgstr "パッチ行を適用/取り消す"
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr "再読み込み"
-#: git-gui.sh:2631
+#: git-gui.sh:2732
msgid "Decrease Font Size"
msgstr "フォントを小さく"
-#: git-gui.sh:2635
+#: git-gui.sh:2736
msgid "Increase Font Size"
msgstr "フォントを大きく"
-#: git-gui.sh:2646
+#: git-gui.sh:2747
msgid "Unstage Hunk From Commit"
msgstr "パッチをコミット予定から外す"
-#: git-gui.sh:2648
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr "コミット予定から行を外す"
+
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "パッチをコミット予定に加える"
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr "パッチ行をコミット予定に加える"
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr "初期化しています…"
-#: git-gui.sh:2762
+#: git-gui.sh:2876
#, tcl-format
msgid ""
"Possible environment issues exist.\n"
@@ -449,7 +450,7 @@ msgstr ""
"以下の環境変数は %s が起動する Git サブプロセスによって無視されるでしょう:\n"
"\n"
-#: git-gui.sh:2792
+#: git-gui.sh:2906
msgid ""
"\n"
"This is due to a known issue with the\n"
@@ -459,7 +460,7 @@ msgstr ""
"これは Cygwin で配布されている Tcl バイナリに\n"
"関しての既知の問題によります"
-#: git-gui.sh:2797
+#: git-gui.sh:2911
#, tcl-format
msgid ""
"\n"
@@ -478,64 +479,80 @@ msgstr ""
msgid "git-gui - a graphical user interface for Git."
msgstr "Git のグラフィカルUI git-gui"
-#: lib/blame.tcl:77
+#: lib/blame.tcl:70
msgid "File Viewer"
msgstr "ファイルピューワ"
-#: lib/blame.tcl:81
+#: lib/blame.tcl:74
msgid "Commit:"
msgstr "コミット:"
-#: lib/blame.tcl:264
+#: lib/blame.tcl:257
msgid "Copy Commit"
msgstr "コミットをコピー"
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr "コピー検知"
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "%s を読んでいます…"
-#: lib/blame.tcl:488
+#: lib/blame.tcl:492
msgid "Loading copy/move tracking annotations..."
msgstr "コピー・移動追跡データを読んでいます…"
-#: lib/blame.tcl:508
+#: lib/blame.tcl:512
msgid "lines annotated"
msgstr "行を注釈しました"
-#: lib/blame.tcl:689
+#: lib/blame.tcl:704
msgid "Loading original location annotations..."
msgstr "元位置行の注釈データを読んでいます…"
-#: lib/blame.tcl:692
+#: lib/blame.tcl:707
msgid "Annotation complete."
msgstr "注釈完了しました"
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr "実行中"
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr "すでに blame プロセスを実行中です。"
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr "コピー検知を実行中…"
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "注釈を読み込んでいます…"
-#: lib/blame.tcl:802
+#: lib/blame.tcl:883
msgid "Author:"
msgstr "作者:"
-#: lib/blame.tcl:806
+#: lib/blame.tcl:887
msgid "Committer:"
msgstr "コミット者:"
-#: lib/blame.tcl:811
+#: lib/blame.tcl:892
msgid "Original File:"
msgstr "元ファイル"
-#: lib/blame.tcl:925
+#: lib/blame.tcl:1006
msgid "Originally By:"
msgstr "原作者:"
-#: lib/blame.tcl:931
+#: lib/blame.tcl:1012
msgid "In File:"
msgstr "ファイル:"
-#: lib/blame.tcl:936
+#: lib/blame.tcl:1017
msgid "Copied Or Moved Here By:"
msgstr "複写・移動者:"
@@ -549,7 +566,7 @@ msgstr "チェックアウト"
#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282
-#: lib/checkout_op.tcl:522 lib/choose_font.tcl:43 lib/merge.tcl:171
+#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:171
#: lib/option.tcl:103 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97
msgid "Cancel"
msgstr "中止"
@@ -558,7 +575,7 @@ msgstr "中止"
msgid "Revision"
msgstr "リビジョン"
-#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:242
+#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:244
msgid "Options"
msgstr "オプション"
@@ -610,7 +627,7 @@ msgstr "いいえ"
msgid "Fast Forward Only"
msgstr "早送りのみ"
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514
+#: lib/branch_create.tcl:85 lib/checkout_op.tcl:536
msgid "Reset"
msgstr "リセット"
@@ -700,7 +717,7 @@ msgstr "新しい名前:"
msgid "Please select a branch to rename."
msgstr "名前を変更するブランチを選んで下さい。"
-#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179
+#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:201
#, tcl-format
msgid "Branch '%s' already exists."
msgstr "'%s'というブランチは既に存在します。"
@@ -732,31 +749,36 @@ msgid "Browse Branch Files"
msgstr "現在のブランチのファイルを見る"
#: lib/browser.tcl:278 lib/choose_repository.tcl:387
-#: lib/choose_repository.tcl:474 lib/choose_repository.tcl:484
-#: lib/choose_repository.tcl:987
+#: lib/choose_repository.tcl:472 lib/choose_repository.tcl:482
+#: lib/choose_repository.tcl:985
msgid "Browse"
msgstr "ブラウズ"
-#: lib/checkout_op.tcl:79
+#: lib/checkout_op.tcl:84
#, tcl-format
msgid "Fetching %s from %s"
msgstr "%s から %s をフェッチしています"
-#: lib/checkout_op.tcl:127
+#: lib/checkout_op.tcl:132
#, tcl-format
msgid "fatal: Cannot resolve %s"
msgstr "致命的エラー: %s を解決できません"
-#: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31
+#: lib/checkout_op.tcl:145 lib/console.tcl:81 lib/database.tcl:31
msgid "Close"
msgstr "閉じる"
-#: lib/checkout_op.tcl:169
+#: lib/checkout_op.tcl:174
#, tcl-format
msgid "Branch '%s' does not exist."
msgstr "ブランチ'%s'は存在しません。"
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "'%s' に簡易 git-pull を設定できませんでした"
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -769,21 +791,21 @@ msgstr ""
"%s に早送りできません。\n"
"マージが必要です。"
-#: lib/checkout_op.tcl:220
+#: lib/checkout_op.tcl:242
#, tcl-format
msgid "Merge strategy '%s' not supported."
msgstr "'%s' マージ戦略はサポートされていません。"
-#: lib/checkout_op.tcl:239
+#: lib/checkout_op.tcl:261
#, tcl-format
msgid "Failed to update '%s'."
msgstr "'%s' の更新に失敗しました。"
-#: lib/checkout_op.tcl:251
+#: lib/checkout_op.tcl:273
msgid "Staging area (index) is already locked."
msgstr "インデックスは既にロックされています。"
-#: lib/checkout_op.tcl:266
+#: lib/checkout_op.tcl:288
msgid ""
"Last scanned state does not match repository state.\n"
"\n"
@@ -799,30 +821,30 @@ msgstr ""
"\n"
"自動的に再スキャンを開始します。\n"
-#: lib/checkout_op.tcl:322
+#: lib/checkout_op.tcl:344
#, tcl-format
msgid "Updating working directory to '%s'..."
msgstr "作業ディレクトリを '%s' に更新しています…"
-#: lib/checkout_op.tcl:323
+#: lib/checkout_op.tcl:345
msgid "files checked out"
msgstr "チェックアウトされたファイル"
-#: lib/checkout_op.tcl:353
+#: lib/checkout_op.tcl:375
#, tcl-format
msgid "Aborted checkout of '%s' (file level merging is required)."
msgstr "'%s' のチェックアウトを中止しました(ファイル毎のマージが必要です)。"
-#: lib/checkout_op.tcl:354
+#: lib/checkout_op.tcl:376
msgid "File level merge required."
msgstr "ファイル毎のマージが必要です。"
-#: lib/checkout_op.tcl:358
+#: lib/checkout_op.tcl:380
#, tcl-format
msgid "Staying on branch '%s'."
msgstr "ブランチ '%s' に滞まります。"
-#: lib/checkout_op.tcl:429
+#: lib/checkout_op.tcl:451
msgid ""
"You are no longer on a local branch.\n"
"\n"
@@ -834,30 +856,30 @@ msgstr ""
"ブランチ上に滞まりたいときは、この「分離されたチェックアウト」から新規ブラン"
"チを開始してください。"
-#: lib/checkout_op.tcl:446 lib/checkout_op.tcl:450
+#: lib/checkout_op.tcl:468 lib/checkout_op.tcl:472
#, tcl-format
msgid "Checked out '%s'."
msgstr "'%s' をチェックアウトしました"
-#: lib/checkout_op.tcl:478
+#: lib/checkout_op.tcl:500
#, tcl-format
msgid "Resetting '%s' to '%s' will lose the following commits:"
msgstr "'%s' を '%s' にリセットすると、以下のコミットが失なわれます:"
-#: lib/checkout_op.tcl:500
+#: lib/checkout_op.tcl:522
msgid "Recovering lost commits may not be easy."
msgstr "失なわれたコミットを回復するのは簡単ではありません。"
-#: lib/checkout_op.tcl:505
+#: lib/checkout_op.tcl:527
#, tcl-format
msgid "Reset '%s'?"
msgstr "'%s' をリセットしますか?"
-#: lib/checkout_op.tcl:510 lib/merge.tcl:163
+#: lib/checkout_op.tcl:532 lib/merge.tcl:163
msgid "Visualize"
msgstr "可視化"
-#: lib/checkout_op.tcl:578
+#: lib/checkout_op.tcl:600
#, tcl-format
msgid ""
"Failed to set current branch.\n"
@@ -909,7 +931,7 @@ msgstr "新しいリポジトリを作る"
msgid "New..."
msgstr "新規…"
-#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:460
+#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:458
msgid "Clone Existing Repository"
msgstr "既存リポジトリを複製する"
@@ -917,7 +939,7 @@ msgstr "既存リポジトリを複製する"
msgid "Clone..."
msgstr "複製…"
-#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:976
+#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:974
msgid "Open Existing Repository"
msgstr "既存リポジトリを開く"
@@ -939,183 +961,183 @@ msgstr "最近使ったリポジトリを開く"
msgid "Failed to create repository %s:"
msgstr "リポジトリ %s を作製できません:"
-#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:478
+#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:476
msgid "Directory:"
msgstr "ディレクトリ:"
-#: lib/choose_repository.tcl:412 lib/choose_repository.tcl:537
-#: lib/choose_repository.tcl:1011
+#: lib/choose_repository.tcl:410 lib/choose_repository.tcl:535
+#: lib/choose_repository.tcl:1007
msgid "Git Repository"
msgstr "GIT リポジトリ"
-#: lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:435
#, tcl-format
msgid "Directory %s already exists."
msgstr "ディレクトリ '%s' は既に存在します。"
-#: lib/choose_repository.tcl:441
+#: lib/choose_repository.tcl:439
#, tcl-format
msgid "File %s already exists."
msgstr "ファイル '%s' は既に存在します。"
-#: lib/choose_repository.tcl:455
+#: lib/choose_repository.tcl:453
msgid "Clone"
msgstr "複製"
-#: lib/choose_repository.tcl:468
+#: lib/choose_repository.tcl:466
msgid "URL:"
msgstr "URL:"
-#: lib/choose_repository.tcl:489
+#: lib/choose_repository.tcl:487
msgid "Clone Type:"
msgstr "複製方式:"
-#: lib/choose_repository.tcl:495
+#: lib/choose_repository.tcl:493
msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
msgstr "標準(高速・中冗長度・ハードリンク)"
-#: lib/choose_repository.tcl:501
+#: lib/choose_repository.tcl:499
msgid "Full Copy (Slower, Redundant Backup)"
msgstr "全複写(低速・冗長バックアップ)"
-#: lib/choose_repository.tcl:507
+#: lib/choose_repository.tcl:505
msgid "Shared (Fastest, Not Recommended, No Backup)"
msgstr "共有(最高速・非推奨・バックアップ無し)"
-#: lib/choose_repository.tcl:543 lib/choose_repository.tcl:590
-#: lib/choose_repository.tcl:736 lib/choose_repository.tcl:806
-#: lib/choose_repository.tcl:1017 lib/choose_repository.tcl:1025
+#: lib/choose_repository.tcl:541 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:734 lib/choose_repository.tcl:804
+#: lib/choose_repository.tcl:1013 lib/choose_repository.tcl:1021
#, tcl-format
msgid "Not a Git repository: %s"
msgstr "Git リポジトリではありません: %s"
-#: lib/choose_repository.tcl:579
+#: lib/choose_repository.tcl:577
msgid "Standard only available for local repository."
msgstr "標準方式は同一計算機上のリポジトリにのみ使えます。"
-#: lib/choose_repository.tcl:583
+#: lib/choose_repository.tcl:581
msgid "Shared only available for local repository."
msgstr "共有方式は同一計算機上のリポジトリにのみ使えます。"
-#: lib/choose_repository.tcl:604
+#: lib/choose_repository.tcl:602
#, tcl-format
msgid "Location %s already exists."
msgstr "'%s' は既に存在します。"
-#: lib/choose_repository.tcl:615
+#: lib/choose_repository.tcl:613
msgid "Failed to configure origin"
msgstr "origin を設定できませんでした"
-#: lib/choose_repository.tcl:627
+#: lib/choose_repository.tcl:625
msgid "Counting objects"
msgstr "オブジェクトを数えています"
-#: lib/choose_repository.tcl:628
+#: lib/choose_repository.tcl:626
msgid "buckets"
msgstr "バケツ"
-#: lib/choose_repository.tcl:652
+#: lib/choose_repository.tcl:650
#, tcl-format
msgid "Unable to copy objects/info/alternates: %s"
msgstr "objects/info/alternates を複写できません: %s"
-#: lib/choose_repository.tcl:688
+#: lib/choose_repository.tcl:686
#, tcl-format
msgid "Nothing to clone from %s."
msgstr "%s から複製する内容はありません"
-#: lib/choose_repository.tcl:690 lib/choose_repository.tcl:904
-#: lib/choose_repository.tcl:916
+#: lib/choose_repository.tcl:688 lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:914
msgid "The 'master' branch has not been initialized."
msgstr "'master' ブランチが初期化されていません"
-#: lib/choose_repository.tcl:703
+#: lib/choose_repository.tcl:701
msgid "Hardlinks are unavailable. Falling back to copying."
msgstr "ハードリンクが作れないので、コピーします"
-#: lib/choose_repository.tcl:715
+#: lib/choose_repository.tcl:713
#, tcl-format
msgid "Cloning from %s"
msgstr "%s から複製しています"
-#: lib/choose_repository.tcl:746
+#: lib/choose_repository.tcl:744
msgid "Copying objects"
msgstr "オブジェクトを複写しています"
-#: lib/choose_repository.tcl:747
+#: lib/choose_repository.tcl:745
msgid "KiB"
msgstr "KiB"
-#: lib/choose_repository.tcl:771
+#: lib/choose_repository.tcl:769
#, tcl-format
msgid "Unable to copy object: %s"
msgstr "オブジェクトを複写できません: %s"
-#: lib/choose_repository.tcl:781
+#: lib/choose_repository.tcl:779
msgid "Linking objects"
msgstr "オブジェクトを連結しています"
-#: lib/choose_repository.tcl:782
+#: lib/choose_repository.tcl:780
msgid "objects"
msgstr "オブジェクト"
-#: lib/choose_repository.tcl:790
+#: lib/choose_repository.tcl:788
#, tcl-format
msgid "Unable to hardlink object: %s"
msgstr "オブジェクトをハードリンクできません: %s"
-#: lib/choose_repository.tcl:845
+#: lib/choose_repository.tcl:843
msgid "Cannot fetch branches and objects. See console output for details."
msgstr "ブランチやオブジェクトを取得できません。コンソール出力を見て下さい"
-#: lib/choose_repository.tcl:856
+#: lib/choose_repository.tcl:854
msgid "Cannot fetch tags. See console output for details."
msgstr "タグを取得できません。コンソール出力を見て下さい"
-#: lib/choose_repository.tcl:880
+#: lib/choose_repository.tcl:878
msgid "Cannot determine HEAD. See console output for details."
msgstr "HEAD を確定できません。コンソール出力を見て下さい"
-#: lib/choose_repository.tcl:889
+#: lib/choose_repository.tcl:887
#, tcl-format
msgid "Unable to cleanup %s"
msgstr "%s を掃除できません"
-#: lib/choose_repository.tcl:895
+#: lib/choose_repository.tcl:893
msgid "Clone failed."
msgstr "複写に失敗しました。"
-#: lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:900
msgid "No default branch obtained."
msgstr "デフォールト・ブランチが取得されませんでした"
-#: lib/choose_repository.tcl:913
+#: lib/choose_repository.tcl:911
#, tcl-format
msgid "Cannot resolve %s as a commit."
msgstr "%s をコミットとして解釈できません"
-#: lib/choose_repository.tcl:925
+#: lib/choose_repository.tcl:923
msgid "Creating working directory"
msgstr "作業ディレクトリを作成しています"
-#: lib/choose_repository.tcl:926 lib/index.tcl:65 lib/index.tcl:127
+#: lib/choose_repository.tcl:924 lib/index.tcl:65 lib/index.tcl:127
#: lib/index.tcl:193
msgid "files"
msgstr "ファイル"
-#: lib/choose_repository.tcl:955
+#: lib/choose_repository.tcl:953
msgid "Initial file checkout failed."
msgstr "初期チェックアウトに失敗しました"
-#: lib/choose_repository.tcl:971
+#: lib/choose_repository.tcl:969
msgid "Open"
msgstr "開く"
-#: lib/choose_repository.tcl:981
+#: lib/choose_repository.tcl:979
msgid "Repository:"
msgstr "リポジトリ:"
-#: lib/choose_repository.tcl:1031
+#: lib/choose_repository.tcl:1027
#, tcl-format
msgid "Failed to open repository %s:"
msgstr "リポジトリ %s を開けません:"
@@ -1405,7 +1427,7 @@ msgstr ""
msgid "Invalid date from Git: %s"
msgstr "Git から出た無効な日付: %s"
-#: lib/diff.tcl:42
+#: lib/diff.tcl:44
#, tcl-format
msgid ""
"No differences detected.\n"
@@ -1427,40 +1449,48 @@ msgstr ""
"\n"
"同様な状態のファイルを探すために、自動的に再スキャンを開始します。"
-#: lib/diff.tcl:81
+#: lib/diff.tcl:83
#, tcl-format
msgid "Loading diff of %s..."
msgstr "%s の変更点をロード中…"
-#: lib/diff.tcl:114 lib/diff.tcl:184
+#: lib/diff.tcl:116 lib/diff.tcl:190
#, tcl-format
msgid "Unable to display %s"
msgstr "%s を表示できません"
-#: lib/diff.tcl:115
+#: lib/diff.tcl:117
msgid "Error loading file:"
msgstr "ファイルを読む際のエラーです:"
-#: lib/diff.tcl:122
+#: lib/diff.tcl:124
msgid "Git Repository (subproject)"
msgstr "Git リポジトリ(サブプロジェクト)"
-#: lib/diff.tcl:134
+#: lib/diff.tcl:136
msgid "* Binary file (not showing content)."
msgstr "* バイナリファイル(内容は表示しません)"
-#: lib/diff.tcl:185
+#: lib/diff.tcl:191
msgid "Error loading diff:"
msgstr "diff を読む際のエラーです:"
-#: lib/diff.tcl:303
+#: lib/diff.tcl:313
msgid "Failed to unstage selected hunk."
msgstr "選択されたパッチをコミット予定から外せません。"
-#: lib/diff.tcl:310
+#: lib/diff.tcl:320
msgid "Failed to stage selected hunk."
msgstr "選択されたパッチをコミット予定に加えられません。"
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr "選択されたパッチ行をコミット予定から外せません。"
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr "選択されたパッチ行をコミット予定に加えられません。"
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "エラー"
@@ -1662,11 +1692,11 @@ msgstr "中断しています"
msgid "files reset"
msgstr "リセットしたファイル"
-#: lib/merge.tcl:265
+#: lib/merge.tcl:266
msgid "Abort failed."
msgstr "中断に失敗しました。"
-#: lib/merge.tcl:267
+#: lib/merge.tcl:268
msgid "Abort completed. Ready."
msgstr "中断完了。"
@@ -1720,42 +1750,62 @@ msgid "Match Tracking Branches"
msgstr "トラッキングブランチを合わせる"
#: lib/option.tcl:126
+msgid "Blame Copy Only On Changed Files"
+msgstr "変更されたファイルのみコピー検知を行なう"
+
+#: lib/option.tcl:127
+msgid "Minimum Letters To Blame Copy On"
+msgstr "コピーを検知する最少文字数"
+
+#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "diff の文脈行数"
-#: lib/option.tcl:127
+#: lib/option.tcl:129
msgid "Commit Message Text Width"
msgstr "コミットメッセージのテキスト幅"
-#: lib/option.tcl:128
+#: lib/option.tcl:130
msgid "New Branch Name Template"
msgstr "新しいブランチ名のテンプレート"
-#: lib/option.tcl:192
+#: lib/option.tcl:194
msgid "Spelling Dictionary:"
msgstr "スペルチェック辞書"
-#: lib/option.tcl:216
+#: lib/option.tcl:218
msgid "Change Font"
msgstr "フォントを変更"
-#: lib/option.tcl:220
+#: lib/option.tcl:222
#, tcl-format
msgid "Choose %s"
msgstr "%s を選択"
-#: lib/option.tcl:226
+#: lib/option.tcl:228
msgid "pt."
msgstr "ポイント"
-#: lib/option.tcl:240
+#: lib/option.tcl:242
msgid "Preferences"
msgstr "設定"
-#: lib/option.tcl:275
+#: lib/option.tcl:277
msgid "Failed to completely save options:"
msgstr "完全にオプションを保存できません:"
+#: lib/remote.tcl:165
+msgid "Prune from"
+msgstr "から刈込む…"
+
+#: lib/remote.tcl:170
+msgid "Fetch from"
+msgstr "取得元"
+
+#: lib/remote.tcl:213
+msgid "Push to"
+msgstr "プッシュ先"
+
#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
msgid "Delete Remote Branch"
msgstr "リモート・ブランチを削除"
@@ -1840,18 +1890,6 @@ msgstr "リポジトリが選択されていません。"
msgid "Scanning %s..."
msgstr "%s をスキャンしています…"
-#: lib/remote.tcl:165
-msgid "Prune from"
-msgstr "から刈込む…"
-
-#: lib/remote.tcl:170
-msgid "Fetch from"
-msgstr "取得元"
-
-#: lib/remote.tcl:213
-msgid "Push to"
-msgstr "プッシュ先"
-
#: lib/shortcut.tcl:20 lib/shortcut.tcl:61
msgid "Cannot write shortcut:"
msgstr "ショートカットが書けません:"
@@ -1885,15 +1923,15 @@ msgstr "スペルチェッカーの起動に失敗しました"
msgid "Unrecognized spell checker"
msgstr "スペルチェッカーが判別できません"
-#: lib/spellcheck.tcl:180
+#: lib/spellcheck.tcl:186
msgid "No Suggestions"
msgstr "提案なし"
-#: lib/spellcheck.tcl:381
+#: lib/spellcheck.tcl:387
msgid "Unexpected EOF from spell checker"
msgstr "スペルチェッカーが予想外の EOF を返しました"
-#: lib/spellcheck.tcl:385
+#: lib/spellcheck.tcl:391
msgid "Spell Checker Failed"
msgstr "スペルチェック失敗"
@@ -1964,6 +2002,3 @@ msgstr "Thin Pack を使う(遅いネットワーク接続)"
#: lib/transport.tcl:168
msgid "Include tags"
msgstr "タグを含める"
-
-#~ msgid "Not connected to aspell"
-#~ msgstr "aspell に接続していません"
diff --git a/git-gui/po/sv.po b/git-gui/po/sv.po
index 4da687bb41..0196ba8cef 100644
--- a/git-gui/po/sv.po
+++ b/git-gui/po/sv.po
@@ -3,45 +3,46 @@
# This file is distributed under the same license as the git-gui package.
#
# Peter Karlsson <peter@softwolves.pp.se>, 2007-2008.
+# Mikael Magnusson <mikachu@gmail.com>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: sv\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 07:18+0100\n"
-"PO-Revision-Date: 2008-03-14 07:23+0100\n"
-"Last-Translator: Peter Karlsson <peter@softwolves.pp.se>\n"
+"POT-Creation-Date: 2008-08-03 01:34+0200\n"
+"PO-Revision-Date: 2008-08-03 01:45+0200\n"
+"Last-Translator: Mikael Magnusson <mikachu@gmail.com>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit"
+"Content-Transfer-Encoding: 8bit\n"
-#: git-gui.sh:41 git-gui.sh:634 git-gui.sh:648 git-gui.sh:661 git-gui.sh:744
-#: git-gui.sh:763
+#: git-gui.sh:41 git-gui.sh:688 git-gui.sh:702 git-gui.sh:715 git-gui.sh:798
+#: git-gui.sh:817
msgid "git-gui: fatal error"
msgstr "git-gui: ödesdigert fel"
-#: git-gui.sh:593
+#: git-gui.sh:644
#, tcl-format
msgid "Invalid font specified in %s:"
msgstr "Ogiltigt teckensnitt angivet i %s:"
-#: git-gui.sh:620
+#: git-gui.sh:674
msgid "Main Font"
msgstr "Huvudteckensnitt"
-#: git-gui.sh:621
+#: git-gui.sh:675
msgid "Diff/Console Font"
msgstr "Diff/konsolteckensnitt"
-#: git-gui.sh:635
+#: git-gui.sh:689
msgid "Cannot find git in PATH."
msgstr "Hittar inte git i PATH."
-#: git-gui.sh:662
+#: git-gui.sh:716
msgid "Cannot parse Git version string:"
msgstr "Kan inte tolka versionssträng från Git:"
-#: git-gui.sh:680
+#: git-gui.sh:734
#, tcl-format
msgid ""
"Git version cannot be determined.\n"
@@ -60,379 +61,380 @@ msgstr ""
"\n"
"Anta att \"%s\" är version 1.5.0?\n"
-#: git-gui.sh:918
+#: git-gui.sh:972
msgid "Git directory not found:"
msgstr "Git-katalogen hittades inte:"
-#: git-gui.sh:925
+#: git-gui.sh:979
msgid "Cannot move to top of working directory:"
msgstr "Kan inte gå till början på arbetskatalogen:"
-#: git-gui.sh:932
+#: git-gui.sh:986
msgid "Cannot use funny .git directory:"
msgstr "Kan inte använda underlig .git-katalog:"
-#: git-gui.sh:937
+#: git-gui.sh:991
msgid "No working directory"
msgstr "Ingen arbetskatalog"
-#: git-gui.sh:1084 lib/checkout_op.tcl:283
+#: git-gui.sh:1138 lib/checkout_op.tcl:305
msgid "Refreshing file status..."
msgstr "Uppdaterar filstatus..."
-#: git-gui.sh:1149
+#: git-gui.sh:1194
msgid "Scanning for modified files ..."
msgstr "Söker efter ändrade filer..."
-#: git-gui.sh:1324 lib/browser.tcl:246
+#: git-gui.sh:1369 lib/browser.tcl:246
msgid "Ready."
msgstr "Klar."
-#: git-gui.sh:1590
+#: git-gui.sh:1635
msgid "Unmodified"
msgstr "Oförändrade"
-#: git-gui.sh:1592
+#: git-gui.sh:1637
msgid "Modified, not staged"
msgstr "Förändrade, ej köade"
-#: git-gui.sh:1593 git-gui.sh:1598
+#: git-gui.sh:1638 git-gui.sh:1643
msgid "Staged for commit"
msgstr "Köade för incheckning"
-#: git-gui.sh:1594 git-gui.sh:1599
+#: git-gui.sh:1639 git-gui.sh:1644
msgid "Portions staged for commit"
msgstr "Delar köade för incheckning"
-#: git-gui.sh:1595 git-gui.sh:1600
+#: git-gui.sh:1640 git-gui.sh:1645
msgid "Staged for commit, missing"
msgstr "Köade för incheckning, saknade"
-#: git-gui.sh:1597
+#: git-gui.sh:1642
msgid "Untracked, not staged"
msgstr "Ej spårade, ej köade"
-#: git-gui.sh:1602
+#: git-gui.sh:1647
msgid "Missing"
msgstr "Saknade"
-#: git-gui.sh:1603
+#: git-gui.sh:1648
msgid "Staged for removal"
msgstr "Köade för borttagning"
-#: git-gui.sh:1604
+#: git-gui.sh:1649
msgid "Staged for removal, still present"
msgstr "Köade för borttagning, fortfarande närvarande"
-#: git-gui.sh:1606 git-gui.sh:1607 git-gui.sh:1608 git-gui.sh:1609
+#: git-gui.sh:1651 git-gui.sh:1652 git-gui.sh:1653 git-gui.sh:1654
msgid "Requires merge resolution"
msgstr "Kräver konflikthantering efter sammanslagning"
-#: git-gui.sh:1644
+#: git-gui.sh:1689
msgid "Starting gitk... please wait..."
msgstr "Startar gitk... vänta..."
-#: git-gui.sh:1653
-#, tcl-format
-msgid ""
-"Unable to start gitk:\n"
-"\n"
-"%s does not exist"
-msgstr ""
-"Kan inte starta gitk:\n"
-"\n"
-"%s finns inte"
+#: git-gui.sh:1698
+msgid "Couldn't find gitk in PATH"
+msgstr "Hittar inte gitk i PATH."
-#: git-gui.sh:1860 lib/choose_repository.tcl:36
+#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Arkiv"
-#: git-gui.sh:1861
+#: git-gui.sh:1949
msgid "Edit"
msgstr "Redigera"
-#: git-gui.sh:1863 lib/choose_rev.tcl:561
+#: git-gui.sh:1951 lib/choose_rev.tcl:561
msgid "Branch"
msgstr "Gren"
-#: git-gui.sh:1866 lib/choose_rev.tcl:548
+#: git-gui.sh:1954 lib/choose_rev.tcl:548
msgid "Commit@@noun"
msgstr "Incheckning"
-#: git-gui.sh:1869 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
+#: git-gui.sh:1957 lib/merge.tcl:120 lib/merge.tcl:149 lib/merge.tcl:167
msgid "Merge"
msgstr "Slå ihop"
-#: git-gui.sh:1870 lib/choose_rev.tcl:557
+#: git-gui.sh:1958 lib/choose_rev.tcl:557
msgid "Remote"
msgstr "Fjärr"
-#: git-gui.sh:1879
+#: git-gui.sh:1967
msgid "Browse Current Branch's Files"
msgstr "Bläddra i grenens filer"
-#: git-gui.sh:1883
+#: git-gui.sh:1971
msgid "Browse Branch Files..."
msgstr "Bläddra filer på gren..."
-#: git-gui.sh:1888
+#: git-gui.sh:1976
msgid "Visualize Current Branch's History"
msgstr "Visualisera grenens historik"
-#: git-gui.sh:1892
+#: git-gui.sh:1980
msgid "Visualize All Branch History"
msgstr "Visualisera alla grenars historik"
-#: git-gui.sh:1899
+#: git-gui.sh:1987
#, tcl-format
msgid "Browse %s's Files"
msgstr "Bläddra i filer för %s"
-#: git-gui.sh:1901
+#: git-gui.sh:1989
#, tcl-format
msgid "Visualize %s's History"
msgstr "Visualisera historik för %s"
-#: git-gui.sh:1906 lib/database.tcl:27 lib/database.tcl:67
+#: git-gui.sh:1994 lib/database.tcl:27 lib/database.tcl:67
msgid "Database Statistics"
msgstr "Databasstatistik"
-#: git-gui.sh:1909 lib/database.tcl:34
+#: git-gui.sh:1997 lib/database.tcl:34
msgid "Compress Database"
msgstr "Komprimera databas"
-#: git-gui.sh:1912
+#: git-gui.sh:2000
msgid "Verify Database"
msgstr "Verifiera databas"
-#: git-gui.sh:1919 git-gui.sh:1923 git-gui.sh:1927 lib/shortcut.tcl:7
+#: git-gui.sh:2007 git-gui.sh:2011 git-gui.sh:2015 lib/shortcut.tcl:7
#: lib/shortcut.tcl:39 lib/shortcut.tcl:71
msgid "Create Desktop Icon"
msgstr "Skapa skrivbordsikon"
-#: git-gui.sh:1932 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
+#: git-gui.sh:2023 lib/choose_repository.tcl:177 lib/choose_repository.tcl:185
msgid "Quit"
msgstr "Avsluta"
-#: git-gui.sh:1939
+#: git-gui.sh:2031
msgid "Undo"
msgstr "Ångra"
-#: git-gui.sh:1942
+#: git-gui.sh:2034
msgid "Redo"
msgstr "Gör om"
-#: git-gui.sh:1946 git-gui.sh:2443
+#: git-gui.sh:2038 git-gui.sh:2545
msgid "Cut"
msgstr "Klipp ut"
-#: git-gui.sh:1949 git-gui.sh:2446 git-gui.sh:2520 git-gui.sh:2614
+#: git-gui.sh:2041 git-gui.sh:2548 git-gui.sh:2622 git-gui.sh:2715
#: lib/console.tcl:69
msgid "Copy"
msgstr "Kopiera"
-#: git-gui.sh:1952 git-gui.sh:2449
+#: git-gui.sh:2044 git-gui.sh:2551
msgid "Paste"
msgstr "Klistra in"
-#: git-gui.sh:1955 git-gui.sh:2452 lib/branch_delete.tcl:26
+#: git-gui.sh:2047 git-gui.sh:2554 lib/branch_delete.tcl:26
#: lib/remote_branch_delete.tcl:38
msgid "Delete"
msgstr "Ta bort"
-#: git-gui.sh:1959 git-gui.sh:2456 git-gui.sh:2618 lib/console.tcl:71
+#: git-gui.sh:2051 git-gui.sh:2558 git-gui.sh:2719 lib/console.tcl:71
msgid "Select All"
msgstr "Markera alla"
-#: git-gui.sh:1968
+#: git-gui.sh:2060
msgid "Create..."
msgstr "Skapa..."
-#: git-gui.sh:1974
+#: git-gui.sh:2066
msgid "Checkout..."
msgstr "Checka ut..."
-#: git-gui.sh:1980
+#: git-gui.sh:2072
msgid "Rename..."
msgstr "Byt namn..."
-#: git-gui.sh:1985 git-gui.sh:2085
+#: git-gui.sh:2077 git-gui.sh:2187
msgid "Delete..."
msgstr "Ta bort..."
-#: git-gui.sh:1990
+#: git-gui.sh:2082
msgid "Reset..."
msgstr "Återställ..."
-#: git-gui.sh:2002 git-gui.sh:2389
+#: git-gui.sh:2094 git-gui.sh:2491
msgid "New Commit"
msgstr "Ny incheckning"
-#: git-gui.sh:2010 git-gui.sh:2396
+#: git-gui.sh:2102 git-gui.sh:2498
msgid "Amend Last Commit"
msgstr "Lägg till föregående incheckning"
-#: git-gui.sh:2019 git-gui.sh:2356 lib/remote_branch_delete.tcl:99
+#: git-gui.sh:2111 git-gui.sh:2458 lib/remote_branch_delete.tcl:99
msgid "Rescan"
msgstr "Sök på nytt"
-#: git-gui.sh:2025
+#: git-gui.sh:2117
msgid "Stage To Commit"
msgstr "Köa för incheckning"
-#: git-gui.sh:2031
+#: git-gui.sh:2123
msgid "Stage Changed Files To Commit"
msgstr "Köa ändrade filer för incheckning"
-#: git-gui.sh:2037
+#: git-gui.sh:2129
msgid "Unstage From Commit"
msgstr "Ta bort från incheckningskö"
-#: git-gui.sh:2042 lib/index.tcl:395
+#: git-gui.sh:2134 lib/index.tcl:395
msgid "Revert Changes"
msgstr "Återställ ändringar"
-#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
+#: git-gui.sh:2141 git-gui.sh:2702
+msgid "Show Less Context"
+msgstr "Visa mindre sammanhang"
+
+#: git-gui.sh:2145 git-gui.sh:2706
+msgid "Show More Context"
+msgstr "Visa mer sammanhang"
+
+#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "Skriv under"
-#: git-gui.sh:2053 git-gui.sh:2372
+#: git-gui.sh:2155 git-gui.sh:2474
msgid "Commit@@verb"
msgstr "Checka in"
-#: git-gui.sh:2064
+#: git-gui.sh:2166
msgid "Local Merge..."
msgstr "Lokal sammanslagning..."
-#: git-gui.sh:2069
+#: git-gui.sh:2171
msgid "Abort Merge..."
msgstr "Avbryt sammanslagning..."
-#: git-gui.sh:2081
+#: git-gui.sh:2183
msgid "Push..."
msgstr "Sänd..."
-#: git-gui.sh:2092 lib/choose_repository.tcl:41
-msgid "Apple"
-msgstr "Äpple"
-
-#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
+#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
msgstr "Om %s"
-#: git-gui.sh:2099
+#: git-gui.sh:2201
msgid "Preferences..."
msgstr "Inställningar..."
-#: git-gui.sh:2107 git-gui.sh:2639
+#: git-gui.sh:2209 git-gui.sh:2740
msgid "Options..."
msgstr "Alternativ..."
-#: git-gui.sh:2113 lib/choose_repository.tcl:47
+#: git-gui.sh:2215 lib/choose_repository.tcl:47
msgid "Help"
msgstr "Hjälp"
-#: git-gui.sh:2154
+#: git-gui.sh:2256
msgid "Online Documentation"
msgstr "Webbdokumentation"
-#: git-gui.sh:2238
+#: git-gui.sh:2340
#, tcl-format
msgid "fatal: cannot stat path %s: No such file or directory"
msgstr ""
"ödesdigert: kunde inte ta status på sökvägen %s: Fil eller katalog saknas"
-#: git-gui.sh:2271
+#: git-gui.sh:2373
msgid "Current Branch:"
msgstr "Aktuell gren:"
-#: git-gui.sh:2292
+#: git-gui.sh:2394
msgid "Staged Changes (Will Commit)"
msgstr "Köade ändringar (kommer att checkas in)"
-#: git-gui.sh:2312
+#: git-gui.sh:2414
msgid "Unstaged Changes"
msgstr "Oköade ändringar"
-#: git-gui.sh:2362
+#: git-gui.sh:2464
msgid "Stage Changed"
msgstr "Köa ändrade"
-#: git-gui.sh:2378 lib/transport.tcl:93 lib/transport.tcl:182
+#: git-gui.sh:2480 lib/transport.tcl:93 lib/transport.tcl:182
msgid "Push"
msgstr "Sänd"
-#: git-gui.sh:2408
+#: git-gui.sh:2510
msgid "Initial Commit Message:"
msgstr "Inledande incheckningsmeddelande:"
-#: git-gui.sh:2409
+#: git-gui.sh:2511
msgid "Amended Commit Message:"
msgstr "Utökat incheckningsmeddelande:"
-#: git-gui.sh:2410
+#: git-gui.sh:2512
msgid "Amended Initial Commit Message:"
msgstr "Utökat inledande incheckningsmeddelande:"
-#: git-gui.sh:2411
+#: git-gui.sh:2513
msgid "Amended Merge Commit Message:"
msgstr "Utökat incheckningsmeddelande för sammanslagning:"
-#: git-gui.sh:2412
+#: git-gui.sh:2514
msgid "Merge Commit Message:"
msgstr "Incheckningsmeddelande för sammanslagning:"
-#: git-gui.sh:2413
+#: git-gui.sh:2515
msgid "Commit Message:"
msgstr "Incheckningsmeddelande:"
-#: git-gui.sh:2459 git-gui.sh:2622 lib/console.tcl:73
+#: git-gui.sh:2561 git-gui.sh:2723 lib/console.tcl:73
msgid "Copy All"
msgstr "Kopiera alla"
-#: git-gui.sh:2483 lib/blame.tcl:107
+#: git-gui.sh:2585 lib/blame.tcl:100
msgid "File:"
msgstr "Fil:"
-#: git-gui.sh:2589
+#: git-gui.sh:2691
msgid "Apply/Reverse Hunk"
msgstr "Använd/återställ del"
-#: git-gui.sh:2595
-msgid "Show Less Context"
-msgstr "Visa mindre sammanhang"
-
-#: git-gui.sh:2602
-msgid "Show More Context"
-msgstr "Visa mer sammanhang"
+#: git-gui.sh:2696
+msgid "Apply/Reverse Line"
+msgstr "Använd/återställ rad"
-#: git-gui.sh:2610
+#: git-gui.sh:2711
msgid "Refresh"
msgstr "Uppdatera"
-#: git-gui.sh:2631
+#: git-gui.sh:2732
msgid "Decrease Font Size"
msgstr "Minska teckensnittsstorlek"
-#: git-gui.sh:2635
+#: git-gui.sh:2736
msgid "Increase Font Size"
msgstr "Öka teckensnittsstorlek"
-#: git-gui.sh:2646
+#: git-gui.sh:2747
msgid "Unstage Hunk From Commit"
msgstr "Ta bort del ur incheckningskö"
-#: git-gui.sh:2648
+#: git-gui.sh:2748
+msgid "Unstage Line From Commit"
+msgstr "Ta bort rad ur incheckningskö"
+
+#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "Ställ del i incheckningskö"
-#: git-gui.sh:2667
+#: git-gui.sh:2751
+msgid "Stage Line For Commit"
+msgstr "Ställ rad i incheckningskö"
+
+#: git-gui.sh:2771
msgid "Initializing..."
msgstr "Initierar..."
-#: git-gui.sh:2762
+#: git-gui.sh:2876
#, tcl-format
msgid ""
"Possible environment issues exist.\n"
@@ -449,7 +451,7 @@ msgstr ""
"av %s:\n"
"\n"
-#: git-gui.sh:2792
+#: git-gui.sh:2906
msgid ""
"\n"
"This is due to a known issue with the\n"
@@ -459,7 +461,7 @@ msgstr ""
"Detta beror på ett känt problem med\n"
"Tcl-binären som följer med Cygwin."
-#: git-gui.sh:2797
+#: git-gui.sh:2911
#, tcl-format
msgid ""
"\n"
@@ -480,64 +482,80 @@ msgstr ""
msgid "git-gui - a graphical user interface for Git."
msgstr "git-gui - ett grafiskt användargränssnitt för Git."
-#: lib/blame.tcl:77
+#: lib/blame.tcl:70
msgid "File Viewer"
msgstr "Filvisare"
-#: lib/blame.tcl:81
+#: lib/blame.tcl:74
msgid "Commit:"
msgstr "Incheckning:"
-#: lib/blame.tcl:264
+#: lib/blame.tcl:257
msgid "Copy Commit"
msgstr "Kopiera incheckning"
-#: lib/blame.tcl:384
+#: lib/blame.tcl:260
+msgid "Do Full Copy Detection"
+msgstr "Gör full kopieringsigenkänning"
+
+#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "Läser %s..."
-#: lib/blame.tcl:488
+#: lib/blame.tcl:492
msgid "Loading copy/move tracking annotations..."
msgstr "Läser annoteringar för kopiering/flyttning..."
-#: lib/blame.tcl:508
+#: lib/blame.tcl:512
msgid "lines annotated"
msgstr "rader annoterade"
-#: lib/blame.tcl:689
+#: lib/blame.tcl:704
msgid "Loading original location annotations..."
msgstr "Läser in annotering av originalplacering..."
-#: lib/blame.tcl:692
+#: lib/blame.tcl:707
msgid "Annotation complete."
msgstr "Annotering fullbordad."
-#: lib/blame.tcl:746
+#: lib/blame.tcl:737
+msgid "Busy"
+msgstr "Upptagen"
+
+#: lib/blame.tcl:738
+msgid "Annotation process is already running."
+msgstr "Annoteringsprocess körs redan."
+
+#: lib/blame.tcl:777
+msgid "Running thorough copy detection..."
+msgstr "Kör grundlig kopieringsigenkänning..."
+
+#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "Läser in annotering..."
-#: lib/blame.tcl:802
+#: lib/blame.tcl:883
msgid "Author:"
msgstr "Författare:"
-#: lib/blame.tcl:806
+#: lib/blame.tcl:887
msgid "Committer:"
msgstr "Incheckare:"
-#: lib/blame.tcl:811
+#: lib/blame.tcl:892
msgid "Original File:"
msgstr "Ursprunglig fil:"
-#: lib/blame.tcl:925
+#: lib/blame.tcl:1006
msgid "Originally By:"
msgstr "Ursprungligen av:"
-#: lib/blame.tcl:931
+#: lib/blame.tcl:1012
msgid "In File:"
msgstr "I filen:"
-#: lib/blame.tcl:936
+#: lib/blame.tcl:1017
msgid "Copied Or Moved Here By:"
msgstr "Kopierad eller flyttad hit av:"
@@ -551,7 +569,7 @@ msgstr "Checka ut"
#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282
-#: lib/checkout_op.tcl:522 lib/choose_font.tcl:43 lib/merge.tcl:171
+#: lib/checkout_op.tcl:544 lib/choose_font.tcl:43 lib/merge.tcl:171
#: lib/option.tcl:103 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97
msgid "Cancel"
msgstr "Avbryt"
@@ -560,7 +578,7 @@ msgstr "Avbryt"
msgid "Revision"
msgstr "Revision"
-#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:242
+#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:244
msgid "Options"
msgstr "Alternativ"
@@ -612,7 +630,7 @@ msgstr "Nej"
msgid "Fast Forward Only"
msgstr "Endast snabbspolning"
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514
+#: lib/branch_create.tcl:85 lib/checkout_op.tcl:536
msgid "Reset"
msgstr "Återställ"
@@ -702,7 +720,7 @@ msgstr "Nytt namn:"
msgid "Please select a branch to rename."
msgstr "Välj en gren att byta namn på."
-#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179
+#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:201
#, tcl-format
msgid "Branch '%s' already exists."
msgstr "Grenen \"%s\" finns redan."
@@ -734,31 +752,36 @@ msgid "Browse Branch Files"
msgstr "Bläddra filer på grenen"
#: lib/browser.tcl:278 lib/choose_repository.tcl:387
-#: lib/choose_repository.tcl:474 lib/choose_repository.tcl:484
-#: lib/choose_repository.tcl:987
+#: lib/choose_repository.tcl:472 lib/choose_repository.tcl:482
+#: lib/choose_repository.tcl:985
msgid "Browse"
msgstr "Bläddra"
-#: lib/checkout_op.tcl:79
+#: lib/checkout_op.tcl:84
#, tcl-format
msgid "Fetching %s from %s"
msgstr "Hämtar %s från %s"
-#: lib/checkout_op.tcl:127
+#: lib/checkout_op.tcl:132
#, tcl-format
msgid "fatal: Cannot resolve %s"
msgstr "ödesdigert: Kunde inte slå upp %s"
-#: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31
+#: lib/checkout_op.tcl:145 lib/console.tcl:81 lib/database.tcl:31
msgid "Close"
msgstr "Stäng"
-#: lib/checkout_op.tcl:169
+#: lib/checkout_op.tcl:174
#, tcl-format
msgid "Branch '%s' does not exist."
msgstr "Grenen \"%s\" finns inte."
-#: lib/checkout_op.tcl:206
+#: lib/checkout_op.tcl:193
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "Kunde inte konfigurera förenklad git-pull för '%s'."
+
+#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -771,21 +794,21 @@ msgstr ""
"Den kan inte snabbspolas till %s.\n"
"En sammanslagning krävs."
-#: lib/checkout_op.tcl:220
+#: lib/checkout_op.tcl:242
#, tcl-format
msgid "Merge strategy '%s' not supported."
msgstr "Sammanslagningsstrategin \"%s\" stöds inte."
-#: lib/checkout_op.tcl:239
+#: lib/checkout_op.tcl:261
#, tcl-format
msgid "Failed to update '%s'."
msgstr "Misslyckades med att uppdatera \"%s\"."
-#: lib/checkout_op.tcl:251
+#: lib/checkout_op.tcl:273
msgid "Staging area (index) is already locked."
msgstr "Köområdet (index) är redan låst."
-#: lib/checkout_op.tcl:266
+#: lib/checkout_op.tcl:288
msgid ""
"Last scanned state does not match repository state.\n"
"\n"
@@ -801,30 +824,30 @@ msgstr ""
"\n"
"Sökningen kommer att startas automatiskt nu.\n"
-#: lib/checkout_op.tcl:322
+#: lib/checkout_op.tcl:344
#, tcl-format
msgid "Updating working directory to '%s'..."
msgstr "Uppdaterar arbetskatalogen till \"%s\"..."
-#: lib/checkout_op.tcl:323
+#: lib/checkout_op.tcl:345
msgid "files checked out"
msgstr "filer utcheckade"
-#: lib/checkout_op.tcl:353
+#: lib/checkout_op.tcl:375
#, tcl-format
msgid "Aborted checkout of '%s' (file level merging is required)."
msgstr "Avbryter utcheckning av \"%s\" (sammanslagning på filnivå krävs)."
-#: lib/checkout_op.tcl:354
+#: lib/checkout_op.tcl:376
msgid "File level merge required."
msgstr "Sammanslagning på filnivå krävs."
-#: lib/checkout_op.tcl:358
+#: lib/checkout_op.tcl:380
#, tcl-format
msgid "Staying on branch '%s'."
msgstr "Stannar på grenen \"%s\"."
-#: lib/checkout_op.tcl:429
+#: lib/checkout_op.tcl:451
msgid ""
"You are no longer on a local branch.\n"
"\n"
@@ -836,31 +859,31 @@ msgstr ""
"Om du ville vara på en gren skapar du en nu, baserad på \"Denna frånkopplade "
"utcheckning\"."
-#: lib/checkout_op.tcl:446 lib/checkout_op.tcl:450
+#: lib/checkout_op.tcl:468 lib/checkout_op.tcl:472
#, tcl-format
msgid "Checked out '%s'."
msgstr "Checkade ut \"%s\"."
-#: lib/checkout_op.tcl:478
+#: lib/checkout_op.tcl:500
#, tcl-format
msgid "Resetting '%s' to '%s' will lose the following commits:"
msgstr ""
"Om du återställer \"%s\" till \"%s\" går följande incheckningar förlorade:"
-#: lib/checkout_op.tcl:500
+#: lib/checkout_op.tcl:522
msgid "Recovering lost commits may not be easy."
msgstr "Det kanske inte är så enkelt att återskapa förlorade incheckningar."
-#: lib/checkout_op.tcl:505
+#: lib/checkout_op.tcl:527
#, tcl-format
msgid "Reset '%s'?"
msgstr "Återställa \"%s\"?"
-#: lib/checkout_op.tcl:510 lib/merge.tcl:163
+#: lib/checkout_op.tcl:532 lib/merge.tcl:163
msgid "Visualize"
msgstr "Visualisera"
-#: lib/checkout_op.tcl:578
+#: lib/checkout_op.tcl:600
#, tcl-format
msgid ""
"Failed to set current branch.\n"
@@ -913,7 +936,7 @@ msgstr "Skapa nytt arkiv"
msgid "New..."
msgstr "Nytt..."
-#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:460
+#: lib/choose_repository.tcl:94 lib/choose_repository.tcl:458
msgid "Clone Existing Repository"
msgstr "Klona befintligt arkiv"
@@ -921,7 +944,7 @@ msgstr "Klona befintligt arkiv"
msgid "Clone..."
msgstr "Klona..."
-#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:976
+#: lib/choose_repository.tcl:107 lib/choose_repository.tcl:974
msgid "Open Existing Repository"
msgstr "Öppna befintligt arkiv"
@@ -943,183 +966,183 @@ msgstr "Öppna tidigare arkiv:"
msgid "Failed to create repository %s:"
msgstr "Kunde inte skapa arkivet %s:"
-#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:478
+#: lib/choose_repository.tcl:381 lib/choose_repository.tcl:476
msgid "Directory:"
msgstr "Katalog:"
-#: lib/choose_repository.tcl:412 lib/choose_repository.tcl:537
-#: lib/choose_repository.tcl:1011
+#: lib/choose_repository.tcl:410 lib/choose_repository.tcl:535
+#: lib/choose_repository.tcl:1007
msgid "Git Repository"
msgstr "Gitarkiv"
-#: lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:435
#, tcl-format
msgid "Directory %s already exists."
msgstr "Katalogen %s finns redan."
-#: lib/choose_repository.tcl:441
+#: lib/choose_repository.tcl:439
#, tcl-format
msgid "File %s already exists."
msgstr "Filen %s finns redan."
-#: lib/choose_repository.tcl:455
+#: lib/choose_repository.tcl:453
msgid "Clone"
msgstr "Klona"
-#: lib/choose_repository.tcl:468
+#: lib/choose_repository.tcl:466
msgid "URL:"
msgstr "Webbadress:"
-#: lib/choose_repository.tcl:489
+#: lib/choose_repository.tcl:487
msgid "Clone Type:"
msgstr "Typ av klon:"
-#: lib/choose_repository.tcl:495
+#: lib/choose_repository.tcl:493
msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
msgstr "Standard (snabb, semiredundant, hårda länkar)"
-#: lib/choose_repository.tcl:501
+#: lib/choose_repository.tcl:499
msgid "Full Copy (Slower, Redundant Backup)"
msgstr "Full kopia (långsammare, redundant säkerhetskopia)"
-#: lib/choose_repository.tcl:507
+#: lib/choose_repository.tcl:505
msgid "Shared (Fastest, Not Recommended, No Backup)"
msgstr "Delad (snabbast, rekommenderas ej, ingen säkerhetskopia)"
-#: lib/choose_repository.tcl:543 lib/choose_repository.tcl:590
-#: lib/choose_repository.tcl:736 lib/choose_repository.tcl:806
-#: lib/choose_repository.tcl:1017 lib/choose_repository.tcl:1025
+#: lib/choose_repository.tcl:541 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:734 lib/choose_repository.tcl:804
+#: lib/choose_repository.tcl:1013 lib/choose_repository.tcl:1021
#, tcl-format
msgid "Not a Git repository: %s"
msgstr "Inte ett Gitarkiv: %s"
-#: lib/choose_repository.tcl:579
+#: lib/choose_repository.tcl:577
msgid "Standard only available for local repository."
msgstr "Standard är endast tillgängligt för lokala arkiv."
-#: lib/choose_repository.tcl:583
+#: lib/choose_repository.tcl:581
msgid "Shared only available for local repository."
msgstr "Delat är endast tillgängligt för lokala arkiv."
-#: lib/choose_repository.tcl:604
+#: lib/choose_repository.tcl:602
#, tcl-format
msgid "Location %s already exists."
msgstr "Platsen %s finns redan."
-#: lib/choose_repository.tcl:615
+#: lib/choose_repository.tcl:613
msgid "Failed to configure origin"
msgstr "Kunde inte konfigurera ursprung"
-#: lib/choose_repository.tcl:627
+#: lib/choose_repository.tcl:625
msgid "Counting objects"
msgstr "Räknar objekt"
-#: lib/choose_repository.tcl:628
+#: lib/choose_repository.tcl:626
msgid "buckets"
msgstr "hinkar"
-#: lib/choose_repository.tcl:652
+#: lib/choose_repository.tcl:650
#, tcl-format
msgid "Unable to copy objects/info/alternates: %s"
msgstr "Kunde inte kopiera objekt/info/alternativ: %s"
-#: lib/choose_repository.tcl:688
+#: lib/choose_repository.tcl:686
#, tcl-format
msgid "Nothing to clone from %s."
msgstr "Ingenting att klona från %s."
-#: lib/choose_repository.tcl:690 lib/choose_repository.tcl:904
-#: lib/choose_repository.tcl:916
+#: lib/choose_repository.tcl:688 lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:914
msgid "The 'master' branch has not been initialized."
msgstr "Grenen \"master\" har inte initierats."
-#: lib/choose_repository.tcl:703
+#: lib/choose_repository.tcl:701
msgid "Hardlinks are unavailable. Falling back to copying."
msgstr "Hårda länkar är inte tillgängliga. Faller tillbaka på kopiering."
-#: lib/choose_repository.tcl:715
+#: lib/choose_repository.tcl:713
#, tcl-format
msgid "Cloning from %s"
msgstr "Klonar från %s"
-#: lib/choose_repository.tcl:746
+#: lib/choose_repository.tcl:744
msgid "Copying objects"
msgstr "Kopierar objekt"
-#: lib/choose_repository.tcl:747
+#: lib/choose_repository.tcl:745
msgid "KiB"
msgstr "KiB"
-#: lib/choose_repository.tcl:771
+#: lib/choose_repository.tcl:769
#, tcl-format
msgid "Unable to copy object: %s"
msgstr "Kunde inte kopiera objekt: %s"
-#: lib/choose_repository.tcl:781
+#: lib/choose_repository.tcl:779
msgid "Linking objects"
msgstr "Länkar objekt"
-#: lib/choose_repository.tcl:782
+#: lib/choose_repository.tcl:780
msgid "objects"
msgstr "objekt"
-#: lib/choose_repository.tcl:790
+#: lib/choose_repository.tcl:788
#, tcl-format
msgid "Unable to hardlink object: %s"
msgstr "Kunde inte hårdlänka objekt: %s"
-#: lib/choose_repository.tcl:845
+#: lib/choose_repository.tcl:843
msgid "Cannot fetch branches and objects. See console output for details."
msgstr "Kunde inte hämta grenar och objekt. Se konsolutdata för detaljer."
-#: lib/choose_repository.tcl:856
+#: lib/choose_repository.tcl:854
msgid "Cannot fetch tags. See console output for details."
msgstr "Kunde inte hämta taggar. Se konsolutdata för detaljer."
-#: lib/choose_repository.tcl:880
+#: lib/choose_repository.tcl:878
msgid "Cannot determine HEAD. See console output for details."
msgstr "Kunde inte avgöra HEAD. Se konsolutdata för detaljer."
-#: lib/choose_repository.tcl:889
+#: lib/choose_repository.tcl:887
#, tcl-format
msgid "Unable to cleanup %s"
msgstr "Kunde inte städa upp %s"
-#: lib/choose_repository.tcl:895
+#: lib/choose_repository.tcl:893
msgid "Clone failed."
msgstr "Kloning misslyckades."
-#: lib/choose_repository.tcl:902
+#: lib/choose_repository.tcl:900
msgid "No default branch obtained."
msgstr "Hämtade ingen standardgren."
-#: lib/choose_repository.tcl:913
+#: lib/choose_repository.tcl:911
#, tcl-format
msgid "Cannot resolve %s as a commit."
msgstr "Kunde inte slå upp %s till någon incheckning."
-#: lib/choose_repository.tcl:925
+#: lib/choose_repository.tcl:923
msgid "Creating working directory"
msgstr "Skapar arbetskatalog"
-#: lib/choose_repository.tcl:926 lib/index.tcl:65 lib/index.tcl:127
+#: lib/choose_repository.tcl:924 lib/index.tcl:65 lib/index.tcl:127
#: lib/index.tcl:193
msgid "files"
msgstr "filer"
-#: lib/choose_repository.tcl:955
+#: lib/choose_repository.tcl:953
msgid "Initial file checkout failed."
msgstr "Inledande filutcheckning misslyckades."
-#: lib/choose_repository.tcl:971
+#: lib/choose_repository.tcl:969
msgid "Open"
msgstr "Öppna"
-#: lib/choose_repository.tcl:981
+#: lib/choose_repository.tcl:979
msgid "Repository:"
msgstr "Arkiv:"
-#: lib/choose_repository.tcl:1031
+#: lib/choose_repository.tcl:1027
#, tcl-format
msgid "Failed to open repository %s:"
msgstr "Kunde inte öppna arkivet %s:"
@@ -1410,7 +1433,7 @@ msgstr ""
msgid "Invalid date from Git: %s"
msgstr "Ogiltigt datum från Git: %s"
-#: lib/diff.tcl:42
+#: lib/diff.tcl:44
#, tcl-format
msgid ""
"No differences detected.\n"
@@ -1433,40 +1456,48 @@ msgstr ""
"En sökning kommer automatiskt att startas för att hitta andra filer som kan "
"vara i samma tillstånd."
-#: lib/diff.tcl:81
+#: lib/diff.tcl:83
#, tcl-format
msgid "Loading diff of %s..."
msgstr "Läser differens för %s..."
-#: lib/diff.tcl:114 lib/diff.tcl:184
+#: lib/diff.tcl:116 lib/diff.tcl:190
#, tcl-format
msgid "Unable to display %s"
msgstr "Kan inte visa %s"
-#: lib/diff.tcl:115
+#: lib/diff.tcl:117
msgid "Error loading file:"
msgstr "Fel vid läsning av fil:"
-#: lib/diff.tcl:122
+#: lib/diff.tcl:124
msgid "Git Repository (subproject)"
msgstr "Gitarkiv (underprojekt)"
-#: lib/diff.tcl:134
+#: lib/diff.tcl:136
msgid "* Binary file (not showing content)."
msgstr "* Binärfil (visar inte innehållet)."
-#: lib/diff.tcl:185
+#: lib/diff.tcl:191
msgid "Error loading diff:"
msgstr "Fel vid inläsning av differens:"
-#: lib/diff.tcl:303
+#: lib/diff.tcl:313
msgid "Failed to unstage selected hunk."
msgstr "Kunde inte ta bort den valda delen från kön."
-#: lib/diff.tcl:310
+#: lib/diff.tcl:320
msgid "Failed to stage selected hunk."
msgstr "Kunde inte lägga till den valda delen till kön."
+#: lib/diff.tcl:386
+msgid "Failed to unstage selected line."
+msgstr "Kunde inte ta bort den valda raden från kön."
+
+#: lib/diff.tcl:394
+msgid "Failed to stage selected line."
+msgstr "Kunde inte lägga till den valda raden till kön."
+
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "fel"
@@ -1673,11 +1704,11 @@ msgstr "Avbryter"
msgid "files reset"
msgstr "filer återställda"
-#: lib/merge.tcl:265
+#: lib/merge.tcl:266
msgid "Abort failed."
msgstr "Misslyckades avbryta."
-#: lib/merge.tcl:267
+#: lib/merge.tcl:268
msgid "Abort completed. Ready."
msgstr "Avbrytning fullbordad. Redo."
@@ -1731,39 +1762,47 @@ msgid "Match Tracking Branches"
msgstr "Matcha spårade grenar"
#: lib/option.tcl:126
+msgid "Blame Copy Only On Changed Files"
+msgstr "Klandra kopiering bara i ändrade filer"
+
+#: lib/option.tcl:127
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Minsta antal tecken att klandra kopiering för"
+
+#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "Antal rader sammanhang i differenser"
-#: lib/option.tcl:127
+#: lib/option.tcl:129
msgid "Commit Message Text Width"
msgstr "Textbredd för incheckningsmeddelande"
-#: lib/option.tcl:128
+#: lib/option.tcl:130
msgid "New Branch Name Template"
msgstr "Mall för namn på nya grenar"
-#: lib/option.tcl:192
+#: lib/option.tcl:194
msgid "Spelling Dictionary:"
msgstr "Stavningsordlista:"
-#: lib/option.tcl:216
+#: lib/option.tcl:218
msgid "Change Font"
msgstr "Byt teckensnitt"
-#: lib/option.tcl:220
+#: lib/option.tcl:222
#, tcl-format
msgid "Choose %s"
msgstr "Välj %s"
-#: lib/option.tcl:226
+#: lib/option.tcl:228
msgid "pt."
msgstr "p."
-#: lib/option.tcl:240
+#: lib/option.tcl:242
msgid "Preferences"
msgstr "Inställningar"
-#: lib/option.tcl:275
+#: lib/option.tcl:277
msgid "Failed to completely save options:"
msgstr "Misslyckades med att helt spara alternativ:"
@@ -1896,15 +1935,15 @@ msgstr "Stavningskontroll misslyckades tyst vid start"
msgid "Unrecognized spell checker"
msgstr "Stavningskontrollprogrammet känns inte igen"
-#: lib/spellcheck.tcl:180
+#: lib/spellcheck.tcl:186
msgid "No Suggestions"
msgstr "Inga förslag"
-#: lib/spellcheck.tcl:381
+#: lib/spellcheck.tcl:387
msgid "Unexpected EOF from spell checker"
msgstr "Oväntat filslut från stavningskontroll"
-#: lib/spellcheck.tcl:385
+#: lib/spellcheck.tcl:391
msgid "Spell Checker Failed"
msgstr "Stavningskontroll misslyckades"
@@ -1976,5 +2015,17 @@ msgstr "Använd tunt paket (för långsamma nätverksanslutningar)"
msgid "Include tags"
msgstr "Ta med taggar"
+#~ msgid ""
+#~ "Unable to start gitk:\n"
+#~ "\n"
+#~ "%s does not exist"
+#~ msgstr ""
+#~ "Kan inte starta gitk:\n"
+#~ "\n"
+#~ "%s finns inte"
+
+#~ msgid "Apple"
+#~ msgstr "Äpple"
+
#~ msgid "Not connected to aspell"
#~ msgstr "Inte ansluten till aspell"
diff --git a/git-gui/windows/git-gui.sh b/git-gui/windows/git-gui.sh
index 98f32c0a07..53c3a94686 100644
--- a/git-gui/windows/git-gui.sh
+++ b/git-gui/windows/git-gui.sh
@@ -8,9 +8,12 @@ if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
incr argc -2
}
-set gitguidir [file dirname [info script]]
-regsub -all ";" $gitguidir "\\;" gitguidir
-set env(PATH) "$gitguidir;$env(PATH)"
-unset gitguidir
+set bindir [file dirname \
+ [file dirname \
+ [file dirname [info script]]]]
+set bindir [file join $bindir bin]
+regsub -all ";" $bindir "\\;" bindir
+set env(PATH) "$bindir;$env(PATH)"
+unset bindir
source [file join [file dirname [info script]] git-gui.tcl]
diff --git a/git-merge-octopus.sh b/git-merge-octopus.sh
index 645e1147dc..1dadbb4966 100755
--- a/git-merge-octopus.sh
+++ b/git-merge-octopus.sh
@@ -61,7 +61,7 @@ do
exit 2
esac
- common=$(git merge-base --all $MRC $SHA1) ||
+ common=$(git merge-base --all $SHA1 $MRC) ||
die "Unable to find common commit with $SHA1"
case "$LF$common$LF" in
@@ -100,14 +100,7 @@ do
next=$(git write-tree 2>/dev/null)
fi
- # We have merged the other branch successfully. Ideally
- # we could implement OR'ed heads in merge-base, and keep
- # a list of commits we have merged so far in MRC to feed
- # them to merge-base, but we approximate it by keep using
- # the current MRC. We used to update it to $common, which
- # was incorrectly doing AND'ed merge-base here, which was
- # unneeded.
-
+ MRC="$MRC $SHA1"
MRT=$next
done
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 4e334ba41d..929d681c47 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -145,7 +145,16 @@ pick_one () {
}
pick_one_preserving_merges () {
- case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac
+ fast_forward=t
+ case "$1" in
+ -n)
+ fast_forward=f
+ sha1=$2
+ ;;
+ *)
+ sha1=$1
+ ;;
+ esac
sha1=$(git rev-parse $sha1)
if test -f "$DOTEST"/current-commit
@@ -156,15 +165,14 @@ pick_one_preserving_merges () {
die "Cannot write current commit's replacement sha1"
fi
+ echo $sha1 > "$DOTEST"/current-commit
+
# rewrite parents; if none were rewritten, we can fast-forward.
- fast_forward=t
- preserve=t
new_parents=
for p in $(git rev-list --parents -1 $sha1 | cut -d' ' -f2-)
do
if test -f "$REWRITTEN"/$p
then
- preserve=f
new_p=$(cat "$REWRITTEN"/$p)
test $p != $new_p && fast_forward=f
case "$new_parents" in
@@ -181,7 +189,8 @@ pick_one_preserving_merges () {
case $fast_forward in
t)
output warn "Fast forward to $sha1"
- test $preserve = f || echo $sha1 > "$REWRITTEN"/$sha1
+ output git reset --hard $sha1 ||
+ die "Cannot fast forward to $sha1"
;;
f)
test "a$1" = a-n && die "Refusing to squash a merge: $sha1"
@@ -191,7 +200,6 @@ pick_one_preserving_merges () {
output git checkout $first_parent 2> /dev/null ||
die "Cannot move HEAD to $first_parent"
- echo $sha1 > "$DOTEST"/current-commit
case "$new_parents" in
' '*' '*)
# redo merge
diff --git a/git-rebase.sh b/git-rebase.sh
index 412e135c3a..528b604cd5 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -144,8 +144,19 @@ is_interactive () {
done && test -n "$1"
}
+test -f "$GIT_DIR"/rebase-apply/applying &&
+ die 'It looks like git-am is in progress. Cannot rebase.'
+
is_interactive "$@" && exec git-rebase--interactive "$@"
+if test $# -eq 0
+then
+ test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply || usage
+ test -d "$dotest" -o -f "$GIT_DIR"/rebase-apply/rebasing &&
+ die 'A rebase is in progress, try --continue, --skip or --abort.'
+ die "No arguments given and $GIT_DIR/rebase-apply already exists."
+fi
+
while test $# != 0
do
case "$1" in
@@ -268,16 +279,16 @@ done
# Make sure we do not have $GIT_DIR/rebase-apply
if test -z "$do_merge"
then
- if mkdir "$GIT_DIR"/rebase-apply
+ if mkdir "$GIT_DIR"/rebase-apply 2>/dev/null
then
rmdir "$GIT_DIR"/rebase-apply
else
echo >&2 '
-It seems that I cannot create a '"$GIT_DIR"'/rebase-apply directory,
-and I wonder if you are in the middle of patch application or another
+It seems that I cannot create a rebase-apply directory, and
+I wonder if you are in the middle of patch application or another
rebase. If that is not the case, please
rm -fr '"$GIT_DIR"'/rebase-apply
- and run me again. I am stopping in case you still have something
+and run me again. I am stopping in case you still have something
valuable there.'
exit 1
fi
@@ -285,7 +296,7 @@ else
if test -d "$dotest"
then
die "previous rebase directory $dotest still exists." \
- 'try git-rebase < --continue | --abort >'
+ 'Try git rebase (--continue | --abort | --skip)'
fi
fi
diff --git a/git-stash.sh b/git-stash.sh
index d4609ed66e..e15c12abc3 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -1,7 +1,13 @@
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | save | list | show | apply | clear | drop | pop | create ]'
+dashless=$(basename "$0" | sed -e 's/-/ /')
+USAGE="list [<options>]
+ or: $dashless (show | drop | pop ) [<stash>]
+ or: $dashless apply [--index] [<stash>]
+ or: $dashless branch <branchname> [<stash>]
+ or: $dashless [save [--keep-index] [<message>]]
+ or: $dashless clear"
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
diff --git a/git-submodule.sh b/git-submodule.sh
index b40f876a2c..1c39b593a6 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -6,9 +6,10 @@
USAGE="[--quiet] [--cached] \
[add <repo> [-b branch] <path>]|[status|init|update [-i|--init]|summary [-n|--summary-limit <n>] [<commit>]] \
-[--] [<path>...]"
+[--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]"
OPTIONS_SPEC=
. git-sh-setup
+. git-parse-remote
require_work_tree
command=
@@ -30,12 +31,11 @@ say()
# Resolve relative url by appending to parent's url
resolve_relative_url ()
{
- branch="$(git symbolic-ref HEAD 2>/dev/null)"
- remote="$(git config branch.${branch#refs/heads/}.remote)"
- remote="${remote:-origin}"
+ remote=$(get_default_remote)
remoteurl=$(git config "remote.$remote.url") ||
die "remote ($remote) does not have a url defined in .git/config"
url="$1"
+ remoteurl=${remoteurl%/}
while test -n "$url"
do
case "$url" in
@@ -50,7 +50,16 @@ resolve_relative_url ()
break;;
esac
done
- echo "$remoteurl/$url"
+ echo "$remoteurl/${url%/}"
+}
+
+#
+# Get submodule info for registered submodules
+# $@ = path to limit submodule list
+#
+module_list()
+{
+ git ls-files --stage -- "$@" | grep '^160000 '
}
#
@@ -199,6 +208,26 @@ cmd_add()
}
#
+# Execute an arbitrary command sequence in each checked out
+# submodule
+#
+# $@ = command to execute
+#
+cmd_foreach()
+{
+ module_list |
+ while read mode sha1 stage path
+ do
+ if test -e "$path"/.git
+ then
+ say "Entering '$path'"
+ (cd "$path" && eval "$@") ||
+ die "Stopping at '$path'; script returned non-zero status."
+ fi
+ done
+}
+
+#
# Register submodules in .git/config
#
# $@ = requested paths (default to all)
@@ -226,7 +255,7 @@ cmd_init()
shift
done
- git ls-files --stage -- "$@" | grep '^160000 ' |
+ module_list "$@" |
while read mode sha1 stage path
do
# Skip already registered paths
@@ -284,7 +313,7 @@ cmd_update()
esac
done
- git ls-files --stage -- "$@" | grep '^160000 ' |
+ module_list "$@" |
while read mode sha1 stage path
do
name=$(module_name "$path") || exit
@@ -549,7 +578,7 @@ cmd_status()
shift
done
- git ls-files --stage -- "$@" | grep '^160000 ' |
+ module_list "$@" |
while read mode sha1 stage path
do
name=$(module_name "$path") || exit
@@ -573,6 +602,50 @@ cmd_status()
fi
done
}
+#
+# Sync remote urls for submodules
+# This makes the value for remote.$remote.url match the value
+# specified in .gitmodules.
+#
+cmd_sync()
+{
+ while test $# -ne 0
+ do
+ case "$1" in
+ -q|--quiet)
+ quiet=1
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ usage
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ cd_to_toplevel
+ module_list "$@" |
+ while read mode sha1 stage path
+ do
+ name=$(module_name "$path")
+ url=$(git config -f .gitmodules --get submodule."$name".url)
+ if test -e "$path"/.git
+ then
+ (
+ unset GIT_DIR
+ cd "$path"
+ remote=$(get_default_remote)
+ say "Synchronizing submodule url for '$name'"
+ git config remote."$remote".url "$url"
+ )
+ fi
+ done
+}
# This loop parses the command line arguments to find the
# subcommand name to dispatch. Parsing of the subcommand specific
@@ -583,7 +656,7 @@ cmd_status()
while test $# != 0 && test -z "$command"
do
case "$1" in
- add | init | update | status | summary)
+ add | foreach | init | update | status | summary | sync)
command=$1
;;
-q|--quiet)
diff --git a/git-svn.perl b/git-svn.perl
index cf6dbbc427..7a1d26db8b 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,
$_version, $_fetch_all, $_no_rebase,
$_merge, $_strategy, $_dry_run, $_local,
$_prefix, $_no_checkout, $_url, $_verbose,
- $_git_format);
+ $_git_format, $_commit_url);
$Git::SVN::_follow_parent = 1;
my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
'config-dir=s' => \$Git::SVN::Ra::config_dir,
@@ -127,6 +127,8 @@ my %cmd = (
'verbose|v' => \$_verbose,
'dry-run|n' => \$_dry_run,
'fetch-all|all' => \$_fetch_all,
+ 'commit-url=s' => \$_commit_url,
+ 'revision|r=i' => \$_revision,
'no-rebase' => \$_no_rebase,
%cmt_opts, %fc_opts } ],
'set-tree' => [ \&cmd_set_tree,
@@ -169,7 +171,8 @@ my %cmd = (
'color' => \$Git::SVN::Log::color,
'pager=s' => \$Git::SVN::Log::pager
} ],
- 'find-rev' => [ \&cmd_find_rev, "Translate between SVN revision numbers and tree-ish",
+ 'find-rev' => [ \&cmd_find_rev,
+ "Translate between SVN revision numbers and tree-ish",
{} ],
'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
{ 'merge|m|M' => \$_merge,
@@ -229,7 +232,9 @@ unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
read_repo_config(\%opts);
-Getopt::Long::Configure('pass_through') if ($cmd && ($cmd eq 'log' || $cmd eq 'blame'));
+if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
+ Getopt::Long::Configure('pass_through');
+}
my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
'minimize-connections' => \$Git::SVN::Migration::_minimize,
'id|i=s' => \$Git::SVN::default_ref_id,
@@ -416,6 +421,8 @@ sub cmd_dcommit {
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
+ $url = defined $_commit_url ? $_commit_url : $gs->full_url;
+ my $last_rev = $_revision if defined $_revision;
if ($url) {
print "Committing to $url ...\n";
}
@@ -423,7 +430,6 @@ sub cmd_dcommit {
die "Unable to determine upstream SVN information from ",
"$head history.\nPerhaps the repository is empty.";
}
- my $last_rev;
my ($linear_refs, $parents) = linearize_history($gs, \@refs);
if ($_no_rebase && scalar(@$linear_refs) > 1) {
warn "Attempting to commit more than one change while ",
@@ -431,6 +437,8 @@ sub cmd_dcommit {
"If these changes depend on each other, re-running ",
"without --no-rebase may be required."
}
+ my $expect_url = $url;
+ Git::SVN::remove_username($expect_url);
while (1) {
my $d = shift @$linear_refs or last;
unless (defined $last_rev) {
@@ -446,7 +454,7 @@ sub cmd_dcommit {
my $cmt_rev;
my %ed_opts = ( r => $last_rev,
log => get_commit_entry($d)->{log},
- ra => Git::SVN::Ra->new($gs->full_url),
+ ra => Git::SVN::Ra->new($url),
config => SVN::Core::config_get_config(
$Git::SVN::Ra::config_dir
),
@@ -505,9 +513,9 @@ sub cmd_dcommit {
$gs->refname,
"\nBefore dcommitting";
}
- if ($url_ ne $url) {
+ if ($url_ ne $expect_url) {
fatal "URL mismatch after rebase: ",
- "$url_ != $url";
+ "$url_ != $expect_url";
}
if ($uuid_ ne $uuid) {
fatal "uuid mismatch after rebase: ",
@@ -796,8 +804,8 @@ sub cmd_commit_diff {
}
sub cmd_info {
- my $path = canonicalize_path(shift or ".");
- unless (scalar(@_) == 0) {
+ my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
+ if (exists $_[1]) {
die "Too many arguments specified\n";
}
@@ -813,6 +821,10 @@ sub cmd_info {
die "Unable to determine upstream SVN information from ",
"working tree history\n";
}
+
+ # canonicalize_path() will return "" to make libsvn 1.5.x happy,
+ $path = "." if $path eq "";
+
my $full_url = $url . ($path eq "." ? "" : "/$path");
if ($_url) {
@@ -980,8 +992,10 @@ sub complete_url_ls_init {
if (length $pfx && $pfx !~ m#/$#) {
die "--prefix='$pfx' must have a trailing slash '/'\n";
}
- command_noisy('config', "svn-remote.$gs->{repo_id}.$n",
- "$remote_path:refs/remotes/$pfx*");
+ command_noisy('config',
+ "svn-remote.$gs->{repo_id}.$n",
+ "$remote_path:refs/remotes/$pfx*" .
+ ('/*' x (($remote_path =~ tr/*/*/) - 1)) );
}
sub verify_ref {
@@ -1253,7 +1267,7 @@ sub md5sum {
my $arg = shift;
my $ref = ref $arg;
my $md5 = Digest::MD5->new();
- if ($ref eq 'GLOB' || $ref eq 'IO::File') {
+ if ($ref eq 'GLOB' || $ref eq 'IO::File' || $ref eq 'File::Temp') {
$md5->addfile($arg) or croak $!;
} elsif ($ref eq 'SCALAR') {
$md5->add($$arg) or croak $!;
@@ -1316,6 +1330,7 @@ BEGIN {
}
}
+
my (%LOCKFILES, %INDEX_FILES);
END {
unlink keys %LOCKFILES if %LOCKFILES;
@@ -1420,8 +1435,12 @@ sub read_all_remotes {
svn.useSvmProps/) };
$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;
foreach (grep { s/^svn-remote\.// } command(qw/config -l/)) {
- if (m!^(.+)\.fetch=\s*(.*)\s*:\s*refs/remotes/(.+)\s*$!) {
- my ($remote, $local_ref, $remote_ref) = ($1, $2, $3);
+ if (m!^(.+)\.fetch=\s*(.*)\s*:\s*(.+)\s*$!) {
+ my ($remote, $local_ref, $_remote_ref) = ($1, $2, $3);
+ die("svn-remote.$remote: remote ref '$_remote_ref' "
+ . "must start with 'refs/remotes/'\n")
+ unless $_remote_ref =~ m{^refs/remotes/(.+)};
+ my $remote_ref = $1;
$local_ref =~ s{^/}{};
$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;
$r->{$remote}->{svm} = {} if $use_svm_props;
@@ -3214,13 +3233,11 @@ sub change_file_prop {
sub apply_textdelta {
my ($self, $fb, $exp) = @_;
- my $fh = IO::File->new_tmpfile;
- $fh->autoflush(1);
+ my $fh = Git::temp_acquire('svn_delta');
# $fh gets auto-closed() by SVN::TxDelta::apply(),
# (but $base does not,) so dup() it for reading in close_file
open my $dup, '<&', $fh or croak $!;
- my $base = IO::File->new_tmpfile;
- $base->autoflush(1);
+ my $base = Git::temp_acquire('git_blob');
if ($fb->{blob}) {
print $base 'link ' if ($fb->{mode_a} == 120000);
my $size = $::_repository->cat_blob($fb->{blob}, $base);
@@ -3235,9 +3252,9 @@ sub apply_textdelta {
}
}
seek $base, 0, 0 or croak $!;
- $fb->{fh} = $dup;
+ $fb->{fh} = $fh;
$fb->{base} = $base;
- [ SVN::TxDelta::apply($base, $fh, undef, $fb->{path}, $fb->{pool}) ];
+ [ SVN::TxDelta::apply($base, $dup, undef, $fb->{path}, $fb->{pool}) ];
}
sub close_file {
@@ -3253,35 +3270,36 @@ sub close_file {
"expected: $exp\n got: $got\n";
}
}
- sysseek($fh, 0, 0) or croak $!;
if ($fb->{mode_b} == 120000) {
- eval {
- sysread($fh, my $buf, 5) == 5 or croak $!;
- $buf eq 'link ' or die "$path has mode 120000",
- " but is not a link";
- };
- if ($@) {
- warn "$@\n";
- sysseek($fh, 0, 0) or croak $!;
- }
- }
+ sysseek($fh, 0, 0) or croak $!;
+ sysread($fh, my $buf, 5) == 5 or croak $!;
- my ($tmp_fh, $tmp_filename) = File::Temp::tempfile(UNLINK => 1);
- my $result;
- while ($result = sysread($fh, my $string, 1024)) {
- my $wrote = syswrite($tmp_fh, $string, $result);
- defined($wrote) && $wrote == $result
- or croak("write $tmp_filename: $!\n");
- }
- defined $result or croak $!;
- close $tmp_fh or croak $!;
+ unless ($buf eq 'link ') {
+ warn "$path has mode 120000",
+ " but is not a link\n";
+ } else {
+ my $tmp_fh = Git::temp_acquire('svn_hash');
+ my $res;
+ while ($res = sysread($fh, my $str, 1024)) {
+ my $out = syswrite($tmp_fh, $str, $res);
+ defined($out) && $out == $res
+ or croak("write ",
+ $tmp_fh->filename,
+ ": $!\n");
+ }
+ defined $res or croak $!;
- close $fh or croak $!;
+ ($fh, $tmp_fh) = ($tmp_fh, $fh);
+ Git::temp_release($tmp_fh, 1);
+ }
+ }
- $hash = $::_repository->hash_and_insert_object($tmp_filename);
- unlink($tmp_filename);
+ $hash = $::_repository->hash_and_insert_object(
+ $fh->filename);
$hash =~ /^[a-f\d]{40}$/ or die "not a sha1: $hash\n";
- close $fb->{base} or croak $!;
+
+ Git::temp_release($fb->{base}, 1);
+ Git::temp_release($fh, 1);
} else {
$hash = $fb->{blob} or die "no blob information\n";
}
@@ -3651,7 +3669,7 @@ sub chg_file {
} elsif ($m->{mode_b} !~ /755$/ && $m->{mode_a} =~ /755$/) {
$self->change_file_prop($fbat,'svn:executable',undef);
}
- my $fh = IO::File->new_tmpfile or croak $!;
+ my $fh = Git::temp_acquire('git_blob');
if ($m->{mode_b} =~ /^120/) {
print $fh 'link ' or croak $!;
$self->change_file_prop($fbat,'svn:special','*');
@@ -3670,9 +3688,8 @@ sub chg_file {
my $atd = $self->apply_textdelta($fbat, undef, $pool);
my $got = SVN::TxDelta::send_stream($fh, @$atd, $pool);
die "Checksum mismatch\nexpected: $exp\ngot: $got\n" if ($got ne $exp);
+ Git::temp_release($fh, 1);
$pool->clear;
-
- close $fh or croak $!;
}
sub D {
@@ -4113,16 +4130,38 @@ sub gs_fetch_loop_common {
Git::SVN::gc();
}
+sub get_dir_globbed {
+ my ($self, $left, $depth, $r) = @_;
+
+ my @x = eval { $self->get_dir($left, $r) };
+ return unless scalar @x == 3;
+ my $dirents = $x[0];
+ my @finalents;
+ foreach my $de (keys %$dirents) {
+ next if $dirents->{$de}->{kind} != $SVN::Node::dir;
+ if ($depth > 1) {
+ my @args = ("$left/$de", $depth - 1, $r);
+ foreach my $dir ($self->get_dir_globbed(@args)) {
+ push @finalents, "$de/$dir";
+ }
+ } else {
+ push @finalents, $de;
+ }
+ }
+ @finalents;
+}
+
sub match_globs {
my ($self, $exists, $paths, $globs, $r) = @_;
sub get_dir_check {
my ($self, $exists, $g, $r) = @_;
- my @x = eval { $self->get_dir($g->{path}->{left}, $r) };
- return unless scalar @x == 3;
- my $dirents = $x[0];
- foreach my $de (keys %$dirents) {
- next if $dirents->{$de}->{kind} != $SVN::Node::dir;
+
+ my @dirs = $self->get_dir_globbed($g->{path}->{left},
+ $g->{path}->{depth},
+ $r);
+
+ foreach my $de (@dirs) {
my $p = $g->{path}->full_path($de);
next if $exists->{$p};
next if (length $g->{path}->{right} &&
@@ -4904,15 +4943,20 @@ sub new {
my ($class, $glob) = @_;
my $re = $glob;
$re =~ s!/+$!!g; # no need for trailing slashes
- my $nr = ($re =~ s!^(.*)\*(.*)$!\(\[^/\]+\)!g);
- my ($left, $right) = ($1, $2);
- if ($nr > 1) {
- die "Only one '*' wildcard expansion ",
- "is supported (got $nr): '$glob'\n";
- } elsif ($nr == 0) {
+ $re =~ m!^([^*]*)(\*(?:/\*)*)([^*]*)$!;
+ my $temp = $re;
+ my ($left, $right) = ($1, $3);
+ $re = $2;
+ my $depth = $re =~ tr/*/*/;
+ if ($depth != $temp =~ tr/*/*/) {
+ die "Only one set of wildcard directories " .
+ "(e.g. '*' or '*/*/*') is supported: '$glob'\n";
+ }
+ if ($depth == 0) {
die "One '*' is needed for glob: '$glob'\n";
}
- $re = quotemeta($left) . $re . quotemeta($right);
+ $re =~ s!\*!\[^/\]*!g;
+ $re = quotemeta($left) . "($re)" . quotemeta($right);
if (length $left && !($left =~ s!/+$!!g)) {
die "Missing trailing '/' on left side of: '$glob' ($left)\n";
}
@@ -4921,7 +4965,7 @@ sub new {
}
my $left_re = qr/^\/\Q$left\E(\/|$)/;
bless { left => $left, right => $right, left_regex => $left_re,
- regex => qr/$re/, glob => $glob }, $class;
+ regex => qr/$re/, glob => $glob, depth => $depth }, $class;
}
sub full_path {
diff --git a/gitk-git/gitk b/gitk-git/gitk
index fddcb45817..087c4ac733 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -22,11 +22,11 @@ proc gitdir {} {
# run before X event handlers, so reading from a fast source can
# make the GUI completely unresponsive.
proc run args {
- global isonrunq runq
+ global isonrunq runq currunq
set script $args
if {[info exists isonrunq($script)]} return
- if {$runq eq {}} {
+ if {$runq eq {} && ![info exists currunq]} {
after idle dorunq
}
lappend runq [list {} $script]
@@ -38,10 +38,10 @@ proc filerun {fd script} {
}
proc filereadable {fd script} {
- global runq
+ global runq currunq
fileevent $fd readable {}
- if {$runq eq {}} {
+ if {$runq eq {} && ![info exists currunq]} {
after idle dorunq
}
lappend runq [list $fd $script]
@@ -60,17 +60,19 @@ proc nukefile {fd} {
}
proc dorunq {} {
- global isonrunq runq
+ global isonrunq runq currunq
set tstart [clock clicks -milliseconds]
set t0 $tstart
while {[llength $runq] > 0} {
set fd [lindex $runq 0 0]
set script [lindex $runq 0 1]
+ set currunq [lindex $runq 0]
+ set runq [lrange $runq 1 end]
set repeat [eval $script]
+ unset currunq
set t1 [clock clicks -milliseconds]
set t [expr {$t1 - $t0}]
- set runq [lrange $runq 1 end]
if {$repeat ne {} && $repeat} {
if {$fd eq {} || $repeat == 2} {
# script returns 1 if it wants to be readded
@@ -90,6 +92,15 @@ proc dorunq {} {
}
}
+proc reg_instance {fd} {
+ global commfd leftover loginstance
+
+ set i [incr loginstance]
+ set commfd($i) $fd
+ set leftover($i) {}
+ return $i
+}
+
proc unmerged_files {files} {
global nr_unmerged
@@ -294,11 +305,11 @@ proc parseviewrevs {view revs} {
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
global startmsecs commitidx viewcomplete curview
- global commfd leftover tclencoding
+ global tclencoding
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest
- global viewactive loginstance viewinstances vmergeonly
- global pending_select mainheadid
+ global viewactive viewinstances vmergeonly
+ global mainheadid
global vcanopt vflags vrevs vorigargs
set startmsecs [clock clicks -milliseconds]
@@ -354,10 +365,8 @@ proc start_rev_list {view} {
error_popup "[mc "Error executing git log:"] $err"
return 0
}
- set i [incr loginstance]
+ set i [reg_instance $fd]
set viewinstances($view) [list $i]
- set commfd($i) $fd
- set leftover($i) {}
if {$showlocalchanges && $mainheadid ne {}} {
lappend commitinterest($mainheadid) {dodiffindex}
}
@@ -367,36 +376,63 @@ proc start_rev_list {view} {
}
filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"]
- if {$view == $curview} {
- set pending_select $mainheadid
- }
set viewcomplete($view) 0
set viewactive($view) 1
return 1
}
-proc stop_rev_list {view} {
- global commfd viewinstances leftover
+proc stop_instance {inst} {
+ global commfd leftover
- foreach inst $viewinstances($view) {
- set fd $commfd($inst)
- catch {
- set pid [pid $fd]
+ set fd $commfd($inst)
+ catch {
+ set pid [pid $fd]
+
+ if {$::tcl_platform(platform) eq {windows}} {
+ exec kill -f $pid
+ } else {
exec kill $pid
}
- catch {close $fd}
- nukefile $fd
- unset commfd($inst)
- unset leftover($inst)
+ }
+ catch {close $fd}
+ nukefile $fd
+ unset commfd($inst)
+ unset leftover($inst)
+}
+
+proc stop_backends {} {
+ global commfd
+
+ foreach inst [array names commfd] {
+ stop_instance $inst
+ }
+}
+
+proc stop_rev_list {view} {
+ global viewinstances
+
+ foreach inst $viewinstances($view) {
+ stop_instance $inst
}
set viewinstances($view) {}
}
-proc getcommits {} {
+proc reset_pending_select {selid} {
+ global pending_select mainheadid
+
+ if {$selid ne {}} {
+ set pending_select $selid
+ } else {
+ set pending_select $mainheadid
+ }
+}
+
+proc getcommits {selid} {
global canv curview need_redisplay viewactive
initlayout
if {[start_rev_list $curview]} {
+ reset_pending_select $selid
show_status [mc "Reading commits..."]
set need_redisplay 1
} else {
@@ -406,8 +442,8 @@ proc getcommits {} {
proc updatecommits {} {
global curview vcanopt vorigargs vfilelimit viewinstances
- global viewactive viewcomplete loginstance tclencoding
- global startmsecs commfd showneartags showlocalchanges leftover
+ global viewactive viewcomplete tclencoding
+ global startmsecs showneartags showlocalchanges
global mainheadid pending_select
global isworktree
global varcid vposids vnegids vflags vrevs
@@ -468,10 +504,8 @@ proc updatecommits {} {
if {$viewactive($view) == 0} {
set startmsecs [clock clicks -milliseconds]
}
- set i [incr loginstance]
+ set i [reg_instance $fd]
lappend viewinstances($view) $i
- set commfd($i) $fd
- set leftover($i) {}
fconfigure $fd -blocking 0 -translation lf -eofchar {}
if {$tclencoding != {}} {
fconfigure $fd -encoding $tclencoding
@@ -479,7 +513,7 @@ proc updatecommits {} {
filerun $fd [list getcommitlines $fd $i $view 1]
incr viewactive($view)
set viewcomplete($view) 0
- set pending_select $mainheadid
+ reset_pending_select {}
nowbusy $view "Reading"
if {$showneartags} {
getallcommits
@@ -491,6 +525,11 @@ proc reloadcommits {} {
global showneartags treediffs commitinterest cached_commitrow
global targetid
+ set selid {}
+ if {$selectedline ne {}} {
+ set selid $currentid
+ }
+
if {!$viewcomplete($curview)} {
stop_rev_list $curview
}
@@ -509,7 +548,7 @@ proc reloadcommits {} {
catch {unset cached_commitrow}
catch {unset targetid}
setcanvscroll
- getcommits
+ getcommits $selid
return 0
}
@@ -1469,8 +1508,15 @@ proc chewcommits {} {
global numcommits startmsecs
if {[info exists pending_select]} {
- set row [first_real_row]
- selectline $row 1
+ update
+ reset_pending_select {}
+
+ if {[commitinview $pending_select $curview]} {
+ selectline [rowofcommit $pending_select] 1
+ } else {
+ set row [first_real_row]
+ selectline $row 1
+ }
}
if {$commitidx($curview) > 0} {
#set ms [expr {[clock clicks -milliseconds] - $startmsecs}]
@@ -2103,6 +2149,7 @@ proc makewindow {} {
bind . <$M1B-minus> {incrfont -1}
bind . <$M1B-KP_Subtract> {incrfont -1}
wm protocol . WM_DELETE_WINDOW doquit
+ bind . <Destroy> {stop_backends}
bind . <Button-1> "click %W"
bind $fstring <Key-Return> {dofind 1 1}
bind $sha1entry <Key-Return> gotocommit
@@ -3300,10 +3347,7 @@ proc showview {n} {
run refill_reflist
if {![info exists viewcomplete($n)]} {
- if {$selid ne {}} {
- set pending_select $selid
- }
- getcommits
+ getcommits $selid
return
}
@@ -3337,18 +3381,18 @@ proc showview {n} {
drawvisible
if {$row ne {}} {
selectline $row 0
- } elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
- selectline [rowofcommit $mainheadid] 1
} elseif {!$viewcomplete($n)} {
- if {$selid ne {}} {
- set pending_select $selid
- } else {
- set pending_select $mainheadid
- }
+ reset_pending_select $selid
} else {
- set row [first_real_row]
- if {$row < $numcommits} {
- selectline $row 0
+ reset_pending_select {}
+
+ if {[commitinview $pending_select $curview]} {
+ selectline [rowofcommit $pending_select] 1
+ } else {
+ set row [first_real_row]
+ if {$row < $numcommits} {
+ selectline $row 0
+ }
}
}
if {!$viewcomplete($n)} {
@@ -4011,6 +4055,7 @@ proc layoutmore {} {
}
if {[info exists pending_select] &&
[commitinview $pending_select $curview]} {
+ update
selectline [rowofcommit $pending_select] 1
}
drawvisible
@@ -4048,10 +4093,11 @@ proc dodiffindex {} {
incr lserial
set fd [open "|git diff-index --cached HEAD" r]
fconfigure $fd -blocking 0
- filerun $fd [list readdiffindex $fd $lserial]
+ set i [reg_instance $fd]
+ filerun $fd [list readdiffindex $fd $lserial $i]
}
-proc readdiffindex {fd serial} {
+proc readdiffindex {fd serial inst} {
global mainheadid nullid nullid2 curview commitinfo commitdata lserial
set isdiff 1
@@ -4062,7 +4108,7 @@ proc readdiffindex {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
- close $fd
+ stop_instance $inst
if {$serial != $lserial} {
return 0
@@ -4071,7 +4117,8 @@ proc readdiffindex {fd serial} {
# now see if there are any local changes not checked in to the index
set fd [open "|git diff-files" r]
fconfigure $fd -blocking 0
- filerun $fd [list readdifffiles $fd $serial]
+ set i [reg_instance $fd]
+ filerun $fd [list readdifffiles $fd $serial $i]
if {$isdiff && ![commitinview $nullid2 $curview]} {
# add the line for the changes in the index to the graph
@@ -4088,7 +4135,7 @@ proc readdiffindex {fd serial} {
return 0
}
-proc readdifffiles {fd serial} {
+proc readdifffiles {fd serial inst} {
global mainheadid nullid nullid2 curview
global commitinfo commitdata lserial
@@ -4100,7 +4147,7 @@ proc readdifffiles {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
- close $fd
+ stop_instance $inst
if {$serial != $lserial} {
return 0
@@ -6430,9 +6477,10 @@ proc diffcmd {ids flags} {
proc gettreediffs {ids} {
global treediff treepending
+ if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
+
set treepending $ids
set treediff {}
- if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
fconfigure $gdtf -blocking 0
filerun $gdtf [list gettreediffline $gdtf $ids]
}
@@ -9945,4 +9993,4 @@ if {[info exists permviews]} {
addviewmenu $n
}
}
-getcommits
+getcommits {}
diff --git a/gitk-git/po/de.po b/gitk-git/po/de.po
index b9867bf8e0..04ee570995 100644
--- a/gitk-git/po/de.po
+++ b/gitk-git/po/de.po
@@ -7,19 +7,37 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-01 11:54+0200\n"
-"PO-Revision-Date: 2008-05-02 21:12+0200\n"
+"POT-Creation-Date: 2008-05-24 22:32+0200\n"
+"PO-Revision-Date: 2008-05-24 22:40+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: gitk:111
-msgid "Error executing git rev-list:"
-msgstr "Fehler beim Ausführen von git-rev-list:"
+#: gitk:102
+msgid "Couldn't get list of unmerged files:"
+msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
+
+#: gitk:329
+msgid "No files selected: --merge specified but no files are unmerged."
+msgstr ""
+"Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-"
+"zusammengeführten Dateien."
+
+#: gitk:332
+msgid ""
+"No files selected: --merge specified but no unmerged files are within file "
+"limit."
+msgstr ""
+"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
+"zusammengeführten Dateien sind in der Dateiauswahl."
-#: gitk:124
+#: gitk:354
+msgid "Error executing git log:"
+msgstr "Fehler beim Ausführen von git-log:"
+
+#: gitk:369
msgid "Reading"
msgstr "Lesen"
@@ -56,7 +74,11 @@ msgstr "Datei"
msgid "Update"
msgstr "Aktualisieren"
-#: gitk:664
+#: gitk:1722
+msgid "Reload"
+msgstr "Neu laden"
+
+#: gitk:1723
msgid "Reread references"
msgstr "Zweige neu laden"
@@ -112,7 +134,11 @@ msgstr "Tastenkürzel"
msgid "SHA1 ID: "
msgstr "SHA1:"
-#: gitk:791
+#: gitk:1831
+msgid "Row"
+msgstr "Zeile"
+
+#: gitk:1862
msgid "Find"
msgstr "Suche"
@@ -126,19 +152,19 @@ msgstr "vorige"
#: gitk:794
msgid "commit"
-msgstr "Version"
+msgstr "Version nach"
#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
msgid "containing:"
-msgstr "enthaltend:"
+msgstr "Beschreibung:"
#: gitk:800 gitk:1778 gitk:1783 gitk:2431
msgid "touching paths:"
-msgstr "Pfad betreffend:"
+msgstr "Dateien:"
#: gitk:801 gitk:2436
msgid "adding/removing string:"
-msgstr "Zeichenkette ändernd:"
+msgstr "Änderungen:"
#: gitk:810 gitk:812
msgid "Exact"
@@ -253,23 +279,25 @@ msgstr "Diesen auch hervorheben"
msgid "Highlight this only"
msgstr "Nur diesen hervorheben"
-#: gitk:1318
+#: gitk:2162
+msgid "External diff"
+msgstr "Externer Vergleich"
+
+#: gitk:2403
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Use and redistribute under the terms of the GNU General Public License"
msgstr ""
"\n"
"Gitk - eine Visualisierung der Git Historie\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
-"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public "
-"License\n"
-" "
+"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License"
#: gitk:1326 gitk:1387 gitk:6582
msgid "Close"
@@ -450,11 +478,11 @@ msgstr "Name"
msgid "Remember this view"
msgstr "Diese Ansicht speichern"
-#: gitk:1928
-msgid "Commits to include (arguments to git rev-list):"
-msgstr "Versionen anzeigen (Argumente von git-rev-list):"
+#: gitk:3126
+msgid "Commits to include (arguments to git log):"
+msgstr "Versionen anzeigen (Argumente von git-log):"
-#: gitk:1935
+#: gitk:3133
msgid "Command to generate more commits to include:"
msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:"
@@ -566,7 +594,11 @@ msgstr "Kinder"
msgid "Reset %s branch to here"
msgstr "Zweig »%s« hierher zurücksetzen"
-#: gitk:6050
+#: gitk:7204
+msgid "Detached head: can't reset"
+msgstr "Zweigspitze ist abgetrennt: Zurücksetzen nicht möglich"
+
+#: gitk:7236
msgid "Top"
msgstr "Oben"
@@ -798,7 +830,15 @@ msgstr "Naheliegende Überschriften anzeigen"
msgid "Limit diffs to listed paths"
msgstr "Vergleich nur für angezeigte Pfade"
-#: gitk:8045
+#: gitk:9264
+msgid "External diff tool"
+msgstr "Externes Vergleich-(Diff-)Programm"
+
+#: gitk:9266
+msgid "Choose..."
+msgstr "Wählen..."
+
+#: gitk:9271
msgid "Colors: press to choose"
msgstr "Farben: Klicken zum Wählen"
@@ -873,22 +913,6 @@ msgstr "Mehrdeutige Angabe »%s«: Sowohl Version als auch Dateiname existiert."
msgid "Bad arguments to gitk:"
msgstr "Falsche Kommandozeilen-Parameter für gitk:"
-#: gitk:8637
-msgid "Couldn't get list of unmerged files:"
-msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
-
-#: gitk:8653
-msgid "No files selected: --merge specified but no files are unmerged."
-msgstr "Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-zusammengeführten Dateien."
-
-#: gitk:8656
-msgid ""
-"No files selected: --merge specified but no unmerged files are within file "
-"limit."
-msgstr ""
-"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
-"zusammengeführten Dateien sind in der Dateiauswahl."
-
-#: gitk:8717
+#: gitk:9915
msgid "Command line"
msgstr "Kommandozeile"
diff --git a/gitk-git/po/sv.po b/gitk-git/po/sv.po
index f6b080df4c..e1ecfb7586 100644
--- a/gitk-git/po/sv.po
+++ b/gitk-git/po/sv.po
@@ -3,687 +3,724 @@
# This file is distributed under the same license as the gitk package.
#
# Peter Karlsson <peter@softwolves.pp.se>, 2008.
+# Mikael Magnusson <mikachu@gmail.com>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: sv\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-14 15:03+0100\n"
-"PO-Revision-Date: 2008-03-14 16:06CET-1\n"
-"Last-Translator: Peter Karlsson <peter@softwolves.pp.se>\n"
+"POT-Creation-Date: 2008-08-03 18:58+0200\n"
+"PO-Revision-Date: 2008-08-03 19:03+0200\n"
+"Last-Translator: Mikael Magnusson <mikachu@gmail.com>\n"
"Language-Team: Swedish <sv@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit"
+"Content-Transfer-Encoding: 8bit\n"
-#: gitk:111
-msgid "Error executing git rev-list:"
-msgstr "Fel vid körning av git rev-list:"
+#: gitk:102
+msgid "Couldn't get list of unmerged files:"
+msgstr "Kunde inta hämta lista över ej sammanslagna filer:"
+
+#: gitk:329
+msgid "No files selected: --merge specified but no files are unmerged."
+msgstr ""
+"Inga filer valdes: --merge angavs men det finns inga filer som inte har "
+"slagits samman."
+
+#: gitk:332
+msgid ""
+"No files selected: --merge specified but no unmerged files are within file "
+"limit."
+msgstr ""
+"Inga filer valdes: --merge angavs men det finns inga filer inom "
+"filbegränsningen."
+
+#: gitk:354
+msgid "Error executing git log:"
+msgstr "Fel vid körning av git log:"
-#: gitk:124
+#: gitk:369
msgid "Reading"
msgstr "Läser"
-#: gitk:151 gitk:2191
+#: gitk:400 gitk:3356
msgid "Reading commits..."
msgstr "Läser incheckningar..."
-#: gitk:275
-msgid "Can't parse git log output:"
-msgstr "Kan inte tolka utdata från git log:"
-
-#: gitk:386 gitk:2195
+#: gitk:403 gitk:1480 gitk:3359
msgid "No commits selected"
msgstr "Inga incheckningar markerade"
-#: gitk:500
+#: gitk:1358
+msgid "Can't parse git log output:"
+msgstr "Kan inte tolka utdata från git log:"
+
+#: gitk:1557
msgid "No commit information available"
msgstr "Ingen incheckningsinformation är tillgänglig"
-#: gitk:599 gitk:621 gitk:1955 gitk:6423 gitk:7923 gitk:8082
+#: gitk:1654 gitk:1676 gitk:3150 gitk:7620 gitk:9149 gitk:9317
msgid "OK"
msgstr "OK"
-#: gitk:623 gitk:1956 gitk:6107 gitk:6178 gitk:6275 gitk:6321 gitk:6425
-#: gitk:7924 gitk:8083
+#: gitk:1678 gitk:3151 gitk:7296 gitk:7367 gitk:7470 gitk:7516 gitk:7622
+#: gitk:9150 gitk:9318
msgid "Cancel"
msgstr "Avbryt"
-#: gitk:661
+#: gitk:1716
msgid "File"
msgstr "Arkiv"
-#: gitk:663
+#: gitk:1718
msgid "Update"
msgstr "Uppdatera"
-#: gitk:664
+#: gitk:1719
+msgid "Reload"
+msgstr "Ladda om"
+
+#: gitk:1720
msgid "Reread references"
msgstr "Läs om referenser"
-#: gitk:665
+#: gitk:1721
msgid "List references"
msgstr "Visa referenser"
-#: gitk:666
+#: gitk:1722
msgid "Quit"
msgstr "Avsluta"
-#: gitk:668
+#: gitk:1724
msgid "Edit"
msgstr "Redigera"
-#: gitk:669
+#: gitk:1725
msgid "Preferences"
msgstr "Inställningar"
-#: gitk:672 gitk:1892
+#: gitk:1728 gitk:3087
msgid "View"
msgstr "Visa"
-#: gitk:673
+#: gitk:1729
msgid "New view..."
msgstr "Ny vy..."
-#: gitk:674 gitk:2133 gitk:8722
+#: gitk:1730 gitk:3298 gitk:9932
msgid "Edit view..."
msgstr "Ändra vy..."
-#: gitk:676 gitk:2134 gitk:8723
+#: gitk:1732 gitk:3299 gitk:9933
msgid "Delete view"
msgstr "Ta bort vy"
-#: gitk:678
+#: gitk:1734
msgid "All files"
msgstr "Alla filer"
-#: gitk:682
+#: gitk:1738
msgid "Help"
msgstr "Hjälp"
-#: gitk:683 gitk:1317
+#: gitk:1739 gitk:2399
msgid "About gitk"
msgstr "Om gitk"
-#: gitk:684
+#: gitk:1740
msgid "Key bindings"
msgstr "Tangentbordsbindningar"
-#: gitk:741
+#: gitk:1797
msgid "SHA1 ID: "
msgstr "SHA1-id: "
-#: gitk:791
+#: gitk:1828
+msgid "Row"
+msgstr "Rad"
+
+#: gitk:1859
msgid "Find"
msgstr "Sök"
-#: gitk:792
+#: gitk:1860
msgid "next"
msgstr "nästa"
-#: gitk:793
+#: gitk:1861
msgid "prev"
msgstr "föreg"
-#: gitk:794
+#: gitk:1862
msgid "commit"
msgstr "incheckning"
-#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
+#: gitk:1865 gitk:1867 gitk:3511 gitk:3534 gitk:3558 gitk:5441 gitk:5512
msgid "containing:"
msgstr "som innehåller:"
-#: gitk:800 gitk:1778 gitk:1783 gitk:2431
+#: gitk:1868 gitk:2866 gitk:2871 gitk:3586
msgid "touching paths:"
msgstr "som rör sökväg:"
-#: gitk:801 gitk:2436
+#: gitk:1869 gitk:3591
msgid "adding/removing string:"
msgstr "som lägger/till tar bort sträng:"
-#: gitk:810 gitk:812
+#: gitk:1878 gitk:1880
msgid "Exact"
msgstr "Exakt"
-#: gitk:812 gitk:2514 gitk:4274
+#: gitk:1880 gitk:3667 gitk:5409
msgid "IgnCase"
msgstr "IgnVersaler"
-#: gitk:812 gitk:2405 gitk:2512 gitk:4270
+#: gitk:1880 gitk:3560 gitk:3665 gitk:5405
msgid "Regexp"
msgstr "Reg.uttr."
-#: gitk:814 gitk:815 gitk:2533 gitk:2563 gitk:2570 gitk:4380 gitk:4436
+#: gitk:1882 gitk:1883 gitk:3686 gitk:3716 gitk:3723 gitk:5532 gitk:5599
msgid "All fields"
msgstr "Alla fält"
-#: gitk:815 gitk:2531 gitk:2563 gitk:4336
+#: gitk:1883 gitk:3684 gitk:3716 gitk:5471
msgid "Headline"
msgstr "Rubrik"
-#: gitk:816 gitk:2531 gitk:4336 gitk:4436 gitk:4827
+#: gitk:1884 gitk:3684 gitk:5471 gitk:5599 gitk:6000
msgid "Comments"
msgstr "Kommentarer"
-#: gitk:816 gitk:2531 gitk:2535 gitk:2570 gitk:4336 gitk:4763 gitk:5956
-#: gitk:5971
+#: gitk:1884 gitk:3684 gitk:3688 gitk:3723 gitk:5471 gitk:5936 gitk:7142
+#: gitk:7157
msgid "Author"
msgstr "Författare"
-#: gitk:816 gitk:2531 gitk:4336 gitk:4765
+#: gitk:1884 gitk:3684 gitk:5471 gitk:5938
msgid "Committer"
msgstr "Incheckare"
-#: gitk:845
+#: gitk:1913
msgid "Search"
msgstr "Sök"
-#: gitk:852
+#: gitk:1920
msgid "Diff"
msgstr "Diff"
-#: gitk:854
+#: gitk:1922
msgid "Old version"
msgstr "Gammal version"
-#: gitk:856
+#: gitk:1924
msgid "New version"
msgstr "Ny version"
-#: gitk:858
+#: gitk:1926
msgid "Lines of context"
msgstr "Rader sammanhang"
-#: gitk:868
+#: gitk:1936
msgid "Ignore space change"
msgstr "Ignorera ändringar i blanksteg"
-#: gitk:926
+#: gitk:1994
msgid "Patch"
msgstr "Patch"
-#: gitk:928
+#: gitk:1996
msgid "Tree"
msgstr "Träd"
-#: gitk:1053 gitk:1068 gitk:6022
+#: gitk:2121 gitk:2136 gitk:7211
msgid "Diff this -> selected"
msgstr "Diff denna -> markerad"
-#: gitk:1055 gitk:1070 gitk:6023
+#: gitk:2123 gitk:2138 gitk:7212
msgid "Diff selected -> this"
msgstr "Diff markerad -> denna"
-#: gitk:1057 gitk:1072 gitk:6024
+#: gitk:2125 gitk:2140 gitk:7213
msgid "Make patch"
msgstr "Skapa patch"
-#: gitk:1058 gitk:6162
+#: gitk:2126 gitk:7351
msgid "Create tag"
msgstr "Skapa tagg"
-#: gitk:1059 gitk:6255
+#: gitk:2127 gitk:7450
msgid "Write commit to file"
msgstr "Skriv incheckning till fil"
-#: gitk:1060 gitk:6309
+#: gitk:2128 gitk:7504
msgid "Create new branch"
msgstr "Skapa ny gren"
-#: gitk:1061
+#: gitk:2129
msgid "Cherry-pick this commit"
msgstr "Plocka denna incheckning"
-#: gitk:1063
+#: gitk:2131
msgid "Reset HEAD branch to here"
msgstr "Återställ HEAD-grenen hit"
-#: gitk:1079
+#: gitk:2147
msgid "Check out this branch"
msgstr "Checka ut denna gren"
-#: gitk:1081
+#: gitk:2149
msgid "Remove this branch"
msgstr "Ta bort denna gren"
-#: gitk:1087
+#: gitk:2155
msgid "Highlight this too"
msgstr "Markera även detta"
-#: gitk:1089
+#: gitk:2157
msgid "Highlight this only"
msgstr "Markera bara detta"
-#: gitk:1318
+#: gitk:2159
+msgid "External diff"
+msgstr "Extern diff"
+
+#: gitk:2400
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Use and redistribute under the terms of the GNU General Public License"
msgstr ""
"\n"
"Gitk - en incheckningsvisare för git\n"
"\n"
-"Copyright © 2005-2006 Paul Mackerras\n"
+"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Använd och vidareförmedla enligt villkoren i GNU General Public License"
-#: gitk:1326 gitk:1387 gitk:6581
+#: gitk:2408 gitk:2469 gitk:7799
msgid "Close"
msgstr "Stäng"
-#: gitk:1345
+#: gitk:2427
msgid "Gitk key bindings"
msgstr "Tangentbordsbindningar för Gitk"
-#: gitk:1347
+#: gitk:2429
msgid "Gitk key bindings:"
msgstr "Tangentbordsbindningar för Gitk:"
-#: gitk:1349
+#: gitk:2431
#, tcl-format
msgid "<%s-Q>\t\tQuit"
msgstr "<%s-Q>\t\tAvsluta"
-#: gitk:1350
+#: gitk:2432
msgid "<Home>\t\tMove to first commit"
msgstr "<Home>\t\tGå till första incheckning"
-#: gitk:1351
+#: gitk:2433
msgid "<End>\t\tMove to last commit"
msgstr "<End>\t\tGå till sista incheckning"
-#: gitk:1352
+#: gitk:2434
msgid "<Up>, p, i\tMove up one commit"
msgstr "<Upp>, p, i\tGå en incheckning upp"
-#: gitk:1353
+#: gitk:2435
msgid "<Down>, n, k\tMove down one commit"
msgstr "<Ned>, n, k\tGå en incheckning ned"
-#: gitk:1354
+#: gitk:2436
msgid "<Left>, z, j\tGo back in history list"
msgstr "<Vänster>, z, j\tGå bakåt i historiken"
-#: gitk:1355
+#: gitk:2437
msgid "<Right>, x, l\tGo forward in history list"
msgstr "<Höger>, x, l\tGå framåt i historiken"
-#: gitk:1356
+#: gitk:2438
msgid "<PageUp>\tMove up one page in commit list"
msgstr "<PageUp>\tGå upp en sida i incheckningslistan"
-#: gitk:1357
+#: gitk:2439
msgid "<PageDown>\tMove down one page in commit list"
msgstr "<PageDown>\tGå ned en sida i incheckningslistan"
-#: gitk:1358
+#: gitk:2440
#, tcl-format
msgid "<%s-Home>\tScroll to top of commit list"
msgstr "<%s-Home>\tRulla till början av incheckningslistan"
-#: gitk:1359
+#: gitk:2441
#, tcl-format
msgid "<%s-End>\tScroll to bottom of commit list"
msgstr "<%s-End>\tRulla till slutet av incheckningslistan"
-#: gitk:1360
+#: gitk:2442
#, tcl-format
msgid "<%s-Up>\tScroll commit list up one line"
msgstr "<%s-Upp>\tRulla incheckningslistan upp ett steg"
-#: gitk:1361
+#: gitk:2443
#, tcl-format
msgid "<%s-Down>\tScroll commit list down one line"
msgstr "<%s-Ned>\tRulla incheckningslistan ned ett steg"
-#: gitk:1362
+#: gitk:2444
#, tcl-format
msgid "<%s-PageUp>\tScroll commit list up one page"
msgstr "<%s-PageUp>\tRulla incheckningslistan upp en sida"
-#: gitk:1363
+#: gitk:2445
#, tcl-format
msgid "<%s-PageDown>\tScroll commit list down one page"
msgstr "<%s-PageDown>\tRulla incheckningslistan ned en sida"
-#: gitk:1364
+#: gitk:2446
msgid "<Shift-Up>\tFind backwards (upwards, later commits)"
msgstr "<Skift-Upp>\tSök bakåt (uppåt, senare incheckningar)"
-#: gitk:1365
+#: gitk:2447
msgid "<Shift-Down>\tFind forwards (downwards, earlier commits)"
msgstr "<Skift-Ned>\tSök framåt (nedåt, tidigare incheckningar)"
-#: gitk:1366
+#: gitk:2448
msgid "<Delete>, b\tScroll diff view up one page"
msgstr "<Delete>, b\tRulla diffvisningen upp en sida"
-#: gitk:1367
+#: gitk:2449
msgid "<Backspace>\tScroll diff view up one page"
msgstr "<Baksteg>\tRulla diffvisningen upp en sida"
-#: gitk:1368
+#: gitk:2450
msgid "<Space>\t\tScroll diff view down one page"
msgstr "<Blanksteg>\tRulla diffvisningen ned en sida"
-#: gitk:1369
+#: gitk:2451
msgid "u\t\tScroll diff view up 18 lines"
msgstr "u\t\tRulla diffvisningen upp 18 rader"
-#: gitk:1370
+#: gitk:2452
msgid "d\t\tScroll diff view down 18 lines"
msgstr "d\t\tRulla diffvisningen ned 18 rader"
-#: gitk:1371
+#: gitk:2453
#, tcl-format
msgid "<%s-F>\t\tFind"
msgstr "<%s-F>\t\tSök"
-#: gitk:1372
+#: gitk:2454
#, tcl-format
msgid "<%s-G>\t\tMove to next find hit"
msgstr "<%s-G>\t\tGå till nästa sökträff"
-#: gitk:1373
+#: gitk:2455
msgid "<Return>\tMove to next find hit"
msgstr "<Return>\t\tGå till nästa sökträff"
-#: gitk:1374
+#: gitk:2456
msgid "/\t\tMove to next find hit, or redo find"
msgstr "/\t\tGå till nästa sökträff, eller sök på nytt"
-#: gitk:1375
+#: gitk:2457
msgid "?\t\tMove to previous find hit"
msgstr "?\t\tGå till föregående sökträff"
-#: gitk:1376
+#: gitk:2458
msgid "f\t\tScroll diff view to next file"
msgstr "f\t\tRulla diffvisningen till nästa fil"
-#: gitk:1377
+#: gitk:2459
#, tcl-format
msgid "<%s-S>\t\tSearch for next hit in diff view"
msgstr "<%s-S>\t\tGå till nästa sökträff i diffvisningen"
-#: gitk:1378
+#: gitk:2460
#, tcl-format
msgid "<%s-R>\t\tSearch for previous hit in diff view"
msgstr "<%s-R>\t\tGå till föregående sökträff i diffvisningen"
-#: gitk:1379
+#: gitk:2461
#, tcl-format
msgid "<%s-KP+>\tIncrease font size"
msgstr "<%s-Num+>\tÖka teckenstorlek"
-#: gitk:1380
+#: gitk:2462
#, tcl-format
msgid "<%s-plus>\tIncrease font size"
msgstr "<%s-plus>\tÖka teckenstorlek"
-#: gitk:1381
+#: gitk:2463
#, tcl-format
msgid "<%s-KP->\tDecrease font size"
msgstr "<%s-Num->\tMinska teckenstorlek"
-#: gitk:1382
+#: gitk:2464
#, tcl-format
msgid "<%s-minus>\tDecrease font size"
msgstr "<%s-minus>\tMinska teckenstorlek"
-#: gitk:1383
+#: gitk:2465
msgid "<F5>\t\tUpdate"
msgstr "<F5>\t\tUppdatera"
-#: gitk:1896
+#: gitk:3091
msgid "Gitk view definition"
msgstr "Definition av Gitk-vy"
-#: gitk:1921
+#: gitk:3116
msgid "Name"
msgstr "Namn"
-#: gitk:1924
+#: gitk:3119
msgid "Remember this view"
msgstr "Spara denna vy"
-#: gitk:1928
-msgid "Commits to include (arguments to git rev-list):"
-msgstr "Incheckningar att ta med (argument till git rev-list):"
+#: gitk:3123
+msgid "Commits to include (arguments to git log):"
+msgstr "Incheckningar att ta med (argument till git log):"
-#: gitk:1935
+#: gitk:3130
msgid "Command to generate more commits to include:"
msgstr "Kommando för att generera fler incheckningar att ta med:"
-#: gitk:1942
+#: gitk:3137
msgid "Enter files and directories to include, one per line:"
msgstr "Ange filer och kataloger att ta med, en per rad:"
-#: gitk:1989
+#: gitk:3184
msgid "Error in commit selection arguments:"
msgstr "Fel i argument för val av incheckningar:"
-#: gitk:2043 gitk:2127 gitk:2583 gitk:2597 gitk:3781 gitk:8688 gitk:8689
+#: gitk:3238 gitk:3290 gitk:3736 gitk:3750 gitk:4951 gitk:9896 gitk:9897
msgid "None"
msgstr "Inget"
-#: gitk:2531 gitk:4336 gitk:5958 gitk:5973
+#: gitk:3684 gitk:5471 gitk:7144 gitk:7159
msgid "Date"
msgstr "Datum"
-#: gitk:2531 gitk:4336
+#: gitk:3684 gitk:5471
msgid "CDate"
msgstr "Skapat datum"
-#: gitk:2680 gitk:2685
+#: gitk:3833 gitk:3838
msgid "Descendant"
msgstr "Avkomling"
-#: gitk:2681
+#: gitk:3834
msgid "Not descendant"
msgstr "Inte avkomling"
-#: gitk:2688 gitk:2693
+#: gitk:3841 gitk:3846
msgid "Ancestor"
msgstr "Förfader"
-#: gitk:2689
+#: gitk:3842
msgid "Not ancestor"
msgstr "Inte förfader"
-#: gitk:2924
+#: gitk:4078
msgid "Local changes checked in to index but not committed"
msgstr "Lokala ändringar sparade i indexet men inte incheckade"
-#: gitk:2954
+#: gitk:4111
msgid "Local uncommitted changes, not checked in to index"
msgstr "Lokala ändringar, ej sparade i indexet"
-#: gitk:4305
+#: gitk:5440
msgid "Searching"
msgstr "Söker"
-#: gitk:4767
+#: gitk:5940
msgid "Tags:"
msgstr "Taggar:"
-#: gitk:4784 gitk:4790 gitk:5951
+#: gitk:5957 gitk:5963 gitk:7137
msgid "Parent"
msgstr "Förälder"
-#: gitk:4795
+#: gitk:5968
msgid "Child"
msgstr "Barn"
-#: gitk:4804
+#: gitk:5977
msgid "Branch"
msgstr "Gren"
-#: gitk:4807
+#: gitk:5980
msgid "Follows"
msgstr "Följer"
-#: gitk:4810
+#: gitk:5983
msgid "Precedes"
msgstr "Föregår"
-#: gitk:5093
+#: gitk:6267
msgid "Error getting merge diffs:"
msgstr "Fel vid hämtning av sammanslagningsdiff:"
-#: gitk:5778
+#: gitk:6970
msgid "Goto:"
msgstr "Gå till:"
-#: gitk:5780
+#: gitk:6972
msgid "SHA1 ID:"
msgstr "SHA1-id:"
-#: gitk:5805
+#: gitk:6991
#, tcl-format
msgid "Short SHA1 id %s is ambiguous"
msgstr "Förkortat SHA1-id %s är tvetydigt"
-#: gitk:5817
+#: gitk:7003
#, tcl-format
msgid "SHA1 id %s is not known"
msgstr "SHA-id:t %s är inte känt"
-#: gitk:5819
+#: gitk:7005
#, tcl-format
msgid "Tag/Head %s is not known"
msgstr "Tagg/huvud %s är okänt"
-#: gitk:5961
+#: gitk:7147
msgid "Children"
msgstr "Barn"
-#: gitk:6018
+#: gitk:7204
#, tcl-format
msgid "Reset %s branch to here"
msgstr "Återställ grenen %s hit"
-#: gitk:6049
+#: gitk:7206
+msgid "Detached head: can't reset"
+msgstr "Frånkopplad head: kan inte återställa"
+
+#: gitk:7238
msgid "Top"
msgstr "Topp"
-#: gitk:6050
+#: gitk:7239
msgid "From"
msgstr "Från"
-#: gitk:6055
+#: gitk:7244
msgid "To"
msgstr "Till"
-#: gitk:6078
+#: gitk:7267
msgid "Generate patch"
msgstr "Generera patch"
-#: gitk:6080
+#: gitk:7269
msgid "From:"
msgstr "Från:"
-#: gitk:6089
+#: gitk:7278
msgid "To:"
msgstr "Till:"
-#: gitk:6098
+#: gitk:7287
msgid "Reverse"
msgstr "Vänd"
-#: gitk:6100 gitk:6269
+#: gitk:7289 gitk:7464
msgid "Output file:"
msgstr "Utdatafil:"
-#: gitk:6106
+#: gitk:7295
msgid "Generate"
msgstr "Generera"
-#: gitk:6142
+#: gitk:7331
msgid "Error creating patch:"
msgstr "Fel vid generering av patch:"
-#: gitk:6164 gitk:6257 gitk:6311
+#: gitk:7353 gitk:7452 gitk:7506
msgid "ID:"
msgstr "Id:"
-#: gitk:6173
+#: gitk:7362
msgid "Tag name:"
msgstr "Taggnamn:"
-#: gitk:6177 gitk:6320
+#: gitk:7366 gitk:7515
msgid "Create"
msgstr "Skapa"
-#: gitk:6192
+#: gitk:7381
msgid "No tag name specified"
msgstr "Inget taggnamn angavs"
-#: gitk:6196
+#: gitk:7385
#, tcl-format
msgid "Tag \"%s\" already exists"
msgstr "Taggen \"%s\" finns redan"
-#: gitk:6202
+#: gitk:7391
msgid "Error creating tag:"
msgstr "Fel vid skapande av tagg:"
-#: gitk:6266
+#: gitk:7461
msgid "Command:"
msgstr "Kommando:"
-#: gitk:6274
+#: gitk:7469
msgid "Write"
msgstr "Skriv"
-#: gitk:6290
+#: gitk:7485
msgid "Error writing commit:"
msgstr "Fel vid skrivning av incheckning:"
-#: gitk:6316
+#: gitk:7511
msgid "Name:"
msgstr "Namn:"
-#: gitk:6335
+#: gitk:7530
msgid "Please specify a name for the new branch"
msgstr "Ange ett namn för den nya grenen"
-#: gitk:6364
+#: gitk:7559
#, tcl-format
msgid "Commit %s is already included in branch %s -- really re-apply it?"
-msgstr "Incheckningen %s finns redan på grenen %s -- skall den verkligen appliceras på nytt?"
+msgstr ""
+"Incheckningen %s finns redan på grenen %s -- skall den verkligen appliceras "
+"på nytt?"
-#: gitk:6369
+#: gitk:7564
msgid "Cherry-picking"
msgstr "Plockar"
-#: gitk:6381
+#: gitk:7576
msgid "No changes committed"
msgstr "Inga ändringar incheckade"
-#: gitk:6404
+#: gitk:7601
msgid "Confirm reset"
msgstr "Bekräfta återställning"
-#: gitk:6406
+#: gitk:7603
#, tcl-format
msgid "Reset branch %s to %s?"
msgstr "Återställa grenen %s till %s?"
-#: gitk:6410
+#: gitk:7607
msgid "Reset type:"
msgstr "Typ av återställning:"
-#: gitk:6414
+#: gitk:7611
msgid "Soft: Leave working tree and index untouched"
msgstr "Mjuk: Rör inte utcheckning och index"
-#: gitk:6417
+#: gitk:7614
msgid "Mixed: Leave working tree untouched, reset index"
msgstr "Blandad: Rör inte utcheckning, återställ index"
-#: gitk:6420
+#: gitk:7617
msgid ""
"Hard: Reset working tree and index\n"
"(discard ALL local changes)"
@@ -691,19 +728,19 @@ msgstr ""
"Hård: Återställ utcheckning och index\n"
"(förkastar ALLA lokala ändringar)"
-#: gitk:6436
+#: gitk:7633
msgid "Resetting"
msgstr "Återställer"
-#: gitk:6493
+#: gitk:7690
msgid "Checking out"
msgstr "Checkar ut"
-#: gitk:6523
+#: gitk:7741
msgid "Cannot delete the currently checked-out branch"
msgstr "Kan inte ta bort den just nu utcheckade grenen"
-#: gitk:6529
+#: gitk:7747
#, tcl-format
msgid ""
"The commits on branch %s aren't on any other branch.\n"
@@ -712,16 +749,16 @@ msgstr ""
"Incheckningarna på grenen %s existerar inte på någon annan gren.\n"
"Vill du verkligen ta bort grenen %s?"
-#: gitk:6560
+#: gitk:7778
#, tcl-format
msgid "Tags and heads: %s"
msgstr "Taggar och huvuden: %s"
-#: gitk:6574
+#: gitk:7792
msgid "Filter"
msgstr "Filter"
-#: gitk:6868
+#: gitk:8086
msgid ""
"Error reading commit topology information; branch and preceding/following "
"tag information will be incomplete."
@@ -729,117 +766,125 @@ msgstr ""
"Fel vid läsning av information om incheckningstopologi; information om "
"grenar och föregående/senare taggar kommer inte vara komplett."
-#: gitk:7852
+#: gitk:9072
msgid "Tag"
msgstr "Tagg"
-#: gitk:7852
+#: gitk:9072
msgid "Id"
msgstr "Id"
-#: gitk:7892
+#: gitk:9118
msgid "Gitk font chooser"
msgstr "Teckensnittsväljare för Gitk"
-#: gitk:7909
+#: gitk:9135
msgid "B"
msgstr "F"
-#: gitk:7912
+#: gitk:9138
msgid "I"
msgstr "K"
-#: gitk:8005
+#: gitk:9231
msgid "Gitk preferences"
msgstr "Inställningar för Gitk"
-#: gitk:8006
+#: gitk:9232
msgid "Commit list display options"
msgstr "Alternativ för incheckningslistvy"
-#: gitk:8009
+#: gitk:9235
msgid "Maximum graph width (lines)"
msgstr "Maximal grafbredd (rader)"
-#: gitk:8013
+#: gitk:9239
#, tcl-format
msgid "Maximum graph width (% of pane)"
msgstr "Maximal grafbredd (% av ruta)"
-#: gitk:8018
+#: gitk:9244
msgid "Show local changes"
msgstr "Visa lokala ändringar"
-#: gitk:8023
+#: gitk:9249
msgid "Auto-select SHA1"
msgstr "Välj SHA1 automatiskt"
-#: gitk:8028
+#: gitk:9254
msgid "Diff display options"
msgstr "Alternativ för diffvy"
-#: gitk:8030
+#: gitk:9256
msgid "Tab spacing"
msgstr "Blanksteg för tabulatortecken"
-#: gitk:8034
+#: gitk:9260
msgid "Display nearby tags"
msgstr "Visa närliggande taggar"
-#: gitk:8039
+#: gitk:9265
msgid "Limit diffs to listed paths"
msgstr "Begränsa diff till listade sökvägar"
-#: gitk:8044
+#: gitk:9272
+msgid "External diff tool"
+msgstr "Externt diff-verktyg"
+
+#: gitk:9274
+msgid "Choose..."
+msgstr "Välj..."
+
+#: gitk:9279
msgid "Colors: press to choose"
msgstr "Färger: tryck för att välja"
-#: gitk:8047
+#: gitk:9282
msgid "Background"
msgstr "Bakgrund"
-#: gitk:8051
+#: gitk:9286
msgid "Foreground"
msgstr "Förgrund"
-#: gitk:8055
+#: gitk:9290
msgid "Diff: old lines"
msgstr "Diff: gamla rader"
-#: gitk:8060
+#: gitk:9295
msgid "Diff: new lines"
msgstr "Diff: nya rader"
-#: gitk:8065
+#: gitk:9300
msgid "Diff: hunk header"
msgstr "Diff: delhuvud"
-#: gitk:8071
+#: gitk:9306
msgid "Select bg"
msgstr "Markerad bakgrund"
-#: gitk:8075
+#: gitk:9310
msgid "Fonts: press to choose"
msgstr "Teckensnitt: tryck för att välja"
-#: gitk:8077
+#: gitk:9312
msgid "Main font"
msgstr "Huvudteckensnitt"
-#: gitk:8078
+#: gitk:9313
msgid "Diff display font"
msgstr "Teckensnitt för diffvisning"
-#: gitk:8079
+#: gitk:9314
msgid "User interface font"
msgstr "Teckensnitt för användargränssnitt"
-#: gitk:8095
+#: gitk:9339
#, tcl-format
msgid "Gitk: choose color for %s"
msgstr "Gitk: välj färg för %s"
-#: gitk:8476
+#: gitk:9720
msgid ""
"Sorry, gitk cannot run with this version of Tcl/Tk.\n"
" Gitk requires at least Tcl/Tk 8.4."
@@ -847,41 +892,24 @@ msgstr ""
"Gitk kan tyvärr inte köra med denna version av Tcl/Tk.\n"
" Gitk kräver åtminstone Tcl/Tk 8.4."
-#: gitk:8565
+#: gitk:9812
msgid "Cannot find a git repository here."
msgstr "Hittar inget gitk-arkiv här."
-#: gitk:8569
+#: gitk:9816
#, tcl-format
msgid "Cannot find the git directory \"%s\"."
msgstr "Hittar inte git-katalogen \"%s\"."
-#: gitk:8612
+#: gitk:9853
#, tcl-format
msgid "Ambiguous argument '%s': both revision and filename"
msgstr "Tvetydigt argument \"%s\": både revision och filnamn"
-#: gitk:8624
+#: gitk:9865
msgid "Bad arguments to gitk:"
msgstr "Felaktiga argument till gitk:"
-#: gitk:8636
-msgid "Couldn't get list of unmerged files:"
-msgstr "Kunde inta hämta lista över ej sammanslagna filer:"
-
-#: gitk:8652
-msgid "No files selected: --merge specified but no files are unmerged."
-msgstr "Inga filer valdes: --merge angavs men det finns inga filer som inte har slagits samman."
-
-#: gitk:8655
-msgid ""
-"No files selected: --merge specified but no unmerged files are within file "
-"limit."
-msgstr ""
-"Inga filer valdes: --merge angavs men det finns inga filer inom "
-"filbegränsningen."
-
-#: gitk:8716
+#: gitk:9925
msgid "Command line"
msgstr "Kommandorad"
-
diff --git a/hash-object.c b/hash-object.c
index 46c06a9552..a4d127cf78 100644
--- a/hash-object.c
+++ b/hash-object.c
@@ -7,16 +7,14 @@
#include "cache.h"
#include "blob.h"
#include "quote.h"
+#include "parse-options.h"
-static void hash_object(const char *path, enum object_type type, int write_object)
+static void hash_fd(int fd, const char *type, int write_object, const char *path)
{
- int fd;
struct stat st;
unsigned char sha1[20];
- fd = open(path, O_RDONLY);
- if (fd < 0 ||
- fstat(fd, &st) < 0 ||
- index_fd(sha1, fd, &st, write_object, type, path))
+ if (fstat(fd, &st) < 0 ||
+ index_fd(sha1, fd, &st, write_object, type_from_string(type), path))
die(write_object
? "Unable to add %s to database"
: "Unable to hash %s", path);
@@ -24,12 +22,14 @@ static void hash_object(const char *path, enum object_type type, int write_objec
maybe_flush_or_die(stdout, "hash to stdout");
}
-static void hash_stdin(const char *type, int write_object)
+static void hash_object(const char *path, const char *type, int write_object,
+ const char *vpath)
{
- unsigned char sha1[20];
- if (index_pipe(sha1, 0, type, write_object))
- die("Unable to add stdin to database");
- printf("%s\n", sha1_to_hex(sha1));
+ int fd;
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
+ die("Cannot open %s", path);
+ hash_fd(fd, type, write_object, vpath);
}
static void hash_stdin_paths(const char *type, int write_objects)
@@ -45,92 +45,91 @@ static void hash_stdin_paths(const char *type, int write_objects)
die("line is badly quoted");
strbuf_swap(&buf, &nbuf);
}
- hash_object(buf.buf, type_from_string(type), write_objects);
+ hash_object(buf.buf, type, write_objects, buf.buf);
}
strbuf_release(&buf);
strbuf_release(&nbuf);
}
-static const char hash_object_usage[] =
-"git hash-object [ [-t <type>] [-w] [--stdin] <file>... | --stdin-paths < <list-of-paths> ]";
+static const char * const hash_object_usage[] = {
+ "git hash-object [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin] [--] <file>...",
+ "git hash-object --stdin-paths < <list-of-paths>",
+ NULL
+};
-int main(int argc, char **argv)
+static const char *type;
+static int write_object;
+static int hashstdin;
+static int stdin_paths;
+static int no_filters;
+static const char *vpath;
+
+static const struct option hash_object_options[] = {
+ OPT_STRING('t', NULL, &type, "type", "object type"),
+ OPT_BOOLEAN('w', NULL, &write_object, "write the object into the object database"),
+ OPT_BOOLEAN( 0 , "stdin", &hashstdin, "read the object from stdin"),
+ OPT_BOOLEAN( 0 , "stdin-paths", &stdin_paths, "read file names from stdin"),
+ OPT_BOOLEAN( 0 , "no-filters", &no_filters, "store file as is without filters"),
+ OPT_STRING( 0 , "path", &vpath, "file", "process file as it were from this path"),
+ OPT_END()
+};
+
+int main(int argc, const char **argv)
{
int i;
- const char *type = blob_type;
- int write_object = 0;
const char *prefix = NULL;
int prefix_length = -1;
- int no_more_flags = 0;
- int hashstdin = 0;
- int stdin_paths = 0;
+ const char *errstr = NULL;
+
+ type = blob_type;
git_config(git_default_config, NULL);
- for (i = 1 ; i < argc; i++) {
- if (!no_more_flags && argv[i][0] == '-') {
- if (!strcmp(argv[i], "-t")) {
- if (argc <= ++i)
- usage(hash_object_usage);
- type = argv[i];
- }
- else if (!strcmp(argv[i], "-w")) {
- if (prefix_length < 0) {
- prefix = setup_git_directory();
- prefix_length =
- prefix ? strlen(prefix) : 0;
- }
- write_object = 1;
- }
- else if (!strcmp(argv[i], "--")) {
- no_more_flags = 1;
- }
- else if (!strcmp(argv[i], "--help"))
- usage(hash_object_usage);
- else if (!strcmp(argv[i], "--stdin-paths")) {
- if (hashstdin) {
- error("Can't use --stdin-paths with --stdin");
- usage(hash_object_usage);
- }
- stdin_paths = 1;
-
- }
- else if (!strcmp(argv[i], "--stdin")) {
- if (stdin_paths) {
- error("Can't use %s with --stdin-paths", argv[i]);
- usage(hash_object_usage);
- }
- if (hashstdin)
- die("Multiple --stdin arguments are not supported");
- hashstdin = 1;
- }
- else
- usage(hash_object_usage);
- }
- else {
- const char *arg = argv[i];
-
- if (stdin_paths) {
- error("Can't specify files (such as \"%s\") with --stdin-paths", arg);
- usage(hash_object_usage);
- }
-
- if (hashstdin) {
- hash_stdin(type, write_object);
- hashstdin = 0;
- }
- if (0 <= prefix_length)
- arg = prefix_filename(prefix, prefix_length,
- arg);
- hash_object(arg, type_from_string(type), write_object);
- no_more_flags = 1;
- }
+ argc = parse_options(argc, argv, hash_object_options, hash_object_usage, 0);
+
+ if (write_object) {
+ prefix = setup_git_directory();
+ prefix_length = prefix ? strlen(prefix) : 0;
+ if (vpath && prefix)
+ vpath = prefix_filename(prefix, prefix_length, vpath);
+ }
+
+ if (stdin_paths) {
+ if (hashstdin)
+ errstr = "Can't use --stdin-paths with --stdin";
+ else if (argc)
+ errstr = "Can't specify files with --stdin-paths";
+ else if (vpath)
+ errstr = "Can't use --stdin-paths with --path";
+ else if (no_filters)
+ errstr = "Can't use --stdin-paths with --no-filters";
+ }
+ else {
+ if (hashstdin > 1)
+ errstr = "Multiple --stdin arguments are not supported";
+ if (vpath && no_filters)
+ errstr = "Can't use --path with --no-filters";
+ }
+
+ if (errstr) {
+ error (errstr);
+ usage_with_options(hash_object_usage, hash_object_options);
+ }
+
+ if (hashstdin)
+ hash_fd(0, type, write_object, vpath);
+
+ for (i = 0 ; i < argc; i++) {
+ const char *arg = argv[i];
+
+ if (0 <= prefix_length)
+ arg = prefix_filename(prefix, prefix_length, arg);
+ hash_object(arg, type, write_object,
+ no_filters ? NULL : vpath ? vpath : arg);
}
if (stdin_paths)
hash_stdin_paths(type, write_object);
- if (hashstdin)
- hash_stdin(type, write_object);
return 0;
}
diff --git a/ident.c b/ident.c
index b35504a8d2..09cf0c95c9 100644
--- a/ident.c
+++ b/ident.c
@@ -204,7 +204,7 @@ const char *fmt_ident(const char *name, const char *email,
if ((warn_on_no_name || error_on_no_name) &&
name == git_default_name && env_hint) {
fprintf(stderr, env_hint, au_env, co_env);
- env_hint = NULL; /* warn only once, for "git-var -l" */
+ env_hint = NULL; /* warn only once, for "git var -l" */
}
if (error_on_no_name)
die("empty ident %s <%s> not allowed", name, email);
diff --git a/imap-send.c b/imap-send.c
index 1ec1310921..af7e08c094 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -23,71 +23,74 @@
*/
#include "cache.h"
+#ifdef NO_OPENSSL
+typedef void *SSL;
+#endif
-typedef struct store_conf {
+struct store_conf {
char *name;
const char *path; /* should this be here? its interpretation is driver-specific */
char *map_inbox;
char *trash;
unsigned max_size; /* off_t is overkill */
unsigned trash_remote_new:1, trash_only_new:1;
-} store_conf_t;
+};
-typedef struct string_list {
+struct string_list {
struct string_list *next;
char string[1];
-} string_list_t;
+};
-typedef struct channel_conf {
+struct channel_conf {
struct channel_conf *next;
char *name;
- store_conf_t *master, *slave;
+ struct store_conf *master, *slave;
char *master_name, *slave_name;
char *sync_state;
- string_list_t *patterns;
+ struct string_list *patterns;
int mops, sops;
unsigned max_messages; /* for slave only */
-} channel_conf_t;
+};
-typedef struct group_conf {
+struct group_conf {
struct group_conf *next;
char *name;
- string_list_t *channels;
-} group_conf_t;
+ struct string_list *channels;
+};
/* For message->status */
#define M_RECENT (1<<0) /* unsyncable flag; maildir_* depend on this being 1<<0 */
#define M_DEAD (1<<1) /* expunged */
#define M_FLAGS (1<<2) /* flags fetched */
-typedef struct message {
+struct message {
struct message *next;
- /* string_list_t *keywords; */
+ /* struct string_list *keywords; */
size_t size; /* zero implies "not fetched" */
int uid;
unsigned char flags, status;
-} message_t;
+};
-typedef struct store {
- store_conf_t *conf; /* foreign */
+struct store {
+ struct store_conf *conf; /* foreign */
/* currently open mailbox */
const char *name; /* foreign! maybe preset? */
char *path; /* own */
- message_t *msgs; /* own */
+ struct message *msgs; /* own */
int uidvalidity;
unsigned char opts; /* maybe preset? */
/* note that the following do _not_ reflect stats from msgs, but mailbox totals */
int count; /* # of messages */
int recent; /* # of recent messages - don't trust this beyond the initial read */
-} store_t;
+};
-typedef struct {
+struct msg_data {
char *data;
int len;
unsigned char flags;
unsigned int crlf:1;
-} msg_data_t;
+};
#define DRV_OK 0
#define DRV_MSG_BAD -1
@@ -96,14 +99,14 @@ typedef struct {
static int Verbose, Quiet;
-static void imap_info( const char *, ... );
-static void imap_warn( const char *, ... );
+static void imap_info(const char *, ...);
+static void imap_warn(const char *, ...);
-static char *next_arg( char ** );
+static char *next_arg(char **);
-static void free_generic_messages( message_t * );
+static void free_generic_messages(struct message *);
-static int nfsnprintf( char *buf, int blen, const char *fmt, ... );
+static int nfsnprintf(char *buf, int blen, const char *fmt, ...);
static int nfvasprintf(char **strp, const char *fmt, va_list ap)
{
@@ -119,67 +122,70 @@ static int nfvasprintf(char **strp, const char *fmt, va_list ap)
return len;
}
-static void arc4_init( void );
-static unsigned char arc4_getbyte( void );
+static void arc4_init(void);
+static unsigned char arc4_getbyte(void);
-typedef struct imap_server_conf {
+struct imap_server_conf {
char *name;
char *tunnel;
char *host;
int port;
char *user;
char *pass;
-} imap_server_conf_t;
+ int use_ssl;
+ int ssl_verify;
+};
-typedef struct imap_store_conf {
- store_conf_t gen;
- imap_server_conf_t *server;
+struct imap_store_conf {
+ struct store_conf gen;
+ struct imap_server_conf *server;
unsigned use_namespace:1;
-} imap_store_conf_t;
+};
-#define NIL (void*)0x1
-#define LIST (void*)0x2
+#define NIL (void *)0x1
+#define LIST (void *)0x2
-typedef struct _list {
- struct _list *next, *child;
+struct imap_list {
+ struct imap_list *next, *child;
char *val;
int len;
-} list_t;
+};
-typedef struct {
+struct imap_socket {
int fd;
-} Socket_t;
+ SSL *ssl;
+};
-typedef struct {
- Socket_t sock;
+struct imap_buffer {
+ struct imap_socket sock;
int bytes;
int offset;
char buf[1024];
-} buffer_t;
+};
struct imap_cmd;
-typedef struct imap {
+struct imap {
int uidnext; /* from SELECT responses */
- list_t *ns_personal, *ns_other, *ns_shared; /* NAMESPACE info */
+ struct imap_list *ns_personal, *ns_other, *ns_shared; /* NAMESPACE info */
unsigned caps, rcaps; /* CAPABILITY results */
/* command queue */
int nexttag, num_in_progress, literal_pending;
struct imap_cmd *in_progress, **in_progress_append;
- buffer_t buf; /* this is BIG, so put it last */
-} imap_t;
+ struct imap_buffer buf; /* this is BIG, so put it last */
+};
-typedef struct imap_store {
- store_t gen;
+struct imap_store {
+ struct store gen;
int uidvalidity;
- imap_t *imap;
+ struct imap *imap;
const char *prefix;
unsigned /*currentnc:1,*/ trashnc:1;
-} imap_store_t;
+};
struct imap_cmd_cb {
- int (*cont)( imap_store_t *ctx, struct imap_cmd *cmd, const char *prompt );
- void (*done)( imap_store_t *ctx, struct imap_cmd *cmd, int response);
+ int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
+ void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
void *ctx;
char *data;
int dlen;
@@ -201,6 +207,7 @@ enum CAPABILITY {
UIDPLUS,
LITERALPLUS,
NAMESPACE,
+ STARTTLS,
};
static const char *cap_list[] = {
@@ -208,13 +215,14 @@ static const char *cap_list[] = {
"UIDPLUS",
"LITERAL+",
"NAMESPACE",
+ "STARTTLS",
};
#define RESP_OK 0
#define RESP_NO 1
#define RESP_BAD 2
-static int get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd );
+static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd);
static const char *Flags[] = {
@@ -225,42 +233,137 @@ static const char *Flags[] = {
"Deleted",
};
-static void
-socket_perror( const char *func, Socket_t *sock, int ret )
+#ifndef NO_OPENSSL
+static void ssl_socket_perror(const char *func)
+{
+ fprintf(stderr, "%s: %s\n", func, ERR_error_string(ERR_get_error(), 0));
+}
+#endif
+
+static void socket_perror(const char *func, struct imap_socket *sock, int ret)
+{
+#ifndef NO_OPENSSL
+ if (sock->ssl) {
+ int sslerr = SSL_get_error(sock->ssl, ret);
+ switch (sslerr) {
+ case SSL_ERROR_NONE:
+ break;
+ case SSL_ERROR_SYSCALL:
+ perror("SSL_connect");
+ break;
+ default:
+ ssl_socket_perror("SSL_connect");
+ break;
+ }
+ } else
+#endif
+ {
+ if (ret < 0)
+ perror(func);
+ else
+ fprintf(stderr, "%s: unexpected EOF\n", func);
+ }
+}
+
+static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
{
- if (ret < 0)
- perror( func );
+#ifdef NO_OPENSSL
+ fprintf(stderr, "SSL requested but SSL support not compiled in\n");
+ return -1;
+#else
+ SSL_METHOD *meth;
+ SSL_CTX *ctx;
+ int ret;
+
+ SSL_library_init();
+ SSL_load_error_strings();
+
+ if (use_tls_only)
+ meth = TLSv1_method();
else
- fprintf( stderr, "%s: unexpected EOF\n", func );
+ meth = SSLv23_method();
+
+ if (!meth) {
+ ssl_socket_perror("SSLv23_method");
+ return -1;
+ }
+
+ ctx = SSL_CTX_new(meth);
+
+ if (verify)
+ SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
+
+ if (!SSL_CTX_set_default_verify_paths(ctx)) {
+ ssl_socket_perror("SSL_CTX_set_default_verify_paths");
+ return -1;
+ }
+ sock->ssl = SSL_new(ctx);
+ if (!sock->ssl) {
+ ssl_socket_perror("SSL_new");
+ return -1;
+ }
+ if (!SSL_set_fd(sock->ssl, sock->fd)) {
+ ssl_socket_perror("SSL_set_fd");
+ return -1;
+ }
+
+ ret = SSL_connect(sock->ssl);
+ if (ret <= 0) {
+ socket_perror("SSL_connect", sock, ret);
+ return -1;
+ }
+
+ return 0;
+#endif
}
-static int
-socket_read( Socket_t *sock, char *buf, int len )
+static int socket_read(struct imap_socket *sock, char *buf, int len)
{
- ssize_t n = xread( sock->fd, buf, len );
+ ssize_t n;
+#ifndef NO_OPENSSL
+ if (sock->ssl)
+ n = SSL_read(sock->ssl, buf, len);
+ else
+#endif
+ n = xread(sock->fd, buf, len);
if (n <= 0) {
- socket_perror( "read", sock, n );
- close( sock->fd );
+ socket_perror("read", sock, n);
+ close(sock->fd);
sock->fd = -1;
}
return n;
}
-static int
-socket_write( Socket_t *sock, const char *buf, int len )
+static int socket_write(struct imap_socket *sock, const char *buf, int len)
{
- int n = write_in_full( sock->fd, buf, len );
+ int n;
+#ifndef NO_OPENSSL
+ if (sock->ssl)
+ n = SSL_write(sock->ssl, buf, len);
+ else
+#endif
+ n = write_in_full(sock->fd, buf, len);
if (n != len) {
- socket_perror( "write", sock, n );
- close( sock->fd );
+ socket_perror("write", sock, n);
+ close(sock->fd);
sock->fd = -1;
}
return n;
}
+static void socket_shutdown(struct imap_socket *sock)
+{
+#ifndef NO_OPENSSL
+ if (sock->ssl) {
+ SSL_shutdown(sock->ssl);
+ SSL_free(sock->ssl);
+ }
+#endif
+ close(sock->fd);
+}
+
/* simple line buffering */
-static int
-buffer_gets( buffer_t * b, char **s )
+static int buffer_gets(struct imap_buffer *b, char **s)
{
int n;
int start = b->offset;
@@ -274,7 +377,7 @@ buffer_gets( buffer_t * b, char **s )
/* shift down used bytes */
*s = b->buf;
- assert( start <= b->bytes );
+ assert(start <= b->bytes);
n = b->bytes - start;
if (n)
@@ -284,8 +387,8 @@ buffer_gets( buffer_t * b, char **s )
start = 0;
}
- n = socket_read( &b->sock, b->buf + b->bytes,
- sizeof(b->buf) - b->bytes );
+ n = socket_read(&b->sock, b->buf + b->bytes,
+ sizeof(b->buf) - b->bytes);
if (n <= 0)
return -1;
@@ -294,12 +397,12 @@ buffer_gets( buffer_t * b, char **s )
}
if (b->buf[b->offset] == '\r') {
- assert( b->offset + 1 < b->bytes );
+ assert(b->offset + 1 < b->bytes);
if (b->buf[b->offset + 1] == '\n') {
b->buf[b->offset] = 0; /* terminate the string */
b->offset += 2; /* next line */
if (Verbose)
- puts( *s );
+ puts(*s);
return 0;
}
}
@@ -309,39 +412,36 @@ buffer_gets( buffer_t * b, char **s )
/* not reached */
}
-static void
-imap_info( const char *msg, ... )
+static void imap_info(const char *msg, ...)
{
va_list va;
if (!Quiet) {
- va_start( va, msg );
- vprintf( msg, va );
- va_end( va );
- fflush( stdout );
+ va_start(va, msg);
+ vprintf(msg, va);
+ va_end(va);
+ fflush(stdout);
}
}
-static void
-imap_warn( const char *msg, ... )
+static void imap_warn(const char *msg, ...)
{
va_list va;
if (Quiet < 2) {
- va_start( va, msg );
- vfprintf( stderr, msg, va );
- va_end( va );
+ va_start(va, msg);
+ vfprintf(stderr, msg, va);
+ va_end(va);
}
}
-static char *
-next_arg( char **s )
+static char *next_arg(char **s)
{
char *ret;
if (!s || !*s)
return NULL;
- while (isspace( (unsigned char) **s ))
+ while (isspace((unsigned char) **s))
(*s)++;
if (!**s) {
*s = NULL;
@@ -350,10 +450,10 @@ next_arg( char **s )
if (**s == '"') {
++*s;
ret = *s;
- *s = strchr( *s, '"' );
+ *s = strchr(*s, '"');
} else {
ret = *s;
- while (**s && !isspace( (unsigned char) **s ))
+ while (**s && !isspace((unsigned char) **s))
(*s)++;
}
if (*s) {
@@ -365,27 +465,25 @@ next_arg( char **s )
return ret;
}
-static void
-free_generic_messages( message_t *msgs )
+static void free_generic_messages(struct message *msgs)
{
- message_t *tmsg;
+ struct message *tmsg;
for (; msgs; msgs = tmsg) {
tmsg = msgs->next;
- free( msgs );
+ free(msgs);
}
}
-static int
-nfsnprintf( char *buf, int blen, const char *fmt, ... )
+static int nfsnprintf(char *buf, int blen, const char *fmt, ...)
{
int ret;
va_list va;
- va_start( va, fmt );
- if (blen <= 0 || (unsigned)(ret = vsnprintf( buf, blen, fmt, va )) >= (unsigned)blen)
- die( "Fatal: buffer too small. Please report a bug.\n");
- va_end( va );
+ va_start(va, fmt);
+ if (blen <= 0 || (unsigned)(ret = vsnprintf(buf, blen, fmt, va)) >= (unsigned)blen)
+ die("Fatal: buffer too small. Please report a bug.\n");
+ va_end(va);
return ret;
}
@@ -393,21 +491,20 @@ static struct {
unsigned char i, j, s[256];
} rs;
-static void
-arc4_init( void )
+static void arc4_init(void)
{
int i, fd;
unsigned char j, si, dat[128];
- if ((fd = open( "/dev/urandom", O_RDONLY )) < 0 && (fd = open( "/dev/random", O_RDONLY )) < 0) {
- fprintf( stderr, "Fatal: no random number source available.\n" );
- exit( 3 );
+ if ((fd = open("/dev/urandom", O_RDONLY)) < 0 && (fd = open("/dev/random", O_RDONLY)) < 0) {
+ fprintf(stderr, "Fatal: no random number source available.\n");
+ exit(3);
}
- if (read_in_full( fd, dat, 128 ) != 128) {
- fprintf( stderr, "Fatal: cannot read random number source.\n" );
- exit( 3 );
+ if (read_in_full(fd, dat, 128) != 128) {
+ fprintf(stderr, "Fatal: cannot read random number source.\n");
+ exit(3);
}
- close( fd );
+ close(fd);
for (i = 0; i < 256; i++)
rs.s[i] = i;
@@ -423,8 +520,7 @@ arc4_init( void )
arc4_getbyte();
}
-static unsigned char
-arc4_getbyte( void )
+static unsigned char arc4_getbyte(void)
{
unsigned char si, sj;
@@ -437,54 +533,53 @@ arc4_getbyte( void )
return rs.s[(si + sj) & 0xff];
}
-static struct imap_cmd *
-v_issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb,
- const char *fmt, va_list ap )
+static struct imap_cmd *v_issue_imap_cmd(struct imap_store *ctx,
+ struct imap_cmd_cb *cb,
+ const char *fmt, va_list ap)
{
- imap_t *imap = ctx->imap;
+ struct imap *imap = ctx->imap;
struct imap_cmd *cmd;
int n, bufl;
char buf[1024];
- cmd = xmalloc( sizeof(struct imap_cmd) );
- nfvasprintf( &cmd->cmd, fmt, ap );
+ cmd = xmalloc(sizeof(struct imap_cmd));
+ nfvasprintf(&cmd->cmd, fmt, ap);
cmd->tag = ++imap->nexttag;
if (cb)
cmd->cb = *cb;
else
- memset( &cmd->cb, 0, sizeof(cmd->cb) );
+ memset(&cmd->cb, 0, sizeof(cmd->cb));
while (imap->literal_pending)
- get_cmd_result( ctx, NULL );
+ get_cmd_result(ctx, NULL);
- bufl = nfsnprintf( buf, sizeof(buf), cmd->cb.data ? CAP(LITERALPLUS) ?
+ bufl = nfsnprintf(buf, sizeof(buf), cmd->cb.data ? CAP(LITERALPLUS) ?
"%d %s{%d+}\r\n" : "%d %s{%d}\r\n" : "%d %s\r\n",
- cmd->tag, cmd->cmd, cmd->cb.dlen );
+ cmd->tag, cmd->cmd, cmd->cb.dlen);
if (Verbose) {
if (imap->num_in_progress)
- printf( "(%d in progress) ", imap->num_in_progress );
- if (memcmp( cmd->cmd, "LOGIN", 5 ))
- printf( ">>> %s", buf );
+ printf("(%d in progress) ", imap->num_in_progress);
+ if (memcmp(cmd->cmd, "LOGIN", 5))
+ printf(">>> %s", buf);
else
- printf( ">>> %d LOGIN <user> <pass>\n", cmd->tag );
+ printf(">>> %d LOGIN <user> <pass>\n", cmd->tag);
}
- if (socket_write( &imap->buf.sock, buf, bufl ) != bufl) {
- free( cmd->cmd );
- free( cmd );
+ if (socket_write(&imap->buf.sock, buf, bufl) != bufl) {
+ free(cmd->cmd);
+ free(cmd);
if (cb)
- free( cb->data );
+ free(cb->data);
return NULL;
}
if (cmd->cb.data) {
if (CAP(LITERALPLUS)) {
- n = socket_write( &imap->buf.sock, cmd->cb.data, cmd->cb.dlen );
- free( cmd->cb.data );
+ n = socket_write(&imap->buf.sock, cmd->cb.data, cmd->cb.dlen);
+ free(cmd->cb.data);
if (n != cmd->cb.dlen ||
- (n = socket_write( &imap->buf.sock, "\r\n", 2 )) != 2)
- {
- free( cmd->cmd );
- free( cmd );
+ (n = socket_write(&imap->buf.sock, "\r\n", 2)) != 2) {
+ free(cmd->cmd);
+ free(cmd);
return NULL;
}
cmd->cb.data = NULL;
@@ -499,109 +594,106 @@ v_issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb,
return cmd;
}
-static struct imap_cmd *
-issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb, const char *fmt, ... )
+static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
+ struct imap_cmd_cb *cb,
+ const char *fmt, ...)
{
struct imap_cmd *ret;
va_list ap;
- va_start( ap, fmt );
- ret = v_issue_imap_cmd( ctx, cb, fmt, ap );
- va_end( ap );
+ va_start(ap, fmt);
+ ret = v_issue_imap_cmd(ctx, cb, fmt, ap);
+ va_end(ap);
return ret;
}
-static int
-imap_exec( imap_store_t *ctx, struct imap_cmd_cb *cb, const char *fmt, ... )
+static int imap_exec(struct imap_store *ctx, struct imap_cmd_cb *cb,
+ const char *fmt, ...)
{
va_list ap;
struct imap_cmd *cmdp;
- va_start( ap, fmt );
- cmdp = v_issue_imap_cmd( ctx, cb, fmt, ap );
- va_end( ap );
+ va_start(ap, fmt);
+ cmdp = v_issue_imap_cmd(ctx, cb, fmt, ap);
+ va_end(ap);
if (!cmdp)
return RESP_BAD;
- return get_cmd_result( ctx, cmdp );
+ return get_cmd_result(ctx, cmdp);
}
-static int
-imap_exec_m( imap_store_t *ctx, struct imap_cmd_cb *cb, const char *fmt, ... )
+static int imap_exec_m(struct imap_store *ctx, struct imap_cmd_cb *cb,
+ const char *fmt, ...)
{
va_list ap;
struct imap_cmd *cmdp;
- va_start( ap, fmt );
- cmdp = v_issue_imap_cmd( ctx, cb, fmt, ap );
- va_end( ap );
+ va_start(ap, fmt);
+ cmdp = v_issue_imap_cmd(ctx, cb, fmt, ap);
+ va_end(ap);
if (!cmdp)
return DRV_STORE_BAD;
- switch (get_cmd_result( ctx, cmdp )) {
+ switch (get_cmd_result(ctx, cmdp)) {
case RESP_BAD: return DRV_STORE_BAD;
case RESP_NO: return DRV_MSG_BAD;
default: return DRV_OK;
}
}
-static int
-is_atom( list_t *list )
+static int is_atom(struct imap_list *list)
{
return list && list->val && list->val != NIL && list->val != LIST;
}
-static int
-is_list( list_t *list )
+static int is_list(struct imap_list *list)
{
return list && list->val == LIST;
}
-static void
-free_list( list_t *list )
+static void free_list(struct imap_list *list)
{
- list_t *tmp;
+ struct imap_list *tmp;
for (; list; list = tmp) {
tmp = list->next;
- if (is_list( list ))
- free_list( list->child );
- else if (is_atom( list ))
- free( list->val );
- free( list );
+ if (is_list(list))
+ free_list(list->child);
+ else if (is_atom(list))
+ free(list->val);
+ free(list);
}
}
-static int
-parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
+static int parse_imap_list_l(struct imap *imap, char **sp, struct imap_list **curp, int level)
{
- list_t *cur;
+ struct imap_list *cur;
char *s = *sp, *p;
int n, bytes;
for (;;) {
- while (isspace( (unsigned char)*s ))
+ while (isspace((unsigned char)*s))
s++;
if (level && *s == ')') {
s++;
break;
}
- *curp = cur = xmalloc( sizeof(*cur) );
+ *curp = cur = xmalloc(sizeof(*cur));
curp = &cur->next;
cur->val = NULL; /* for clean bail */
if (*s == '(') {
/* sublist */
s++;
cur->val = LIST;
- if (parse_imap_list_l( imap, &s, &cur->child, level + 1 ))
+ if (parse_imap_list_l(imap, &s, &cur->child, level + 1))
goto bail;
} else if (imap && *s == '{') {
/* literal */
- bytes = cur->len = strtol( s + 1, &s, 10 );
+ bytes = cur->len = strtol(s + 1, &s, 10);
if (*s != '}')
goto bail;
- s = cur->val = xmalloc( cur->len );
+ s = cur->val = xmalloc(cur->len);
/* dump whats left over in the input buffer */
n = imap->buf.bytes - imap->buf.offset;
@@ -610,7 +702,7 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
/* the entire message fit in the buffer */
n = bytes;
- memcpy( s, imap->buf.buf + imap->buf.offset, n );
+ memcpy(s, imap->buf.buf + imap->buf.offset, n);
s += n;
bytes -= n;
@@ -619,13 +711,13 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
/* now read the rest of the message */
while (bytes > 0) {
- if ((n = socket_read (&imap->buf.sock, s, bytes)) <= 0)
+ if ((n = socket_read(&imap->buf.sock, s, bytes)) <= 0)
goto bail;
s += n;
bytes -= n;
}
- if (buffer_gets( &imap->buf, &s ))
+ if (buffer_gets(&imap->buf, &s))
goto bail;
} else if (*s == '"') {
/* quoted string */
@@ -640,15 +732,14 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
} else {
/* atom */
p = s;
- for (; *s && !isspace( (unsigned char)*s ); s++)
+ for (; *s && !isspace((unsigned char)*s); s++)
if (level && *s == ')')
break;
cur->len = s - p;
- if (cur->len == 3 && !memcmp ("NIL", p, 3)) {
+ if (cur->len == 3 && !memcmp("NIL", p, 3))
cur->val = NIL;
- } else {
+ else
cur->val = xmemdupz(p, cur->len);
- }
}
if (!level)
@@ -660,127 +751,122 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
*curp = NULL;
return 0;
- bail:
+bail:
*curp = NULL;
return -1;
}
-static list_t *
-parse_imap_list( imap_t *imap, char **sp )
+static struct imap_list *parse_imap_list(struct imap *imap, char **sp)
{
- list_t *head;
+ struct imap_list *head;
- if (!parse_imap_list_l( imap, sp, &head, 0 ))
+ if (!parse_imap_list_l(imap, sp, &head, 0))
return head;
- free_list( head );
+ free_list(head);
return NULL;
}
-static list_t *
-parse_list( char **sp )
+static struct imap_list *parse_list(char **sp)
{
- return parse_imap_list( NULL, sp );
+ return parse_imap_list(NULL, sp);
}
-static void
-parse_capability( imap_t *imap, char *cmd )
+static void parse_capability(struct imap *imap, char *cmd)
{
char *arg;
unsigned i;
imap->caps = 0x80000000;
- while ((arg = next_arg( &cmd )))
+ while ((arg = next_arg(&cmd)))
for (i = 0; i < ARRAY_SIZE(cap_list); i++)
- if (!strcmp( cap_list[i], arg ))
+ if (!strcmp(cap_list[i], arg))
imap->caps |= 1 << i;
imap->rcaps = imap->caps;
}
-static int
-parse_response_code( imap_store_t *ctx, struct imap_cmd_cb *cb, char *s )
+static int parse_response_code(struct imap_store *ctx, struct imap_cmd_cb *cb,
+ char *s)
{
- imap_t *imap = ctx->imap;
+ struct imap *imap = ctx->imap;
char *arg, *p;
if (*s != '[')
return RESP_OK; /* no response code */
s++;
- if (!(p = strchr( s, ']' ))) {
- fprintf( stderr, "IMAP error: malformed response code\n" );
+ if (!(p = strchr(s, ']'))) {
+ fprintf(stderr, "IMAP error: malformed response code\n");
return RESP_BAD;
}
*p++ = 0;
- arg = next_arg( &s );
- if (!strcmp( "UIDVALIDITY", arg )) {
- if (!(arg = next_arg( &s )) || !(ctx->gen.uidvalidity = atoi( arg ))) {
- fprintf( stderr, "IMAP error: malformed UIDVALIDITY status\n" );
+ arg = next_arg(&s);
+ if (!strcmp("UIDVALIDITY", arg)) {
+ if (!(arg = next_arg(&s)) || !(ctx->gen.uidvalidity = atoi(arg))) {
+ fprintf(stderr, "IMAP error: malformed UIDVALIDITY status\n");
return RESP_BAD;
}
- } else if (!strcmp( "UIDNEXT", arg )) {
- if (!(arg = next_arg( &s )) || !(imap->uidnext = atoi( arg ))) {
- fprintf( stderr, "IMAP error: malformed NEXTUID status\n" );
+ } else if (!strcmp("UIDNEXT", arg)) {
+ if (!(arg = next_arg(&s)) || !(imap->uidnext = atoi(arg))) {
+ fprintf(stderr, "IMAP error: malformed NEXTUID status\n");
return RESP_BAD;
}
- } else if (!strcmp( "CAPABILITY", arg )) {
- parse_capability( imap, s );
- } else if (!strcmp( "ALERT", arg )) {
+ } else if (!strcmp("CAPABILITY", arg)) {
+ parse_capability(imap, s);
+ } else if (!strcmp("ALERT", arg)) {
/* RFC2060 says that these messages MUST be displayed
* to the user
*/
- for (; isspace( (unsigned char)*p ); p++);
- fprintf( stderr, "*** IMAP ALERT *** %s\n", p );
- } else if (cb && cb->ctx && !strcmp( "APPENDUID", arg )) {
- if (!(arg = next_arg( &s )) || !(ctx->gen.uidvalidity = atoi( arg )) ||
- !(arg = next_arg( &s )) || !(*(int *)cb->ctx = atoi( arg )))
- {
- fprintf( stderr, "IMAP error: malformed APPENDUID status\n" );
+ for (; isspace((unsigned char)*p); p++);
+ fprintf(stderr, "*** IMAP ALERT *** %s\n", p);
+ } else if (cb && cb->ctx && !strcmp("APPENDUID", arg)) {
+ if (!(arg = next_arg(&s)) || !(ctx->gen.uidvalidity = atoi(arg)) ||
+ !(arg = next_arg(&s)) || !(*(int *)cb->ctx = atoi(arg))) {
+ fprintf(stderr, "IMAP error: malformed APPENDUID status\n");
return RESP_BAD;
}
}
return RESP_OK;
}
-static int
-get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
+static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
{
- imap_t *imap = ctx->imap;
+ struct imap *imap = ctx->imap;
struct imap_cmd *cmdp, **pcmdp, *ncmdp;
char *cmd, *arg, *arg1, *p;
int n, resp, resp2, tag;
for (;;) {
- if (buffer_gets( &imap->buf, &cmd ))
+ if (buffer_gets(&imap->buf, &cmd))
return RESP_BAD;
- arg = next_arg( &cmd );
+ arg = next_arg(&cmd);
if (*arg == '*') {
- arg = next_arg( &cmd );
+ arg = next_arg(&cmd);
if (!arg) {
- fprintf( stderr, "IMAP error: unable to parse untagged response\n" );
+ fprintf(stderr, "IMAP error: unable to parse untagged response\n");
return RESP_BAD;
}
- if (!strcmp( "NAMESPACE", arg )) {
- imap->ns_personal = parse_list( &cmd );
- imap->ns_other = parse_list( &cmd );
- imap->ns_shared = parse_list( &cmd );
- } else if (!strcmp( "OK", arg ) || !strcmp( "BAD", arg ) ||
- !strcmp( "NO", arg ) || !strcmp( "BYE", arg )) {
- if ((resp = parse_response_code( ctx, NULL, cmd )) != RESP_OK)
+ if (!strcmp("NAMESPACE", arg)) {
+ imap->ns_personal = parse_list(&cmd);
+ imap->ns_other = parse_list(&cmd);
+ imap->ns_shared = parse_list(&cmd);
+ } else if (!strcmp("OK", arg) || !strcmp("BAD", arg) ||
+ !strcmp("NO", arg) || !strcmp("BYE", arg)) {
+ if ((resp = parse_response_code(ctx, NULL, cmd)) != RESP_OK)
return resp;
- } else if (!strcmp( "CAPABILITY", arg ))
- parse_capability( imap, cmd );
- else if ((arg1 = next_arg( &cmd ))) {
- if (!strcmp( "EXISTS", arg1 ))
- ctx->gen.count = atoi( arg );
- else if (!strcmp( "RECENT", arg1 ))
- ctx->gen.recent = atoi( arg );
+ } else if (!strcmp("CAPABILITY", arg))
+ parse_capability(imap, cmd);
+ else if ((arg1 = next_arg(&cmd))) {
+ if (!strcmp("EXISTS", arg1))
+ ctx->gen.count = atoi(arg);
+ else if (!strcmp("RECENT", arg1))
+ ctx->gen.recent = atoi(arg);
} else {
- fprintf( stderr, "IMAP error: unable to parse untagged response\n" );
+ fprintf(stderr, "IMAP error: unable to parse untagged response\n");
return RESP_BAD;
}
} else if (!imap->in_progress) {
- fprintf( stderr, "IMAP error: unexpected reply: %s %s\n", arg, cmd ? cmd : "" );
+ fprintf(stderr, "IMAP error: unexpected reply: %s %s\n", arg, cmd ? cmd : "");
return RESP_BAD;
} else if (*arg == '+') {
/* This can happen only with the last command underway, as
@@ -788,57 +874,57 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
cmdp = (struct imap_cmd *)((char *)imap->in_progress_append -
offsetof(struct imap_cmd, next));
if (cmdp->cb.data) {
- n = socket_write( &imap->buf.sock, cmdp->cb.data, cmdp->cb.dlen );
- free( cmdp->cb.data );
+ n = socket_write(&imap->buf.sock, cmdp->cb.data, cmdp->cb.dlen);
+ free(cmdp->cb.data);
cmdp->cb.data = NULL;
if (n != (int)cmdp->cb.dlen)
return RESP_BAD;
} else if (cmdp->cb.cont) {
- if (cmdp->cb.cont( ctx, cmdp, cmd ))
+ if (cmdp->cb.cont(ctx, cmdp, cmd))
return RESP_BAD;
} else {
- fprintf( stderr, "IMAP error: unexpected command continuation request\n" );
+ fprintf(stderr, "IMAP error: unexpected command continuation request\n");
return RESP_BAD;
}
- if (socket_write( &imap->buf.sock, "\r\n", 2 ) != 2)
+ if (socket_write(&imap->buf.sock, "\r\n", 2) != 2)
return RESP_BAD;
if (!cmdp->cb.cont)
imap->literal_pending = 0;
if (!tcmd)
return DRV_OK;
} else {
- tag = atoi( arg );
+ tag = atoi(arg);
for (pcmdp = &imap->in_progress; (cmdp = *pcmdp); pcmdp = &cmdp->next)
if (cmdp->tag == tag)
goto gottag;
- fprintf( stderr, "IMAP error: unexpected tag %s\n", arg );
+ fprintf(stderr, "IMAP error: unexpected tag %s\n", arg);
return RESP_BAD;
- gottag:
+ gottag:
if (!(*pcmdp = cmdp->next))
imap->in_progress_append = pcmdp;
imap->num_in_progress--;
if (cmdp->cb.cont || cmdp->cb.data)
imap->literal_pending = 0;
- arg = next_arg( &cmd );
- if (!strcmp( "OK", arg ))
+ arg = next_arg(&cmd);
+ if (!strcmp("OK", arg))
resp = DRV_OK;
else {
- if (!strcmp( "NO", arg )) {
- if (cmdp->cb.create && cmd && (cmdp->cb.trycreate || !memcmp( cmd, "[TRYCREATE]", 11 ))) { /* SELECT, APPEND or UID COPY */
- p = strchr( cmdp->cmd, '"' );
- if (!issue_imap_cmd( ctx, NULL, "CREATE \"%.*s\"", strchr( p + 1, '"' ) - p + 1, p )) {
+ if (!strcmp("NO", arg)) {
+ if (cmdp->cb.create && cmd && (cmdp->cb.trycreate || !memcmp(cmd, "[TRYCREATE]", 11))) { /* SELECT, APPEND or UID COPY */
+ p = strchr(cmdp->cmd, '"');
+ if (!issue_imap_cmd(ctx, NULL, "CREATE \"%.*s\"", strchr(p + 1, '"') - p + 1, p)) {
resp = RESP_BAD;
goto normal;
}
/* not waiting here violates the spec, but a server that does not
grok this nonetheless violates it too. */
cmdp->cb.create = 0;
- if (!(ncmdp = issue_imap_cmd( ctx, &cmdp->cb, "%s", cmdp->cmd ))) {
+ if (!(ncmdp = issue_imap_cmd(ctx, &cmdp->cb, "%s", cmdp->cmd))) {
resp = RESP_BAD;
goto normal;
}
- free( cmdp->cmd );
- free( cmdp );
+ free(cmdp->cmd);
+ free(cmdp);
if (!tcmd)
return 0; /* ignored */
if (cmdp == tcmd)
@@ -846,21 +932,21 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
continue;
}
resp = RESP_NO;
- } else /*if (!strcmp( "BAD", arg ))*/
+ } else /*if (!strcmp("BAD", arg))*/
resp = RESP_BAD;
- fprintf( stderr, "IMAP command '%s' returned response (%s) - %s\n",
- memcmp (cmdp->cmd, "LOGIN", 5) ?
+ fprintf(stderr, "IMAP command '%s' returned response (%s) - %s\n",
+ memcmp(cmdp->cmd, "LOGIN", 5) ?
cmdp->cmd : "LOGIN <user> <pass>",
arg, cmd ? cmd : "");
}
- if ((resp2 = parse_response_code( ctx, &cmdp->cb, cmd )) > resp)
+ if ((resp2 = parse_response_code(ctx, &cmdp->cb, cmd)) > resp)
resp = resp2;
- normal:
+ normal:
if (cmdp->cb.done)
- cmdp->cb.done( ctx, cmdp, resp );
- free( cmdp->cb.data );
- free( cmdp->cmd );
- free( cmdp );
+ cmdp->cb.done(ctx, cmdp, resp);
+ free(cmdp->cb.data);
+ free(cmdp->cmd);
+ free(cmdp);
if (!tcmd || tcmd == cmdp)
return resp;
}
@@ -868,170 +954,184 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
/* not reached */
}
-static void
-imap_close_server( imap_store_t *ictx )
+static void imap_close_server(struct imap_store *ictx)
{
- imap_t *imap = ictx->imap;
+ struct imap *imap = ictx->imap;
if (imap->buf.sock.fd != -1) {
- imap_exec( ictx, NULL, "LOGOUT" );
- close( imap->buf.sock.fd );
+ imap_exec(ictx, NULL, "LOGOUT");
+ socket_shutdown(&imap->buf.sock);
}
- free_list( imap->ns_personal );
- free_list( imap->ns_other );
- free_list( imap->ns_shared );
- free( imap );
+ free_list(imap->ns_personal);
+ free_list(imap->ns_other);
+ free_list(imap->ns_shared);
+ free(imap);
}
-static void
-imap_close_store( store_t *ctx )
+static void imap_close_store(struct store *ctx)
{
- imap_close_server( (imap_store_t *)ctx );
- free_generic_messages( ctx->msgs );
- free( ctx );
+ imap_close_server((struct imap_store *)ctx);
+ free_generic_messages(ctx->msgs);
+ free(ctx);
}
-static store_t *
-imap_open_store( imap_server_conf_t *srvc )
+static struct store *imap_open_store(struct imap_server_conf *srvc)
{
- imap_store_t *ctx;
- imap_t *imap;
+ struct imap_store *ctx;
+ struct imap *imap;
char *arg, *rsp;
struct hostent *he;
struct sockaddr_in addr;
int s, a[2], preauth;
pid_t pid;
- ctx = xcalloc( sizeof(*ctx), 1 );
+ ctx = xcalloc(sizeof(*ctx), 1);
- ctx->imap = imap = xcalloc( sizeof(*imap), 1 );
+ ctx->imap = imap = xcalloc(sizeof(*imap), 1);
imap->buf.sock.fd = -1;
imap->in_progress_append = &imap->in_progress;
/* open connection to IMAP server */
if (srvc->tunnel) {
- imap_info( "Starting tunnel '%s'... ", srvc->tunnel );
+ imap_info("Starting tunnel '%s'... ", srvc->tunnel);
- if (socketpair( PF_UNIX, SOCK_STREAM, 0, a )) {
- perror( "socketpair" );
- exit( 1 );
+ if (socketpair(PF_UNIX, SOCK_STREAM, 0, a)) {
+ perror("socketpair");
+ exit(1);
}
pid = fork();
if (pid < 0)
- _exit( 127 );
+ _exit(127);
if (!pid) {
- if (dup2( a[0], 0 ) == -1 || dup2( a[0], 1 ) == -1)
- _exit( 127 );
- close( a[0] );
- close( a[1] );
- execl( "/bin/sh", "sh", "-c", srvc->tunnel, NULL );
- _exit( 127 );
+ if (dup2(a[0], 0) == -1 || dup2(a[0], 1) == -1)
+ _exit(127);
+ close(a[0]);
+ close(a[1]);
+ execl("/bin/sh", "sh", "-c", srvc->tunnel, NULL);
+ _exit(127);
}
- close (a[0]);
+ close(a[0]);
imap->buf.sock.fd = a[1];
- imap_info( "ok\n" );
+ imap_info("ok\n");
} else {
- memset( &addr, 0, sizeof(addr) );
- addr.sin_port = htons( srvc->port );
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_port = htons(srvc->port);
addr.sin_family = AF_INET;
- imap_info( "Resolving %s... ", srvc->host );
- he = gethostbyname( srvc->host );
+ imap_info("Resolving %s... ", srvc->host);
+ he = gethostbyname(srvc->host);
if (!he) {
- perror( "gethostbyname" );
+ perror("gethostbyname");
goto bail;
}
- imap_info( "ok\n" );
+ imap_info("ok\n");
addr.sin_addr.s_addr = *((int *) he->h_addr_list[0]);
- s = socket( PF_INET, SOCK_STREAM, 0 );
+ s = socket(PF_INET, SOCK_STREAM, 0);
- imap_info( "Connecting to %s:%hu... ", inet_ntoa( addr.sin_addr ), ntohs( addr.sin_port ) );
- if (connect( s, (struct sockaddr *)&addr, sizeof(addr) )) {
- close( s );
- perror( "connect" );
+ imap_info("Connecting to %s:%hu... ", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
+ if (connect(s, (struct sockaddr *)&addr, sizeof(addr))) {
+ close(s);
+ perror("connect");
goto bail;
}
- imap_info( "ok\n" );
imap->buf.sock.fd = s;
+ if (srvc->use_ssl &&
+ ssl_socket_connect(&imap->buf.sock, 0, srvc->ssl_verify)) {
+ close(s);
+ goto bail;
+ }
+ imap_info("ok\n");
}
/* read the greeting string */
- if (buffer_gets( &imap->buf, &rsp )) {
- fprintf( stderr, "IMAP error: no greeting response\n" );
+ if (buffer_gets(&imap->buf, &rsp)) {
+ fprintf(stderr, "IMAP error: no greeting response\n");
goto bail;
}
- arg = next_arg( &rsp );
- if (!arg || *arg != '*' || (arg = next_arg( &rsp )) == NULL) {
- fprintf( stderr, "IMAP error: invalid greeting response\n" );
+ arg = next_arg(&rsp);
+ if (!arg || *arg != '*' || (arg = next_arg(&rsp)) == NULL) {
+ fprintf(stderr, "IMAP error: invalid greeting response\n");
goto bail;
}
preauth = 0;
- if (!strcmp( "PREAUTH", arg ))
+ if (!strcmp("PREAUTH", arg))
preauth = 1;
- else if (strcmp( "OK", arg ) != 0) {
- fprintf( stderr, "IMAP error: unknown greeting response\n" );
+ else if (strcmp("OK", arg) != 0) {
+ fprintf(stderr, "IMAP error: unknown greeting response\n");
goto bail;
}
- parse_response_code( ctx, NULL, rsp );
- if (!imap->caps && imap_exec( ctx, NULL, "CAPABILITY" ) != RESP_OK)
+ parse_response_code(ctx, NULL, rsp);
+ if (!imap->caps && imap_exec(ctx, NULL, "CAPABILITY") != RESP_OK)
goto bail;
if (!preauth) {
-
- imap_info ("Logging in...\n");
+#ifndef NO_OPENSSL
+ if (!srvc->use_ssl && CAP(STARTTLS)) {
+ if (imap_exec(ctx, 0, "STARTTLS") != RESP_OK)
+ goto bail;
+ if (ssl_socket_connect(&imap->buf.sock, 1,
+ srvc->ssl_verify))
+ goto bail;
+ /* capabilities may have changed, so get the new capabilities */
+ if (imap_exec(ctx, 0, "CAPABILITY") != RESP_OK)
+ goto bail;
+ }
+#endif
+ imap_info("Logging in...\n");
if (!srvc->user) {
- fprintf( stderr, "Skipping server %s, no user\n", srvc->host );
+ fprintf(stderr, "Skipping server %s, no user\n", srvc->host);
goto bail;
}
if (!srvc->pass) {
char prompt[80];
- sprintf( prompt, "Password (%s@%s): ", srvc->user, srvc->host );
- arg = getpass( prompt );
+ sprintf(prompt, "Password (%s@%s): ", srvc->user, srvc->host);
+ arg = getpass(prompt);
if (!arg) {
- perror( "getpass" );
- exit( 1 );
+ perror("getpass");
+ exit(1);
}
if (!*arg) {
- fprintf( stderr, "Skipping account %s@%s, no password\n", srvc->user, srvc->host );
+ fprintf(stderr, "Skipping account %s@%s, no password\n", srvc->user, srvc->host);
goto bail;
}
/*
* getpass() returns a pointer to a static buffer. make a copy
* for long term storage.
*/
- srvc->pass = xstrdup( arg );
+ srvc->pass = xstrdup(arg);
}
if (CAP(NOLOGIN)) {
- fprintf( stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host );
+ fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
goto bail;
}
- imap_warn( "*** IMAP Warning *** Password is being sent in the clear\n" );
- if (imap_exec( ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass ) != RESP_OK) {
- fprintf( stderr, "IMAP error: LOGIN failed\n" );
+ if (!imap->buf.sock.ssl)
+ imap_warn("*** IMAP Warning *** Password is being "
+ "sent in the clear\n");
+ if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
+ fprintf(stderr, "IMAP error: LOGIN failed\n");
goto bail;
}
} /* !preauth */
ctx->prefix = "";
ctx->trashnc = 1;
- return (store_t *)ctx;
+ return (struct store *)ctx;
- bail:
- imap_close_store( &ctx->gen );
+bail:
+ imap_close_store(&ctx->gen);
return NULL;
}
-static int
-imap_make_flags( int flags, char *buf )
+static int imap_make_flags(int flags, char *buf)
{
const char *s;
unsigned i, d;
@@ -1050,11 +1150,10 @@ imap_make_flags( int flags, char *buf )
#define TUIDL 8
-static int
-imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
+static int imap_store_msg(struct store *gctx, struct msg_data *data, int *uid)
{
- imap_store_t *ctx = (imap_store_t *)gctx;
- imap_t *imap = ctx->imap;
+ struct imap_store *ctx = (struct imap_store *)gctx;
+ struct imap *imap = ctx->imap;
struct imap_cmd_cb cb;
char *fmap, *buf;
const char *prefix, *box;
@@ -1062,14 +1161,14 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
int start, sbreak = 0, ebreak = 0;
char flagstr[128], tuid[TUIDL * 2 + 1];
- memset( &cb, 0, sizeof(cb) );
+ memset(&cb, 0, sizeof(cb));
fmap = data->data;
len = data->len;
nocr = !data->crlf;
extra = 0, i = 0;
if (!CAP(UIDPLUS) && uid) {
- nloop:
+ nloop:
start = i;
while (i < len)
if (fmap[i++] == '\n') {
@@ -1078,18 +1177,18 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
sbreak = ebreak = i - 2 + nocr;
goto mktid;
}
- if (!memcmp( fmap + start, "X-TUID: ", 8 )) {
+ if (!memcmp(fmap + start, "X-TUID: ", 8)) {
extra -= (ebreak = i) - (sbreak = start) + nocr;
goto mktid;
}
goto nloop;
}
/* invalid message */
- free( fmap );
+ free(fmap);
return DRV_MSG_BAD;
- mktid:
+ mktid:
for (j = 0; j < TUIDL; j++)
- sprintf( tuid + j * 2, "%02x", arc4_getbyte() );
+ sprintf(tuid + j * 2, "%02x", arc4_getbyte());
extra += 8 + TUIDL * 2 + 2;
}
if (nocr)
@@ -1098,7 +1197,7 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
extra++;
cb.dlen = len + extra;
- buf = cb.data = xmalloc( cb.dlen );
+ buf = cb.data = xmalloc(cb.dlen);
i = 0;
if (!CAP(UIDPLUS) && uid) {
if (nocr) {
@@ -1109,12 +1208,12 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
} else
*buf++ = fmap[i];
} else {
- memcpy( buf, fmap, sbreak );
+ memcpy(buf, fmap, sbreak);
buf += sbreak;
}
- memcpy( buf, "X-TUID: ", 8 );
+ memcpy(buf, "X-TUID: ", 8);
buf += 8;
- memcpy( buf, tuid, TUIDL * 2 );
+ memcpy(buf, tuid, TUIDL * 2);
buf += TUIDL * 2;
*buf++ = '\r';
*buf++ = '\n';
@@ -1128,13 +1227,13 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
} else
*buf++ = fmap[i];
} else
- memcpy( buf, fmap + i, len - i );
+ memcpy(buf, fmap + i, len - i);
- free( fmap );
+ free(fmap);
d = 0;
if (data->flags) {
- d = imap_make_flags( data->flags, flagstr );
+ d = imap_make_flags(data->flags, flagstr);
flagstr[d++] = ' ';
}
flagstr[d] = 0;
@@ -1147,11 +1246,11 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
imap->caps = imap->rcaps & ~(1 << LITERALPLUS);
} else {
box = gctx->name;
- prefix = !strcmp( box, "INBOX" ) ? "" : ctx->prefix;
+ prefix = !strcmp(box, "INBOX") ? "" : ctx->prefix;
cb.create = 0;
}
cb.ctx = uid;
- ret = imap_exec_m( ctx, &cb, "APPEND \"%s%s\" %s", prefix, box, flagstr );
+ ret = imap_exec_m(ctx, &cb, "APPEND \"%s%s\" %s", prefix, box, flagstr);
imap->caps = imap->rcaps;
if (ret != DRV_OK)
return ret;
@@ -1165,8 +1264,7 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid )
#define CHUNKSIZE 0x1000
-static int
-read_message( FILE *f, msg_data_t *msg )
+static int read_message(FILE *f, struct msg_data *msg)
{
struct strbuf buf;
@@ -1183,8 +1281,7 @@ read_message( FILE *f, msg_data_t *msg )
return msg->len;
}
-static int
-count_messages( msg_data_t *msg )
+static int count_messages(struct msg_data *msg)
{
int count = 0;
char *p = msg->data;
@@ -1194,7 +1291,7 @@ count_messages( msg_data_t *msg )
count++;
p += 5;
}
- p = strstr( p+5, "\nFrom ");
+ p = strstr(p+5, "\nFrom ");
if (!p)
break;
p++;
@@ -1202,22 +1299,21 @@ count_messages( msg_data_t *msg )
return count;
}
-static int
-split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs )
+static int split_msg(struct msg_data *all_msgs, struct msg_data *msg, int *ofs)
{
char *p, *data;
- memset( msg, 0, sizeof *msg );
+ memset(msg, 0, sizeof *msg);
if (*ofs >= all_msgs->len)
return 0;
- data = &all_msgs->data[ *ofs ];
+ data = &all_msgs->data[*ofs];
msg->len = all_msgs->len - *ofs;
if (msg->len < 5 || prefixcmp(data, "From "))
return 0;
- p = strchr( data, '\n' );
+ p = strchr(data, '\n');
if (p) {
p = &p[1];
msg->len -= p-data;
@@ -1225,7 +1321,7 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs )
data = p;
}
- p = strstr( data, "\nFrom " );
+ p = strstr(data, "\nFrom ");
if (p)
msg->len = &p[1] - data;
@@ -1234,24 +1330,24 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs )
return 1;
}
-static imap_server_conf_t server =
-{
+static struct imap_server_conf server = {
NULL, /* name */
NULL, /* tunnel */
NULL, /* host */
0, /* port */
NULL, /* user */
NULL, /* pass */
+ 0, /* use_ssl */
+ 1, /* ssl_verify */
};
static char *imap_folder;
-static int
-git_imap_config(const char *key, const char *val, void *cb)
+static int git_imap_config(const char *key, const char *val, void *cb)
{
char imap_key[] = "imap.";
- if (strncmp( key, imap_key, sizeof imap_key - 1 ))
+ if (strncmp(key, imap_key, sizeof imap_key - 1))
return 0;
if (!val)
@@ -1259,90 +1355,96 @@ git_imap_config(const char *key, const char *val, void *cb)
key += sizeof imap_key - 1;
- if (!strcmp( "folder", key )) {
- imap_folder = xstrdup( val );
- } else if (!strcmp( "host", key )) {
- {
- if (!prefixcmp(val, "imap:"))
- val += 5;
- if (!server.port)
- server.port = 143;
+ if (!strcmp("folder", key)) {
+ imap_folder = xstrdup(val);
+ } else if (!strcmp("host", key)) {
+ if (!prefixcmp(val, "imap:"))
+ val += 5;
+ else if (!prefixcmp(val, "imaps:")) {
+ val += 6;
+ server.use_ssl = 1;
}
if (!prefixcmp(val, "//"))
val += 2;
- server.host = xstrdup( val );
- }
- else if (!strcmp( "user", key ))
- server.user = xstrdup( val );
- else if (!strcmp( "pass", key ))
- server.pass = xstrdup( val );
- else if (!strcmp( "port", key ))
- server.port = git_config_int( key, val );
- else if (!strcmp( "tunnel", key ))
- server.tunnel = xstrdup( val );
+ server.host = xstrdup(val);
+ } else if (!strcmp("user", key))
+ server.user = xstrdup(val);
+ else if (!strcmp("pass", key))
+ server.pass = xstrdup(val);
+ else if (!strcmp("port", key))
+ server.port = git_config_int(key, val);
+ else if (!strcmp("tunnel", key))
+ server.tunnel = xstrdup(val);
+ else if (!strcmp("sslverify", key))
+ server.ssl_verify = git_config_bool(key, val);
return 0;
}
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
- msg_data_t all_msgs, msg;
- store_t *ctx = NULL;
+ struct msg_data all_msgs, msg;
+ struct store *ctx = NULL;
int uid = 0;
int ofs = 0;
int r;
int total, n = 0;
+ int nongit_ok;
/* init the random number generator */
arc4_init();
+ setup_git_directory_gently(&nongit_ok);
git_config(git_imap_config, NULL);
+ if (!server.port)
+ server.port = server.use_ssl ? 993 : 143;
+
if (!imap_folder) {
- fprintf( stderr, "no imap store specified\n" );
+ fprintf(stderr, "no imap store specified\n");
return 1;
}
if (!server.host) {
if (!server.tunnel) {
- fprintf( stderr, "no imap host specified\n" );
+ fprintf(stderr, "no imap host specified\n");
return 1;
}
server.host = "tunnel";
}
/* read the messages */
- if (!read_message( stdin, &all_msgs )) {
- fprintf(stderr,"nothing to send\n");
+ if (!read_message(stdin, &all_msgs)) {
+ fprintf(stderr, "nothing to send\n");
return 1;
}
- total = count_messages( &all_msgs );
+ total = count_messages(&all_msgs);
if (!total) {
- fprintf(stderr,"no messages to send\n");
+ fprintf(stderr, "no messages to send\n");
return 1;
}
/* write it to the imap server */
- ctx = imap_open_store( &server );
+ ctx = imap_open_store(&server);
if (!ctx) {
- fprintf( stderr,"failed to open store\n");
+ fprintf(stderr, "failed to open store\n");
return 1;
}
- fprintf( stderr, "sending %d message%s\n", total, (total!=1)?"s":"" );
+ fprintf(stderr, "sending %d message%s\n", total, (total != 1) ? "s" : "");
ctx->name = imap_folder;
while (1) {
unsigned percent = n * 100 / total;
- fprintf( stderr, "%4u%% (%d/%d) done\r", percent, n, total );
- if (!split_msg( &all_msgs, &msg, &ofs ))
+ fprintf(stderr, "%4u%% (%d/%d) done\r", percent, n, total);
+ if (!split_msg(&all_msgs, &msg, &ofs))
+ break;
+ r = imap_store_msg(ctx, &msg, &uid);
+ if (r != DRV_OK)
break;
- r = imap_store_msg( ctx, &msg, &uid );
- if (r != DRV_OK) break;
n++;
}
- fprintf( stderr,"\n" );
+ fprintf(stderr, "\n");
- imap_close_store( ctx );
+ imap_close_store(ctx);
return 0;
}
diff --git a/index-pack.c b/index-pack.c
index 52064befdb..728af7da9c 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -876,7 +876,9 @@ int main(int argc, char **argv)
char *index_name_buf = NULL, *keep_name_buf = NULL;
struct pack_idx_entry **idx_objects;
unsigned char sha1[20];
+ int nongit = 0;
+ setup_git_directory_gently(&nongit);
git_config(git_index_pack_config, NULL);
for (i = 1; i < argc; i++) {
diff --git a/log-tree.c b/log-tree.c
index 5505606ed6..30cd5bb228 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -198,7 +198,7 @@ void log_write_email_headers(struct rev_info *opt, const char *name,
extra_headers = subject_buffer;
snprintf(buffer, sizeof(buffer) - 1,
- "--%s%s\n"
+ "\n--%s%s\n"
"Content-Type: text/x-patch;"
" name=\"%s.diff\"\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -432,7 +432,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
struct commit_list *parents;
unsigned const char *sha1 = commit->object.sha1;
- if (!opt->diff)
+ if (!opt->diff && !DIFF_OPT_TST(&opt->diffopt, EXIT_WITH_STATUS))
return 0;
/* Root commit? */
diff --git a/pack-revindex.c b/pack-revindex.c
index cd300bdff5..6096b6224a 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -142,3 +142,15 @@ struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs)
} while (lo < hi);
die("internal error: pack revindex corrupt");
}
+
+void discard_revindex(void)
+{
+ if (pack_revindex_hashsz) {
+ int i;
+ for (i = 0; i < pack_revindex_hashsz; i++)
+ if (pack_revindex[i].revindex)
+ free(pack_revindex[i].revindex);
+ free(pack_revindex);
+ pack_revindex_hashsz = 0;
+ }
+}
diff --git a/pack-revindex.h b/pack-revindex.h
index 36a514a6cf..8d5027ad91 100644
--- a/pack-revindex.h
+++ b/pack-revindex.h
@@ -7,5 +7,6 @@ struct revindex_entry {
};
struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs);
+void discard_revindex(void);
#endif
diff --git a/pack-write.c b/pack-write.c
index a8f0269936..ddcfd37af2 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -179,6 +179,7 @@ void fixup_pack_header_footer(int pack_fd,
SHA1_Final(pack_file_sha1, &c);
write_or_die(pack_fd, pack_file_sha1, 20);
+ fsync_or_die(pack_fd, pack_name);
}
char *index_pack_lockfile(int ip_out)
diff --git a/pager.c b/pager.c
index 6b5c9e44b4..aa0966c9c5 100644
--- a/pager.c
+++ b/pager.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "run-command.h"
/*
* This is split up from the rest of git so that we can do
@@ -8,7 +9,7 @@
static int spawned_pager;
#ifndef __MINGW32__
-static void run_pager(const char *pager)
+static void pager_preexec(void)
{
/*
* Work around bug in "less" by not starting it until we
@@ -20,17 +21,13 @@ static void run_pager(const char *pager)
FD_SET(0, &in);
select(1, &in, NULL, &in, NULL);
- execlp(pager, pager, NULL);
- execl("/bin/sh", "sh", "-c", pager, NULL);
+ setenv("LESS", "FRSX", 0);
}
-#else
-#include "run-command.h"
+#endif
static const char *pager_argv[] = { "sh", "-c", NULL, NULL };
-static struct child_process pager_process = {
- .argv = pager_argv,
- .in = -1
-};
+static struct child_process pager_process;
+
static void wait_for_pager(void)
{
fflush(stdout);
@@ -40,14 +37,9 @@ static void wait_for_pager(void)
close(2);
finish_command(&pager_process);
}
-#endif
void setup_pager(void)
{
-#ifndef __MINGW32__
- pid_t pid;
- int fd[2];
-#endif
const char *pager = getenv("GIT_PAGER");
if (!isatty(1))
@@ -66,37 +58,13 @@ void setup_pager(void)
spawned_pager = 1; /* means we are emitting to terminal */
-#ifndef __MINGW32__
- if (pipe(fd) < 0)
- return;
- pid = fork();
- if (pid < 0) {
- close(fd[0]);
- close(fd[1]);
- return;
- }
-
- /* return in the child */
- if (!pid) {
- dup2(fd[1], 1);
- dup2(fd[1], 2);
- close(fd[0]);
- close(fd[1]);
- return;
- }
-
- /* The original process turns into the PAGER */
- dup2(fd[0], 0);
- close(fd[0]);
- close(fd[1]);
-
- setenv("LESS", "FRSX", 0);
- run_pager(pager);
- die("unable to execute pager '%s'", pager);
- exit(255);
-#else
/* spawn the pager */
pager_argv[2] = pager;
+ pager_process.argv = pager_argv;
+ pager_process.in = -1;
+#ifndef __MINGW32__
+ pager_process.preexec_cb = pager_preexec;
+#endif
if (start_command(&pager_process))
return;
@@ -107,7 +75,6 @@ void setup_pager(void)
/* this makes sure that the parent terminates after the pager */
atexit(wait_for_pager);
-#endif
}
int pager_in_use(void)
diff --git a/parse-options.c b/parse-options.c
index 71a7acf4e2..fd08bb425c 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -483,3 +483,15 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
*(unsigned long *)(opt->value) = approxidate(arg);
return 0;
}
+
+/*
+ * This should really be OPTION_FILENAME type as a part of
+ * parse_options that take prefix to do this while parsing.
+ */
+extern const char *parse_options_fix_filename(const char *prefix, const char *file)
+{
+ if (!file || !prefix || is_absolute_path(file) || !strcmp("-", file))
+ return file;
+ return prefix_filename(prefix, strlen(prefix), file);
+}
+
diff --git a/parse-options.h b/parse-options.h
index bc317e7512..5199950c00 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -159,4 +159,6 @@ extern int parse_opt_approxidate_cb(const struct option *, const char *, int);
"use <n> digits to display SHA-1s", \
PARSE_OPT_OPTARG, &parse_opt_abbrev_cb, 0 }
+extern const char *parse_options_fix_filename(const char *prefix, const char *file);
+
#endif
diff --git a/path.c b/path.c
index 9df447bd6d..76e8872622 100644
--- a/path.c
+++ b/path.c
@@ -365,7 +365,7 @@ int normalize_absolute_path(char *buf, const char *path)
* path = Canonical absolute path
* prefix_list = Colon-separated list of absolute paths
*
- * Determines, for each path in parent_list, whether the "prefix" really
+ * Determines, for each path in prefix_list, whether the "prefix" really
* is an ancestor directory of path. Returns the length of the longest
* ancestor directory, excluding any trailing slashes, or -1 if no prefix
* is an ancestor. (Note that this means 0 is returned if prefix_list is
diff --git a/perl/Git.pm b/perl/Git.pm
index d99e778200..102e6a4ce3 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -57,7 +57,8 @@ require Exporter;
command_output_pipe command_input_pipe command_close_pipe
command_bidi_pipe command_close_bidi_pipe
version exec_path hash_object git_cmd_try
- remote_refs);
+ remote_refs
+ temp_acquire temp_release temp_reset);
=head1 DESCRIPTION
@@ -90,7 +91,7 @@ TODO: In the future, we might also do
Currently, the module merely wraps calls to external Git tools. In the future,
it will provide a much faster way to interact with Git by linking directly
to libgit. This should be completely opaque to the user, though (performance
-increate nonwithstanding).
+increase notwithstanding).
=cut
@@ -99,7 +100,7 @@ use Carp qw(carp croak); # but croak is bad - throw instead
use Error qw(:try);
use Cwd qw(abs_path);
use IPC::Open2 qw(open2);
-
+use Fcntl qw(SEEK_SET SEEK_CUR);
}
@@ -417,6 +418,7 @@ have more complicated structure.
=cut
sub command_close_bidi_pipe {
+ local $?;
my ($pid, $in, $out, $ctx) = @_;
foreach my $fh ($in, $out) {
unless (close $fh) {
@@ -730,7 +732,7 @@ This suite of functions retrieves and parses ident information, as stored
in the commit and tag objects or produced by C<var GIT_type_IDENT> (thus
C<TYPE> can be either I<author> or I<committer>; case is insignificant).
-The C<ident> method retrieves the ident information from C<git-var>
+The C<ident> method retrieves the ident information from C<git var>
and either returns it as a scalar string or as an array with the fields parsed.
Alternatively, it can take a prepared ident string (e.g. from the commit
object) and just parse it.
@@ -839,8 +841,8 @@ sub _close_hash_and_insert_object {
my @vars = map { 'hash_object_' . $_ } qw(pid in out ctx);
- command_close_bidi_pipe($self->{@vars});
- delete $self->{@vars};
+ command_close_bidi_pipe(@$self{@vars});
+ delete @$self{@vars};
}
=item cat_blob ( SHA1, FILEHANDLE )
@@ -928,10 +930,135 @@ sub _close_cat_blob {
my @vars = map { 'cat_blob_' . $_ } qw(pid in out ctx);
- command_close_bidi_pipe($self->{@vars});
- delete $self->{@vars};
+ command_close_bidi_pipe(@$self{@vars});
+ delete @$self{@vars};
+}
+
+
+{ # %TEMP_* Lexical Context
+
+my (%TEMP_LOCKS, %TEMP_FILES);
+
+=item temp_acquire ( NAME )
+
+Attempts to retreive the temporary file mapped to the string C<NAME>. If an
+associated temp file has not been created this session or was closed, it is
+created, cached, and set for autoflush and binmode.
+
+Internally locks the file mapped to C<NAME>. This lock must be released with
+C<temp_release()> when the temp file is no longer needed. Subsequent attempts
+to retrieve temporary files mapped to the same C<NAME> while still locked will
+cause an error. This locking mechanism provides a weak guarantee and is not
+threadsafe. It does provide some error checking to help prevent temp file refs
+writing over one another.
+
+In general, the L<File::Handle> returned should not be closed by consumers as
+it defeats the purpose of this caching mechanism. If you need to close the temp
+file handle, then you should use L<File::Temp> or another temp file faculty
+directly. If a handle is closed and then requested again, then a warning will
+issue.
+
+=cut
+
+sub temp_acquire {
+ my ($self, $name) = _maybe_self(@_);
+
+ my $temp_fd = _temp_cache($name);
+
+ $TEMP_LOCKS{$temp_fd} = 1;
+ $temp_fd;
}
+=item temp_release ( NAME )
+
+=item temp_release ( FILEHANDLE )
+
+Releases a lock acquired through C<temp_acquire()>. Can be called either with
+the C<NAME> mapping used when acquiring the temp file or with the C<FILEHANDLE>
+referencing a locked temp file.
+
+Warns if an attempt is made to release a file that is not locked.
+
+The temp file will be truncated before being released. This can help to reduce
+disk I/O where the system is smart enough to detect the truncation while data
+is in the output buffers. Beware that after the temp file is released and
+truncated, any operations on that file may fail miserably until it is
+re-acquired. All contents are lost between each release and acquire mapped to
+the same string.
+
+=cut
+
+sub temp_release {
+ my ($self, $temp_fd, $trunc) = _maybe_self(@_);
+
+ if (ref($temp_fd) ne 'File::Temp') {
+ $temp_fd = $TEMP_FILES{$temp_fd};
+ }
+ unless ($TEMP_LOCKS{$temp_fd}) {
+ carp "Attempt to release temp file '",
+ $temp_fd, "' that has not been locked";
+ }
+ temp_reset($temp_fd) if $trunc and $temp_fd->opened;
+
+ $TEMP_LOCKS{$temp_fd} = 0;
+ undef;
+}
+
+sub _temp_cache {
+ my ($name) = @_;
+
+ _verify_require();
+
+ my $temp_fd = \$TEMP_FILES{$name};
+ if (defined $$temp_fd and $$temp_fd->opened) {
+ if ($TEMP_LOCKS{$$temp_fd}) {
+ throw Error::Simple("Temp file with moniker '",
+ $name, "' already in use");
+ }
+ } else {
+ if (defined $$temp_fd) {
+ # then we're here because of a closed handle.
+ carp "Temp file '", $name,
+ "' was closed. Opening replacement.";
+ }
+ $$temp_fd = File::Temp->new(
+ TEMPLATE => 'Git_XXXXXX',
+ DIR => File::Spec->tmpdir
+ ) or throw Error::Simple("couldn't open new temp file");
+ $$temp_fd->autoflush;
+ binmode $$temp_fd;
+ }
+ $$temp_fd;
+}
+
+sub _verify_require {
+ eval { require File::Temp; require File::Spec; };
+ $@ and throw Error::Simple($@);
+}
+
+=item temp_reset ( FILEHANDLE )
+
+Truncates and resets the position of the C<FILEHANDLE>.
+
+=cut
+
+sub temp_reset {
+ my ($self, $temp_fd) = _maybe_self(@_);
+
+ truncate $temp_fd, 0
+ or throw Error::Simple("couldn't truncate file");
+ sysseek($temp_fd, 0, SEEK_SET) and seek($temp_fd, 0, SEEK_SET)
+ or throw Error::Simple("couldn't seek to beginning of file");
+ sysseek($temp_fd, 0, SEEK_CUR) == 0 and tell($temp_fd) == 0
+ or throw Error::Simple("expected file position to be reset");
+}
+
+sub END {
+ unlink values %TEMP_FILES if %TEMP_FILES;
+}
+
+} # %TEMP_* Lexical Context
+
=back
=head1 ERROR HANDLING
diff --git a/perl/Makefile b/perl/Makefile
index b8547db2c6..e3dd1a5547 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
echo ' cp private-Error.pm blib/lib/Error.pm' >> $@
echo install: >> $@
- echo ' mkdir -p $(instdir_SQ)' >> $@
- echo ' $(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@
- echo ' $(RM) $(instdir_SQ)/Error.pm' >> $@
+ echo ' mkdir -p "$(instdir_SQ)"' >> $@
+ echo ' $(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
+ echo ' $(RM) "$(instdir_SQ)/Error.pm"' >> $@
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
- echo ' cp private-Error.pm $(instdir_SQ)/Error.pm' >> $@
+ echo ' cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
echo instlibdir: >> $@
echo ' echo $(instdir_SQ)' >> $@
else
diff --git a/read-cache.c b/read-cache.c
index 1cae361c6c..5150c1e14b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -8,6 +8,11 @@
#include "cache-tree.h"
#include "refs.h"
#include "dir.h"
+#include "tree.h"
+#include "commit.h"
+#include "diff.h"
+#include "diffcore.h"
+#include "revision.h"
/* Index extensions.
*
@@ -147,7 +152,7 @@ static int ce_modified_check_fs(struct cache_entry *ce, struct stat *st)
break;
case S_IFDIR:
if (S_ISGITLINK(ce->ce_mode))
- return 0;
+ return ce_compare_gitlink(ce) ? DATA_CHANGED : 0;
default:
return TYPE_CHANGED;
}
@@ -187,6 +192,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
changed |= TYPE_CHANGED;
break;
case S_IFGITLINK:
+ /* We ignore most of the st_xxx fields for gitlinks */
if (!S_ISDIR(st->st_mode))
changed |= TYPE_CHANGED;
else if (ce_compare_gitlink(ce))
@@ -293,11 +299,22 @@ int ie_modified(const struct index_state *istate,
if (changed & (MODE_CHANGED | TYPE_CHANGED))
return changed;
- /* Immediately after read-tree or update-index --cacheinfo,
- * the length field is zero. For other cases the ce_size
- * should match the SHA1 recorded in the index entry.
+ /*
+ * Immediately after read-tree or update-index --cacheinfo,
+ * the length field is zero, as we have never even read the
+ * lstat(2) information once, and we cannot trust DATA_CHANGED
+ * returned by ie_match_stat() which in turn was returned by
+ * ce_match_stat_basic() to signal that the filesize of the
+ * blob changed. We have to actually go to the filesystem to
+ * see if the contents match, and if so, should answer "unchanged".
+ *
+ * The logic does not apply to gitlinks, as ce_match_stat_basic()
+ * already has checked the actual HEAD from the filesystem in the
+ * subproject. If ie_match_stat() already said it is different,
+ * then we know it is.
*/
- if ((changed & DATA_CHANGED) && ce->ce_size != 0)
+ if ((changed & DATA_CHANGED) &&
+ (S_ISGITLINK(ce->ce_mode) || ce->ce_size != 0))
return changed;
changed_fs = ce_modified_check_fs(ce, st);
@@ -1106,6 +1123,10 @@ static void convert_from_disk(struct ondisk_cache_entry *ondisk, struct cache_en
ce->ce_size = ntohl(ondisk->size);
/* On-disk flags are just 16 bits */
ce->ce_flags = ntohs(ondisk->flags);
+
+ /* For future extension: we do not understand this entry yet */
+ if (ce->ce_flags & CE_EXTENDED)
+ die("Unknown index entry format");
hashcpy(ce->sha1, ondisk->sha1);
len = ce->ce_flags & CE_NAMEMASK;
@@ -1143,7 +1164,7 @@ int read_index_from(struct index_state *istate, const char *path)
size_t mmap_size;
errno = EBUSY;
- if (istate->alloc)
+ if (istate->initialized)
return istate->cache_nr;
errno = ENOENT;
@@ -1183,6 +1204,7 @@ int read_index_from(struct index_state *istate, const char *path)
* index size
*/
istate->alloc = xmalloc(estimate_cache_size(mmap_size, istate->cache_nr));
+ istate->initialized = 1;
src_offset = sizeof(*hdr);
dst_offset = 0;
@@ -1235,6 +1257,7 @@ int discard_index(struct index_state *istate)
cache_tree_free(&(istate->cache_tree));
free(istate->alloc);
istate->alloc = NULL;
+ istate->initialized = 0;
/* no need to throw away allocated active_cache */
return 0;
@@ -1326,6 +1349,11 @@ static void ce_smudge_racily_clean_entry(struct cache_entry *ce)
* falsely clean entry due to touch-update-touch race, so we leave
* everything else as they are. We are called for entries whose
* ce_mtime match the index file mtime.
+ *
+ * Note that this actually does not do much for gitlinks, for
+ * which ce_match_stat_basic() always goes to the actual
+ * contents. The caller checks with is_racy_timestamp() which
+ * always says "no" for gitlinks, so we are not called for them ;-)
*/
struct stat st;
@@ -1460,3 +1488,59 @@ int read_index_unmerged(struct index_state *istate)
istate->cache_nr = dst - istate->cache;
return !!last;
}
+
+struct update_callback_data
+{
+ int flags;
+ int add_errors;
+};
+
+static void update_callback(struct diff_queue_struct *q,
+ struct diff_options *opt, void *cbdata)
+{
+ int i;
+ struct update_callback_data *data = cbdata;
+
+ for (i = 0; i < q->nr; i++) {
+ struct diff_filepair *p = q->queue[i];
+ const char *path = p->one->path;
+ switch (p->status) {
+ default:
+ die("unexpected diff status %c", p->status);
+ case DIFF_STATUS_UNMERGED:
+ case DIFF_STATUS_MODIFIED:
+ case DIFF_STATUS_TYPE_CHANGED:
+ if (add_file_to_index(&the_index, path, data->flags)) {
+ if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
+ die("updating files failed");
+ data->add_errors++;
+ }
+ break;
+ case DIFF_STATUS_DELETED:
+ if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
+ break;
+ if (!(data->flags & ADD_CACHE_PRETEND))
+ remove_file_from_index(&the_index, path);
+ if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
+ printf("remove '%s'\n", path);
+ break;
+ }
+ }
+}
+
+int add_files_to_cache(const char *prefix, const char **pathspec, int flags)
+{
+ struct update_callback_data data;
+ struct rev_info rev;
+ init_revisions(&rev, prefix);
+ setup_revisions(0, NULL, &rev, NULL);
+ rev.prune_data = pathspec;
+ rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
+ rev.diffopt.format_callback = update_callback;
+ data.flags = flags;
+ data.add_errors = 0;
+ rev.diffopt.format_callback_data = &data;
+ run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
+ return !!data.add_errors;
+}
+
diff --git a/remote.c b/remote.c
index f61a3ab399..3ef09a44a1 100644
--- a/remote.c
+++ b/remote.c
@@ -449,6 +449,26 @@ static int verify_refname(char *name, int is_glob)
return result;
}
+/*
+ * This function frees a refspec array.
+ * Warning: code paths should be checked to ensure that the src
+ * and dst pointers are always freeable pointers as well
+ * as the refspec pointer itself.
+ */
+void free_refspecs(struct refspec *refspec, int nr_refspec)
+{
+ int i;
+
+ if (!refspec)
+ return;
+
+ for (i = 0; i < nr_refspec; i++) {
+ free(refspec[i].src);
+ free(refspec[i].dst);
+ }
+ free(refspec);
+}
+
static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
{
int i;
@@ -567,7 +587,12 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
invalid:
if (verify) {
- free(rs);
+ /*
+ * nr_refspec must be greater than zero and i must be valid
+ * since it is only possible to reach this point from within
+ * the for loop above.
+ */
+ free_refspecs(rs, i+1);
return NULL;
}
die("Invalid refspec '%s'", refspec[i]);
@@ -579,8 +604,7 @@ int valid_fetch_refspec(const char *fetch_refspec_str)
struct refspec *refspec;
refspec = parse_refspec_internal(1, fetch_refspec, 1, 1);
- if (refspec)
- free(refspec);
+ free_refspecs(refspec, 1);
return !!refspec;
}
diff --git a/remote.h b/remote.h
index 091b1d041f..2601f6e76d 100644
--- a/remote.h
+++ b/remote.h
@@ -78,6 +78,7 @@ void ref_remove_duplicates(struct ref *ref_map);
int valid_fetch_refspec(const char *refspec);
struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec);
struct refspec *parse_push_refspec(int nr_refspec, const char **refspec);
+void free_refspecs(struct refspec *refspec, int nr_refspec);
int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
int nr_refspec, const char **refspec, int all);
diff --git a/revision.c b/revision.c
index 3897fec531..36291b6b86 100644
--- a/revision.c
+++ b/revision.c
@@ -782,6 +782,10 @@ void init_revisions(struct rev_info *revs, const char *prefix)
revs->commit_format = CMIT_FMT_DEFAULT;
+ revs->grep_filter.status_only = 1;
+ revs->grep_filter.pattern_tail = &(revs->grep_filter.pattern_list);
+ revs->grep_filter.regflags = REG_NEWLINE;
+
diff_setup(&revs->diffopt);
if (prefix && !revs->diffopt.prefix) {
revs->diffopt.prefix = prefix;
@@ -946,15 +950,7 @@ void read_revisions_from_stdin(struct rev_info *revs)
static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
{
- if (!revs->grep_filter) {
- struct grep_opt *opt = xcalloc(1, sizeof(*opt));
- opt->status_only = 1;
- opt->pattern_tail = &(opt->pattern_list);
- opt->regflags = REG_NEWLINE;
- revs->grep_filter = opt;
- }
- append_grep_pattern(revs->grep_filter, ptn,
- "command line", 0, what);
+ append_grep_pattern(&revs->grep_filter, ptn, "command line", 0, what);
}
static void add_header_grep(struct rev_info *revs, const char *field, const char *pattern)
@@ -1002,7 +998,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
!strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk"))
{
unkv[(*unkc)++] = arg;
- return 0;
+ return 1;
}
if (!prefixcmp(arg, "--max-count=")) {
@@ -1164,17 +1160,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!prefixcmp(arg, "--grep=")) {
add_message_grep(revs, arg+7);
} else if (!strcmp(arg, "--extended-regexp") || !strcmp(arg, "-E")) {
- if (revs->grep_filter)
- revs->grep_filter->regflags |= REG_EXTENDED;
+ revs->grep_filter.regflags |= REG_EXTENDED;
} else if (!strcmp(arg, "--regexp-ignore-case") || !strcmp(arg, "-i")) {
- if (revs->grep_filter)
- revs->grep_filter->regflags |= REG_ICASE;
+ revs->grep_filter.regflags |= REG_ICASE;
} else if (!strcmp(arg, "--fixed-strings") || !strcmp(arg, "-F")) {
- if (revs->grep_filter)
- revs->grep_filter->fixed = 1;
+ revs->grep_filter.fixed = 1;
} else if (!strcmp(arg, "--all-match")) {
- if (revs->grep_filter)
- revs->grep_filter->all_match = 1;
+ revs->grep_filter.all_match = 1;
} else if (!prefixcmp(arg, "--encoding=")) {
arg += 11;
if (strcmp(arg, "none"))
@@ -1349,9 +1341,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (diff_setup_done(&revs->diffopt) < 0)
die("diff_setup_done failed");
- if (revs->grep_filter) {
- compile_grep_patterns(revs->grep_filter);
- }
+ compile_grep_patterns(&revs->grep_filter);
if (revs->reverse && revs->reflog_info)
die("cannot combine --reverse with --walk-reflogs");
@@ -1492,9 +1482,9 @@ static int rewrite_parents(struct rev_info *revs, struct commit *commit)
static int commit_match(struct commit *commit, struct rev_info *opt)
{
- if (!opt->grep_filter)
+ if (!opt->grep_filter.pattern_list)
return 1;
- return grep_buffer(opt->grep_filter,
+ return grep_buffer(&opt->grep_filter,
NULL, /* we say nothing, not even filename */
commit->buffer, strlen(commit->buffer));
}
diff --git a/revision.h b/revision.h
index f64e8ce7ff..91f194478b 100644
--- a/revision.h
+++ b/revision.h
@@ -2,6 +2,7 @@
#define REVISION_H
#include "parse-options.h"
+#include "grep.h"
#define SEEN (1u<<0)
#define UNINTERESTING (1u<<1)
@@ -92,7 +93,7 @@ struct rev_info {
int show_log_size;
/* Filter by commit log message */
- struct grep_opt *grep_filter;
+ struct grep_opt grep_filter;
/* Display history graph */
struct git_graph *graph;
@@ -119,7 +120,7 @@ struct rev_info {
void read_revisions_from_stdin(struct rev_info *revs);
typedef void (*show_early_output_fn_t)(struct rev_info *, struct commit_list *);
-volatile show_early_output_fn_t show_early_output;
+extern volatile show_early_output_fn_t show_early_output;
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);
diff --git a/run-command.c b/run-command.c
index a3b28a64dc..caab374577 100644
--- a/run-command.c
+++ b/run-command.c
@@ -68,6 +68,7 @@ int start_command(struct child_process *cmd)
trace_argv_printf(cmd->argv, "trace: run_command:");
#ifndef __MINGW32__
+ fflush(NULL);
cmd->pid = fork();
if (!cmd->pid) {
if (cmd->no_stdin)
@@ -110,6 +111,8 @@ int start_command(struct child_process *cmd)
unsetenv(*cmd->env);
}
}
+ if (cmd->preexec_cb)
+ cmd->preexec_cb();
if (cmd->git_cmd) {
execv_git_cmd(cmd->argv);
} else {
@@ -304,6 +307,9 @@ int start_async(struct async *async)
async->out = pipe_out[0];
#ifndef __MINGW32__
+ /* Flush stdio before fork() to avoid cloning buffers */
+ fflush(NULL);
+
async->pid = fork();
if (async->pid < 0) {
error("fork (async) failed: %s", strerror(errno));
diff --git a/run-command.h b/run-command.h
index 5203a9ebb1..4f2b7d7d40 100644
--- a/run-command.h
+++ b/run-command.h
@@ -42,6 +42,7 @@ struct child_process {
unsigned no_stderr:1;
unsigned git_cmd:1; /* if this is to be git sub-command */
unsigned stdout_to_stderr:1;
+ void (*preexec_cb)(void);
};
int start_command(struct child_process *);
diff --git a/sha1_file.c b/sha1_file.c
index e281c14f01..9ee1ed16ad 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -990,6 +990,7 @@ void prepare_packed_git(void)
void reprepare_packed_git(void)
{
+ discard_revindex();
prepare_packed_git_run_once = 0;
prepare_packed_git();
}
@@ -1929,11 +1930,18 @@ static int sha1_loose_object_info(const unsigned char *sha1, unsigned long *size
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
{
struct pack_entry e;
+ int status;
if (!find_pack_entry(sha1, &e, NULL)) {
+ /* Most likely it's a loose object. */
+ status = sha1_loose_object_info(sha1, sizep);
+ if (status >= 0)
+ return status;
+
+ /* Not a loose object; someone else may have just packed it. */
reprepare_packed_git();
if (!find_pack_entry(sha1, &e, NULL))
- return sha1_loose_object_info(sha1, sizep);
+ return status;
}
return packed_object_info(e.p, e.offset, sizep);
}
@@ -2353,51 +2361,22 @@ int has_sha1_file(const unsigned char *sha1)
return has_loose_object(sha1);
}
-int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object)
-{
- struct strbuf buf;
- int ret;
-
- strbuf_init(&buf, 0);
- if (strbuf_read(&buf, fd, 4096) < 0) {
- strbuf_release(&buf);
- return -1;
- }
-
- if (!type)
- type = blob_type;
- if (write_object)
- ret = write_sha1_file(buf.buf, buf.len, type, sha1);
- else
- ret = hash_sha1_file(buf.buf, buf.len, type, sha1);
- strbuf_release(&buf);
-
- return ret;
-}
-
-int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
- enum object_type type, const char *path)
+static int index_mem(unsigned char *sha1, void *buf, size_t size,
+ int write_object, enum object_type type, const char *path)
{
- size_t size = xsize_t(st->st_size);
- void *buf = NULL;
int ret, re_allocated = 0;
- if (size)
- buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- close(fd);
-
if (!type)
type = OBJ_BLOB;
/*
* Convert blobs to git internal format
*/
- if ((type == OBJ_BLOB) && S_ISREG(st->st_mode)) {
+ if ((type == OBJ_BLOB) && path) {
struct strbuf nbuf;
strbuf_init(&nbuf, 0);
if (convert_to_git(path, buf, size, &nbuf,
write_object ? safe_crlf : 0)) {
- munmap(buf, size);
buf = strbuf_detach(&nbuf, &size);
re_allocated = 1;
}
@@ -2407,12 +2386,33 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
ret = write_sha1_file(buf, size, typename(type), sha1);
else
ret = hash_sha1_file(buf, size, typename(type), sha1);
- if (re_allocated) {
+ if (re_allocated)
free(buf);
- return ret;
- }
- if (size)
+ return ret;
+}
+
+int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
+ enum object_type type, const char *path)
+{
+ int ret;
+ size_t size = xsize_t(st->st_size);
+
+ if (!S_ISREG(st->st_mode)) {
+ struct strbuf sbuf;
+ strbuf_init(&sbuf, 0);
+ if (strbuf_read(&sbuf, fd, 4096) >= 0)
+ ret = index_mem(sha1, sbuf.buf, sbuf.len, write_object,
+ type, path);
+ else
+ ret = -1;
+ strbuf_release(&sbuf);
+ } else if (size) {
+ void *buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
+ ret = index_mem(sha1, buf, size, write_object, type, path);
munmap(buf, size);
+ } else
+ ret = index_mem(sha1, NULL, size, write_object, type, path);
+ close(fd);
return ret;
}
diff --git a/sha1_name.c b/sha1_name.c
index 4fb77f8863..41b680915d 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -349,7 +349,10 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
else
nth = -1;
}
- if (0 <= nth)
+ if (100000000 <= nth) {
+ at_time = nth;
+ nth = -1;
+ } else if (0 <= nth)
at_time = 0;
else {
char *tmp = xstrndup(str + at + 2, reflog_len);
diff --git a/shell.c b/shell.c
index 6a48de05ff..0f6a727a8c 100644
--- a/shell.c
+++ b/shell.c
@@ -3,14 +3,6 @@
#include "exec_cmd.h"
#include "strbuf.h"
-/* Stubs for functions that make no sense for git-shell. These stubs
- * are provided here to avoid linking in external redundant modules.
- */
-void release_pack_memory(size_t need, int fd){}
-void trace_argv_printf(const char **argv, const char *fmt, ...){}
-void trace_printf(const char *fmt, ...){}
-
-
static int do_generic_cmd(const char *me, char *arg)
{
const char *my_argv[4];
diff --git a/t/.gitignore b/t/.gitignore
index b27e280083..7dcbb232cd 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -1,2 +1,2 @@
-/trash directory
+/trash directory*
/test-results
diff --git a/t/Makefile b/t/Makefile
index 0d65cedaa6..ed49c20b16 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -14,7 +14,8 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
TSVN = $(wildcard t91[0-9][0-9]-*.sh)
-all: pre-clean $(T) aggregate-results clean
+all: pre-clean
+ $(MAKE) aggregate-results-and-cleanup
$(T):
@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
@@ -25,6 +26,10 @@ pre-clean:
clean:
$(RM) -r 'trash directory' test-results
+aggregate-results-and-cleanup: $(T)
+ $(MAKE) aggregate-results
+ $(MAKE) clean
+
aggregate-results:
'$(SHELL_PATH_SQ)' ./aggregate-results.sh test-results/t*-*
@@ -34,4 +39,3 @@ full-svn-test:
$(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
.PHONY: pre-clean $(T) aggregate-results clean
-.NOTPARALLEL:
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index dc473dfb53..6ac312b905 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -14,7 +14,7 @@ fi
LIB_HTTPD_PATH=${LIB_HTTPD_PATH-'/usr/sbin/apache2'}
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'8111'}
-TEST_PATH="$PWD"/../lib-httpd
+TEST_PATH="$TEST_DIRECTORY"/lib-httpd
HTTPD_ROOT_PATH="$PWD"/httpd
HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www
diff --git a/t/t0022-crlf-rename.sh b/t/t0022-crlf-rename.sh
index 7d1ce2d056..f1e1d48869 100755
--- a/t/t0022-crlf-rename.sh
+++ b/t/t0022-crlf-rename.sh
@@ -6,13 +6,13 @@ test_description='ignore CR in CRLF sequence while computing similiarity'
test_expect_success setup '
- cat ../t0022-crlf-rename.sh >sample &&
+ cat "$TEST_DIRECTORY"/t0022-crlf-rename.sh >sample &&
git add sample &&
test_tick &&
git commit -m Initial &&
- sed -e "s/\$/ /" ../t0022-crlf-rename.sh >elpmas &&
+ sed -e "s/\$/ /" "$TEST_DIRECTORY"/t0022-crlf-rename.sh >elpmas &&
git add elpmas &&
rm -f sample &&
diff --git a/t/t0023-crlf-am.sh b/t/t0023-crlf-am.sh
index 6f8a4347d5..aaed725402 100755
--- a/t/t0023-crlf-am.sh
+++ b/t/t0023-crlf-am.sh
@@ -36,7 +36,7 @@ test_expect_success 'setup' '
test_expect_success 'am' '
- git am --binary -3 <patchfile &&
+ git am -3 <patchfile &&
git diff-files --name-status --exit-code
'
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index 03dbe00102..e38241c80a 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -47,6 +47,7 @@ test_expect_success 'test help' '
cat > expect << EOF
boolean: 2
integer: 1729
+timestamp: 0
string: 123
abbrev: 7
verbose: 2
@@ -63,6 +64,7 @@ test_expect_success 'short options' '
cat > expect << EOF
boolean: 2
integer: 1729
+timestamp: 0
string: 321
abbrev: 10
verbose: 2
@@ -88,6 +90,7 @@ test_expect_success 'missing required value' '
cat > expect << EOF
boolean: 1
integer: 13
+timestamp: 0
string: 123
abbrev: 7
verbose: 0
@@ -108,6 +111,7 @@ test_expect_success 'intermingled arguments' '
cat > expect << EOF
boolean: 0
integer: 2
+timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -135,6 +139,7 @@ test_expect_success 'ambiguously abbreviated option' '
cat > expect << EOF
boolean: 0
integer: 0
+timestamp: 0
string: 123
abbrev: 7
verbose: 0
@@ -161,6 +166,7 @@ test_expect_success 'detect possible typos' '
cat > expect <<EOF
boolean: 0
integer: 0
+timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -177,7 +183,8 @@ test_expect_success 'keep some options as arguments' '
cat > expect <<EOF
boolean: 0
-integer: 1
+integer: 0
+timestamp: 1
string: default
abbrev: 7
verbose: 0
@@ -197,6 +204,7 @@ cat > expect <<EOF
Callback: "four", 0
boolean: 5
integer: 4
+timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -223,6 +231,7 @@ test_expect_success 'OPT_CALLBACK() and callback errors work' '
cat > expect <<EOF
boolean: 1
integer: 23
+timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
diff --git a/t/t0055-beyond-symlinks.sh b/t/t0055-beyond-symlinks.sh
new file mode 100755
index 0000000000..b29c37a5a4
--- /dev/null
+++ b/t/t0055-beyond-symlinks.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description='update-index and add refuse to add beyond symlinks'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ >a &&
+ mkdir b &&
+ ln -s b c &&
+ >c/d &&
+ git update-index --add a b/d
+'
+
+test_expect_success 'update-index --add beyond symlinks' '
+ test_must_fail git update-index --add c/d &&
+ ! ( git ls-files | grep c/d )
+'
+
+test_expect_success 'add beyond symlinks' '
+ test_must_fail git add c/d &&
+ ! ( git ls-files | grep c/d )
+'
+
+test_done
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index 807fb83af8..22ba7a5442 100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -72,7 +72,7 @@ In addition:
'
. ./test-lib.sh
-. ../lib-read-tree-m-3way.sh
+. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
################################################################
# Trivial "majority when 3 stages exist" merge plus #2ALT, #3ALT
diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index aa9dd580a6..5e40cec530 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -14,6 +14,8 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
compare_change () {
sed >current \
+ -e '1{/^diff --git /d;}' \
+ -e '2{/^index /d;}' \
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
-e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1"
test_cmp expected current
@@ -75,7 +77,7 @@ test_expect_success \
git update-index --add yomin &&
git read-tree -m -u $treeH $treeM &&
git ls-files --stage >4.out || return 1
- diff -U0 M.out 4.out >4diff.out
+ git diff -U0 --no-index M.out 4.out >4diff.out
compare_change 4diff.out expected &&
check_cache_at yomin clean &&
sum bozbar frotz nitfol >actual4.sum &&
@@ -94,7 +96,7 @@ test_expect_success \
echo yomin yomin >yomin &&
git read-tree -m -u $treeH $treeM &&
git ls-files --stage >5.out || return 1
- diff -U0 M.out 5.out >5diff.out
+ git diff -U0 --no-index M.out 5.out >5diff.out
compare_change 5diff.out expected &&
check_cache_at yomin dirty &&
sum bozbar frotz nitfol >actual5.sum &&
@@ -206,7 +208,7 @@ test_expect_success \
git update-index --add nitfol &&
git read-tree -m -u $treeH $treeM &&
git ls-files --stage >14.out || return 1
- diff -U0 M.out 14.out >14diff.out
+ git diff -U0 --no-index M.out 14.out >14diff.out
compare_change 14diff.out expected &&
sum bozbar frotz >actual14.sum &&
grep -v nitfol M.sum > expected14.sum &&
@@ -227,7 +229,7 @@ test_expect_success \
echo nitfol nitfol nitfol >nitfol &&
git read-tree -m -u $treeH $treeM &&
git ls-files --stage >15.out || return 1
- diff -U0 M.out 15.out >15diff.out
+ git diff -U0 --no-index M.out 15.out >15diff.out
compare_change 15diff.out expected &&
check_cache_at nitfol dirty &&
sum bozbar frotz >actual15.sum &&
diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index 1ec0535138..fcdd15a358 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -49,16 +49,28 @@ setup_repo
# Argument checking
test_expect_success "multiple '--stdin's are rejected" '
- test_must_fail git hash-object --stdin --stdin < example
+ echo example | test_must_fail git hash-object --stdin --stdin
'
test_expect_success "Can't use --stdin and --stdin-paths together" '
- test_must_fail git hash-object --stdin --stdin-paths &&
- test_must_fail git hash-object --stdin-paths --stdin
+ echo example | test_must_fail git hash-object --stdin --stdin-paths &&
+ echo example | test_must_fail git hash-object --stdin-paths --stdin
'
test_expect_success "Can't pass filenames as arguments with --stdin-paths" '
- test_must_fail git hash-object --stdin-paths hello < example
+ echo example | test_must_fail git hash-object --stdin-paths hello
+'
+
+test_expect_success "Can't use --path with --stdin-paths" '
+ echo example | test_must_fail git hash-object --stdin-paths --path=foo
+'
+
+test_expect_success "Can't use --stdin-paths with --no-filters" '
+ echo example | test_must_fail git hash-object --stdin-paths --no-filters
+'
+
+test_expect_success "Can't use --path with --no-filters" '
+ test_must_fail git hash-object --no-filters --path=foo
'
# Behavior
@@ -93,6 +105,42 @@ test_expect_success 'git hash-object --stdin file1 <file0 first operates on file
test "$obname1" = "$obname1new"
'
+test_expect_success 'check that appropriate filter is invoke when --path is used' '
+ echo fooQ | tr Q "\\015" >file0 &&
+ cp file0 file1 &&
+ echo "file0 -crlf" >.gitattributes &&
+ echo "file1 crlf" >>.gitattributes &&
+ git config core.autocrlf true &&
+ file0_sha=$(git hash-object file0) &&
+ file1_sha=$(git hash-object file1) &&
+ test "$file0_sha" != "$file1_sha" &&
+ path1_sha=$(git hash-object --path=file1 file0) &&
+ path0_sha=$(git hash-object --path=file0 file1) &&
+ test "$file0_sha" = "$path0_sha" &&
+ test "$file1_sha" = "$path1_sha" &&
+ path1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&
+ path0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&
+ test "$file0_sha" = "$path0_sha" &&
+ test "$file1_sha" = "$path1_sha" &&
+ git config --unset core.autocrlf
+'
+
+test_expect_success 'check that --no-filters option works' '
+ echo fooQ | tr Q "\\015" >file0 &&
+ cp file0 file1 &&
+ echo "file0 -crlf" >.gitattributes &&
+ echo "file1 crlf" >>.gitattributes &&
+ git config core.autocrlf true &&
+ file0_sha=$(git hash-object file0) &&
+ file1_sha=$(git hash-object file1) &&
+ test "$file0_sha" != "$file1_sha" &&
+ nofilters_file1=$(git hash-object --no-filters file1) &&
+ test "$file0_sha" = "$nofilters_file1" &&
+ nofilters_file1=$(cat file1 | git hash-object --stdin) &&
+ test "$file0_sha" = "$nofilters_file1" &&
+ git config --unset core.autocrlf
+'
+
pop_repo
for args in "-w --stdin" "--stdin -w"; do
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 73f830db23..5b24f05573 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -188,16 +188,30 @@ test_expect_success 'delete' '
test_tick &&
git commit -m tiger C &&
- test 5 = $(git reflog | wc -l) &&
+ HEAD_entry_count=$(git reflog | wc -l)
+ master_entry_count=$(git reflog show master | wc -l)
+
+ test $HEAD_entry_count = 5 &&
+ test $master_entry_count = 5 &&
+
git reflog delete master@{1} &&
git reflog show master > output &&
- test 4 = $(wc -l < output) &&
+ test $(($master_entry_count - 1)) = $(wc -l < output) &&
+ test $HEAD_entry_count = $(git reflog | wc -l) &&
! grep ox < output &&
+ master_entry_count=$(wc -l < output)
+
+ git reflog delete HEAD@{1} &&
+ test $(($HEAD_entry_count -1)) = $(git reflog | wc -l) &&
+ test $master_entry_count = $(git reflog show master | wc -l) &&
+
+ HEAD_entry_count=$(git reflog | wc -l)
+
git reflog delete master@{07.04.2005.15:15:00.-0700} &&
git reflog show master > output &&
- test 3 = $(wc -l < output) &&
+ test $(($master_entry_count - 1)) = $(wc -l < output) &&
! grep dragon < output
'
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index aff360303a..f2880152b0 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -269,6 +269,17 @@ test_expect_success 'merge-recursive result' '
'
+test_expect_success 'fail if the index has unresolved entries' '
+
+ rm -fr [abcd] &&
+ git checkout -f "$c1" &&
+
+ test_must_fail git merge "$c5" &&
+ test_must_fail git merge "$c5" 2> out &&
+ grep "You are in the middle of a conflicted merge" out
+
+'
+
test_expect_success 'merge-recursive remove conflict' '
rm -fr [abcd] &&
diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh
index 0574ef1f10..db46d53e82 100755
--- a/t/t3300-funny-names.sh
+++ b/t/t3300-funny-names.sh
@@ -21,7 +21,7 @@ cat >"$p0" <<\EOF
3. A quick brown fox jumps over the lazy cat, oops dog.
EOF
-cat >"$p1" "$p0"
+cat 2>/dev/null >"$p1" "$p0"
echo 'Foo Bar Baz' >"$p2"
test -f "$p1" && cmp "$p0" "$p1" || {
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index ffe3dd97b7..5aa487ac02 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -202,6 +202,9 @@ test_expect_success 'retain authorship when squashing' '
test_expect_success '-p handles "no changes" gracefully' '
HEAD=$(git rev-parse HEAD) &&
git rebase -i -p HEAD^ &&
+ git update-index --refresh &&
+ git diff-files --quiet &&
+ git diff-index --quiet --cached HEAD -- &&
test $HEAD = $(git rev-parse HEAD)
'
@@ -235,6 +238,9 @@ test_expect_success 'preserve merges with -p' '
git checkout -b to-be-rebased &&
test_tick &&
git rebase -i -p --onto branch1 master &&
+ git update-index --refresh &&
+ git diff-files --quiet &&
+ git diff-index --quiet --cached HEAD -- &&
test $(git rev-parse HEAD~6) = $(git rev-parse branch1) &&
test $(git rev-parse HEAD~4^2) = $(git rev-parse to-be-preserved) &&
test $(git rev-parse HEAD^^2^) = $(git rev-parse HEAD^^^) &&
@@ -244,6 +250,18 @@ test_expect_success 'preserve merges with -p' '
test $(git show HEAD:unrelated-file) = 1
'
+test_expect_success 'edit ancestor with -p' '
+ FAKE_LINES="1 edit 2 3 4" git rebase -i -p HEAD~3 &&
+ echo 2 > unrelated-file &&
+ test_tick &&
+ git commit -m L2-modified --amend unrelated-file &&
+ git rebase --continue &&
+ git update-index --refresh &&
+ git diff-files --quiet &&
+ git diff-index --quiet --cached HEAD -- &&
+ test $(git show HEAD:unrelated-file) = 2
+'
+
test_expect_success '--continue tries to commit' '
test_tick &&
test_must_fail git rebase -i --onto new-branch1 HEAD^ &&
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
new file mode 100755
index 0000000000..f7b3518a32
--- /dev/null
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+test_description='cherry-pick should rerere for conflicts'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ echo foo >foo &&
+ git add foo && test_tick && git commit -q -m 1 &&
+ echo foo-master >foo &&
+ git add foo && test_tick && git commit -q -m 2 &&
+
+ git checkout -b dev HEAD^ &&
+ echo foo-dev >foo &&
+ git add foo && test_tick && git commit -q -m 3 &&
+ git config rerere.enabled true
+'
+
+test_expect_success 'conflicting merge' '
+ test_must_fail git merge master
+'
+
+test_expect_success 'fixup' '
+ echo foo-dev >foo &&
+ git add foo && test_tick && git commit -q -m 4 &&
+ git reset --hard HEAD^
+ echo foo-dev >expect
+'
+
+test_expect_success 'cherry-pick conflict' '
+ test_must_fail git cherry-pick master &&
+ test_cmp expect foo
+'
+
+test_expect_success 'reconfigure' '
+ git config rerere.enabled false
+ git reset --hard
+'
+
+test_expect_success 'cherry-pick conflict without rerere' '
+ test_must_fail git cherry-pick master &&
+ test_must_fail test_cmp expect foo
+'
+
+test_done
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 7d123d17fc..2ac93a346d 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -222,4 +222,12 @@ test_expect_success 'git add (add.ignore-errors = false)' '
! ( git ls-files foo1 | grep foo1 )
'
+test_expect_success 'git add '\''fo\[ou\]bar'\'' ignores foobar' '
+ git reset --hard &&
+ touch fo\[ou\]bar foobar &&
+ git add '\''fo\[ou\]bar'\'' &&
+ git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
+ ! ( git ls-files foobar | grep foobar )
+'
+
test_done
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index 883281dbd6..f4f41847f3 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -16,7 +16,7 @@ test_expect_success setup '
: >F &&
git add F &&
T=$(git write-tree) &&
- C=$(git commit-tree $T <../t3900/1-UTF-8.txt) &&
+ C=$(git commit-tree $T <"$TEST_DIRECTORY"/t3900/1-UTF-8.txt) &&
git update-ref HEAD $C &&
git-tag C0
'
@@ -32,7 +32,7 @@ do
git config i18n.commitencoding $H &&
git-checkout -b $H C0 &&
echo $H >F &&
- git-commit -a -F ../t3900/$H.txt
+ git-commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt
'
done
@@ -57,13 +57,13 @@ test_expect_success 'config to remove customization' '
'
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
- compare_with ISO-8859-1 ../t3900/1-UTF-8.txt
+ compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
'
for H in EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in UTF-8 now" '
- compare_with '$H' ../t3900/2-UTF-8.txt
+ compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
'
done
@@ -82,7 +82,7 @@ for H in ISO-8859-1 EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in itself now" '
git config i18n.commitencoding '$H' &&
- compare_with '$H' ../t3900/'$H'.txt
+ compare_with '$H' "$TEST_DIRECTORY"/t3900/'$H'.txt
'
done
@@ -91,13 +91,13 @@ test_expect_success 'config to tweak customization' '
'
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
- compare_with ISO-8859-1 ../t3900/1-UTF-8.txt
+ compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
'
for H in EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in UTF-8 now" '
- compare_with '$H' ../t3900/2-UTF-8.txt
+ compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
'
done
@@ -107,7 +107,7 @@ do
for H in EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in $J now" '
- compare_with '$H' ../t3900/'$J'.txt
+ compare_with '$H' "$TEST_DIRECTORY"/t3900/'$J'.txt
'
done
done
@@ -115,7 +115,7 @@ done
for H in ISO-8859-1 EUCJP ISO-2022-JP
do
test_expect_success "No conversion with $H" '
- compare_with "--encoding=none '$H'" ../t3900/'$H'.txt
+ compare_with "--encoding=none '$H'" "$TEST_DIRECTORY"/t3900/'$H'.txt
'
done
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 235f372832..f68ff53051 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -35,7 +35,7 @@ test_expect_success setup '
# use UTF-8 in author and committer name to match the
# i18n.commitencoding settings
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
test_tick &&
echo "$GIT_AUTHOR_NAME" >mine &&
@@ -57,7 +57,7 @@ test_expect_success setup '
# the second one on the side branch is ISO-8859-1
git config i18n.commitencoding ISO-8859-1 &&
# use author and committer name in ISO-8859-1 to match it.
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
test_tick &&
echo Yet another >theirs &&
git add theirs &&
@@ -101,7 +101,7 @@ test_expect_success 'rebase (U/U)' '
# The result will be committed by GIT_COMMITTER_NAME --
# we want UTF-8 encoded name.
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git checkout -b test &&
git-rebase master &&
@@ -111,7 +111,7 @@ test_expect_success 'rebase (U/U)' '
test_expect_success 'rebase (U/L)' '
git config i18n.commitencoding UTF-8 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git reset --hard side &&
git-rebase master &&
@@ -123,7 +123,7 @@ test_expect_success 'rebase (L/L)' '
# In this test we want ISO-8859-1 encoded commits as the result
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard side &&
git-rebase master &&
@@ -136,7 +136,7 @@ test_expect_success 'rebase (L/U)' '
# to get ISO-8859-1 results.
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding UTF-8 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard side &&
git-rebase master &&
@@ -149,7 +149,7 @@ test_expect_success 'cherry-pick(U/U)' '
git config i18n.commitencoding UTF-8 &&
git config i18n.logoutputencoding UTF-8 &&
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git reset --hard master &&
git cherry-pick side^ &&
@@ -164,7 +164,7 @@ test_expect_success 'cherry-pick(L/L)' '
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard master &&
git cherry-pick side^ &&
@@ -179,7 +179,7 @@ test_expect_success 'cherry-pick(U/L)' '
git config i18n.commitencoding UTF-8 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git reset --hard master &&
git cherry-pick side^ &&
@@ -195,7 +195,7 @@ test_expect_success 'cherry-pick(L/U)' '
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding UTF-8 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard master &&
git cherry-pick side^ &&
@@ -208,7 +208,7 @@ test_expect_success 'cherry-pick(L/U)' '
test_expect_success 'rebase --merge (U/U)' '
git config i18n.commitencoding UTF-8 &&
git config i18n.logoutputencoding UTF-8 &&
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git reset --hard side &&
git-rebase --merge master &&
@@ -219,7 +219,7 @@ test_expect_success 'rebase --merge (U/U)' '
test_expect_success 'rebase --merge (U/L)' '
git config i18n.commitencoding UTF-8 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-utf8.txt &&
+ . "$TEST_DIRECTORY"/t3901-utf8.txt &&
git reset --hard side &&
git-rebase --merge master &&
@@ -231,7 +231,7 @@ test_expect_success 'rebase --merge (L/L)' '
# In this test we want ISO-8859-1 encoded commits as the result
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding ISO-8859-1 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard side &&
git-rebase --merge master &&
@@ -244,7 +244,7 @@ test_expect_success 'rebase --merge (L/U)' '
# to get ISO-8859-1 results.
git config i18n.commitencoding ISO-8859-1 &&
git config i18n.logoutputencoding UTF-8 &&
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
git reset --hard side &&
git-rebase --merge master &&
diff --git a/t/t3902-quoted.sh b/t/t3902-quoted.sh
index fe4fb5116a..5868052425 100755
--- a/t/t3902-quoted.sh
+++ b/t/t3902-quoted.sh
@@ -7,12 +7,6 @@ test_description='quoted output'
. ./test-lib.sh
-P1='pathname with HT'
-: >"$P1" 2>&1 && test -f "$P1" && rm -f "$P1" || {
- echo >&2 'Filesystem does not support HT in names'
- test_done
-}
-
FN='濱野'
GN='純'
HT=' '
@@ -20,7 +14,7 @@ LF='
'
DQ='"'
-echo foo > "Name and an${HT}HT"
+echo foo 2>/dev/null > "Name and an${HT}HT"
test -f "Name and an${HT}HT" || {
# since FAT/NTFS does not allow tabs in filenames, skip this test
say 'Your filesystem does not allow tabs in filenames, test skipped.'
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index c44b27aeb2..6ddd46915d 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.
'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
echo >path0 'Line 1
Line 2
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index a32692417d..71bac83dd5 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.
'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
echo >path0 'Line 1
Line 2
diff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh
index a4cfde6b29..cc3681f161 100755
--- a/t/t4002-diff-basic.sh
+++ b/t/t4002-diff-basic.sh
@@ -7,7 +7,7 @@ test_description='Test diff raw-output.
'
. ./test-lib.sh
-. ../lib-read-tree-m-3way.sh
+. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
cat >.test-plain-OA <<\EOF
:000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A AA
@@ -169,6 +169,20 @@ test_expect_success \
cmp -s .test-a .test-recursive-AB'
test_expect_success \
+ 'diff-tree --stdin of known trees.' \
+ 'echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
+ echo $tree_A $tree_B > .test-plain-ABx &&
+ cat .test-plain-AB >> .test-plain-ABx &&
+ cmp -s .test-a .test-plain-ABx'
+
+test_expect_success \
+ 'diff-tree --stdin of known trees.' \
+ 'echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
+ echo $tree_A $tree_B > .test-recursive-ABx &&
+ cat .test-recursive-AB >> .test-recursive-ABx &&
+ cmp -s .test-a .test-recursive-ABx'
+
+test_expect_success \
'diff-cache O with A in cache' \
'git read-tree $tree_A &&
git diff-index --cached $tree_O >.test-a &&
diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
index 8b1f875286..c6130c4019 100755
--- a/t/t4003-diff-rename-1.sh
+++ b/t/t4003-diff-rename-1.sh
@@ -7,11 +7,11 @@ test_description='More rename detection
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
@@ -99,7 +99,7 @@ test_expect_success \
test_expect_success \
'prepare work tree once again' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'
# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
index 3d25be7a67..b35af9b42d 100755
--- a/t/t4004-diff-rename-symlink.sh
+++ b/t/t4004-diff-rename-symlink.sh
@@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed
by an edit for them.
'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
test_expect_success \
'prepare reference tree' \
diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
index 6630017312..1ba359d478 100755
--- a/t/t4005-diff-rename-2.sh
+++ b/t/t4005-diff-rename-2.sh
@@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw.
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
@@ -71,7 +71,7 @@ test_expect_success \
test_expect_success \
'prepare work tree once again' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'
git diff-index -C --find-copies-harder $tree >current
diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh
index 104a4e1492..42072d724e 100755
--- a/t/t4007-rename-3.sh
+++ b/t/t4007-rename-3.sh
@@ -7,12 +7,12 @@ test_description='Rename interaction with pathspec.
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
'mkdir path0 path1 &&
- cp ../../COPYING path0/COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
git update-index --add path0/COPYING &&
tree=$(git write-tree) &&
echo $tree'
diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh
index 26c2e4aa65..7e343a9cd1 100755
--- a/t/t4008-diff-break-rewrite.sh
+++ b/t/t4008-diff-break-rewrite.sh
@@ -22,12 +22,12 @@ four changes in total.
Further, with -B and -M together, these should turn into two renames.
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
setup \
- 'cat ../../README >file0 &&
- cat ../../COPYING >file1 &&
+ 'cat "$TEST_DIRECTORY"/../README >file0 &&
+ cat "$TEST_DIRECTORY"/../COPYING >file1 &&
git update-index --add file0 file1 &&
tree=$(git write-tree) &&
echo "$tree"'
diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh
index d2b45e7b8f..de3f17478e 100755
--- a/t/t4009-diff-rename-4.sh
+++ b/t/t4009-diff-rename-4.sh
@@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
'prepare reference tree' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
@@ -78,7 +78,7 @@ test_expect_success \
test_expect_success \
'prepare work tree once again' \
- 'cat ../../COPYING >COPYING &&
+ 'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'
git diff-index -z -C --find-copies-harder $tree >current
diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh
index ad3d9e4845..9322298ecc 100755
--- a/t/t4010-diff-pathspec.sh
+++ b/t/t4010-diff-pathspec.sh
@@ -10,7 +10,7 @@ Prepare:
path1/file1
'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
test_expect_success \
setup \
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index c6d13693ba..02efecae3a 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -7,7 +7,7 @@ test_description='Test diff of symlinks.
'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
cat > expected << EOF
diff --git a/frotz b/frotz
diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh
index eced1f30fb..69934991cb 100755
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
@@ -12,7 +12,7 @@ test_expect_success 'prepare repository' \
'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
git update-index --add a b c d &&
echo git >a &&
- cat ../test4012.png >b &&
+ cat "$TEST_DIRECTORY"/test4012.png >b &&
echo git >c &&
cat b b >d'
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 9337b81064..1a6b52234d 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -99,7 +99,7 @@ do
test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
cnt=`expr $test_count + 1`
pfx=`printf "%04d" $cnt`
- expect="../t4013/diff.$test"
+ expect="$TEST_DIRECTORY/t4013/diff.$test"
actual="$pfx-diff.$test"
test_expect_success "git $cmd" '
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
index cf6891f748..43346b9ba4 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
@@ -75,6 +77,8 @@ Content-Transfer-Encoding: 8bit
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
@@ -122,6 +126,8 @@ Content-Transfer-Encoding: 8bit
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
index fe0258720c..d7490a9fd7 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
@@ -75,6 +77,8 @@ Content-Transfer-Encoding: 8bit
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
index 9ff828ee9d..38f790290a 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
@@ -17,6 +17,8 @@ Content-Transfer-Encoding: 8bit
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master
index a8093be7ca..fca5cce373 100644
--- a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master
+++ b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
@@ -75,6 +77,8 @@ Content-Transfer-Encoding: 8bit
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
@@ -122,6 +126,8 @@ Content-Transfer-Encoding: 8bit
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_initial..master
index aa110c0e7f..6d6fac3908 100644
--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
@@ -75,6 +77,8 @@ Content-Transfer-Encoding: 8bit
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
@@ -122,6 +126,8 @@ Content-Transfer-Encoding: 8bit
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^
index 95e9ea4c59..18a1110def 100644
--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
@@ -75,6 +77,8 @@ Content-Transfer-Encoding: 8bit
file1 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^^
index b8e81e1552..4f258b8858 100644
--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^^
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^^
@@ -19,6 +19,8 @@ This is the second commit.
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..side b/t/t4013/diff.format-patch_--inline_--stdout_initial..side
index 86ae923d71..e86dce69a3 100644
--- a/t/t4013/diff.format-patch_--inline_--stdout_initial..side
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..side
@@ -17,6 +17,8 @@ Content-Transfer-Encoding: 8bit
file3 | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
+
+
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 7fe853c20d..9d99dc2887 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -230,4 +230,29 @@ test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '
'
+cat > expect << EOF
+---
+ file | 16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/file b/file
+index 40f36c6..2dc5c23 100644
+--- a/file
++++ b/file
+@@ -13,4 +13,20 @@ C
+ 10
+ D
+ E
+ F
++5
+EOF
+
+test_expect_success 'format-patch respects -U' '
+
+ git format-patch -U4 -2 &&
+ sed -e "1,/^$/d" -e "/^+5/q" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&
+ test_cmp expect output
+
+'
+
test_done
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index a27fccc8dc..fc2307eaa3 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.
'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
# Ray Lehtiniemi's example
@@ -341,4 +341,31 @@ test_expect_success 'checkdiff detects trailing blank lines' '
git diff --check | grep "ends with blank"
'
+test_expect_success 'checkdiff allows new blank lines' '
+ git checkout x &&
+ mv x y &&
+ (
+ echo "/* This is new */" &&
+ echo "" &&
+ cat y
+ ) >x &&
+ git diff --check
+'
+
+test_expect_success 'combined diff with autocrlf conversion' '
+
+ git reset --hard &&
+ echo >x hello &&
+ git commit -m "one side" x &&
+ git checkout HEAD^ &&
+ echo >x goodbye &&
+ git commit -m "the other side" x &&
+ git config core.autocrlf true &&
+ test_must_fail git merge master &&
+
+ git diff | sed -e "1,/^@@@/d" >actual &&
+ ! grep "^-" actual
+
+'
+
test_done
diff --git a/t/t4016-diff-quote.sh b/t/t4016-diff-quote.sh
index f07035ab7e..55eb5f83f1 100755
--- a/t/t4016-diff-quote.sh
+++ b/t/t4016-diff-quote.sh
@@ -13,8 +13,8 @@ P1='pathname with HT'
P2='pathname with SP'
P3='pathname
with LF'
-: >"$P1" 2>&1 && test -f "$P1" && rm -f "$P1" || {
- echo >&2 'Filesystem does not support tabs in names'
+: 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
+ say 'Your filesystem does not allow tabs in filenames, test skipped.'
test_done
}
diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh
index 0d9cbb6261..7eae1f4500 100755
--- a/t/t4019-diff-wserror.sh
+++ b/t/t4019-diff-wserror.sh
@@ -13,7 +13,8 @@ test_expect_success setup '
echo " HT and SP indent" >>F &&
echo "With trailing SP " >>F &&
echo "Carriage ReturnQ" | tr Q "\015" >>F &&
- echo "No problem" >>F
+ echo "No problem" >>F &&
+ echo >>F
'
@@ -160,4 +161,21 @@ test_expect_success 'with cr-at-eol (attribute)' '
'
+test_expect_success 'trailing empty lines (1)' '
+
+ rm -f .gitattributes &&
+ test_must_fail git diff --check >output &&
+ grep "ends with blank lines." output &&
+ grep "trailing whitespace" output
+
+'
+
+test_expect_success 'trailing empty lines (2)' '
+
+ echo "F -whitespace" >.gitattributes &&
+ git diff --check >output &&
+ ! test -s output
+
+'
+
test_done
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 637b4e19d5..dfe3fbc74b 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -104,7 +104,7 @@ echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
test_expect_success 'force diff with "diff"' '
echo >.gitattributes "file diff" &&
git diff >actual &&
- test_cmp ../t4020/diff.NUL actual
+ test_cmp "$TEST_DIRECTORY"/t4020/diff.NUL actual
'
test_done
diff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh
index bf996fc414..2a537a21e8 100755
--- a/t/t4022-diff-rewrite.sh
+++ b/t/t4022-diff-rewrite.sh
@@ -6,12 +6,12 @@ test_description='rewrite diff'
test_expect_success setup '
- cat ../../COPYING >test &&
+ cat "$TEST_DIRECTORY"/../COPYING >test &&
git add test &&
tr \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \
- <../../COPYING >test
+ <"$TEST_DIRECTORY"/../COPYING >test
'
diff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh
index 4dbfc6e8b7..297ddb5a25 100755
--- a/t/t4023-diff-rename-typechange.sh
+++ b/t/t4023-diff-rename-typechange.sh
@@ -7,21 +7,21 @@ test_description='typechange rename detection'
test_expect_success setup '
rm -f foo bar &&
- cat ../../COPYING >foo &&
+ cat "$TEST_DIRECTORY"/../COPYING >foo &&
ln -s linklink bar &&
git add foo bar &&
git commit -a -m Initial &&
git tag one &&
rm -f foo bar &&
- cat ../../COPYING >bar &&
+ cat "$TEST_DIRECTORY"/../COPYING >bar &&
ln -s linklink foo &&
git add foo bar &&
git commit -a -m Second &&
git tag two &&
rm -f foo bar &&
- cat ../../COPYING >foo &&
+ cat "$TEST_DIRECTORY"/../COPYING >foo &&
git add foo &&
git commit -a -m Third &&
git tag three &&
@@ -35,15 +35,15 @@ test_expect_success setup '
# This is purely for sanity check
rm -f foo bar &&
- cat ../../COPYING >foo &&
- cat ../../Makefile >bar &&
+ cat "$TEST_DIRECTORY"/../COPYING >foo &&
+ cat "$TEST_DIRECTORY"/../Makefile >bar &&
git add foo bar &&
git commit -a -m Fifth &&
git tag five &&
rm -f foo bar &&
- cat ../../Makefile >foo &&
- cat ../../COPYING >bar &&
+ cat "$TEST_DIRECTORY"/../Makefile >foo &&
+ cat "$TEST_DIRECTORY"/../COPYING >bar &&
git add foo bar &&
git commit -a -m Sixth &&
git tag six
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index ba6679c6e4..1c2edebb09 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -3,7 +3,7 @@
test_description='difference in submodules'
. ./test-lib.sh
-. ../diff-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
_z40=0000000000000000000000000000000000000000
test_expect_success setup '
diff --git a/t/t4029-diff-trailing-space.sh b/t/t4029-diff-trailing-space.sh
new file mode 100755
index 0000000000..4ca65e0332
--- /dev/null
+++ b/t/t4029-diff-trailing-space.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# Copyright (c) Jim Meyering
+#
+test_description='diff honors config option, diff.suppress-blank-empty'
+
+. ./test-lib.sh
+
+cat <<\EOF > exp ||
+diff --git a/f b/f
+index 5f6a263..8cb8bae 100644
+--- a/f
++++ b/f
+@@ -1,2 +1,2 @@
+
+-x
++y
+EOF
+exit 1
+
+test_expect_success \
+ "$test_description" \
+ 'printf "\nx\n" > f &&
+ git add f &&
+ git commit -q -m. f &&
+ printf "\ny\n" > f &&
+ git config --bool diff.suppress-blank-empty true &&
+ git diff f > actual &&
+ test_cmp exp actual &&
+ perl -i.bak -p -e "s/^\$/ /" exp &&
+ git config --bool diff.suppress-blank-empty false &&
+ git diff f > actual &&
+ test_cmp exp actual &&
+ git config --bool --unset diff.suppress-blank-empty &&
+ git diff f > actual &&
+ test_cmp exp actual
+ '
+
+test_done
diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh
index e0c67740a5..9b433de836 100755
--- a/t/t4100-apply-stat.sh
+++ b/t/t4100-apply-stat.sh
@@ -17,13 +17,13 @@ do
test_expect_success "$title" '
git apply --stat --summary \
<"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current &&
- test_cmp ../t4100/t-apply-$num.expect current
+ test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
'
test_expect_success "$title with recount" '
sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" |
git apply --recount --stat --summary >current &&
- test_cmp ../t4100/t-apply-$num.expect current
+ test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current
'
done <<\EOF
rename
diff --git a/t/t4101-apply-nonl.sh b/t/t4101-apply-nonl.sh
index da8abcf364..e3443d004d 100755
--- a/t/t4101-apply-nonl.sh
+++ b/t/t4101-apply-nonl.sh
@@ -21,9 +21,10 @@ do
do
test $i -eq $j && continue
cat frotz.$i >frotz
- test_expect_success \
- "apply diff between $i and $j" \
- "git apply <../t4101/diff.$i-$j && diff frotz.$j frotz"
+ test_expect_success "apply diff between $i and $j" '
+ git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
+ test_cmp frotz.$j frotz
+ '
done
done
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 4c8af45f83..0ab925c4e4 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -69,7 +69,29 @@ test_expect_success 'diff-filter=D' '
'
+test_expect_success 'setup case sensitivity tests' '
+ echo case >one &&
+ test_tick &&
+ git commit -a -m Second
+'
+
+test_expect_success 'log --grep' '
+ echo second >expect &&
+ git log -1 --pretty="tformat:%s" --grep=sec >actual &&
+ test_cmp expect actual
+'
+test_expect_success 'log -i --grep' '
+ echo Second >expect &&
+ git log -1 --pretty="tformat:%s" -i --grep=sec >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'log --grep -i' '
+ echo Second >expect &&
+ git log -1 --pretty="tformat:%s" --grep=sec -i >actual &&
+ test_cmp expect actual
+'
test_done
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index e9f3e72c7e..fe14589427 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -8,27 +8,28 @@ test_description='git mailinfo and git mailsplit test'
. ./test-lib.sh
test_expect_success 'split sample box' \
- 'git mailsplit -o. ../t5100/sample.mbox >last &&
+ 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
- test `cat last` = 10'
+ test `cat last` = 11'
for mail in `echo 00*`
do
- test_expect_success "mailinfo $mail" \
- "git mailinfo -u msg$mail patch$mail <$mail >info$mail &&
+ test_expect_success "mailinfo $mail" '
+ git mailinfo -u msg$mail patch$mail <$mail >info$mail &&
echo msg &&
- diff ../t5100/msg$mail msg$mail &&
+ test_cmp "$TEST_DIRECTORY"/t5100/msg$mail msg$mail &&
echo patch &&
- diff ../t5100/patch$mail patch$mail &&
+ test_cmp "$TEST_DIRECTORY"/t5100/patch$mail patch$mail &&
echo info &&
- diff ../t5100/info$mail info$mail"
+ test_cmp "$TEST_DIRECTORY"/t5100/info$mail info$mail
+ '
done
test_expect_success 'respect NULs' '
- git mailsplit -d3 -o. ../t5100/nul-plain &&
- cmp ../t5100/nul-plain 001 &&
+ git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
+ test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
(cat 001 | git mailinfo msg patch) &&
test 4 = $(wc -l < patch)
@@ -36,10 +37,21 @@ test_expect_success 'respect NULs' '
test_expect_success 'Preserve NULs out of MIME encoded message' '
- git mailsplit -d5 -o. ../t5100/nul-b64.in &&
- cmp ../t5100/nul-b64.in 00001 &&
+ git mailsplit -d5 -o. "$TEST_DIRECTORY"/t5100/nul-b64.in &&
+ test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.in 00001 &&
git mailinfo msg patch <00001 &&
- cmp ../t5100/nul-b64.expect patch
+ test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.expect patch
+
+'
+
+test_expect_success 'mailinfo on from header without name works' '
+
+ mkdir info-from &&
+ git mailsplit -oinfo-from "$TEST_DIRECTORY"/t5100/info-from.in &&
+ test_cmp "$TEST_DIRECTORY"/t5100/info-from.in info-from/0001 &&
+ git mailinfo info-from/msg info-from/patch \
+ <info-from/0001 >info-from/out &&
+ test_cmp "$TEST_DIRECTORY"/t5100/info-from.expect info-from/out
'
diff --git a/t/t5100/info-from.expect b/t/t5100/info-from.expect
new file mode 100644
index 0000000000..c31d2eb550
--- /dev/null
+++ b/t/t5100/info-from.expect
@@ -0,0 +1,5 @@
+Author: bare@example.com
+Email: bare@example.com
+Subject: testing bare address in from header
+Date: Sun, 25 May 2008 00:38:18 -0700
+
diff --git a/t/t5100/info-from.in b/t/t5100/info-from.in
new file mode 100644
index 0000000000..4f082093fc
--- /dev/null
+++ b/t/t5100/info-from.in
@@ -0,0 +1,8 @@
+From 667d8940e719cddee1cfe237cbbe215e20270b09 Mon Sep 17 00:00:00 2001
+From: bare@example.com
+Date: Sun, 25 May 2008 00:38:18 -0700
+Subject: [PATCH] testing bare address in from header
+
+commit message
+---
+patch
diff --git a/t/t5100/info0011 b/t/t5100/info0011
new file mode 100644
index 0000000000..da5a605a12
--- /dev/null
+++ b/t/t5100/info0011
@@ -0,0 +1,5 @@
+Author: A U Thor
+Email: a.u.thor@example.com
+Subject: Xyzzy
+Date: Fri, 8 Aug 2008 13:08:37 +0200 (CEST)
+
diff --git a/t/t5100/msg0011 b/t/t5100/msg0011
new file mode 100644
index 0000000000..4667f21007
--- /dev/null
+++ b/t/t5100/msg0011
@@ -0,0 +1,2 @@
+Here comes a commit log message, and
+its second line is here.
diff --git a/t/t5100/patch0011 b/t/t5100/patch0011
new file mode 100644
index 0000000000..8841d3c139
--- /dev/null
+++ b/t/t5100/patch0011
@@ -0,0 +1,22 @@
+---
+ builtin-mailinfo.c | 4 ++--
+
+diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
+index 3e5fe51..aabfe5c 100644
+--- a/builtin-mailinfo.c
++++ b/builtin-mailinfo.c
+@@ -758,8 +758,8 @@ static void handle_body(void)
+ /* process any boundary lines */
+ if (*content_top && is_multipart_boundary(&line)) {
+ /* flush any leftover */
+- if (line.len)
+- handle_filter(&line);
++ if (prev.len)
++ handle_filter(&prev);
+
+ if (!handle_boundary())
+ goto handle_body_out;
+--
+1.6.0.rc2
+
+
diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
index aba57f922b..4bf7947b41 100644
--- a/t/t5100/sample.mbox
+++ b/t/t5100/sample.mbox
@@ -465,3 +465,39 @@ index 962aa34..2d1520f 100644
--
1.5.6.2.455.g1efb2
+From nobody Fri Aug 8 22:24:03 2008
+Date: Fri, 8 Aug 2008 13:08:37 +0200 (CEST)
+From: A U Thor <a.u.thor@example.com>
+Subject: [PATCH 3/3 v2] Xyzzy
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="=-=-="
+
+--=-=-=
+Content-Type: text/plain; charset=iso-8859-15
+Content-Transfer-Encoding: quoted-printable
+
+Here comes a commit log message, and
+its second line is here.
+---
+ builtin-mailinfo.c | 4 ++--
+
+diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
+index 3e5fe51..aabfe5c 100644
+--- a/builtin-mailinfo.c
++++ b/builtin-mailinfo.c
+@@ -758,8 +758,8 @@ static void handle_body(void)
+ /* process any boundary lines */
+ if (*content_top && is_multipart_boundary(&line)) {
+ /* flush any leftover */
+- if (line.len)
+- handle_filter(&line);
++ if (prev.len)
++ handle_filter(&prev);
+=20
+ if (!handle_boundary())
+ goto handle_body_out;
+--=20
+1.6.0.rc2
+
+--=-=-=--
+
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 645583f9d7..83abe5f25e 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -187,6 +187,12 @@ test_expect_success \
test-3-${packname_3}.idx'
test_expect_success \
+ 'verify pack -v' \
+ 'git verify-pack -v test-1-${packname_1}.idx \
+ test-2-${packname_2}.idx \
+ test-3-${packname_3}.idx'
+
+test_expect_success \
'verify-pack catches mismatched .idx and .pack files' \
'cat test-1-${packname_1}.idx >test-3.idx &&
cat test-2-${packname_2}.pack >test-3.pack &&
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index 9fd9d07000..771c0a06a4 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -21,7 +21,7 @@ test_expect_success 'prune stale packs' '
orig_pack=$(echo .git/objects/pack/*.pack) &&
: > .git/objects/tmp_1.pack &&
: > .git/objects/tmp_2.pack &&
- test-chmtime -86501 .git/objects/tmp_1.pack &&
+ test-chmtime =-86501 .git/objects/tmp_1.pack &&
git prune --expire 1.day &&
test -f $orig_pack &&
test -f .git/objects/tmp_2.pack &&
@@ -39,7 +39,7 @@ test_expect_success 'prune --expire' '
git prune --expire=1.hour.ago &&
test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test -f $BLOB_FILE &&
- test-chmtime -86500 $BLOB_FILE &&
+ test-chmtime =-86500 $BLOB_FILE &&
git prune --expire 1.day &&
test $before = $(git count-objects | sed "s/ .*//") &&
! test -f $BLOB_FILE
@@ -53,11 +53,11 @@ test_expect_success 'gc: implicit prune --expire' '
BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test -f $BLOB_FILE &&
- test-chmtime -$((86400*14-30)) $BLOB_FILE &&
+ test-chmtime =-$((86400*14-30)) $BLOB_FILE &&
git gc &&
test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
test -f $BLOB_FILE &&
- test-chmtime -$((86400*14+1)) $BLOB_FILE &&
+ test-chmtime =-$((86400*14+1)) $BLOB_FILE &&
git gc &&
test $before = $(git count-objects | sed "s/ .*//") &&
! test -f $BLOB_FILE
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 362cf7e928..7125baebb8 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -137,7 +137,7 @@ test_expect_success "clone shallow object count" \
"test \"in-pack: 18\" = \"$(grep in-pack count.shallow)\""
count_output () {
- sed -e '/^in-pack:/d' -e '/^packs:/d' -e '/: 0$/d' "$1"
+ sed -e '/^in-pack:/d' -e '/^packs:/d' -e '/^size-pack:/d' -e '/: 0$/d' "$1"
}
test_expect_success "clone shallow object count (part 2)" '
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 8becbc3f38..1f4608d8ba 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -131,9 +131,9 @@ do
test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
cnt=`expr $test_count + 1`
pfx=`printf "%04d" $cnt`
- expect_f="../../t5515/fetch.$test"
+ expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
actual_f="$pfx-fetch.$test"
- expect_r="../../t5515/refs.$test"
+ expect_r="$TEST_DIRECTORY/t5515/refs.$test"
actual_r="$pfx-refs.$test"
test_expect_success "$cmd" '
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index f8c17cd96c..da9588645c 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -19,7 +19,7 @@ then
exit
fi
-. ../lib-httpd.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
if ! start_httpd >&3 2>&4
then
@@ -41,7 +41,7 @@ test_expect_success 'setup remote repository' '
git clone --bare test_repo test_repo.git &&
cd test_repo.git &&
git --bare update-server-info &&
- chmod +x hooks/post-update &&
+ mv hooks/post-update.sample hooks/post-update &&
cd - &&
mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
'
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index d785b3df78..59c65fef28 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -31,6 +31,12 @@ test_expect_success 'clone with excess parameters (2)' '
'
+test_expect_success 'output from clone' '
+ rm -fr dst &&
+ git clone -n "file://$(pwd)/src" dst >output &&
+ test $(grep Initialized output | wc -l) = 1
+'
+
test_expect_success 'clone does not keep pack' '
rm -fr dst &&
@@ -70,4 +76,35 @@ test_expect_success 'clone creates intermediate directories for bare repo' '
'
+test_expect_success 'clone --mirror' '
+
+ git clone --mirror src mirror &&
+ test -f mirror/HEAD &&
+ test ! -f mirror/file &&
+ FETCH="$(cd mirror && git config remote.origin.fetch)" &&
+ test "+refs/*:refs/*" = "$FETCH" &&
+ MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" &&
+ test "$MIRROR" = true
+
+'
+
+test_expect_success 'clone --bare names the local repository <name>.git' '
+
+ git clone --bare src &&
+ test -d src.git
+
+'
+
+test_expect_success 'clone --mirror does not repeat tags' '
+
+ (cd src &&
+ git tag some-tag HEAD) &&
+ git clone --mirror src mirror2 &&
+ (cd mirror2 &&
+ git show-ref 2> clone.err > clone.out) &&
+ test_must_fail grep Duplicate mirror2/clone.err &&
+ grep some-tag mirror2/clone.out
+
+'
+
test_done
diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
index 8f5de097ec..b4e8fbaa5e 100755
--- a/t/t6002-rev-list-bisect.sh
+++ b/t/t6002-rev-list-bisect.sh
@@ -5,7 +5,7 @@
test_description='Tests git rev-list --bisect functionality'
. ./test-lib.sh
-. ../t6000lib.sh # t6xxx specific functions
+. "$TEST_DIRECTORY"/t6000lib.sh # t6xxx specific functions
# usage: test_bisection max-diff bisect-option head ^prune...
#
diff --git a/t/t6003-rev-list-topo-order.sh b/t/t6003-rev-list-topo-order.sh
index 5daa0be8cc..2c73f2da7b 100755
--- a/t/t6003-rev-list-topo-order.sh
+++ b/t/t6003-rev-list-topo-order.sh
@@ -6,7 +6,7 @@
test_description='Tests git rev-list --topo-order functionality'
. ./test-lib.sh
-. ../t6000lib.sh # t6xxx specific functions
+. "$TEST_DIRECTORY"/t6000lib.sh # t6xxx specific functions
list_duplicates()
{
diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index b6e57b2426..04e4b7c5c2 100755
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
@@ -108,4 +108,52 @@ test_expect_success 'compute merge-base (all)' \
'MB=$(git merge-base --all PL PR) &&
expr "$(git name-rev "$MB")" : "[0-9a-f]* tags/C2"'
+# Another set to demonstrate base between one commit and a merge
+# in the documentation.
+
+test_expect_success 'merge-base for octopus-step (setup)' '
+ test_tick && git commit --allow-empty -m root && git tag MMR &&
+ test_tick && git commit --allow-empty -m 1 && git tag MM1 &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m A && git tag MMA &&
+ git checkout MM1 &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m B && git tag MMB &&
+ git checkout MMR &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m C && git tag MMC
+'
+
+test_expect_success 'merge-base A B C' '
+ MB=$(git merge-base --all MMA MMB MMC) &&
+ MM1=$(git rev-parse --verify MM1) &&
+ test "$MM1" = "$MB"
+'
+
+test_expect_success 'criss-cross merge-base for octopus-step (setup)' '
+ git reset --hard MMR &&
+ test_tick && git commit --allow-empty -m 1 && git tag CC1 &&
+ git reset --hard E &&
+ test_tick && git commit --allow-empty -m 2 && git tag CC2 &&
+ test_tick && git merge -s ours CC1 &&
+ test_tick && git commit --allow-empty -m o &&
+ test_tick && git commit --allow-empty -m B && git tag CCB &&
+ git reset --hard CC1 &&
+ test_tick && git merge -s ours CC2 &&
+ test_tick && git commit --allow-empty -m A && git tag CCA
+'
+
+test_expect_success 'merge-base B A^^ A^^2' '
+ MB0=$(git merge-base --all CCB CCA^^ CCA^^2 | sort) &&
+ MB1=$(git rev-parse CC1 CC2 | sort) &&
+ test "$MB0" = "$MB1"
+'
+
test_done
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index f674c48cab..42620e0732 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -136,7 +136,7 @@ test_expect_success "expected conflict markers" "test_cmp expect out"
test_expect_success 'binary files cannot be merged' '
test_must_fail git merge-file -p \
- orig.txt ../test4012.png new1.txt 2> merge.err &&
+ orig.txt "$TEST_DIRECTORY"/test4012.png new1.txt 2> merge.err &&
grep "Cannot merge binary files" merge.err
'
diff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh
index 92ca1f0f8c..b519626ca0 100755
--- a/t/t6027-merge-binary.sh
+++ b/t/t6027-merge-binary.sh
@@ -6,7 +6,7 @@ test_description='ask merge-recursive to merge binary files'
test_expect_success setup '
- cat ../test4012.png >m &&
+ cat "$TEST_DIRECTORY"/test4012.png >m &&
git add m &&
git ls-files -s | sed -e "s/ 0 / 1 /" >E1 &&
test_tick &&
diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index 919552a2fc..f105fab98e 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -6,7 +6,7 @@
test_description='Test git rev-parse with different parent options'
. ./test-lib.sh
-. ../t6000lib.sh # t6xxx specific functions
+. "$TEST_DIRECTORY"/t6000lib.sh # t6xxx specific functions
date >path0
git update-index --add path0
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index bc74349416..8f5a06f7dd 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -83,13 +83,13 @@ test_expect_success 'merge-msg test #1' '
'
cat >expected <<EOF
-Merge branch 'left' of ../$test
+Merge branch 'left' of $TEST_DIRECTORY/$test
EOF
test_expect_success 'merge-msg test #2' '
git checkout master &&
- git fetch ../"$test" left &&
+ git fetch "$TEST_DIRECTORY/$test" left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
test_cmp expected actual
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index a3c8941c72..8ced59321e 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -262,4 +262,14 @@ for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do
"
done
+test_expect_success 'an unusual tag with an incomplete line' '
+
+ git tag -m "bogo" bogo &&
+ bogo=$(git cat-file tag bogo) &&
+ bogo=$(printf "%s" "$bogo" | git mktag) &&
+ git tag -f bogo "$bogo" &&
+ git for-each-ref --format "%(body)" refs/tags/bogo
+
+'
+
test_done
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index 910a28c7e2..78167980b3 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -6,7 +6,7 @@ test_description='git mv in subdirs'
test_expect_success \
'prepare reference tree' \
'mkdir path0 path1 &&
- cp ../../COPYING path0/COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
git add path0/COPYING &&
git-commit -m add -a'
@@ -40,7 +40,7 @@ test_expect_success \
test_expect_success \
'adding another file' \
- 'cp ../../README path0/README &&
+ 'cp "$TEST_DIRECTORY"/../README path0/README &&
git add path0/README &&
git-commit -m add2 -a'
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index a0ab096c8f..f92d414e63 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -250,4 +250,12 @@ test_expect_success 'Tag name filtering strips gpg signature' '
test_cmp expect actual
'
+test_expect_success 'Tag name filtering allows slashes in tag names' '
+ git tag -m tag-with-slash X/1 &&
+ git cat-file tag X/1 | sed -e s,X/1,X/2, > expect &&
+ git filter-branch -f --tag-name-filter "echo X/2" &&
+ git cat-file tag X/2 > actual &&
+ test_cmp expect actual
+'
+
test_done
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index bc7ce2cbbb..198244c57d 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -625,7 +625,7 @@ esac
# Name and email: C O Mitter <committer@example.com>
# No password given, to enable non-interactive operation.
-cp -R ../t7004 ./gpghome
+cp -R "$TEST_DIRECTORY"/t7004 ./gpghome
chmod 0700 gpghome
GNUPGHOME="$(pwd)/gpghome"
export GNUPGHOME
@@ -1070,4 +1070,24 @@ test_expect_success \
test_cmp expect actual
'
+test_expect_success 'filename for the message is relative to cwd' '
+ mkdir subdir &&
+ echo "Tag message in top directory" >msgfile-5 &&
+ echo "Tag message in sub directory" >subdir/msgfile-5 &&
+ (
+ cd subdir &&
+ git tag -a -F msgfile-5 tag-from-subdir
+ ) &&
+ git cat-file tag tag-from-subdir | grep "in sub directory"
+'
+
+test_expect_success 'filename for the message is relative to cwd' '
+ echo "Tag message in sub directory" >subdir/msgfile-6 &&
+ (
+ cd subdir &&
+ git tag -a -F msgfile-6 tag-from-subdir-2
+ ) &&
+ git cat-file tag tag-from-subdir-2 | grep "in sub directory"
+'
+
test_done
diff --git a/t/t7101-reset.sh b/t/t7101-reset.sh
index 0d9874bfd7..ffaeb3983a 100755
--- a/t/t7101-reset.sh
+++ b/t/t7101-reset.sh
@@ -9,7 +9,7 @@ test_description='git-reset should cull empty subdirs'
test_expect_success \
'creating initial files' \
'mkdir path0 &&
- cp ../../COPYING path0/COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
git add path0/COPYING &&
git-commit -m add -a'
@@ -17,10 +17,10 @@ test_expect_success \
'creating second files' \
'mkdir path1 &&
mkdir path1/path2 &&
- cp ../../COPYING path1/path2/COPYING &&
- cp ../../COPYING path1/COPYING &&
- cp ../../COPYING COPYING &&
- cp ../../COPYING path0/COPYING-TOO &&
+ cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING path1/COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING COPYING &&
+ cp "$TEST_DIRECTORY"/../COPYING path0/COPYING-TOO &&
git add path1/path2/COPYING &&
git add path1/COPYING &&
git add COPYING &&
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 9ad5d635a2..1dff84d2fd 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -337,4 +337,36 @@ test_expect_success \
test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
test_must_fail git checkout --track -b track'
+test_expect_success \
+ 'checkout with --track fakes a sensible -b <name>' '
+ git update-ref refs/remotes/origin/koala/bear renamer &&
+ git update-ref refs/new/koala/bear renamer &&
+
+ git checkout --track origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+
+ git checkout master && git branch -D koala/bear &&
+
+ git checkout --track refs/remotes/origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+
+ git checkout master && git branch -D koala/bear &&
+
+ git checkout --track remotes/origin/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+
+ git checkout master && git branch -D koala/bear &&
+
+ git checkout --track refs/new/koala/bear &&
+ test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
+'
+
+test_expect_success \
+ 'checkout with --track, but without -b, fails with too short tracked name' '
+ test_must_fail git checkout --track renamer'
+
test_done
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index d89f91a6fb..7ae0bd0e31 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -46,15 +46,24 @@ test_expect_success 'unedited template with comments should not commit' '
'
test_expect_success 'a Signed-off-by line by itself should not commit' '
- ! GIT_EDITOR=../t7500/add-signed-off git commit --template "$TEMPLATE"
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-signed-off &&
+ test_must_fail git commit --template "$TEMPLATE"
+ )
'
test_expect_success 'adding comments to a template should not commit' '
- ! GIT_EDITOR=../t7500/add-comments git commit --template "$TEMPLATE"
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-comments &&
+ test_must_fail git commit --template "$TEMPLATE"
+ )
'
test_expect_success 'adding real content to a template should commit' '
- GIT_EDITOR=../t7500/add-content git commit --template "$TEMPLATE" &&
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+ git commit --template "$TEMPLATE"
+ ) &&
commit_msg_is "template linecommit message"
'
@@ -62,7 +71,10 @@ test_expect_success '-t option should be short for --template' '
echo "short template" > "$TEMPLATE" &&
echo "new content" >> foo &&
git add foo &&
- GIT_EDITOR=../t7500/add-content git commit -t "$TEMPLATE" &&
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+ git commit -t "$TEMPLATE"
+ ) &&
commit_msg_is "short templatecommit message"
'
@@ -71,7 +83,10 @@ test_expect_success 'config-specified template should commit' '
git config commit.template "$TEMPLATE" &&
echo "more content" >> foo &&
git add foo &&
- GIT_EDITOR=../t7500/add-content git commit &&
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+ git commit
+ ) &&
git config --unset commit.template &&
commit_msg_is "new templatecommit message"
'
@@ -79,7 +94,7 @@ test_expect_success 'config-specified template should commit' '
test_expect_success 'explicit commit message should override template' '
echo "still more content" >> foo &&
git add foo &&
- GIT_EDITOR=../t7500/add-content git commit --template "$TEMPLATE" \
+ GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit --template "$TEMPLATE" \
-m "command line msg" &&
commit_msg_is "command line msg"
'
@@ -88,8 +103,10 @@ test_expect_success 'commit message from file should override template' '
echo "content galore" >> foo &&
git add foo &&
echo "standard input msg" |
- GIT_EDITOR=../t7500/add-content git commit \
- --template "$TEMPLATE" --file - &&
+ (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+ git commit --template "$TEMPLATE" --file -
+ ) &&
commit_msg_is "standard input msg"
'
@@ -132,10 +149,41 @@ EOF
test_expect_success '--signoff' '
echo "yet another content *narf*" >> foo &&
- echo "zort" |
- GIT_EDITOR=../t7500/add-content git commit -s -F - foo &&
+ echo "zort" | (
+ test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+ git commit -s -F - foo
+ ) &&
git cat-file commit HEAD | sed "1,/^$/d" > output &&
- diff expect output
+ test_cmp expect output
+'
+
+test_expect_success 'commit message from file (1)' '
+ mkdir subdir &&
+ echo "Log in top directory" >log &&
+ echo "Log in sub directory" >subdir/log &&
+ (
+ cd subdir &&
+ git commit --allow-empty -F log
+ ) &&
+ commit_msg_is "Log in sub directory"
+'
+
+test_expect_success 'commit message from file (2)' '
+ rm -f log &&
+ echo "Log in sub directory" >subdir/log &&
+ (
+ cd subdir &&
+ git commit --allow-empty -F log
+ ) &&
+ commit_msg_is "Log in sub directory"
+'
+
+test_expect_success 'commit message from stdin' '
+ (
+ cd subdir &&
+ echo "Log with foo word" | git commit --allow-empty -F -
+ ) &&
+ commit_msg_is "Log with foo word"
'
test_done
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 4f2682ea80..3eb9faedcf 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -141,8 +141,8 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
echo "sample
-# Please enter the commit message for your changes.
-# (Comment lines starting with '#' will not be included)" >expect
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit." >expect
test_expect_success 'cleanup commit messages (strip,-F,-e)' '
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 0329aee2cd..6a2b12558a 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -492,4 +492,23 @@ test_expect_success 'merge c1 with c1 and c2' '
test_debug 'gitk --all'
+test_expect_success 'merge fast-forward in a dirty tree' '
+ git reset --hard c0 &&
+ mv file file1 &&
+ cat file1 >file &&
+ rm -f file1 &&
+ git merge c2
+'
+
+test_debug 'gitk --all'
+
+test_expect_success 'in-index merge' '
+ git reset --hard c0 &&
+ git merge --no-ff -s resolve c1 > out &&
+ grep "Wonderful." out &&
+ verify_parents $c0 $c1
+'
+
+test_debug 'gitk --all'
+
test_done
diff --git a/t/t7605-merge-resolve.sh b/t/t7605-merge-resolve.sh
index ee21a107fd..f1f86ddb23 100755
--- a/t/t7605-merge-resolve.sh
+++ b/t/t7605-merge-resolve.sh
@@ -36,7 +36,9 @@ test_expect_success 'merge c1 to c2' '
git diff --exit-code &&
test -f c0.c &&
test -f c1.c &&
- test -f c2.c
+ test -f c2.c &&
+ test 3 = $(git ls-tree -r HEAD | wc -l) &&
+ test 3 = $(git ls-files | wc -l)
'
test_expect_success 'merge c2 to c3 (fails)' '
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index eabec2e06e..45cb60ea4b 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -4,7 +4,7 @@ test_description='git annotate'
. ./test-lib.sh
PROG='git annotate'
-. ../annotate-tests.sh
+. "$TEST_DIRECTORY"/annotate-tests.sh
test_expect_success \
'Annotating an old revision works' \
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index 92ece30fa9..597cf0486f 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -4,6 +4,6 @@ test_description='git blame'
. ./test-lib.sh
PROG='git blame -c'
-. ../annotate-tests.sh
+. "$TEST_DIRECTORY"/annotate-tests.sh
test_done
diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
index f6f71d0545..8b792a1370 100755
--- a/t/t9108-git-svn-glob.sh
+++ b/t/t9108-git-svn-glob.sh
@@ -16,7 +16,8 @@ test_expect_success 'test refspec globbing' '
echo "goodbye world" > trunk/src/b/readme &&
svn import -m "initial" trunk "$svnrepo"/trunk &&
svn co "$svnrepo" tmp &&
- cd tmp &&
+ (
+ cd tmp &&
mkdir branches tags &&
svn add branches tags &&
svn cp trunk branches/start &&
@@ -37,7 +38,7 @@ test_expect_success 'test refspec globbing' '
echo "byebye" >> tags/end/src/b/readme &&
poke tags/end/src/b/readme &&
svn commit -m "nothing to see here"
- cd .. &&
+ ) &&
git config --add svn-remote.svn.url "$svnrepo" &&
git config --add svn-remote.svn.fetch \
"trunk/src/a:refs/remotes/trunk" &&
@@ -48,11 +49,12 @@ test_expect_success 'test refspec globbing' '
git-svn multi-fetch &&
git log --pretty=oneline refs/remotes/tags/end | \
sed -e "s/^.\{41\}//" > output.end &&
- cmp expect.end output.end &&
+ test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \
"`git rev-parse refs/remotes/branches/start`" &&
test "`git rev-parse refs/remotes/branches/start~2`" = \
- "`git rev-parse refs/remotes/trunk`"
+ "`git rev-parse refs/remotes/trunk`" &&
+ test_must_fail git rev-parse refs/remotes/tags/end@3
'
echo try to try > expect.two
@@ -66,11 +68,12 @@ test_expect_success 'test left-hand-side only globbing' '
"branches/*:refs/remotes/two/branches/*" &&
git config --add svn-remote.two.tags \
"tags/*:refs/remotes/two/tags/*" &&
- cd tmp &&
+ (
+ cd tmp &&
echo "try try" >> tags/end/src/b/readme &&
poke tags/end/src/b/readme &&
svn commit -m "try to try"
- cd .. &&
+ ) &&
git-svn fetch two &&
test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
test `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 &&
@@ -80,7 +83,29 @@ test_expect_success 'test left-hand-side only globbing' '
`git rev-parse refs/remotes/two/branches/start` &&
git log --pretty=oneline refs/remotes/two/tags/end | \
sed -e "s/^.\{41\}//" > output.two &&
- cmp expect.two output.two
+ test_cmp expect.two output.two
+ '
+
+echo "Only one set of wildcard directories" \
+ "(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
+echo "" >> expect.three
+
+test_expect_success 'test disallow multi-globs' '
+ git config --add svn-remote.three.url "$svnrepo" &&
+ git config --add svn-remote.three.fetch \
+ trunk:refs/remotes/three/trunk &&
+ git config --add svn-remote.three.branches \
+ "branches/*/t/*:refs/remotes/three/branches/*" &&
+ git config --add svn-remote.three.tags \
+ "tags/*/*:refs/remotes/three/tags/*" &&
+ (
+ cd tmp &&
+ echo "try try" >> tags/end/src/b/readme &&
+ poke tags/end/src/b/readme &&
+ svn commit -m "try to try"
+ ) &&
+ test_must_fail git-svn fetch three 2> stderr.three &&
+ test_cmp expect.three stderr.three
'
test_done
diff --git a/t/t9108-git-svn-multi-glob.sh b/t/t9108-git-svn-multi-glob.sh
new file mode 100755
index 0000000000..3583721652
--- /dev/null
+++ b/t/t9108-git-svn-multi-glob.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+# Copyright (c) 2007 Eric Wong
+test_description='git-svn globbing refspecs'
+. ./lib-git-svn.sh
+
+cat > expect.end <<EOF
+the end
+hi
+start a new branch
+initial
+EOF
+
+test_expect_success 'test refspec globbing' '
+ mkdir -p trunk/src/a trunk/src/b trunk/doc &&
+ echo "hello world" > trunk/src/a/readme &&
+ echo "goodbye world" > trunk/src/b/readme &&
+ svn import -m "initial" trunk "$svnrepo"/trunk &&
+ svn co "$svnrepo" tmp &&
+ (
+ cd tmp &&
+ mkdir branches branches/v1 tags &&
+ svn add branches tags &&
+ svn cp trunk branches/v1/start &&
+ svn commit -m "start a new branch" &&
+ svn up &&
+ echo "hi" >> branches/v1/start/src/b/readme &&
+ poke branches/v1/start/src/b/readme &&
+ echo "hey" >> branches/v1/start/src/a/readme &&
+ poke branches/v1/start/src/a/readme &&
+ svn commit -m "hi" &&
+ svn up &&
+ svn cp branches/v1/start tags/end &&
+ echo "bye" >> tags/end/src/b/readme &&
+ poke tags/end/src/b/readme &&
+ echo "aye" >> tags/end/src/a/readme &&
+ poke tags/end/src/a/readme &&
+ svn commit -m "the end" &&
+ echo "byebye" >> tags/end/src/b/readme &&
+ poke tags/end/src/b/readme &&
+ svn commit -m "nothing to see here"
+ ) &&
+ git config --add svn-remote.svn.url "$svnrepo" &&
+ git config --add svn-remote.svn.fetch \
+ "trunk/src/a:refs/remotes/trunk" &&
+ git config --add svn-remote.svn.branches \
+ "branches/*/*/src/a:refs/remotes/branches/*/*" &&
+ git config --add svn-remote.svn.tags\
+ "tags/*/src/a:refs/remotes/tags/*" &&
+ git-svn multi-fetch &&
+ git log --pretty=oneline refs/remotes/tags/end | \
+ sed -e "s/^.\{41\}//" > output.end &&
+ test_cmp expect.end output.end &&
+ test "`git rev-parse refs/remotes/tags/end~1`" = \
+ "`git rev-parse refs/remotes/branches/v1/start`" &&
+ test "`git rev-parse refs/remotes/branches/v1/start~2`" = \
+ "`git rev-parse refs/remotes/trunk`" &&
+ test_must_fail git rev-parse refs/remotes/tags/end@3
+ '
+
+echo try to try > expect.two
+echo nothing to see here >> expect.two
+cat expect.end >> expect.two
+
+test_expect_success 'test left-hand-side only globbing' '
+ git config --add svn-remote.two.url "$svnrepo" &&
+ git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&
+ git config --add svn-remote.two.branches \
+ "branches/*/*:refs/remotes/two/branches/*/*" &&
+ git config --add svn-remote.two.tags \
+ "tags/*:refs/remotes/two/tags/*" &&
+ (
+ cd tmp &&
+ echo "try try" >> tags/end/src/b/readme &&
+ poke tags/end/src/b/readme &&
+ svn commit -m "try to try"
+ ) &&
+ git-svn fetch two &&
+ test `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&
+ test `git rev-list refs/remotes/two/branches/v1/start | wc -l` -eq 3 &&
+ test `git rev-parse refs/remotes/two/branches/v1/start~2` = \
+ `git rev-parse refs/remotes/two/trunk` &&
+ test `git rev-parse refs/remotes/two/tags/end~3` = \
+ `git rev-parse refs/remotes/two/branches/v1/start` &&
+ git log --pretty=oneline refs/remotes/two/tags/end | \
+ sed -e "s/^.\{41\}//" > output.two &&
+ test_cmp expect.two output.two
+ '
+cat > expect.four <<EOF
+adios
+adding more
+Changed 2 in v2/start
+Another versioned branch
+initial
+EOF
+
+test_expect_success 'test another branch' '
+ (
+ cd tmp &&
+ mkdir branches/v2 &&
+ svn add branches/v2 &&
+ svn cp trunk branches/v2/start &&
+ svn commit -m "Another versioned branch" &&
+ svn up &&
+ echo "hello" >> branches/v2/start/src/b/readme &&
+ poke branches/v2/start/src/b/readme &&
+ echo "howdy" >> branches/v2/start/src/a/readme &&
+ poke branches/v2/start/src/a/readme &&
+ svn commit -m "Changed 2 in v2/start" &&
+ svn up &&
+ svn cp branches/v2/start tags/next &&
+ echo "bye" >> tags/next/src/b/readme &&
+ poke tags/next/src/b/readme &&
+ echo "aye" >> tags/next/src/a/readme &&
+ poke tags/next/src/a/readme &&
+ svn commit -m "adding more" &&
+ echo "byebye" >> tags/next/src/b/readme &&
+ poke tags/next/src/b/readme &&
+ svn commit -m "adios"
+ ) &&
+ git config --add svn-remote.four.url "$svnrepo" &&
+ git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&
+ git config --add svn-remote.four.branches \
+ "branches/*/*:refs/remotes/four/branches/*/*" &&
+ git config --add svn-remote.four.tags \
+ "tags/*:refs/remotes/four/tags/*" &&
+ git-svn fetch four &&
+ test `git rev-list refs/remotes/four/tags/next | wc -l` -eq 5 &&
+ test `git rev-list refs/remotes/four/branches/v2/start | wc -l` -eq 3 &&
+ test `git rev-parse refs/remotes/four/branches/v2/start~2` = \
+ `git rev-parse refs/remotes/four/trunk` &&
+ test `git rev-parse refs/remotes/four/tags/next~2` = \
+ `git rev-parse refs/remotes/four/branches/v2/start` &&
+ git log --pretty=oneline refs/remotes/four/tags/next | \
+ sed -e "s/^.\{41\}//" > output.four &&
+ test_cmp expect.four output.four
+ '
+
+echo "Only one set of wildcard directories" \
+ "(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
+echo "" >> expect.three
+
+test_expect_success 'test disallow multiple globs' '
+ git config --add svn-remote.three.url "$svnrepo" &&
+ git config --add svn-remote.three.fetch \
+ trunk:refs/remotes/three/trunk &&
+ git config --add svn-remote.three.branches \
+ "branches/*/t/*:refs/remotes/three/branches/*/*" &&
+ git config --add svn-remote.three.tags \
+ "tags/*:refs/remotes/three/tags/*" &&
+ (
+ cd tmp &&
+ echo "try try" >> tags/end/src/b/readme &&
+ poke tags/end/src/b/readme &&
+ svn commit -m "try to try"
+ ) &&
+ test_must_fail git-svn fetch three 2> stderr.three &&
+ test_cmp expect.three stderr.three
+ '
+
+test_done
diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh
index 04d2a65c08..83bd1cf17a 100755
--- a/t/t9110-git-svn-use-svm-props.sh
+++ b/t/t9110-git-svn-use-svm-props.sh
@@ -8,7 +8,7 @@ test_description='git-svn useSvmProps test'
. ./lib-git-svn.sh
test_expect_success 'load svm repo' '
- svnadmin load -q "$rawsvnrepo" < ../t9110/svm.dump &&
+ svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9110/svm.dump &&
git-svn init --minimize-url -R arr -i bar "$svnrepo"/mirror/arr &&
git-svn init --minimize-url -R argh -i dir "$svnrepo"/mirror/argh &&
git-svn init --minimize-url -R argh -i e \
diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh
index a8d74dcd3a..c5dfd61e41 100755
--- a/t/t9111-git-svn-use-svnsync-props.sh
+++ b/t/t9111-git-svn-use-svnsync-props.sh
@@ -8,7 +8,7 @@ test_description='git-svn useSvnsyncProps test'
. ./lib-git-svn.sh
test_expect_success 'load svnsync repo' '
- svnadmin load -q "$rawsvnrepo" < ../t9111/svnsync.dump &&
+ svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9111/svnsync.dump &&
git-svn init --minimize-url -R arr -i bar "$svnrepo"/bar &&
git-svn init --minimize-url -R argh -i dir "$svnrepo"/dir &&
git-svn init --minimize-url -R argh -i e "$svnrepo"/dir/a/b/c/d/e &&
diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh
index 8da8ce58eb..ae78e334ac 100755
--- a/t/t9113-git-svn-dcommit-new-file.sh
+++ b/t/t9113-git-svn-dcommit-new-file.sh
@@ -28,6 +28,7 @@ start_svnserve () {
test_expect_success 'start tracking an empty repo' '
svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
+ echo "[general]" > "$rawsvnrepo"/conf/svnserve.conf &&
echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
start_svnserve &&
git svn init svn://127.0.0.1:$SVNSERVE_PORT &&
diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index f0fbd3aff7..b0ba1f0200 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -8,7 +8,7 @@ test_description='git-svn dcommit can commit renames of files with ugly names'
. ./lib-git-svn.sh
test_expect_success 'load repository with strange names' '
- svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump &&
+ svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9115/funky-names.dump &&
start_httpd gtk+
'
diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh
index cc61911593..5fd36a1483 100755
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
@@ -5,20 +5,38 @@
test_description='git-svn info'
. ./lib-git-svn.sh
-say 'skipping svn-info test (has a race undiagnosed yet)'
-test_done
+
+set -e
+
+# Tested with: svn, version 1.4.4 (r25188)
+v=`svn --version | sed -n -e 's/^svn, version \(1\.4\.[0-9]\).*$/\1/p'`
+case $v in
+1.4.*)
+ ;;
+*)
+ say "skipping svn-info test (SVN version: $v not supported)"
+ test_done
+ ;;
+esac
ptouch() {
perl -w -e '
use strict;
+ use POSIX qw(mktime);
die "ptouch requires exactly 2 arguments" if @ARGV != 2;
- die "$ARGV[0] does not exist" if ! -e $ARGV[0];
- my @s = stat $ARGV[0];
- utime $s[8], $s[9], $ARGV[1];
- ' "$1" "$2"
+ my $text_last_updated = shift @ARGV;
+ my $git_file = shift @ARGV;
+ die "\"$git_file\" does not exist" if ! -e $git_file;
+ if ($text_last_updated
+ =~ /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/) {
+ my $mtime = mktime($6, $5, $4, $3, $2 - 1, $1 - 1900);
+ my $atime = $mtime;
+ utime $atime, $mtime, $git_file;
+ }
+ ' "`svn info $2 | grep '^Text Last Updated:'`" "$1"
}
-test_expect_success 'setup repository and import' "
+test_expect_success 'setup repository and import' '
mkdir info &&
cd info &&
echo FIRST > A &&
@@ -27,19 +45,19 @@ test_expect_success 'setup repository and import' "
mkdir directory &&
touch directory/.placeholder &&
ln -s directory symlink-directory &&
- svn import -m 'initial' . $svnrepo &&
+ svn import -m "initial" . "$svnrepo" &&
cd .. &&
mkdir gitwc &&
cd gitwc &&
- git-svn init $svnrepo &&
+ git-svn init "$svnrepo" &&
git-svn fetch &&
cd .. &&
- svn co $svnrepo svnwc &&
+ svn co "$svnrepo" svnwc &&
ptouch svnwc/file gitwc/file &&
ptouch svnwc/directory gitwc/directory &&
ptouch svnwc/symlink-file gitwc/symlink-file &&
ptouch svnwc/symlink-directory gitwc/symlink-directory
- "
+ '
test_expect_success 'info' "
(cd svnwc; svn info) > expected.info &&
@@ -48,7 +66,7 @@ test_expect_success 'info' "
"
test_expect_success 'info --url' '
- test $(cd gitwc; git-svn info --url) = $svnrepo
+ test "$(cd gitwc; git-svn info --url)" = "$svnrepo"
'
test_expect_success 'info .' "
@@ -58,7 +76,7 @@ test_expect_success 'info .' "
"
test_expect_success 'info --url .' '
- test $(cd gitwc; git-svn info --url .) = $svnrepo
+ test "$(cd gitwc; git-svn info --url .)" = "$svnrepo"
'
test_expect_success 'info file' "
@@ -68,7 +86,7 @@ test_expect_success 'info file' "
"
test_expect_success 'info --url file' '
- test $(cd gitwc; git-svn info --url file) = "$svnrepo/file"
+ test "$(cd gitwc; git-svn info --url file)" = "$svnrepo/file"
'
test_expect_success 'info directory' "
@@ -78,7 +96,7 @@ test_expect_success 'info directory' "
"
test_expect_success 'info --url directory' '
- test $(cd gitwc; git-svn info --url directory) = "$svnrepo/directory"
+ test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory"
'
test_expect_success 'info symlink-file' "
@@ -88,7 +106,7 @@ test_expect_success 'info symlink-file' "
"
test_expect_success 'info --url symlink-file' '
- test $(cd gitwc; git-svn info --url symlink-file) \
+ test "$(cd gitwc; git-svn info --url symlink-file)" \
= "$svnrepo/symlink-file"
'
@@ -101,7 +119,7 @@ test_expect_success 'info symlink-directory' "
"
test_expect_success 'info --url symlink-directory' '
- test $(cd gitwc; git-svn info --url symlink-directory) \
+ test "$(cd gitwc; git-svn info --url symlink-directory)" \
= "$svnrepo/symlink-directory"
'
@@ -121,7 +139,7 @@ test_expect_success 'info added-file' "
"
test_expect_success 'info --url added-file' '
- test $(cd gitwc; git-svn info --url added-file) \
+ test "$(cd gitwc; git-svn info --url added-file)" \
= "$svnrepo/added-file"
'
@@ -143,7 +161,7 @@ test_expect_success 'info added-directory' "
"
test_expect_success 'info --url added-directory' '
- test $(cd gitwc; git-svn info --url added-directory) \
+ test "$(cd gitwc; git-svn info --url added-directory)" \
= "$svnrepo/added-directory"
'
@@ -166,7 +184,7 @@ test_expect_success 'info added-symlink-file' "
"
test_expect_success 'info --url added-symlink-file' '
- test $(cd gitwc; git-svn info --url added-symlink-file) \
+ test "$(cd gitwc; git-svn info --url added-symlink-file)" \
= "$svnrepo/added-symlink-file"
'
@@ -189,7 +207,7 @@ test_expect_success 'info added-symlink-directory' "
"
test_expect_success 'info --url added-symlink-directory' '
- test $(cd gitwc; git-svn info --url added-symlink-directory) \
+ test "$(cd gitwc; git-svn info --url added-symlink-directory)" \
= "$svnrepo/added-symlink-directory"
'
@@ -215,7 +233,7 @@ test_expect_success 'info deleted-file' "
"
test_expect_success 'info --url file (deleted)' '
- test $(cd gitwc; git-svn info --url file) \
+ test "$(cd gitwc; git-svn info --url file)" \
= "$svnrepo/file"
'
@@ -236,7 +254,7 @@ test_expect_success 'info deleted-directory' "
"
test_expect_success 'info --url directory (deleted)' '
- test $(cd gitwc; git-svn info --url directory) \
+ test "$(cd gitwc; git-svn info --url directory)" \
= "$svnrepo/directory"
'
@@ -258,7 +276,7 @@ test_expect_success 'info deleted-symlink-file' "
"
test_expect_success 'info --url symlink-file (deleted)' '
- test $(cd gitwc; git-svn info --url symlink-file) \
+ test "$(cd gitwc; git-svn info --url symlink-file)" \
= "$svnrepo/symlink-file"
'
@@ -280,7 +298,7 @@ test_expect_success 'info deleted-symlink-directory' "
"
test_expect_success 'info --url symlink-directory (deleted)' '
- test $(cd gitwc; git-svn info --url symlink-directory) \
+ test "$(cd gitwc; git-svn info --url symlink-directory)" \
= "$svnrepo/symlink-directory"
'
@@ -297,8 +315,8 @@ test_expect_success 'info unknown-file' "
"
test_expect_success 'info --url unknown-file' '
- test -z $(cd gitwc; git-svn info --url unknown-file \
- 2> ../actual.info--url-unknown-file) &&
+ test -z "$(cd gitwc; git-svn info --url unknown-file \
+ 2> ../actual.info--url-unknown-file)" &&
git-diff expected.info-unknown-file actual.info--url-unknown-file
'
@@ -314,8 +332,8 @@ test_expect_success 'info unknown-directory' "
"
test_expect_success 'info --url unknown-directory' '
- test -z $(cd gitwc; git-svn info --url unknown-directory \
- 2> ../actual.info--url-unknown-directory) &&
+ test -z "$(cd gitwc; git-svn info --url unknown-directory \
+ 2> ../actual.info--url-unknown-directory)" &&
git-diff expected.info-unknown-directory \
actual.info--url-unknown-directory
'
@@ -337,8 +355,8 @@ test_expect_success 'info unknown-symlink-file' "
"
test_expect_success 'info --url unknown-symlink-file' '
- test -z $(cd gitwc; git-svn info --url unknown-symlink-file \
- 2> ../actual.info--url-unknown-symlink-file) &&
+ test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \
+ 2> ../actual.info--url-unknown-symlink-file)" &&
git-diff expected.info-unknown-symlink-file \
actual.info--url-unknown-symlink-file
'
@@ -361,8 +379,8 @@ test_expect_success 'info unknown-symlink-directory' "
"
test_expect_success 'info --url unknown-symlink-directory' '
- test -z $(cd gitwc; git-svn info --url unknown-symlink-directory \
- 2> ../actual.info--url-unknown-symlink-directory) &&
+ test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \
+ 2> ../actual.info--url-unknown-symlink-directory)" &&
git-diff expected.info-unknown-symlink-directory \
actual.info--url-unknown-symlink-directory
'
diff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh
index 99230b0810..92e69a2a75 100755
--- a/t/t9121-git-svn-fetch-renamed-dir.sh
+++ b/t/t9121-git-svn-fetch-renamed-dir.sh
@@ -8,7 +8,7 @@ test_description='git-svn can fetch renamed directories'
. ./lib-git-svn.sh
test_expect_success 'load repository with renamed directory' '
- svnadmin load -q "$rawsvnrepo" < ../t9121/renamed-dir.dump
+ svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9121/renamed-dir.dump
'
test_expect_success 'init and fetch repository' '
diff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh
new file mode 100755
index 0000000000..6b62b52f54
--- /dev/null
+++ b/t/t9125-git-svn-multi-glob-branch-names.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Copyright (c) 2008 Marcus Griep
+
+test_description='git-svn multi-glob branch names'
+. ./lib-git-svn.sh
+
+test_expect_success 'setup svnrepo' '
+ mkdir project project/trunk project/branches \
+ project/branches/v14.1 project/tags &&
+ echo foo > project/trunk/foo &&
+ svn import -m "$test_description" project "$svnrepo/project" &&
+ rm -rf project &&
+ svn cp -m "fun" "$svnrepo/project/trunk" \
+ "$svnrepo/project/branches/v14.1/beta" &&
+ svn cp -m "more fun!" "$svnrepo/project/branches/v14.1/beta" \
+ "$svnrepo/project/branches/v14.1/gold"
+ '
+
+test_expect_success 'test clone with multi-glob in branch names' '
+ git svn clone -T trunk -b branches/*/* -t tags \
+ "$svnrepo/project" project &&
+ cd project &&
+ git rev-parse "refs/remotes/v14.1/beta" &&
+ git rev-parse "refs/remotes/v14.1/gold" &&
+ cd ..
+ '
+
+test_expect_success 'test dcommit to multi-globbed branch' "
+ cd project &&
+ git reset --hard 'refs/remotes/v14.1/gold' &&
+ echo hello >> foo &&
+ git commit -m 'hello' -- foo &&
+ git svn dcommit &&
+ cd ..
+ "
+
+test_done
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 3e32e84e6c..988c3ac754 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -45,8 +45,8 @@ test_expect_success \
'mkdir A B C D E F &&
echo hello1 >A/newfile1.txt &&
echo hello2 >B/newfile2.txt &&
- cp ../test9200a.png C/newfile3.png &&
- cp ../test9200a.png D/newfile4.png &&
+ cp "$TEST_DIRECTORY"/test9200a.png C/newfile3.png &&
+ cp "$TEST_DIRECTORY"/test9200a.png D/newfile4.png &&
git add A/newfile1.txt &&
git add B/newfile2.txt &&
git add C/newfile3.png &&
@@ -71,8 +71,8 @@ test_expect_success \
rm -f B/newfile2.txt &&
rm -f C/newfile3.png &&
echo Hello5 >E/newfile5.txt &&
- cp ../test9200b.png D/newfile4.png &&
- cp ../test9200a.png F/newfile6.png &&
+ cp "$TEST_DIRECTORY"/test9200b.png D/newfile4.png &&
+ cp "$TEST_DIRECTORY"/test9200a.png F/newfile6.png &&
git add E/newfile5.txt &&
git add F/newfile6.png &&
git commit -a -m "Test: Remove, add and update" &&
@@ -160,7 +160,7 @@ test_expect_success \
'mkdir "G g" &&
echo ok then >"G g/with spaces.txt" &&
git add "G g/with spaces.txt" && \
- cp ../test9200a.png "G g/with spaces.png" && \
+ cp "$TEST_DIRECTORY"/test9200a.png "G g/with spaces.png" && \
git add "G g/with spaces.png" &&
git commit -a -m "With spaces" &&
id=$(git rev-list --max-count=1 HEAD) &&
@@ -172,7 +172,7 @@ test_expect_success \
test_expect_success \
'Update file with spaces in file name' \
'echo Ok then >>"G g/with spaces.txt" &&
- cat ../test9200a.png >>"G g/with spaces.png" && \
+ cat "$TEST_DIRECTORY"/test9200a.png >>"G g/with spaces.png" && \
git add "G g/with spaces.png" &&
git commit -a -m "Update with spaces" &&
id=$(git rev-list --max-count=1 HEAD) &&
@@ -197,7 +197,7 @@ test_expect_success \
'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
- cp ../test9200a.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
+ cp "$TEST_DIRECTORY"/test9200a.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
git commit -a -m "Går det så går det" && \
id=$(git rev-list --max-count=1 HEAD) &&
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 1fc06c5a23..bd5d5af661 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -5,7 +5,7 @@
test_description='test git-fast-import utility'
. ./test-lib.sh
-. ../diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
file2_data='file2
second line of EOF'
@@ -1045,7 +1045,7 @@ DATA
INPUT_END
test_expect_success 'P: fail on inline gitlink' '
- ! git-fast-import <input'
+ test_must_fail git-fast-import <input'
test_tick
cat >input <<INPUT_END
@@ -1068,6 +1068,6 @@ M 160000 :1 sub
INPUT_END
test_expect_success 'P: fail on blob mark in gitlink' '
- ! git-fast-import <input'
+ test_must_fail git-fast-import <input'
test_done
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 8324f6e3bd..3cb9f80708 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -67,7 +67,7 @@ test_expect_success 'iso-8859-1' '
git config i18n.commitencoding ISO-8859-1 &&
# use author and committer name in ISO-8859-1 to match it.
- . ../t3901-8859-1.txt &&
+ . "$TEST_DIRECTORY"/t3901-8859-1.txt &&
test_tick &&
echo rosten >file &&
git commit -s -m den file &&
@@ -185,4 +185,50 @@ test_expect_success 'submodule fast-export | fast-import' '
'
+export GIT_AUTHOR_NAME='A U Thor'
+export GIT_COMMITTER_NAME='C O Mitter'
+
+test_expect_success 'setup copies' '
+
+ git config --unset i18n.commitencoding &&
+ git checkout -b copy rein &&
+ git mv file file3 &&
+ git commit -m move1 &&
+ test_tick &&
+ cp file2 file4 &&
+ git add file4 &&
+ git mv file2 file5 &&
+ git commit -m copy1 &&
+ test_tick &&
+ cp file3 file6 &&
+ git add file6 &&
+ git commit -m copy2 &&
+ test_tick &&
+ echo more text >> file6 &&
+ echo even more text >> file6 &&
+ git add file6 &&
+ git commit -m modify &&
+ test_tick &&
+ cp file6 file7 &&
+ echo test >> file7 &&
+ git add file7 &&
+ git commit -m copy_modify
+
+'
+
+test_expect_success 'fast-export -C -C | fast-import' '
+
+ ENTRY=$(git rev-parse --verify copy) &&
+ rm -rf new &&
+ mkdir new &&
+ git --git-dir=new/.git init &&
+ git fast-export -C -C --signed-tags=strip --all > output &&
+ grep "^C \"file6\" \"file7\"\$" output &&
+ cat output |
+ (cd new &&
+ git fast-import &&
+ test $ENTRY = $(git rev-parse --verify refs/heads/copy))
+
+'
+
test_done
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index ae7082be1d..46ba19be7d 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -25,9 +25,9 @@ our \$site_name = "[localhost]";
our \$site_header = "";
our \$site_footer = "";
our \$home_text = "indextext.html";
-our @stylesheets = ("file:///$safe_pwd/../../gitweb/gitweb.css");
-our \$logo = "file:///$safe_pwd/../../gitweb/git-logo.png";
-our \$favicon = "file:///$safe_pwd/../../gitweb/git-favicon.png";
+our @stylesheets = ("file:///$TEST_DIRECTORY/../gitweb/gitweb.css");
+our \$logo = "file:///$TEST_DIRECTORY/../gitweb/git-logo.png";
+our \$favicon = "file:///$TEST_DIRECTORY/../gitweb/git-favicon.png";
our \$projects_list = "";
our \$export_ok = "";
our \$strict_export = "";
@@ -54,7 +54,7 @@ gitweb_run () {
# written to web server logs, so we are not interested in that:
# we are interested only in properly formatted errors/warnings
rm -f gitweb.log &&
- perl -- "$(pwd)/../../gitweb/gitweb.perl" \
+ perl -- "$TEST_DIRECTORY/../gitweb/gitweb.perl" \
>/dev/null 2>gitweb.log &&
if grep -q -s "^[[]" gitweb.log >/dev/null; then false; else true; fi
@@ -525,20 +525,20 @@ test_debug 'cat gitweb.log'
test_expect_success \
'encode(commit): utf8' \
- '. ../t3901-utf8.txt &&
+ '. "$TEST_DIRECTORY"/t3901-utf8.txt &&
echo "UTF-8" >> file &&
git add file &&
- git commit -F ../t3900/1-UTF-8.txt &&
+ git commit -F "$TEST_DIRECTORY"/t3900/1-UTF-8.txt &&
gitweb_run "p=.git;a=commit"'
test_debug 'cat gitweb.log'
test_expect_success \
'encode(commit): iso-8859-1' \
- '. ../t3901-8859-1.txt &&
+ '. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
echo "ISO-8859-1" >> file &&
git add file &&
git config i18n.commitencoding ISO-8859-1 &&
- git commit -F ../t3900/ISO-8859-1.txt &&
+ git commit -F "$TEST_DIRECTORY"/t3900/ISO-8859-1.txt &&
git config --unset i18n.commitencoding &&
gitweb_run "p=.git;a=commit"'
test_debug 'cat gitweb.log'
diff --git a/t/t9700-perl-git.sh b/t/t9700-perl-git.sh
index 9706ee5773..0f04ba094b 100755
--- a/t/t9700-perl-git.sh
+++ b/t/t9700-perl-git.sh
@@ -39,6 +39,6 @@ test_expect_success \
test_external_without_stderr \
'Perl API' \
- perl ../t9700/test.pl
+ perl "$TEST_DIRECTORY"/t9700/test.pl
test_done
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 4d2312548a..851cea4a4b 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -14,10 +14,7 @@ use File::Temp;
BEGIN { use_ok('Git') }
# set up
-our $repo_dir = "trash directory";
our $abs_repo_dir = Cwd->cwd;
-die "this must be run by calling the t/t97* shell script(s)\n"
- if basename(Cwd->cwd) ne $repo_dir;
ok(our $r = Git->repository(Directory => "."), "open repository");
# config
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 11c027571b..e2b106cb6a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -406,7 +406,7 @@ test_create_repo () {
error "bug in the test script: not 1 parameter to test-create-repo"
owd=`pwd`
repo="$1"
- mkdir "$repo"
+ mkdir -p "$repo"
cd "$repo" || error "Cannot setup test environment"
"$GIT_EXEC_PATH/git" init "--template=$GIT_EXEC_PATH/templates/blt/" >&3 2>&4 ||
error "cannot run git init -- have you built things yet?"
@@ -449,6 +449,11 @@ test_done () {
# we will leave things as they are.
say_color pass "passed all $msg"
+
+ test -d "$remove_trash" &&
+ cd "$(dirname "$remove_trash")" &&
+ rm -rf "$(basename "$remove_trash")"
+
exit 0 ;;
*)
@@ -485,7 +490,8 @@ fi
. ../GIT-BUILD-OPTIONS
# Test repository
-test="trash directory"
+test="trash directory.$(basename "$0" .sh)"
+test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
rm -fr "$test" || {
trap - exit
echo >&5 "FATAL: Cannot prepare test area"
diff --git a/templates/Makefile b/templates/Makefile
index 9f3f1fc352..0722a926f7 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -23,13 +23,13 @@ all: boilerplates.made custom
bpsrc = $(filter-out %~,$(wildcard *--*))
boilerplates.made : $(bpsrc)
- $(QUIET)ls *--* 2>/dev/null | \
+ $(QUIET)umask 022 && ls *--* 2>/dev/null | \
while read boilerplate; \
do \
case "$$boilerplate" in *~) continue ;; esac && \
dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
dir=`expr "$$dst" : '\(.*\)/'` && \
- $(INSTALL) -d -m 755 blt/$$dir && \
+ mkdir -p blt/$$dir && \
case "$$boilerplate" in \
*--) ;; \
*) cp -p $$boilerplate blt/$$dst ;; \
@@ -48,4 +48,4 @@ clean:
install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
(cd blt && $(TAR) cf - .) | \
- (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xf -)
+ (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
diff --git a/test-parse-options.c b/test-parse-options.c
index 2a79e729a4..61d2c39814 100644
--- a/test-parse-options.c
+++ b/test-parse-options.c
@@ -2,7 +2,8 @@
#include "parse-options.h"
static int boolean = 0;
-static unsigned long integer = 0;
+static int integer = 0;
+static unsigned long timestamp;
static int abbrev = 7;
static int verbose = 0, dry_run = 0, quiet = 0;
static char *string = NULL;
@@ -14,7 +15,7 @@ int length_callback(const struct option *opt, const char *arg, int unset)
if (unset)
return 1; /* do not support unset */
- *(unsigned long *)opt->value = strlen(arg);
+ *(int *)opt->value = strlen(arg);
return 0;
}
@@ -32,7 +33,7 @@ int main(int argc, const char **argv)
OPT_INTEGER('i', "integer", &integer, "get a integer"),
OPT_INTEGER('j', NULL, &integer, "get a integer, too"),
OPT_SET_INT(0, "set23", &integer, "set integer to 23", 23),
- OPT_DATE('t', NULL, &integer, "get timestamp of <time>"),
+ OPT_DATE('t', NULL, &timestamp, "get timestamp of <time>"),
OPT_CALLBACK('L', "length", &integer, "str",
"get length of <str>", length_callback),
OPT_GROUP("String options"),
@@ -56,7 +57,8 @@ int main(int argc, const char **argv)
argc = parse_options(argc, argv, options, usage, 0);
printf("boolean: %d\n", boolean);
- printf("integer: %lu\n", integer);
+ printf("integer: %u\n", integer);
+ printf("timestamp: %lu\n", timestamp);
printf("string: %s\n", string ? string : "(not set)");
printf("abbrev: %d\n", abbrev);
printf("verbose: %d\n", verbose);
diff --git a/transport.c b/transport.c
index 6eb65b873a..71433d9997 100644
--- a/transport.c
+++ b/transport.c
@@ -463,17 +463,14 @@ static struct ref *get_refs_via_curl(struct transport *transport)
run_active_slot(slot);
if (results.curl_result != CURLE_OK) {
strbuf_release(&buffer);
- if (missing_target(&results)) {
- return NULL;
- } else {
- error("%s", curl_errorstr);
- return NULL;
- }
+ if (missing_target(&results))
+ die("%s not found: did you run git update-server-info on the server?", refs_url);
+ else
+ die("%s download error - %s", refs_url, curl_errorstr);
}
} else {
strbuf_release(&buffer);
- error("Unable to start request");
- return NULL;
+ die("Unable to start HTTP request");
}
data = buffer.buf;
diff --git a/unpack-trees.c b/unpack-trees.c
index cba0aca062..ef21c62195 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -376,6 +376,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
state.refresh_cache = 1;
memset(&o->result, 0, sizeof(o->result));
+ o->result.initialized = 1;
if (o->src_index)
o->result.timestamp = o->src_index->timestamp;
o->merge_size = len;
diff --git a/var.c b/var.c
index 724ba87a7c..f1eb314e89 100644
--- a/var.c
+++ b/var.c
@@ -5,7 +5,7 @@
*/
#include "cache.h"
-static const char var_usage[] = "git-var [-l | <variable>]";
+static const char var_usage[] = "git var [-l | <variable>]";
struct git_var {
const char *name;
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 61dc5c5470..944ad9887f 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -1,5 +1,12 @@
#include "cache.h"
#include "xdiff-interface.h"
+#include "strbuf.h"
+
+struct xdiff_emit_state {
+ xdiff_emit_consume_fn consume;
+ void *consume_callback_data;
+ struct strbuf remainder;
+};
static int parse_num(char **cp_p, int *num_p)
{
@@ -55,13 +62,13 @@ static void consume_one(void *priv_, char *s, unsigned long size)
unsigned long this_size;
ep = memchr(s, '\n', size);
this_size = (ep == NULL) ? size : (ep - s + 1);
- priv->consume(priv, s, this_size);
+ priv->consume(priv->consume_callback_data, s, this_size);
size -= this_size;
s += this_size;
}
}
-int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
+static int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
{
struct xdiff_emit_state *priv = priv_;
int i;
@@ -69,36 +76,22 @@ int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf)
for (i = 0; i < nbuf; i++) {
if (mb[i].ptr[mb[i].size-1] != '\n') {
/* Incomplete line */
- priv->remainder = xrealloc(priv->remainder,
- priv->remainder_size +
- mb[i].size);
- memcpy(priv->remainder + priv->remainder_size,
- mb[i].ptr, mb[i].size);
- priv->remainder_size += mb[i].size;
+ strbuf_add(&priv->remainder, mb[i].ptr, mb[i].size);
continue;
}
/* we have a complete line */
- if (!priv->remainder) {
+ if (!priv->remainder.len) {
consume_one(priv, mb[i].ptr, mb[i].size);
continue;
}
- priv->remainder = xrealloc(priv->remainder,
- priv->remainder_size +
- mb[i].size);
- memcpy(priv->remainder + priv->remainder_size,
- mb[i].ptr, mb[i].size);
- consume_one(priv, priv->remainder,
- priv->remainder_size + mb[i].size);
- free(priv->remainder);
- priv->remainder = NULL;
- priv->remainder_size = 0;
+ strbuf_add(&priv->remainder, mb[i].ptr, mb[i].size);
+ consume_one(priv, priv->remainder.buf, priv->remainder.len);
+ strbuf_reset(&priv->remainder);
}
- if (priv->remainder) {
- consume_one(priv, priv->remainder, priv->remainder_size);
- free(priv->remainder);
- priv->remainder = NULL;
- priv->remainder_size = 0;
+ if (priv->remainder.len) {
+ consume_one(priv, priv->remainder.buf, priv->remainder.len);
+ strbuf_reset(&priv->remainder);
}
return 0;
}
@@ -141,6 +134,25 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
return xdl_diff(&a, &b, xpp, xecfg, xecb);
}
+int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
+ xdiff_emit_consume_fn fn, void *consume_callback_data,
+ xpparam_t const *xpp,
+ xdemitconf_t const *xecfg, xdemitcb_t *xecb)
+{
+ int ret;
+ struct xdiff_emit_state state;
+
+ memset(&state, 0, sizeof(state));
+ state.consume = fn;
+ state.consume_callback_data = consume_callback_data;
+ xecb->outf = xdiff_outf;
+ xecb->priv = &state;
+ strbuf_init(&state.remainder, 0);
+ ret = xdi_diff(mf1, mf2, xpp, xecfg, xecb);
+ strbuf_release(&state.remainder);
+ return ret;
+}
+
int read_mmfile(mmfile_t *ptr, const char *filename)
{
struct stat st;
diff --git a/xdiff-interface.h b/xdiff-interface.h
index f7f791d96b..558492ba38 100644
--- a/xdiff-interface.h
+++ b/xdiff-interface.h
@@ -3,18 +3,13 @@
#include "xdiff/xdiff.h"
-struct xdiff_emit_state;
-
typedef void (*xdiff_emit_consume_fn)(void *, char *, unsigned long);
-struct xdiff_emit_state {
- xdiff_emit_consume_fn consume;
- char *remainder;
- unsigned long remainder_size;
-};
-
int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb);
-int xdiff_outf(void *priv_, mmbuffer_t *mb, int nbuf);
+int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
+ xdiff_emit_consume_fn fn, void *consume_callback_data,
+ xpparam_t const *xpp,
+ xdemitconf_t const *xecfg, xdemitcb_t *xecb);
int parse_hunk_header(char *line, int len,
int *ob, int *on,
int *nb, int *nn);