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.3.txt26
-rw-r--r--Documentation/RelNotes-1.5.6.4.txt47
-rw-r--r--Documentation/RelNotes-1.5.6.5.txt29
-rw-r--r--Documentation/config.txt10
-rw-r--r--Documentation/diff-generate-patch.txt2
-rw-r--r--Documentation/git-add.txt5
-rw-r--r--Documentation/git-am.txt2
-rw-r--r--Documentation/git-blame.txt2
-rw-r--r--Documentation/git-branch.txt2
-rw-r--r--Documentation/git-check-attr.txt2
-rw-r--r--Documentation/git-cherry-pick.txt12
-rw-r--r--Documentation/git-cherry.txt2
-rw-r--r--Documentation/git-commit.txt2
-rw-r--r--Documentation/git-config.txt2
-rw-r--r--Documentation/git-count-objects.txt2
-rw-r--r--Documentation/git-describe.txt2
-rw-r--r--Documentation/git-diff-tree.txt16
-rw-r--r--Documentation/git-fetch.txt2
-rw-r--r--Documentation/git-fmt-merge-msg.txt2
-rw-r--r--Documentation/git-format-patch.txt2
-rw-r--r--Documentation/git-hash-object.txt2
-rw-r--r--Documentation/git-ls-remote.txt2
-rw-r--r--Documentation/git-ls-tree.txt2
-rw-r--r--Documentation/git-mailinfo.txt7
-rw-r--r--Documentation/git-mailsplit.txt2
-rw-r--r--Documentation/git-merge-one-file.txt2
-rw-r--r--Documentation/git-merge.txt2
-rw-r--r--Documentation/git-mktree.txt2
-rw-r--r--Documentation/git-name-rev.txt3
-rw-r--r--Documentation/git-peek-remote.txt2
-rw-r--r--Documentation/git-pull.txt2
-rw-r--r--Documentation/git-push.txt2
-rw-r--r--Documentation/git-rebase.txt2
-rw-r--r--Documentation/git-reflog.txt2
-rw-r--r--Documentation/git-request-pull.txt2
-rw-r--r--Documentation/git-rerere.txt2
-rw-r--r--Documentation/git-reset.txt2
-rw-r--r--Documentation/git-rev-parse.txt2
-rw-r--r--Documentation/git-revert.txt18
-rw-r--r--Documentation/git-show-branch.txt2
-rw-r--r--Documentation/git-show.txt2
-rw-r--r--Documentation/git-status.txt2
-rw-r--r--Documentation/git-symbolic-ref.txt2
-rw-r--r--Documentation/git-tag.txt2
-rw-r--r--Documentation/git-update-server-info.txt2
-rw-r--r--Documentation/git-verify-pack.txt2
-rw-r--r--Documentation/git-whatchanged.txt2
-rw-r--r--Documentation/git.txt9
-rw-r--r--Documentation/howto/rebase-from-internal-branch.txt2
-rw-r--r--Documentation/howto/rebuild-from-update-hook.txt2
-rw-r--r--Documentation/howto/revert-branch-rebase.txt2
-rw-r--r--Documentation/howto/separating-topic-branches.txt2
-rw-r--r--Documentation/howto/update-hook-example.txt2
-rw-r--r--Documentation/pretty-formats.txt2
-rw-r--r--Documentation/rev-list-options.txt6
-rw-r--r--Documentation/technical/api-run-command.txt2
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--Makefile6
l---------RelNotes2
-rw-r--r--attr.c15
-rw-r--r--builtin-checkout.c3
-rw-r--r--builtin-clone.c4
-rw-r--r--builtin-commit.c11
-rw-r--r--builtin-fetch-pack.c3
-rw-r--r--builtin-grep.c29
-rw-r--r--builtin-init-db.c2
-rw-r--r--builtin-mailinfo.c6
-rw-r--r--builtin-name-rev.c81
-rw-r--r--builtin-rev-list.c5
-rw-r--r--builtin-revert.c2
-rw-r--r--builtin-rm.c10
-rw-r--r--builtin-tag.c3
-rw-r--r--cache.h2
-rw-r--r--commit.c13
-rwxr-xr-xcontrib/completion/git-completion.bash68
-rw-r--r--daemon.c70
-rw-r--r--diff-lib.c8
-rw-r--r--diff.c20
-rw-r--r--diff.h9
-rwxr-xr-xgit-add--interactive.perl6
-rwxr-xr-xgit-am.sh3
-rwxr-xr-xgit-cvsimport.perl2
-rwxr-xr-xgit-cvsserver.perl2
-rwxr-xr-xgit-rebase--interactive.sh2
-rwxr-xr-xgit-send-email.perl2
-rwxr-xr-xgit-submodule.sh2
-rw-r--r--http-walker.c2
-rw-r--r--index-pack.c146
-rw-r--r--parse-options.c12
-rw-r--r--parse-options.h2
-rw-r--r--path.c2
-rw-r--r--pretty.c27
-rw-r--r--remote.c52
-rw-r--r--revision.c4
-rw-r--r--revision.h1
-rw-r--r--sha1_file.c1
-rwxr-xr-xt/t0001-init.sh26
-rwxr-xr-xt/t0004-unwritable.sh19
-rwxr-xr-xt/t1301-shared-repo.sh23
-rwxr-xr-xt/t2103-update-index-ignore-missing.sh89
-rwxr-xr-xt/t3202-show-branch-octopus.sh59
-rwxr-xr-xt/t3600-rm.sh12
-rwxr-xr-xt/t4202-log.sh3
-rwxr-xr-xt/t5000-tar-tree.sh11
-rwxr-xr-xt/t5100-mailinfo.sh2
-rw-r--r--t/t5100/001035
-rw-r--r--t/t5100/info00105
-rw-r--r--t/t5100/msg00105
-rw-r--r--t/t5100/patch001020
-rw-r--r--t/t5100/sample.mbox35
-rwxr-xr-xt/t5513-fetch-track.sh30
-rwxr-xr-xt/t5602-clone-remote-exec.sh26
-rwxr-xr-xt/t7004-tag.sh20
-rwxr-xr-xt/t7500-commit.sh29
-rwxr-xr-xt/t7600-merge.sh36
-rw-r--r--transport.c13
-rw-r--r--tree-diff.c27
121 files changed, 1092 insertions, 363 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.3.txt b/Documentation/RelNotes-1.5.6.3.txt
index dd0559b64a..942611299d 100644
--- a/Documentation/RelNotes-1.5.6.3.txt
+++ b/Documentation/RelNotes-1.5.6.3.txt
@@ -4,8 +4,16 @@ GIT v1.5.6.3 Release Notes
Fixes since v1.5.6.2
--------------------
+* Setting core.sharerepository to traditional "true" value was supposed to make
+ the repository group writable but should not affect permission for others.
+ However, since 1.5.6, it was broken to drop permission for others when umask is
+ 022, making the repository unreadable by others.
+
* Setting GIT_TRACE will report spawning of external process via run_command().
+* Using an object with very deep delta chain pinned memory needed for extracting
+ intermediate base objects unnecessarily long, leading to excess memory usage.
+
* Bash completion script did not notice '--' marker on the command
line and tried the relatively slow "ref completion" even when
completing arguments after one.
@@ -14,6 +22,12 @@ Fixes since v1.5.6.2
tree file for it confused "racy-git avoidance" logic into thinking
that the path is now unchanged.
+* The section that describes attributes related to git-archive were placed
+ in a wrong place in the gitattributes(5) manual page.
+
+* "git am" was not helpful to the users when it detected that the committer
+ information is not set up properly yet.
+
* "git clone" had a leftover debugging fprintf().
* "git clone -q" was not quiet enough as it used to and gave object count
@@ -23,8 +37,10 @@ Fixes since v1.5.6.2
good thing if the remote side is well packed but otherwise not,
especially for a project that is not really big.
-* The section that describes attributes related to git-archive were placed
- in a wrong place in the gitattributes(5) manual page.
+* "git daemon" used to call syslog() from a signal handler, which
+ could raise signals of its own but generally is not reentrant. This
+ was fixed by restructuring the code to report syslog() after the handler
+ returns.
* When "git push" tries to remove a remote ref, and corresponding
tracking ref is missing, we used to report error (i.e. failure to
@@ -34,9 +50,3 @@ Fixes since v1.5.6.2
MIME multipart mail correctly.
Contains other various documentation fixes.
-
---
-exec >/var/tmp/1
-O=v1.5.6.2-23-ge965647
-echo O=$(git describe maint)
-git shortlog --no-merges $O..maint
diff --git a/Documentation/RelNotes-1.5.6.4.txt b/Documentation/RelNotes-1.5.6.4.txt
new file mode 100644
index 0000000000..d8968f1ecb
--- /dev/null
+++ b/Documentation/RelNotes-1.5.6.4.txt
@@ -0,0 +1,47 @@
+GIT v1.5.6.4 Release Notes
+==========================
+
+Fixes since v1.5.6.3
+--------------------
+
+* Various commands could overflow its internal buffer on a platform
+ with small PATH_MAX value in a repository that has contents with
+ long pathnames.
+
+* There wasn't a way to make --pretty=format:%<> specifiers to honor
+ .mailmap name rewriting for authors and committers. Now you can with
+ %aN and %cN.
+
+* Bash completion wasted too many cycles; this has been optimized to be
+ usable again.
+
+* Bash completion lost ref part when completing something like "git show
+ pu:Makefile".
+
+* "git-cvsserver" did not clean up its temporary working area after annotate
+ request.
+
+* "git-daemon" called syslog() from its signal handler, which was a
+ no-no.
+
+* "git-fetch" into an empty repository used to remind that the fetch will
+ be huge by saying "no common commits", but this was an unnecessary
+ noise; it is already known by the user anyway.
+
+* "git-http-fetch" would have segfaulted when pack idx file retrieved
+ from the other side was corrupt.
+
+* "git-index-pack" used too much memory when dealing with a deep delta chain.
+
+* "git-mailinfo" (hence "git-am") did not correctly handle in-body [PATCH]
+ line to override the commit title taken from the mail Subject header.
+
+* "git-rebase -i -p" lost parents that are not involved in the history
+ being rewritten.
+
+* "git-rm" lost track of where the index file was when GIT_DIR was
+ specified as a relative path.
+
+* "git-rev-list --quiet" was not quiet as advertised.
+
+Contains other various documentation fixes.
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/config.txt b/Documentation/config.txt
index 5331b450ea..d4ca8b2712 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -92,7 +92,7 @@ Example
# Our diff algorithm
[diff]
- external = "/usr/local/bin/gnu-diff -u"
+ external = /usr/local/bin/diff-wrapper
renames = true
[branch "devel"]
@@ -554,9 +554,11 @@ diff.autorefreshindex::
diff.external::
If this config variable is set, diff generation is not
performed using the internal diff machinery, but using the
- given command. Note: if you want to use an external diff
- program only on a subset of your files, you might want to
- use linkgit:gitattributes[5] instead.
+ given command. Can be overridden with the `GIT_EXTERNAL_DIFF'
+ environment variable. The command is called with parameters
+ as described under "git Diffs" in linkgit:git[1]. Note: if
+ you want to use an external diff program only on a subset of
+ your files, you might want to use linkgit:gitattributes[5] instead.
diff.renameLimit::
The number of files to consider when performing the copy/rename
diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt
index 029c5f2b82..517e1eba3c 100644
--- a/Documentation/diff-generate-patch.txt
+++ b/Documentation/diff-generate-patch.txt
@@ -96,7 +96,7 @@ index fabadb8,cc95eb0..4866510
+
or like this (when '--cc' option is used):
- diff --c file
+ diff --cc file
2. It is followed by one or more extended header lines
(this example shows a merge with two parents):
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index b8e3fa6759..815864c37f 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -187,8 +187,9 @@ update::
"Update>>". When the prompt ends with double '>>', you can
make more than one selection, concatenated with whitespace or
comma. Also you can say ranges. E.g. "2-5 7,9" to choose
- 2,3,4,5,7,9 from the list. You can say '*' to choose
- everything.
+ 2,3,4,5,7,9 from the list. If the second number in a range is
+ omitted, all remaining patches are taken. E.g. "7-" to choose
+ 7,8,9 from the list. You can say '*' to choose everything.
+
What you chose are then highlighted with '*',
like this:
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 46544a0769..5622971f6a 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -153,7 +153,7 @@ linkgit:git-apply[1].
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
index 8f4fb46685..0e0196e5b0 100644
--- a/Documentation/git-blame.txt
+++ b/Documentation/git-blame.txt
@@ -190,7 +190,7 @@ linkgit:git-annotate[1]
AUTHOR
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
GIT
---
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 0fd58083eb..39cd5d961f 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -202,7 +202,7 @@ but different purposes:
Author
------
-Written by Linus Torvalds <torvalds@osdl.org> and Junio C Hamano <junkio@cox.net>
+Written by Linus Torvalds <torvalds@osdl.org> and Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt
index ef16b93982..f8e1bd5027 100644
--- a/Documentation/git-check-attr.txt
+++ b/Documentation/git-check-attr.txt
@@ -30,7 +30,7 @@ linkgit:gitattributes[5].
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 5ac9cfb0ef..44e7749b10 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -58,14 +58,14 @@ OPTIONS
Usually the command automatically creates a commit with
a commit log message stating which commit was
cherry-picked. This flag applies the change necessary
- to cherry-pick the named commit to your working tree,
- but does not make the commit. In addition, when this
- option is used, your working tree does not have to match
+ to cherry-pick the named commit to your working tree
+ and the index, but does not make the commit. In addition,
+ when this option is used, your index does not have to match
the HEAD commit. The cherry-pick is done against the
- beginning state of your working tree.
+ beginning state of your index.
+
This is useful when cherry-picking more than one commits'
-effect to your working tree in a row.
+effect to your index in a row.
-s::
--signoff::
@@ -74,7 +74,7 @@ effect to your working tree in a row.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt
index ef7caf61e1..912601160c 100644
--- a/Documentation/git-cherry.txt
+++ b/Documentation/git-cherry.txt
@@ -64,7 +64,7 @@ linkgit:git-patch-id[1]
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 7e8b4ff72c..861ce93a49 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -322,7 +322,7 @@ linkgit:git-commit-tree[1]
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>
+Junio C Hamano <gitster@pobox.com>
GIT
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index c90421ee7f..b0f20e2392 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -231,7 +231,7 @@ Given a .git/config like this:
; Our diff algorithm
[diff]
- external = "/usr/local/bin/gnu-diff -u"
+ external = /usr/local/bin/diff-wrapper
renames = true
; Proxy settings
diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt
index 1ba85a259a..4a9dcd7382 100644
--- a/Documentation/git-count-objects.txt
+++ b/Documentation/git-count-objects.txt
@@ -27,7 +27,7 @@ OPTIONS
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index 9f6f483186..44aaa4090c 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -136,7 +136,7 @@ will be the smallest number of commits possible.
Author
------
Written by Linus Torvalds <torvalds@osdl.org>, but somewhat
-butchered by Junio C Hamano <junkio@cox.net>. Later significantly
+butchered by Junio C Hamano <gitster@pobox.com>. Later significantly
updated by Shawn Pearce <spearce@spearce.org>.
Documentation
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 56caeb2d26..5d23985b57 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -49,13 +49,13 @@ 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>
+ reads either one <commit> or a list of <commit>
separated with a single space from its standard input.
+
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.
+behavior. The remaining commits, when given, are used as if they are
+parents of the first commit.
-m::
By default, "git-diff-tree --stdin" does not show
@@ -93,11 +93,11 @@ include::pretty-options.txt[]
This flag changes the way a merge commit patch is displayed,
in a similar way to the '-c' option. It implies the '-c'
and '-p' options and further compresses the patch output
- by omitting hunks that show differences from only one
- parent, or show the same change from all but one parent
- for an Octopus merge. When this optimization makes all
- hunks disappear, the commit itself and the commit log
- message is not shown, just like in any other "empty diff" case.
+ by omitting uninteresting hunks whose the contents in the parents
+ have only two variants and the merge result picks one of them
+ without modification. When all hunks are uninteresting, the commit
+ itself and the commit log message is not shown, just like in any other
+ "empty diff" case.
--always::
Show the commit itself and the commit log message even
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 489b2b17e6..4fae7fb5a8 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -45,7 +45,7 @@ linkgit:git-pull[1]
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>
+Junio C Hamano <gitster@pobox.com>
Documentation
-------------
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
index 2a7cfb980b..222052fba7 100644
--- a/Documentation/git-fmt-merge-msg.txt
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -61,7 +61,7 @@ linkgit:git-merge[1]
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 4dafa39a92..ee27eff3b1 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -235,7 +235,7 @@ linkgit:git-am[1], linkgit:git-send-email[1]
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt
index cf3dce8a4a..1abcd96c6d 100644
--- a/Documentation/git-hash-object.txt
+++ b/Documentation/git-hash-object.txt
@@ -37,7 +37,7 @@ OPTIONS
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index f92f3ca186..f282164e9b 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -69,7 +69,7 @@ EXAMPLES
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
GIT
---
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index d9881fbbbe..8955b71302 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -81,7 +81,7 @@ with minimum width of 7 characters. Object size is given only for blobs
Author
------
Written by Petr Baudis <pasky@suse.cz>
-Completely rewritten from scratch by Junio C Hamano <junkio@cox.net>,
+Completely rewritten from scratch by Junio C Hamano <gitster@pobox.com>,
another major rewrite by Linus Torvalds <torvalds@osdl.org>
Documentation
diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
index 183dc1dd75..0b23faee7a 100644
--- a/Documentation/git-mailinfo.txt
+++ b/Documentation/git-mailinfo.txt
@@ -8,7 +8,7 @@ git-mailinfo - Extracts patch and authorship from a single e-mail message
SYNOPSIS
--------
-'git-mailinfo' [-k] [-u | --encoding=<encoding>] <msg> <patch>
+'git-mailinfo' [-k] [-u | --encoding=<encoding> | -n] <msg> <patch>
DESCRIPTION
@@ -46,6 +46,9 @@ conversion, even with this flag.
from what is specified by i18n.commitencoding, this flag
can be used to override it.
+-n::
+ Disable all charset re-coding of the metadata.
+
<msg>::
The commit log message extracted from e-mail, usually
except the title line which comes from e-mail Subject.
@@ -57,7 +60,7 @@ conversion, even with this flag.
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>
+Junio C Hamano <gitster@pobox.com>
Documentation
diff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt
index 9a2aedd480..1a0df38d5b 100644
--- a/Documentation/git-mailsplit.txt
+++ b/Documentation/git-mailsplit.txt
@@ -46,7 +46,7 @@ OPTIONS
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
-and Junio C Hamano <junkio@cox.net>
+and Junio C Hamano <gitster@pobox.com>
Documentation
diff --git a/Documentation/git-merge-one-file.txt b/Documentation/git-merge-one-file.txt
index 5c9ce641ec..546ebe8bf0 100644
--- a/Documentation/git-merge-one-file.txt
+++ b/Documentation/git-merge-one-file.txt
@@ -18,7 +18,7 @@ to resolve a merge after the trivial merge done with "git-read-tree -m".
Author
------
Written by Linus Torvalds <torvalds@osdl.org>,
-Junio C Hamano <junkio@cox.net> and Petr Baudis <pasky@suse.cz>.
+Junio C Hamano <gitster@pobox.com> and Petr Baudis <pasky@suse.cz>.
Documentation
--------------
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index 55bc367479..b05e0cee11 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -159,7 +159,7 @@ linkgit:gitattributes[5]
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
diff --git a/Documentation/git-mktree.txt b/Documentation/git-mktree.txt
index 1ddbf00afc..6927eb9950 100644
--- a/Documentation/git-mktree.txt
+++ b/Documentation/git-mktree.txt
@@ -23,7 +23,7 @@ OPTIONS
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt
index ffac3f8f56..83d8e4a9fc 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 linkgit:git-describe[1] more closely. This option
- cannot be combined with --stdin.
+ of linkgit:git-describe[1] more closely.
--no-undefined::
Die with error code != 0 when a reference is undefined,
diff --git a/Documentation/git-peek-remote.txt b/Documentation/git-peek-remote.txt
index ffbf93a799..3fb17f9d7f 100644
--- a/Documentation/git-peek-remote.txt
+++ b/Documentation/git-peek-remote.txt
@@ -39,7 +39,7 @@ OPTIONS
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index d0f1595f7e..c731bdc07e 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -194,7 +194,7 @@ linkgit:git-fetch[1], linkgit:git-merge[1], linkgit:git-config[1]
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
-and Junio C Hamano <junkio@cox.net>
+and Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 89e0049bce..82dd4433f2 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -194,7 +194,7 @@ git push origin master:refs/heads/experimental::
Author
------
-Written by Junio C Hamano <junkio@cox.net>, later rewritten in C
+Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C
by Linus Torvalds <torvalds@osdl.org>
Documentation
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 7166414355..b7e1da000c 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -397,7 +397,7 @@ after each commit, test, and amend the commit if fixes are necessary.
Authors
------
-Written by Junio C Hamano <junkio@cox.net> and
+Written by Junio C Hamano <gitster@pobox.com> and
Johannes E. Schindelin <johannes.schindelin@gmx.de>
Documentation
diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index 8492aeacf1..c9c25f3337 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -94,7 +94,7 @@ them.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-request-pull.txt b/Documentation/git-request-pull.txt
index c71d86985e..70810c01d4 100644
--- a/Documentation/git-request-pull.txt
+++ b/Documentation/git-request-pull.txt
@@ -28,7 +28,7 @@ OPTIONS
Author
------
-Written by Ryan Anderson <ryan@michonline.com> and Junio C Hamano <junkio@cox.net>
+Written by Ryan Anderson <ryan@michonline.com> and Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index 8030ec4d01..37828e5c5a 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -204,7 +204,7 @@ conflict.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
GIT
---
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 12ea9b23c5..0b368b39ee 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -195,7 +195,7 @@ $ git add frotz.c <3>
Author
------
-Written by Junio C Hamano <junkio@cox.net> and Linus Torvalds <torvalds@osdl.org>
+Written by Junio C Hamano <gitster@pobox.com> and Linus Torvalds <torvalds@osdl.org>
Documentation
--------------
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index ba65bfa16b..9082fc991b 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -416,7 +416,7 @@ but if $REV is empty, the commit object name from master will be printed.
Author
------
Written by Linus Torvalds <torvalds@osdl.org> .
-Junio C Hamano <junkio@cox.net> and Pierre Habouzit <madcoder@debian.org>
+Junio C Hamano <gitster@pobox.com> and Pierre Habouzit <madcoder@debian.org>
Documentation
--------------
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 5b49b81386..5fdeaff994 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -43,16 +43,16 @@ OPTIONS
-n::
--no-commit::
Usually the command automatically creates a commit with
- a commit log message stating which commit was reverted.
- This flag applies the change necessary to revert the
- named commit to your working tree, but does not make the
- commit. In addition, when this option is used, your
- working tree does not have to match the HEAD commit.
- The revert is done against the beginning state of your
- working tree.
+ a commit log message stating which commit was
+ reverted. This flag applies the change necessary
+ to revert the named commit to your working tree
+ and the index, but does not make the commit. In addition,
+ when this option is used, your index does not have to match
+ the HEAD commit. The revert is done against the
+ beginning state of your index.
+
This is useful when reverting more than one commits'
-effect to your working tree in a row.
+effect to your index in a row.
-s::
--signoff::
@@ -61,7 +61,7 @@ effect to your working tree in a row.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index de9e8f885f..6f4a2c4306 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -182,7 +182,7 @@ topologically related with each other.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index baaf2bc8fe..1017391f7c 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -71,7 +71,7 @@ include::i18n.txt[]
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>. Significantly enhanced by
+Junio C Hamano <gitster@pobox.com>. Significantly enhanced by
Johannes Schindelin <Johannes.Schindelin@gmx.de>.
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index fef62b16df..6026e8b84b 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -64,7 +64,7 @@ linkgit:gitignore[5]
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>.
+Junio C Hamano <gitster@pobox.com>.
Documentation
--------------
diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt
index 3d3a059c5e..5709dee208 100644
--- a/Documentation/git-symbolic-ref.txt
+++ b/Documentation/git-symbolic-ref.txt
@@ -55,7 +55,7 @@ name is not a symbolic ref, or 128 if another error occurs.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
GIT
---
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 8f40f4bf0d..6cf11ce648 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -247,7 +247,7 @@ $ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1
Author
------
Written by Linus Torvalds <torvalds@osdl.org>,
-Junio C Hamano <junkio@cox.net> and Chris Wright <chrisw@osdl.org>.
+Junio C Hamano <gitster@pobox.com> and Chris Wright <chrisw@osdl.org>.
Documentation
--------------
diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt
index d21be41d06..4fd7b5edf9 100644
--- a/Documentation/git-update-server-info.txt
+++ b/Documentation/git-update-server-info.txt
@@ -47,7 +47,7 @@ info/refs file unless `--force` flag is given.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt
index 478f236996..ff704bd93f 100644
--- a/Documentation/git-verify-pack.txt
+++ b/Documentation/git-verify-pack.txt
@@ -42,7 +42,7 @@ for objects that are deltified.
Author
------
-Written by Junio C Hamano <junkio@cox.net>
+Written by Junio C Hamano <gitster@pobox.com>
Documentation
--------------
diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt
index f5d39c7870..fb672ea0fc 100644
--- a/Documentation/git-whatchanged.txt
+++ b/Documentation/git-whatchanged.txt
@@ -67,7 +67,7 @@ git-whatchanged --since="2 weeks ago" \-- gitk::
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and
-Junio C Hamano <junkio@cox.net>
+Junio C Hamano <gitster@pobox.com>
Documentation
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 0d6fe9cf79..0f55f8005b 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -43,11 +43,14 @@ 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.2/git.html[documentation for release 1.5.6.2]
+* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
* release notes for
- link:RelNotes-1.5.6.2.txt[1.5.6.2].
- link:RelNotes-1.5.6.1.txt[1.5.6.1].
+ 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],
+ link:RelNotes-1.5.6.1.txt[1.5.6.1],
link:RelNotes-1.5.6.txt[1.5.6].
* link:v1.5.5.4/git.html[documentation for release 1.5.5.4]
diff --git a/Documentation/howto/rebase-from-internal-branch.txt b/Documentation/howto/rebase-from-internal-branch.txt
index 7a76045eb7..d214d4bf9d 100644
--- a/Documentation/howto/rebase-from-internal-branch.txt
+++ b/Documentation/howto/rebase-from-internal-branch.txt
@@ -1,4 +1,4 @@
-From: Junio C Hamano <junkio@cox.net>
+From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Petr Baudis <pasky@suse.cz>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: sending changesets from the middle of a git tree
diff --git a/Documentation/howto/rebuild-from-update-hook.txt b/Documentation/howto/rebuild-from-update-hook.txt
index 8d55dfbfae..48c67568d3 100644
--- a/Documentation/howto/rebuild-from-update-hook.txt
+++ b/Documentation/howto/rebuild-from-update-hook.txt
@@ -1,6 +1,6 @@
Subject: [HOWTO] Using post-update hook
Message-ID: <7vy86o6usx.fsf@assigned-by-dhcp.cox.net>
-From: Junio C Hamano <junkio@cox.net>
+From: Junio C Hamano <gitster@pobox.com>
Date: Fri, 26 Aug 2005 18:19:10 -0700
Abstract: In this how-to article, JC talks about how he
uses the post-update hook to automate git documentation page
diff --git a/Documentation/howto/revert-branch-rebase.txt b/Documentation/howto/revert-branch-rebase.txt
index 865a666324..e70d8a31e7 100644
--- a/Documentation/howto/revert-branch-rebase.txt
+++ b/Documentation/howto/revert-branch-rebase.txt
@@ -1,4 +1,4 @@
-From: Junio C Hamano <junkio@cox.net>
+From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [HOWTO] Reverting an existing commit
Abstract: In this article, JC gives a small real-life example of using
diff --git a/Documentation/howto/separating-topic-branches.txt b/Documentation/howto/separating-topic-branches.txt
index 0d73b31224..6d3eb8ed00 100644
--- a/Documentation/howto/separating-topic-branches.txt
+++ b/Documentation/howto/separating-topic-branches.txt
@@ -1,4 +1,4 @@
-From: Junio C Hamano <junkio@cox.net>
+From: Junio C Hamano <gitster@pobox.com>
Subject: Separating topic branches
Abstract: In this article, JC describes how to separate topic branches.
diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt
index a8d3bae408..3ef7c0d908 100644
--- a/Documentation/howto/update-hook-example.txt
+++ b/Documentation/howto/update-hook-example.txt
@@ -1,4 +1,4 @@
-From: Junio C Hamano <junkio@cox.net> and Carl Baldwin <cnb@fc.hp.com>
+From: Junio C Hamano <gitster@pobox.com> and Carl Baldwin <cnb@fc.hp.com>
Subject: control access to branches.
Date: Thu, 17 Nov 2005 23:55:32 -0800
Message-ID: <7vfypumlu3.fsf@assigned-by-dhcp.cox.net>
diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt
index 69e6d2fa44..c11d495771 100644
--- a/Documentation/pretty-formats.txt
+++ b/Documentation/pretty-formats.txt
@@ -101,6 +101,7 @@ The placeholders are:
- '%P': parent hashes
- '%p': abbreviated parent hashes
- '%an': author name
+- '%aN': author name (respecting .mailmap)
- '%ae': author email
- '%ad': author date
- '%aD': author date, RFC2822 style
@@ -108,6 +109,7 @@ The placeholders are:
- '%at': author date, UNIX timestamp
- '%ai': author date, ISO 8601 format
- '%cn': committer name
+- '%cN': committer name (respecting .mailmap)
- '%ce': committer email
- '%cd': committer date
- '%cD': committer date, RFC2822 style
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 37dd1d61ea..f69260f4c0 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -108,9 +108,9 @@ options may be given. See linkgit:git-diff-files[1] for more options.
--cc::
This flag implies the '-c' options and further compresses the
- patch output by omitting hunks that show differences from only
- one parent, or show the same change from all but one parent for
- an Octopus merge.
+ patch output by omitting uninteresting hunks whose contents in
+ the parents have only two variants and the merge result picks
+ one of them without modification.
-r::
diff --git a/Documentation/technical/api-run-command.txt b/Documentation/technical/api-run-command.txt
index 3e1342acf4..75aa5d4923 100644
--- a/Documentation/technical/api-run-command.txt
+++ b/Documentation/technical/api-run-command.txt
@@ -30,7 +30,7 @@ Functions
start_command() followed by finish_command(). Takes a pointer
to a `struct child_process` that specifies the details.
-`run_command_v_opt`, `run_command_v_opt_dir`, `run_command_v_opt_cd_env`::
+`run_command_v_opt`, `run_command_v_opt_cd`, `run_command_v_opt_cd_env`::
Convenience functions that encapsulate a sequence of
start_command() followed by finish_command(). The argument argv
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index f221447478..445dca3ffc 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.5.6.5.GIT
LF='
'
diff --git a/Makefile b/Makefile
index b003e3e60a..f13184b2ba 100644
--- a/Makefile
+++ b/Makefile
@@ -1210,8 +1210,12 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
echo "$$FLAGS" >GIT-CFLAGS; \
fi
+# We need to apply sq twice, once to protect from the shell
+# that runs GIT-BUILD-OPTIONS, and then again to protect it
+# and the first level quoting from the shell that runs "echo".
GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
- @echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@
+ @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
+ @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
### Detect Tck/Tk interpreter path changes
ifndef NO_TCLTK
diff --git a/RelNotes b/RelNotes
index a2b8043c83..1c0163594a 120000
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes-1.5.6.3.txt \ No newline at end of file
+Documentation/RelNotes-1.5.6.5.txt \ No newline at end of file
diff --git a/attr.c b/attr.c
index 0fb47d3434..17f6a4dca5 100644
--- a/attr.c
+++ b/attr.c
@@ -459,7 +459,9 @@ static void prepare_attr_stack(const char *path, int dirlen)
{
struct attr_stack *elem, *info;
int len;
- char pathbuf[PATH_MAX];
+ struct strbuf pathbuf;
+
+ strbuf_init(&pathbuf, dirlen+2+strlen(GITATTRIBUTES_FILE));
/*
* At the bottom of the attribute stack is the built-in
@@ -510,13 +512,14 @@ static void prepare_attr_stack(const char *path, int dirlen)
len = strlen(attr_stack->origin);
if (dirlen <= len)
break;
- memcpy(pathbuf, path, dirlen);
- memcpy(pathbuf + dirlen, "/", 2);
- cp = strchr(pathbuf + len + 1, '/');
+ strbuf_reset(&pathbuf);
+ strbuf_add(&pathbuf, path, dirlen);
+ strbuf_addch(&pathbuf, '/');
+ cp = strchr(pathbuf.buf + len + 1, '/');
strcpy(cp + 1, GITATTRIBUTES_FILE);
- elem = read_attr(pathbuf, 0);
+ elem = read_attr(pathbuf.buf, 0);
*cp = '\0';
- elem->origin = strdup(pathbuf);
+ elem->origin = strdup(pathbuf.buf);
elem->prev = attr_stack;
attr_stack = elem;
debug_push(elem);
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 93ea69bfaa..aec2bc6f8d 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -520,7 +520,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
opts.track = git_branch_track;
- argc = parse_options(argc, argv, options, checkout_usage, 0);
+ argc = parse_options(argc, argv, options, checkout_usage,
+ PARSE_OPT_KEEP_DASHDASH);
if (argc) {
arg = argv[0];
if (get_sha1(arg, rev))
diff --git a/builtin-clone.c b/builtin-clone.c
index 7ee8275269..863b22eeb2 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -473,6 +473,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_quiet)
transport->verbose = -1;
+ if (option_upload_pack)
+ transport_set_option(transport, TRANS_OPT_UPLOADPACK,
+ option_upload_pack);
+
refs = transport_get_remote_refs(transport);
transport_fetch_refs(transport, refs);
}
diff --git a/builtin-commit.c b/builtin-commit.c
index bcbea3893b..0c6d1f4f45 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -45,7 +45,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;
@@ -700,11 +700,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;
@@ -814,7 +817,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);
@@ -907,7 +910,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);
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index de1e8d1365..6e98cafd08 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -309,7 +309,8 @@ done:
}
flushes--;
}
- return retval;
+ /* it is no error to fetch into a completely empty repo */
+ return count ? retval : 0;
}
static struct commit_list *complete;
diff --git a/builtin-grep.c b/builtin-grep.c
index ef299108f5..d8b06ce810 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -427,33 +427,35 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
struct name_entry entry;
char *down;
int tn_len = strlen(tree_name);
- char *path_buf = xmalloc(PATH_MAX + tn_len + 100);
+ struct strbuf pathbuf;
+
+ strbuf_init(&pathbuf, PATH_MAX + tn_len);
if (tn_len) {
- tn_len = sprintf(path_buf, "%s:", tree_name);
- down = path_buf + tn_len;
- strcat(down, base);
- }
- else {
- down = path_buf;
- strcpy(down, base);
+ strbuf_add(&pathbuf, tree_name, tn_len);
+ strbuf_addch(&pathbuf, ':');
+ tn_len = pathbuf.len;
}
- len = strlen(path_buf);
+ strbuf_addstr(&pathbuf, base);
+ len = pathbuf.len;
while (tree_entry(tree, &entry)) {
- strcpy(path_buf + len, entry.path);
+ int te_len = tree_entry_len(entry.path, entry.sha1);
+ pathbuf.len = len;
+ strbuf_add(&pathbuf, entry.path, te_len);
if (S_ISDIR(entry.mode))
/* Match "abc/" against pathspec to
* decide if we want to descend into "abc"
* directory.
*/
- strcpy(path_buf + len + tree_entry_len(entry.path, entry.sha1), "/");
+ strbuf_addch(&pathbuf, '/');
+ down = pathbuf.buf + tn_len;
if (!pathspec_matches(paths, down))
;
else if (S_ISREG(entry.mode))
- hit |= grep_sha1(opt, entry.sha1, path_buf, tn_len);
+ hit |= grep_sha1(opt, entry.sha1, pathbuf.buf, tn_len);
else if (S_ISDIR(entry.mode)) {
enum object_type type;
struct tree_desc sub;
@@ -469,6 +471,7 @@ static int grep_tree(struct grep_opt *opt, const char **paths,
free(data);
}
}
+ strbuf_release(&pathbuf);
return hit;
}
@@ -495,7 +498,7 @@ static int grep_object(struct grep_opt *opt, const char **paths,
}
static const char builtin_grep_usage[] =
-"git-grep <option>* <rev>* [-e] <pattern> [<path>...]";
+"git-grep <option>* [-e] <pattern> <rev>* [[--] <path>...]";
static const char emsg_invalid_context_len[] =
"%s: invalid context length argument";
diff --git a/builtin-init-db.c b/builtin-init-db.c
index e23b8438c7..c68a3b1e74 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -127,6 +127,8 @@ static void copy_templates(const char *template_dir)
template_dir = strbuf_detach(&d, NULL);
}
}
+ if (!template_dir[0])
+ return;
strcpy(template_path, template_dir);
template_len = strlen(template_path);
if (template_path[template_len-1] != '/') {
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index fa6e8f90a4..13f0502b9e 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -334,7 +334,9 @@ static int check_header(char *line, unsigned linesize, char **hdr_data, int over
return 1;
if (!memcmp("[PATCH]", line, 7) && isspace(line[7])) {
for (i = 0; header[i]; i++) {
- if (!memcmp("Subject: ", header[i], 9)) {
+ if (!memcmp("Subject", header[i], 7)) {
+ if (!hdr_data[i])
+ hdr_data[i] = xmalloc(linesize + 20);
if (! handle_header(line, hdr_data[i], 0)) {
return 1;
}
@@ -960,7 +962,7 @@ static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
}
static const char mailinfo_usage[] =
- "git-mailinfo [-k] [-u | --encoding=<encoding>] msg patch <mail >info";
+ "git-mailinfo [-k] [-u | --encoding=<encoding> | -n] msg patch <mail >info";
int cmd_mailinfo(int argc, const char **argv, const char *prefix)
{
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index f153da012f..5352bc87b9 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-rev-list.c b/builtin-rev-list.c
index 83a7b1349e..39ec61c428 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -597,6 +597,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
revs.commit_format = CMIT_FMT_UNSPECIFIED;
argc = setup_revisions(argc, argv, &revs, NULL);
+ quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
for (i = 1 ; i < argc; i++) {
const char *arg = argv[i];
@@ -628,10 +629,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
read_revisions_from_stdin(&revs);
continue;
}
- if (!strcmp(arg, "--quiet")) {
- quiet = 1;
- continue;
- }
usage(rev_list_usage);
}
diff --git a/builtin-revert.c b/builtin-revert.c
index 0270f9b85a..bde28b2c4d 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -180,7 +180,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);
diff --git a/builtin-rm.c b/builtin-rm.c
index 22c9bd1c6c..abdab7f001 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -146,11 +146,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
- newfd = hold_locked_index(&lock_file, 1);
-
- if (read_cache() < 0)
- die("index file corrupt");
-
argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
if (!argc)
usage_with_options(builtin_rm_usage, builtin_rm_options);
@@ -158,6 +153,11 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
if (!index_only)
setup_work_tree();
+ newfd = hold_locked_index(&lock_file, 1);
+
+ if (read_cache() < 0)
+ die("index file corrupt");
+
pathspec = get_pathspec(prefix, argv);
seen = NULL;
for (i = 0; pathspec[i] ; i++)
diff --git a/builtin-tag.c b/builtin-tag.c
index 3c97c696a5..3bd019cc56 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -385,7 +385,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"),
@@ -411,6 +411,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/cache.h b/cache.h
index ca382d4622..9735b66e5e 100644
--- a/cache.h
+++ b/cache.h
@@ -396,7 +396,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
#define REFRESH_UNMERGED 0x0002 /* allow unmerged */
#define REFRESH_QUIET 0x0004 /* be quiet about it */
#define REFRESH_IGNORE_MISSING 0x0008 /* ignore non-existent */
-#define REFRESH_IGNORE_SUBMODULES 0x0008 /* ignore submodules */
+#define REFRESH_IGNORE_SUBMODULES 0x0010 /* ignore submodules */
extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen);
struct lock_file {
diff --git a/commit.c b/commit.c
index e2d8624d9c..09cf167423 100644
--- a/commit.c
+++ b/commit.c
@@ -428,8 +428,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
/* Mark them and clear the indegree */
for (next = orig; next; next = next->next) {
struct commit *commit = next->item;
- commit->object.flags |= TOPOSORT;
- commit->indegree = 0;
+ commit->indegree = 1;
}
/* update the indegree */
@@ -438,7 +437,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
while (parents) {
struct commit *parent = parents->item;
- if (parent->object.flags & TOPOSORT)
+ if (parent->indegree)
parent->indegree++;
parents = parents->next;
}
@@ -456,7 +455,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
for (next = orig; next; next = next->next) {
struct commit *commit = next->item;
- if (!commit->indegree)
+ if (commit->indegree == 1)
insert = &commit_list_insert(commit, insert)->next;
}
@@ -478,7 +477,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
for (parents = commit->parents; parents ; parents = parents->next) {
struct commit *parent=parents->item;
- if (!(parent->object.flags & TOPOSORT))
+ if (!parent->indegree)
continue;
/*
@@ -486,7 +485,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
* when all their children have been emitted thereby
* guaranteeing topological order.
*/
- if (!--parent->indegree) {
+ if (--parent->indegree == 1) {
if (!lifo)
insert_by_date(parent, &work);
else
@@ -497,7 +496,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)
* work_item is a commit all of whose children
* have already been emitted. we can emit it now.
*/
- commit->object.flags &= ~TOPOSORT;
+ commit->indegree = 0;
*pptr = work_item;
pptr = &work_item->next;
}
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index cff28a88af..72f02f208f 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -45,6 +45,11 @@
# git@vger.kernel.org
#
+case "$COMP_WORDBREAKS" in
+*:*) : great ;;
+*) COMP_WORDBREAKS="$COMP_WORDBREAKS:"
+esac
+
__gitdir ()
{
if [ -z "$1" ]; then
@@ -114,9 +119,20 @@ __git_ps1 ()
fi
}
+__gitcomp_1 ()
+{
+ local c IFS=' '$'\t'$'\n'
+ for c in $1; do
+ case "$c$2" in
+ --*=*) printf %s$'\n' "$c$2" ;;
+ *.) printf %s$'\n' "$c$2" ;;
+ *) printf %s$'\n' "$c$2 " ;;
+ esac
+ done
+}
+
__gitcomp ()
{
- local all c s=$'\n' IFS=' '$'\t'$'\n'
local cur="${COMP_WORDS[COMP_CWORD]}"
if [ $# -gt 2 ]; then
cur="$3"
@@ -124,21 +140,14 @@ __gitcomp ()
case "$cur" in
--*=)
COMPREPLY=()
- return
;;
*)
- for c in $1; do
- case "$c$4" in
- --*=*) all="$all$c$4$s" ;;
- *.) all="$all$c$4$s" ;;
- *) all="$all$c$4 $s" ;;
- esac
- done
+ local IFS=$'\n'
+ COMPREPLY=($(compgen -P "$2" \
+ -W "$(__gitcomp_1 "$1" "$4")" \
+ -- "$cur"))
;;
esac
- IFS=$s
- COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur"))
- return
}
__git_heads ()
@@ -290,9 +299,23 @@ __git_complete_file ()
ls="$ref"
;;
esac
+
+ case "$COMP_WORDBREAKS" in
+ *:*) : great ;;
+ *) pfx="$ref:$pfx" ;;
+ esac
+
+ local IFS=$'\n'
COMPREPLY=($(compgen -P "$pfx" \
-W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
- | sed '/^100... blob /s,^.* ,,
+ | sed '/^100... blob /{
+ s,^.* ,,
+ s,$, ,
+ }
+ /^120000 blob /{
+ s,^.* ,,
+ s,$, ,
+ }
/^040000 tree /{
s,^.* ,,
s,$,/,
@@ -320,9 +343,6 @@ __git_complete_revlist ()
cur="${cur#*..}"
__gitcomp "$(__git_refs)" "$pfx" "$cur"
;;
- *.)
- __gitcomp "$cur."
- ;;
*)
__gitcomp "$(__git_refs)"
;;
@@ -691,7 +711,12 @@ _git_fetch ()
*)
case "$cur" in
*:*)
- __gitcomp "$(__git_refs)" "" "${cur#*:}"
+ local pfx=""
+ case "$COMP_WORDBREAKS" in
+ *:*) : great ;;
+ *) pfx="${cur%%:*}:" ;;
+ esac
+ __gitcomp "$(__git_refs)" "$pfx" "${cur#*:}"
;;
*)
local remote
@@ -864,7 +889,14 @@ _git_push ()
git-push) remote="${COMP_WORDS[1]}" ;;
git) remote="${COMP_WORDS[2]}" ;;
esac
- __gitcomp "$(__git_refs "$remote")" "" "${cur#*:}"
+
+ local pfx=""
+ case "$COMP_WORDBREAKS" in
+ *:*) : great ;;
+ *) pfx="${cur%%:*}:" ;;
+ esac
+
+ __gitcomp "$(__git_refs "$remote")" "$pfx" "${cur#*:}"
;;
+*)
__gitcomp "$(__git_refs)" + "${cur#+}"
diff --git a/daemon.c b/daemon.c
index 63cd12cd9c..ce3a6f58f3 100644
--- a/daemon.c
+++ b/daemon.c
@@ -694,23 +694,47 @@ static void kill_some_children(int signo, unsigned start, unsigned stop)
}
}
+static void check_dead_children(void)
+{
+ unsigned spawned, reaped, deleted;
+
+ spawned = children_spawned;
+ reaped = children_reaped;
+ deleted = children_deleted;
+
+ while (deleted < reaped) {
+ pid_t pid = dead_child[deleted % MAX_CHILDREN];
+ const char *dead = pid < 0 ? " (with error)" : "";
+
+ if (pid < 0)
+ pid = -pid;
+
+ /* XXX: Custom logging, since we don't wanna getpid() */
+ if (verbose) {
+ if (log_syslog)
+ syslog(LOG_INFO, "[%d] Disconnected%s",
+ pid, dead);
+ else
+ fprintf(stderr, "[%d] Disconnected%s\n",
+ pid, dead);
+ }
+ remove_child(pid, deleted, spawned);
+ deleted++;
+ }
+ children_deleted = deleted;
+}
+
static void check_max_connections(void)
{
for (;;) {
int active;
- unsigned spawned, reaped, deleted;
+ unsigned spawned, deleted;
+
+ check_dead_children();
spawned = children_spawned;
- reaped = children_reaped;
deleted = children_deleted;
- while (deleted < reaped) {
- pid_t pid = dead_child[deleted % MAX_CHILDREN];
- remove_child(pid, deleted, spawned);
- deleted++;
- }
- children_deleted = deleted;
-
active = spawned - deleted;
if (active <= max_connections)
break;
@@ -760,18 +784,10 @@ static void child_handler(int signo)
if (pid > 0) {
unsigned reaped = children_reaped;
+ if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
+ pid = -pid;
dead_child[reaped % MAX_CHILDREN] = pid;
children_reaped = reaped + 1;
- /* XXX: Custom logging, since we don't wanna getpid() */
- if (verbose) {
- const char *dead = "";
- if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
- dead = " (with error)";
- if (log_syslog)
- syslog(LOG_INFO, "[%d] Disconnected%s", pid, dead);
- else
- fprintf(stderr, "[%d] Disconnected%s\n", pid, dead);
- }
continue;
}
break;
@@ -928,8 +944,18 @@ static int service_loop(int socknum, int *socklist)
for (;;) {
int i;
+ int timeout;
- if (poll(pfd, socknum, -1) < 0) {
+ /*
+ * This 1-sec timeout could lead to idly looping but it is
+ * here so that children culled in child_handler() are reported
+ * without too much delay. We could probably set up a pipe
+ * to ourselves that we poll, and write to the fd from child_handler()
+ * to wake us up (and consume it when the poll() returns...
+ */
+ timeout = (children_spawned != children_deleted) ? 1000 : -1;
+ i = poll(pfd, socknum, timeout);
+ if (i < 0) {
if (errno != EINTR) {
error("poll failed, resuming: %s",
strerror(errno));
@@ -937,6 +963,10 @@ static int service_loop(int socknum, int *socklist)
}
continue;
}
+ if (i == 0) {
+ check_dead_children();
+ continue;
+ }
for (i = 0; i < socknum; i++) {
if (pfd[i].revents & POLLIN) {
diff --git a/diff-lib.c b/diff-lib.c
index b17722d66a..e7eaff9a68 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -171,7 +171,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
if (silent_on_removed)
continue;
diff_addremove(&revs->diffopt, '-', ce->ce_mode,
- ce->sha1, ce->name, NULL);
+ ce->sha1, ce->name);
continue;
}
changed = ce_match_stat(ce, &st, ce_option);
@@ -184,7 +184,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
newmode = ce_mode_from_stat(ce, st.st_mode);
diff_change(&revs->diffopt, oldmode, newmode,
ce->sha1, (changed ? null_sha1 : ce->sha1),
- ce->name, NULL);
+ ce->name);
}
diffcore_std(&revs->diffopt);
@@ -208,7 +208,7 @@ static void diff_index_show_file(struct rev_info *revs,
const unsigned char *sha1, unsigned int mode)
{
diff_addremove(&revs->diffopt, prefix[0], mode,
- sha1, ce->name, NULL);
+ sha1, ce->name);
}
static int get_stat_data(struct cache_entry *ce,
@@ -312,7 +312,7 @@ static int show_modified(struct oneway_unpack_data *cbdata,
return 0;
diff_change(&revs->diffopt, oldmode, mode,
- old->sha1, sha1, old->name, NULL);
+ old->sha1, sha1, old->name);
return 0;
}
diff --git a/diff.c b/diff.c
index 78c4d3a35a..342733ba73 100644
--- a/diff.c
+++ b/diff.c
@@ -131,10 +131,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 +163,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)
@@ -3356,9 +3357,8 @@ int diff_result_code(struct diff_options *opt, int status)
void diff_addremove(struct diff_options *options,
int addremove, unsigned mode,
const unsigned char *sha1,
- const char *base, const char *path)
+ const char *concatpath)
{
- char concatpath[PATH_MAX];
struct diff_filespec *one, *two;
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode))
@@ -3380,9 +3380,6 @@ void diff_addremove(struct diff_options *options,
addremove = (addremove == '+' ? '-' :
addremove == '-' ? '+' : addremove);
- if (!path) path = "";
- sprintf(concatpath, "%s%s", base, path);
-
if (options->prefix &&
strncmp(concatpath, options->prefix, options->prefix_length))
return;
@@ -3403,9 +3400,8 @@ void diff_change(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
const unsigned char *old_sha1,
const unsigned char *new_sha1,
- const char *base, const char *path)
+ const char *concatpath)
{
- char concatpath[PATH_MAX];
struct diff_filespec *one, *two;
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode)
@@ -3418,8 +3414,6 @@ void diff_change(struct diff_options *options,
tmp = old_mode; old_mode = new_mode; new_mode = tmp;
tmp_c = old_sha1; old_sha1 = new_sha1; new_sha1 = tmp_c;
}
- if (!path) path = "";
- sprintf(concatpath, "%s%s", base, path);
if (options->prefix &&
strncmp(concatpath, options->prefix, options->prefix_length))
diff --git a/diff.h b/diff.h
index 5dc0cb595b..50fb5ddb0b 100644
--- a/diff.h
+++ b/diff.h
@@ -14,12 +14,12 @@ typedef void (*change_fn_t)(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
const unsigned char *old_sha1,
const unsigned char *new_sha1,
- const char *base, const char *path);
+ const char *fullpath);
typedef void (*add_remove_fn_t)(struct diff_options *options,
int addremove, unsigned mode,
const unsigned char *sha1,
- const char *base, const char *path);
+ const char *fullpath);
typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
struct diff_options *options, void *data);
@@ -164,14 +164,13 @@ extern void diff_addremove(struct diff_options *,
int addremove,
unsigned mode,
const unsigned char *sha1,
- const char *base,
- const char *path);
+ const char *fullpath);
extern void diff_change(struct diff_options *,
unsigned mode1, unsigned mode2,
const unsigned char *sha1,
const unsigned char *sha2,
- const char *base, const char *path);
+ const char *fullpath);
extern void diff_unmerge(struct diff_options *,
const char *path,
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 903953e68e..709caa9055 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -394,9 +394,9 @@ sub list_and_choose {
if ($choice =~ s/^-//) {
$choose = 0;
}
- # A range can be specified like 5-7
- if ($choice =~ /^(\d+)-(\d+)$/) {
- ($bottom, $top) = ($1, $2);
+ # A range can be specified like 5-7 or 5-.
+ if ($choice =~ /^(\d+)-(\d*)$/) {
+ ($bottom, $top) = ($1, length($2) ? $2 : 1 + @stuff);
}
elsif ($choice =~ /^\d+$/) {
$bottom = $top = $choice;
diff --git a/git-am.sh b/git-am.sh
index 2c517ede59..83b277acfd 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -30,7 +30,8 @@ set_reflog_action am
require_work_tree
cd_to_toplevel
-git var GIT_COMMITTER_IDENT >/dev/null || exit
+git var GIT_COMMITTER_IDENT >/dev/null ||
+ die "You need to set your committer info first"
stop_here () {
echo "$1" >"$dotest/next"
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index cacbfc0259..7e95fb3740 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-cvsserver.perl b/git-cvsserver.perl
index 920bbe15a3..b00d1c29cd 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1884,7 +1884,7 @@ sub req_annotate
}
# done; get out of the tempdir
- cleanupWorkDir();
+ cleanupWorkTree();
print "ok\n";
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a64d9d57ab..e3f65bd880 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -162,6 +162,8 @@ pick_one_preserving_merges () {
new_parents="$new_parents $new_p"
;;
esac
+ else
+ new_parents="$new_parents $p"
fi
done
case $fast_forward in
diff --git a/git-send-email.perl b/git-send-email.perl
index 0b04ba32f0..385ff7c219 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -850,7 +850,7 @@ foreach my $t (@files) {
}
elsif (/^Content-type:/i) {
$has_content_type = 1;
- if (/charset="?[^ "]+/) {
+ if (/charset="?([^ "]+)/) {
$body_encoding = $1;
}
push @xh, $_;
diff --git a/git-submodule.sh b/git-submodule.sh
index 099a7d7560..21e5b5b7da 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -269,6 +269,7 @@ cmd_update()
do
case "$1" in
-q|--quiet)
+ shift
quiet=1
;;
-i|--init)
@@ -286,7 +287,6 @@ cmd_update()
break
;;
esac
- shift
done
git ls-files --stage -- "$@" | grep '^160000 ' |
diff --git a/http-walker.c b/http-walker.c
index 99f397e32b..74033060c4 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch
return -1;
new_pack = parse_pack_index(sha1);
+ if (!new_pack)
+ return -1; /* parse_pack_index() already issued error message */
new_pack->next = repo->packs;
repo->packs = new_pack;
return 0;
diff --git a/index-pack.c b/index-pack.c
index 5ac91baf98..7d5344abc0 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -26,6 +26,14 @@ union delta_base {
off_t offset;
};
+struct base_data {
+ struct base_data *base;
+ struct base_data *child;
+ struct object_entry *obj;
+ void *data;
+ unsigned long size;
+};
+
/*
* Even if sizeof(union delta_base) == 24 on 64-bit archs, we really want
* to memcmp() only the first 20 bytes.
@@ -43,6 +51,8 @@ struct delta_entry
static struct object_entry *objects;
static struct delta_entry *deltas;
+static struct base_data *base_cache;
+static size_t base_cache_used;
static int nr_objects;
static int nr_deltas;
static int nr_resolved_deltas;
@@ -210,6 +220,46 @@ static void bad_object(unsigned long offset, const char *format, ...)
die("pack has bad object at offset %lu: %s", offset, buf);
}
+static void prune_base_data(struct base_data *retain)
+{
+ struct base_data *b = base_cache;
+ for (b = base_cache;
+ base_cache_used > delta_base_cache_limit && b;
+ b = b->child) {
+ if (b->data && b != retain) {
+ free(b->data);
+ b->data = NULL;
+ base_cache_used -= b->size;
+ }
+ }
+}
+
+static void link_base_data(struct base_data *base, struct base_data *c)
+{
+ if (base)
+ base->child = c;
+ else
+ base_cache = c;
+
+ c->base = base;
+ c->child = NULL;
+ base_cache_used += c->size;
+ prune_base_data(c);
+}
+
+static void unlink_base_data(struct base_data *c)
+{
+ struct base_data *base = c->base;
+ if (base)
+ base->child = NULL;
+ else
+ base_cache = NULL;
+ if (c->data) {
+ free(c->data);
+ base_cache_used -= c->size;
+ }
+}
+
static void *unpack_entry_data(unsigned long offset, unsigned long size)
{
z_stream stream;
@@ -425,33 +475,60 @@ static void sha1_object(const void *data, unsigned long size,
}
}
-static void resolve_delta(struct object_entry *delta_obj, void *base_data,
- unsigned long base_size, enum object_type type)
+static void *get_base_data(struct base_data *c)
+{
+ if (!c->data) {
+ struct object_entry *obj = c->obj;
+
+ if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA) {
+ void *base = get_base_data(c->base);
+ void *raw = get_data_from_pack(obj);
+ c->data = patch_delta(
+ base, c->base->size,
+ raw, obj->size,
+ &c->size);
+ free(raw);
+ if (!c->data)
+ bad_object(obj->idx.offset, "failed to apply delta");
+ } else
+ c->data = get_data_from_pack(obj);
+
+ base_cache_used += c->size;
+ prune_base_data(c);
+ }
+ return c->data;
+}
+
+static void resolve_delta(struct object_entry *delta_obj,
+ struct base_data *base_obj, enum object_type type)
{
void *delta_data;
unsigned long delta_size;
- void *result;
- unsigned long result_size;
union delta_base delta_base;
int j, first, last;
+ struct base_data result;
delta_obj->real_type = type;
delta_data = get_data_from_pack(delta_obj);
delta_size = delta_obj->size;
- result = patch_delta(base_data, base_size, delta_data, delta_size,
- &result_size);
+ result.data = patch_delta(get_base_data(base_obj), base_obj->size,
+ delta_data, delta_size,
+ &result.size);
free(delta_data);
- if (!result)
+ if (!result.data)
bad_object(delta_obj->idx.offset, "failed to apply delta");
- sha1_object(result, result_size, type, delta_obj->idx.sha1);
+ sha1_object(result.data, result.size, type, delta_obj->idx.sha1);
nr_resolved_deltas++;
+ result.obj = delta_obj;
+ link_base_data(base_obj, &result);
+
hashcpy(delta_base.sha1, delta_obj->idx.sha1);
if (!find_delta_children(&delta_base, &first, &last)) {
for (j = first; j <= last; j++) {
struct object_entry *child = objects + deltas[j].obj_no;
if (child->real_type == OBJ_REF_DELTA)
- resolve_delta(child, result, result_size, type);
+ resolve_delta(child, &result, type);
}
}
@@ -461,11 +538,11 @@ static void resolve_delta(struct object_entry *delta_obj, void *base_data,
for (j = first; j <= last; j++) {
struct object_entry *child = objects + deltas[j].obj_no;
if (child->real_type == OBJ_OFS_DELTA)
- resolve_delta(child, result, result_size, type);
+ resolve_delta(child, &result, type);
}
}
- free(result);
+ unlink_base_data(&result);
}
static int compare_delta_entry(const void *a, const void *b)
@@ -480,7 +557,6 @@ static void parse_pack_objects(unsigned char *sha1)
{
int i;
struct delta_entry *delta = deltas;
- void *data;
struct stat st;
/*
@@ -495,7 +571,7 @@ static void parse_pack_objects(unsigned char *sha1)
nr_objects);
for (i = 0; i < nr_objects; i++) {
struct object_entry *obj = &objects[i];
- data = unpack_raw_entry(obj, &delta->base);
+ void *data = unpack_raw_entry(obj, &delta->base);
obj->real_type = obj->type;
if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA) {
nr_deltas++;
@@ -544,6 +620,7 @@ static void parse_pack_objects(unsigned char *sha1)
struct object_entry *obj = &objects[i];
union delta_base base;
int j, ref, ref_first, ref_last, ofs, ofs_first, ofs_last;
+ struct base_data base_obj;
if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA)
continue;
@@ -554,22 +631,24 @@ static void parse_pack_objects(unsigned char *sha1)
ofs = !find_delta_children(&base, &ofs_first, &ofs_last);
if (!ref && !ofs)
continue;
- data = get_data_from_pack(obj);
+ base_obj.data = get_data_from_pack(obj);
+ base_obj.size = obj->size;
+ base_obj.obj = obj;
+ link_base_data(NULL, &base_obj);
+
if (ref)
for (j = ref_first; j <= ref_last; j++) {
struct object_entry *child = objects + deltas[j].obj_no;
if (child->real_type == OBJ_REF_DELTA)
- resolve_delta(child, data,
- obj->size, obj->type);
+ resolve_delta(child, &base_obj, obj->type);
}
if (ofs)
for (j = ofs_first; j <= ofs_last; j++) {
struct object_entry *child = objects + deltas[j].obj_no;
if (child->real_type == OBJ_OFS_DELTA)
- resolve_delta(child, data,
- obj->size, obj->type);
+ resolve_delta(child, &base_obj, obj->type);
}
- free(data);
+ unlink_base_data(&base_obj);
display_progress(progress, nr_resolved_deltas);
}
}
@@ -600,7 +679,8 @@ static int write_compressed(int fd, void *in, unsigned int size, uint32_t *obj_c
return size;
}
-static void append_obj_to_pack(const unsigned char *sha1, void *buf,
+static struct object_entry *append_obj_to_pack(
+ const unsigned char *sha1, void *buf,
unsigned long size, enum object_type type)
{
struct object_entry *obj = &objects[nr_objects++];
@@ -618,9 +698,14 @@ static void append_obj_to_pack(const unsigned char *sha1, void *buf,
write_or_die(output_fd, header, n);
obj[0].idx.crc32 = crc32(0, Z_NULL, 0);
obj[0].idx.crc32 = crc32(obj[0].idx.crc32, header, n);
+ obj[0].size = size;
+ obj[0].hdr_size = n;
+ obj[0].type = type;
+ obj[0].real_type = type;
obj[1].idx.offset = obj[0].idx.offset + n;
obj[1].idx.offset += write_compressed(output_fd, buf, size, &obj[0].idx.crc32);
hashcpy(obj->idx.sha1, sha1);
+ return obj;
}
static int delta_pos_compare(const void *_a, const void *_b)
@@ -655,28 +740,31 @@ static void fix_unresolved_deltas(int nr_unresolved)
for (i = 0; i < n; i++) {
struct delta_entry *d = sorted_by_pos[i];
- void *data;
- unsigned long size;
enum object_type type;
int j, first, last;
+ struct base_data base_obj;
if (objects[d->obj_no].real_type != OBJ_REF_DELTA)
continue;
- data = read_sha1_file(d->base.sha1, &type, &size);
- if (!data)
+ base_obj.data = read_sha1_file(d->base.sha1, &type, &base_obj.size);
+ if (!base_obj.data)
continue;
+ if (check_sha1_signature(d->base.sha1, base_obj.data,
+ base_obj.size, typename(type)))
+ die("local object %s is corrupt", sha1_to_hex(d->base.sha1));
+ base_obj.obj = append_obj_to_pack(d->base.sha1, base_obj.data,
+ base_obj.size, type);
+ link_base_data(NULL, &base_obj);
+
find_delta_children(&d->base, &first, &last);
for (j = first; j <= last; j++) {
struct object_entry *child = objects + deltas[j].obj_no;
if (child->real_type == OBJ_REF_DELTA)
- resolve_delta(child, data, size, type);
+ resolve_delta(child, &base_obj, type);
}
- if (check_sha1_signature(d->base.sha1, data, size, typename(type)))
- die("local object %s is corrupt", sha1_to_hex(d->base.sha1));
- append_obj_to_pack(d->base.sha1, data, size, type);
- free(data);
+ unlink_base_data(&base_obj);
display_progress(progress, nr_resolved_deltas);
}
free(sorted_by_pos);
diff --git a/parse-options.c b/parse-options.c
index f8d52e21fe..12c882296e 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -425,3 +425,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 4ee443dafe..13ad15869e 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -123,4 +123,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 6e3df18499..c1d567996d 100644
--- a/path.c
+++ b/path.c
@@ -272,7 +272,7 @@ int adjust_shared_perm(const char *path)
int tweak = shared_repository;
if (!(mode & S_IWUSR))
tweak &= ~0222;
- mode = (mode & ~0777) | tweak;
+ mode |= tweak;
} else {
/* Preserve old PERM_UMASK behaviour */
if (mode & S_IWUSR)
diff --git a/pretty.c b/pretty.c
index 8eb39e915e..628a5201c1 100644
--- a/pretty.c
+++ b/pretty.c
@@ -3,6 +3,8 @@
#include "utf8.h"
#include "diff.h"
#include "revision.h"
+#include "path-list.h"
+#include "mailmap.h"
static char *user_format;
@@ -288,6 +290,25 @@ static char *logmsg_reencode(const struct commit *commit,
return out;
}
+static int mailmap_name(struct strbuf *sb, const char *email)
+{
+ static struct path_list *mail_map;
+ char buffer[1024];
+
+ if (!mail_map) {
+ mail_map = xcalloc(1, sizeof(*mail_map));
+ read_mailmap(mail_map, ".mailmap", NULL);
+ }
+
+ if (!mail_map->nr)
+ return -1;
+
+ if (!map_email(mail_map, email, buffer, sizeof(buffer)))
+ return -1;
+ strbuf_addstr(sb, buffer);
+ return 0;
+}
+
static size_t format_person_part(struct strbuf *sb, char part,
const char *msg, int len)
{
@@ -309,10 +330,12 @@ static size_t format_person_part(struct strbuf *sb, char part,
if (end >= len - 2)
goto skip;
- if (part == 'n') { /* name */
+ if (part == 'n' || part == 'N') { /* name */
while (end > 0 && isspace(msg[end - 1]))
end--;
- strbuf_add(sb, msg, end);
+ if (part != 'N' || !msg[end] || !msg[end + 1] ||
+ mailmap_name(sb, msg + end + 2) < 0)
+ strbuf_add(sb, msg, end);
return placeholder_len;
}
start = ++end; /* save email start position */
diff --git a/remote.c b/remote.c
index ff2c802167..5f687b2e29 100644
--- a/remote.c
+++ b/remote.c
@@ -424,6 +424,28 @@ static void read_config(void)
alias_all_urls();
}
+/*
+ * We need to make sure the tracking branches are well formed, but a
+ * wildcard refspec in "struct refspec" must have a trailing slash. We
+ * temporarily drop the trailing '/' while calling check_ref_format(),
+ * and put it back. The caller knows that a CHECK_REF_FORMAT_ONELEVEL
+ * error return is Ok for a wildcard refspec.
+ */
+static int verify_refname(char *name, int is_glob)
+{
+ int result, len = -1;
+
+ if (is_glob) {
+ len = strlen(name);
+ assert(name[len - 1] == '/');
+ name[len - 1] = '\0';
+ }
+ result = check_ref_format(name);
+ if (is_glob)
+ name[len - 1] = '/';
+ return result;
+}
+
static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
{
int i;
@@ -431,11 +453,11 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec);
for (i = 0; i < nr_refspec; i++) {
- size_t llen, rlen;
+ size_t llen;
int is_glob;
const char *lhs, *rhs;
- llen = rlen = is_glob = 0;
+ llen = is_glob = 0;
lhs = refspec[i];
if (*lhs == '+') {
@@ -455,12 +477,9 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
}
if (rhs) {
- rhs++;
- rlen = strlen(rhs);
+ size_t rlen = strlen(++rhs);
is_glob = (2 <= rlen && !strcmp(rhs + rlen - 2, "/*"));
- if (is_glob)
- rlen -= 2;
- rs[i].dst = xstrndup(rhs, rlen);
+ rs[i].dst = xstrndup(rhs, rlen - is_glob);
}
llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
@@ -468,7 +487,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if ((rhs && !is_glob) || (!rhs && fetch))
goto invalid;
is_glob = 1;
- llen -= 2;
+ llen--;
} else if (rhs && is_glob) {
goto invalid;
}
@@ -485,7 +504,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if (!*rs[i].src)
; /* empty is ok */
else {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -500,7 +519,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
} else if (!*rs[i].dst) {
; /* ok */
} else {
- st = check_ref_format(rs[i].dst);
+ st = verify_refname(rs[i].dst, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -515,7 +534,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
if (!*rs[i].src)
; /* empty is ok */
else if (is_glob) {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -529,13 +548,13 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
* - otherwise it must be a valid looking ref.
*/
if (!rs[i].dst) {
- st = check_ref_format(rs[i].src);
+ st = verify_refname(rs[i].src, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
} else if (!*rs[i].dst) {
goto invalid;
} else {
- st = check_ref_format(rs[i].dst);
+ st = verify_refname(rs[i].dst, is_glob);
if (st && st != CHECK_REF_FORMAT_ONELEVEL)
goto invalid;
}
@@ -684,8 +703,7 @@ int remote_find_tracking(struct remote *remote, struct refspec *refspec)
if (!fetch->dst)
continue;
if (fetch->pattern) {
- if (!prefixcmp(needle, key) &&
- needle[strlen(key)] == '/') {
+ if (!prefixcmp(needle, key)) {
*result = xmalloc(strlen(value) +
strlen(needle) -
strlen(key) + 1);
@@ -963,9 +981,7 @@ static const struct refspec *check_pattern_match(const struct refspec *rs,
continue;
}
- if (rs[i].pattern &&
- !prefixcmp(src->name, rs[i].src) &&
- src->name[strlen(rs[i].src)] == '/')
+ if (rs[i].pattern && !prefixcmp(src->name, rs[i].src))
return rs + i;
}
if (matching_refs != -1)
diff --git a/revision.c b/revision.c
index d464f14d50..a68abec3f2 100644
--- a/revision.c
+++ b/revision.c
@@ -259,7 +259,7 @@ static int tree_difference = REV_TREE_SAME;
static void file_add_remove(struct diff_options *options,
int addremove, unsigned mode,
const unsigned char *sha1,
- const char *base, const char *path)
+ const char *fullpath)
{
int diff = REV_TREE_DIFFERENT;
@@ -285,7 +285,7 @@ static void file_change(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
const unsigned char *old_sha1,
const unsigned char *new_sha1,
- const char *base, const char *path)
+ const char *fullpath)
{
tree_difference = REV_TREE_DIFFERENT;
DIFF_OPT_SET(options, HAS_CHANGES);
diff --git a/revision.h b/revision.h
index abce5001f1..31f08c4056 100644
--- a/revision.h
+++ b/revision.h
@@ -10,7 +10,6 @@
#define CHILD_SHOWN (1u<<6)
#define ADDED (1u<<7) /* Parents already parsed and added? */
#define SYMMETRIC_LEFT (1u<<8)
-#define TOPOSORT (1u<<9) /* In the active toposort list.. */
struct rev_info;
struct log_info;
diff --git a/sha1_file.c b/sha1_file.c
index d1c406081e..10346b681e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1609,6 +1609,7 @@ static void *unpack_delta_entry(struct packed_git *p,
off_t base_offset;
base_offset = get_delta_base(p, w_curs, &curpos, *type, obj_offset);
+ unuse_pack(w_curs);
base = cache_or_unpack_entry(p, base_offset, &base_size, type, 0);
if (!base)
die("failed to read delta base object"
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index d31887f9bf..c0b781ae49 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -141,4 +141,30 @@ test_expect_success 'reinit' '
test_cmp again/empty again/err2
'
+test_expect_success 'init with --template' '
+ mkdir template-source &&
+ echo content >template-source/file &&
+ (
+ mkdir template-custom &&
+ cd template-custom &&
+ git init --template=../template-source
+ ) &&
+ test_cmp template-source/file template-custom/.git/file
+'
+
+test_expect_success 'init with --template (blank)' '
+ (
+ mkdir template-plain &&
+ cd template-plain &&
+ git init
+ ) &&
+ test -f template-plain/.git/info/exclude &&
+ (
+ mkdir template-blank &&
+ cd template-blank &&
+ git init --template=
+ ) &&
+ ! test -f template-blank/.git/info/exclude
+'
+
test_done
diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh
index 9255c63c08..63e1217e71 100755
--- a/t/t0004-unwritable.sh
+++ b/t/t0004-unwritable.sh
@@ -8,6 +8,7 @@ test_expect_success setup '
>file &&
git add file &&
+ test_tick &&
git commit -m initial &&
echo >file &&
git add file
@@ -17,11 +18,11 @@ test_expect_success setup '
test_expect_success 'write-tree should notice unwritable repository' '
(
- chmod a-w .git/objects
+ chmod a-w .git/objects .git/objects/?? &&
test_must_fail git write-tree
)
status=$?
- chmod 775 .git/objects
+ chmod 775 .git/objects .git/objects/??
(exit $status)
'
@@ -29,11 +30,11 @@ test_expect_success 'write-tree should notice unwritable repository' '
test_expect_success 'commit should notice unwritable repository' '
(
- chmod a-w .git/objects
+ chmod a-w .git/objects .git/objects/?? &&
test_must_fail git commit -m second
)
status=$?
- chmod 775 .git/objects
+ chmod 775 .git/objects .git/objects/??
(exit $status)
'
@@ -41,12 +42,12 @@ test_expect_success 'commit should notice unwritable repository' '
test_expect_success 'update-index should notice unwritable repository' '
(
- echo a >file &&
- chmod a-w .git/objects
+ echo 6O >file &&
+ chmod a-w .git/objects .git/objects/?? &&
test_must_fail git update-index file
)
status=$?
- chmod 775 .git/objects
+ chmod 775 .git/objects .git/objects/??
(exit $status)
'
@@ -55,11 +56,11 @@ test_expect_success 'add should notice unwritable repository' '
(
echo b >file &&
- chmod a-w .git/objects
+ chmod a-w .git/objects .git/objects/?? &&
test_must_fail git add file
)
status=$?
- chmod 775 .git/objects
+ chmod 775 .git/objects .git/objects/??
(exit $status)
'
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 6c78c8bc9b..dc85e8b60a 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -17,6 +17,29 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' '
test $ret != "0"
'
+for u in 002 022
+do
+ test_expect_success "shared=1 does not clear bits preset by umask $u" '
+ mkdir sub && (
+ cd sub &&
+ umask $u &&
+ git init --shared=1 &&
+ test 1 = "$(git config core.sharedrepository)"
+ ) &&
+ actual=$(ls -l sub/.git/HEAD)
+ case "$actual" in
+ -rw-rw-r--*)
+ : happy
+ ;;
+ *)
+ echo Oops, .git/HEAD is not 0664 but $actual
+ false
+ ;;
+ esac
+ '
+ rm -rf sub
+done
+
test_expect_success 'shared=all' '
mkdir sub &&
cd sub &&
diff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh
new file mode 100755
index 0000000000..332694e7d3
--- /dev/null
+++ b/t/t2103-update-index-ignore-missing.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+test_description='update-index with options'
+
+. ./test-lib.sh
+
+test_expect_success basics '
+ >one &&
+ >two &&
+ >three &&
+
+ # need --add when adding
+ test_must_fail git update-index one &&
+ test -z "$(git ls-files)" &&
+ git update-index --add one &&
+ test zone = "z$(git ls-files)" &&
+
+ # update-index is atomic
+ echo 1 >one &&
+ test_must_fail git update-index one two &&
+ echo "M one" >expect &&
+ git diff-files --name-status >actual &&
+ test_cmp expect actual &&
+
+ git update-index --add one two three &&
+ for i in one three two; do echo $i; done >expect &&
+ git ls-files >actual &&
+ test_cmp expect actual &&
+
+ test_tick &&
+ (
+ test_create_repo xyzzy &&
+ cd xyzzy &&
+ >file &&
+ git add file
+ git commit -m "sub initial"
+ ) &&
+ git add xyzzy &&
+
+ test_tick &&
+ git commit -m initial &&
+ git tag initial
+'
+
+test_expect_success '--ignore-missing --refresh' '
+ git reset --hard initial &&
+ echo 2 >one &&
+ test_must_fail git update-index --refresh &&
+ echo 1 >one &&
+ git update-index --refresh &&
+ rm -f two &&
+ test_must_fail git update-index --refresh &&
+ git update-index --ignore-missing --refresh
+
+'
+
+test_expect_success '--unmerged --refresh' '
+ git reset --hard initial &&
+ info=$(git ls-files -s one | sed -e "s/ 0 / 1 /") &&
+ git rm --cached one &&
+ echo "$info" | git update-index --index-info &&
+ test_must_fail git update-index --refresh &&
+ git update-index --unmerged --refresh &&
+ echo 2 >two &&
+ test_must_fail git update-index --unmerged --refresh >actual &&
+ grep two actual &&
+ ! grep one actual &&
+ ! grep three actual
+'
+
+test_expect_success '--ignore-submodules --refresh (1)' '
+ git reset --hard initial &&
+ rm -f two &&
+ test_must_fail git update-index --ignore-submodules --refresh
+'
+
+test_expect_success '--ignore-submodules --refresh (2)' '
+ git reset --hard initial &&
+ test_tick &&
+ (
+ cd xyzzy &&
+ git commit -m "sub second" --allow-empty
+ ) &&
+ test_must_fail git update-index --refresh &&
+ test_must_fail git update-index --ignore-missing --refresh &&
+ git update-index --ignore-submodules --refresh
+'
+
+test_done
diff --git a/t/t3202-show-branch-octopus.sh b/t/t3202-show-branch-octopus.sh
new file mode 100755
index 0000000000..7fe4a6ecb0
--- /dev/null
+++ b/t/t3202-show-branch-octopus.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='test show-branch with more than 8 heads'
+
+. ./test-lib.sh
+
+numbers="1 2 3 4 5 6 7 8 9 10"
+
+test_expect_success 'setup' '
+
+ > file &&
+ git add file &&
+ test_tick &&
+ git commit -m initial &&
+
+ for i in $numbers
+ do
+ git checkout -b branch$i master &&
+ > file$i &&
+ git add file$i &&
+ test_tick &&
+ git commit -m branch$i || break
+ done
+
+'
+
+cat > expect << EOF
+! [branch1] branch1
+ ! [branch2] branch2
+ ! [branch3] branch3
+ ! [branch4] branch4
+ ! [branch5] branch5
+ ! [branch6] branch6
+ ! [branch7] branch7
+ ! [branch8] branch8
+ ! [branch9] branch9
+ * [branch10] branch10
+----------
+ * [branch10] branch10
+ + [branch9] branch9
+ + [branch8] branch8
+ + [branch7] branch7
+ + [branch6] branch6
+ + [branch5] branch5
+ + [branch4] branch4
+ + [branch3] branch3
+ + [branch2] branch2
++ [branch1] branch1
++++++++++* [branch10^] initial
+EOF
+
+test_expect_success 'show-branch with more than 8 branches' '
+
+ git show-branch $(for i in $numbers; do echo branch$i; done) > out &&
+ test_cmp expect out
+
+'
+
+test_done
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index f542f0af41..7893d8c40e 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -217,4 +217,16 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' '
! git rm nonexistent
'
+test_expect_success 'Call "rm" from outside the work tree' '
+ mkdir repo &&
+ cd repo &&
+ git init &&
+ echo something > somefile &&
+ git add somefile &&
+ git commit -m "add a file" &&
+ (cd .. &&
+ git --git-dir=repo/.git --work-tree=repo rm somefile) &&
+ test_must_fail git ls-files --error-unmatch somefile
+'
+
test_done
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index b53645417b..4c8af45f83 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -71,4 +71,5 @@ test_expect_success 'diff-filter=D' '
-test_done \ No newline at end of file
+test_done
+
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 9b0baac8db..87902f81ef 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -25,7 +25,6 @@ commit id embedding:
'
. ./test-lib.sh
-TAR=${TAR:-tar}
UNZIP=${UNZIP:-unzip}
SUBSTFORMAT=%H%n
@@ -68,7 +67,7 @@ test_expect_success \
test_expect_success \
'validate file modification time' \
'mkdir extract &&
- $TAR xf b.tar -C extract a/a &&
+ "$TAR" xf b.tar -C extract a/a &&
perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime &&
echo "1117231200" >expected.mtime &&
diff expected.mtime b.mtime'
@@ -80,7 +79,7 @@ test_expect_success \
test_expect_success \
'extract tar archive' \
- '(cd b && $TAR xf -) <b.tar'
+ '(cd b && "$TAR" xf -) <b.tar'
test_expect_success \
'validate filenames' \
@@ -97,7 +96,7 @@ test_expect_success \
test_expect_success \
'extract tar archive with prefix' \
- '(cd c && $TAR xf -) <c.tar'
+ '(cd c && "$TAR" xf -) <c.tar'
test_expect_success \
'validate filenames with prefix' \
@@ -117,7 +116,7 @@ test_expect_success \
test_expect_success \
'extract substfiles' \
- '(mkdir f && cd f && $TAR xf -) <f.tar'
+ '(mkdir f && cd f && "$TAR" xf -) <f.tar'
test_expect_success \
'validate substfile contents' \
@@ -129,7 +128,7 @@ test_expect_success \
test_expect_success \
'extract substfiles from archive with prefix' \
- '(mkdir g && cd g && $TAR xf -) <g.tar'
+ '(mkdir g && cd g && "$TAR" xf -) <g.tar'
test_expect_success \
'validate substfile contents from archive with prefix' \
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 577ecc210a..e9f3e72c7e 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -11,7 +11,7 @@ test_expect_success 'split sample box' \
'git mailsplit -o. ../t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
- test `cat last` = 9'
+ test `cat last` = 10'
for mail in `echo 00*`
do
diff --git a/t/t5100/0010 b/t/t5100/0010
new file mode 100644
index 0000000000..f5892c9da7
--- /dev/null
+++ b/t/t5100/0010
@@ -0,0 +1,35 @@
+From b9704a518e21158433baa2cc2d591fea687967f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= <lukass@etek.chalmers.se>
+Date: Thu, 10 Jul 2008 23:41:33 +0200
+Subject: Re: discussion that lead to this patch
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[PATCH] git-mailinfo: Fix getting the subject from the body
+
+"Subject: " isn't in the static array "header", and thus
+memcmp("Subject: ", header[i], 7) will never match.
+
+Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
+Signed-off-by: Junio C Hamano <gitster@pobox.com>
+---
+ builtin-mailinfo.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
+index 962aa34..2d1520f 100644
+--- a/builtin-mailinfo.c
++++ b/builtin-mailinfo.c
+@@ -334,7 +334,7 @@ static int check_header(char *line, unsigned linesize, char **hdr_data, int over
+ return 1;
+ if (!memcmp("[PATCH]", line, 7) && isspace(line[7])) {
+ for (i = 0; header[i]; i++) {
+- if (!memcmp("Subject: ", header[i], 9)) {
++ if (!memcmp("Subject", header[i], 7)) {
+ if (! handle_header(line, hdr_data[i], 0)) {
+ return 1;
+ }
+--
+1.5.6.2.455.g1efb2
+
diff --git a/t/t5100/info0010 b/t/t5100/info0010
new file mode 100644
index 0000000000..1791241e46
--- /dev/null
+++ b/t/t5100/info0010
@@ -0,0 +1,5 @@
+Author: Lukas Sandström
+Email: lukass@etek.chalmers.se
+Subject: git-mailinfo: Fix getting the subject from the body
+Date: Thu, 10 Jul 2008 23:41:33 +0200
+
diff --git a/t/t5100/msg0010 b/t/t5100/msg0010
new file mode 100644
index 0000000000..a96c230092
--- /dev/null
+++ b/t/t5100/msg0010
@@ -0,0 +1,5 @@
+"Subject: " isn't in the static array "header", and thus
+memcmp("Subject: ", header[i], 7) will never match.
+
+Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
+Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/t/t5100/patch0010 b/t/t5100/patch0010
new file mode 100644
index 0000000000..f055481d56
--- /dev/null
+++ b/t/t5100/patch0010
@@ -0,0 +1,20 @@
+---
+ builtin-mailinfo.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
+index 962aa34..2d1520f 100644
+--- a/builtin-mailinfo.c
++++ b/builtin-mailinfo.c
+@@ -334,7 +334,7 @@ static int check_header(char *line, unsigned linesize, char **hdr_data, int over
+ return 1;
+ if (!memcmp("[PATCH]", line, 7) && isspace(line[7])) {
+ for (i = 0; header[i]; i++) {
+- if (!memcmp("Subject: ", header[i], 9)) {
++ if (!memcmp("Subject", header[i], 7)) {
+ if (! handle_header(line, hdr_data[i], 0)) {
+ return 1;
+ }
+--
+1.5.6.2.455.g1efb2
+
diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
index 0476b96c33..aba57f922b 100644
--- a/t/t5100/sample.mbox
+++ b/t/t5100/sample.mbox
@@ -430,3 +430,38 @@ index b426a14..97756ec 100644
=20
=20
2. When the environment variable 'GIT_EXTERNAL_DIFF' is set, the
+From b9704a518e21158433baa2cc2d591fea687967f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= <lukass@etek.chalmers.se>
+Date: Thu, 10 Jul 2008 23:41:33 +0200
+Subject: Re: discussion that lead to this patch
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[PATCH] git-mailinfo: Fix getting the subject from the body
+
+"Subject: " isn't in the static array "header", and thus
+memcmp("Subject: ", header[i], 7) will never match.
+
+Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
+Signed-off-by: Junio C Hamano <gitster@pobox.com>
+---
+ builtin-mailinfo.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
+index 962aa34..2d1520f 100644
+--- a/builtin-mailinfo.c
++++ b/builtin-mailinfo.c
+@@ -334,7 +334,7 @@ static int check_header(char *line, unsigned linesize, char **hdr_data, int over
+ return 1;
+ if (!memcmp("[PATCH]", line, 7) && isspace(line[7])) {
+ for (i = 0; header[i]; i++) {
+- if (!memcmp("Subject: ", header[i], 9)) {
++ if (!memcmp("Subject", header[i], 7)) {
+ if (! handle_header(line, hdr_data[i], 0)) {
+ return 1;
+ }
+--
+1.5.6.2.455.g1efb2
+
diff --git a/t/t5513-fetch-track.sh b/t/t5513-fetch-track.sh
new file mode 100755
index 0000000000..9e7486274b
--- /dev/null
+++ b/t/t5513-fetch-track.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='fetch follows remote tracking branches correctly'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ >file &&
+ git add . &&
+ test_tick &&
+ git commit -m Initial &&
+ git branch b-0 &&
+ git branch b1 &&
+ git branch b/one &&
+ test_create_repo other &&
+ (
+ cd other &&
+ git config remote.origin.url .. &&
+ git config remote.origin.fetch "+refs/heads/b/*:refs/remotes/b/*"
+ )
+'
+
+test_expect_success fetch '
+ (
+ cd other && git fetch origin &&
+ test "$(git for-each-ref --format="%(refname)")" = refs/remotes/b/one
+ )
+'
+
+test_done
diff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh
new file mode 100755
index 0000000000..8367a6845f
--- /dev/null
+++ b/t/t5602-clone-remote-exec.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description=clone
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ echo "#!/bin/sh" > not_ssh
+ echo "echo \"\$*\" > not_ssh_output" >> not_ssh
+ echo "exit 1" >> not_ssh
+ chmod +x not_ssh
+'
+
+test_expect_success 'clone calls git-upload-pack unqualified with no -u option' '
+ GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk
+ echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected
+ test_cmp expected not_ssh_output
+'
+
+test_expect_success 'clone calls specified git-upload-pack with -u option' '
+ GIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk
+ echo "localhost /something/bin/git-upload-pack '\''/path/to/repo'\''" >expected
+ test_cmp expected not_ssh_output
+'
+
+test_done
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 241c70dc66..acddbf5037 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1067,4 +1067,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/t7500-commit.sh b/t/t7500-commit.sh
index baed6ce96b..823256a246 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -138,4 +138,33 @@ test_expect_success '--signoff' '
diff 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/t7600-merge.sh b/t/t7600-merge.sh
index d21cd290d3..daf45b7ffa 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -222,36 +222,12 @@ test_expect_success 'setup' '
test_debug 'gitk --all'
test_expect_success 'test option parsing' '
- if git merge -$ c1
- then
- echo "[OOPS] -$ accepted"
- false
- fi &&
- if git merge --no-such c1
- then
- echo "[OOPS] --no-such accepted"
- false
- fi &&
- if git merge -s foobar c1
- then
- echo "[OOPS] -s foobar accepted"
- false
- fi &&
- if git merge -s=foobar c1
- then
- echo "[OOPS] -s=foobar accepted"
- false
- fi &&
- if git merge -m
- then
- echo "[OOPS] missing commit msg accepted"
- false
- fi &&
- if git merge
- then
- echo "[OOPS] missing commit references accepted"
- false
- fi
+ test_must_fail git merge -$ c1 &&
+ test_must_fail git merge --no-such c1 &&
+ test_must_fail git merge -s foobar c1 &&
+ test_must_fail git merge -s=foobar c1 &&
+ test_must_fail git merge -m &&
+ test_must_fail git merge
'
test_expect_success 'merge c0 with c1' '
diff --git a/transport.c b/transport.c
index 6f549b336b..b3e3e61f9d 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/tree-diff.c b/tree-diff.c
index e1e2e6c6ce..bbb126fc46 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -15,6 +15,15 @@ static char *malloc_base(const char *base, int baselen, const char *path, int pa
return newbase;
}
+static char *malloc_fullname(const char *base, int baselen, const char *path, int pathlen)
+{
+ char *fullname = xmalloc(baselen + pathlen + 1);
+ memcpy(fullname, base, baselen);
+ memcpy(fullname + baselen, path, pathlen);
+ fullname[baselen + pathlen] = 0;
+ return fullname;
+}
+
static void show_entry(struct diff_options *opt, const char *prefix, struct tree_desc *desc,
const char *base, int baselen);
@@ -24,6 +33,7 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
const char *path1, *path2;
const unsigned char *sha1, *sha2;
int cmp, pathlen1, pathlen2;
+ char *fullname;
sha1 = tree_entry_extract(t1, &path1, &mode1);
sha2 = tree_entry_extract(t2, &path2, &mode2);
@@ -55,15 +65,20 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
if (DIFF_OPT_TST(opt, RECURSIVE) && S_ISDIR(mode1)) {
int retval;
char *newbase = malloc_base(base, baselen, path1, pathlen1);
- if (DIFF_OPT_TST(opt, TREE_IN_RECURSIVE))
+ if (DIFF_OPT_TST(opt, TREE_IN_RECURSIVE)) {
+ newbase[baselen + pathlen1] = 0;
opt->change(opt, mode1, mode2,
- sha1, sha2, base, path1);
+ sha1, sha2, newbase);
+ newbase[baselen + pathlen1] = '/';
+ }
retval = diff_tree_sha1(sha1, sha2, newbase, opt);
free(newbase);
return retval;
}
- opt->change(opt, mode1, mode2, sha1, sha2, base, path1);
+ fullname = malloc_fullname(base, baselen, path1, pathlen1);
+ opt->change(opt, mode1, mode2, sha1, sha2, fullname);
+ free(fullname);
return 0;
}
@@ -205,10 +220,10 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree
unsigned mode;
const char *path;
const unsigned char *sha1 = tree_entry_extract(desc, &path, &mode);
+ int pathlen = tree_entry_len(path, sha1);
if (DIFF_OPT_TST(opt, RECURSIVE) && S_ISDIR(mode)) {
enum object_type type;
- int pathlen = tree_entry_len(path, sha1);
char *newbase = malloc_base(base, baselen, path, pathlen);
struct tree_desc inner;
void *tree;
@@ -224,7 +239,9 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree
free(tree);
free(newbase);
} else {
- opt->add_remove(opt, prefix[0], mode, sha1, base, path);
+ char *fullname = malloc_fullname(base, baselen, path, pathlen);
+ opt->add_remove(opt, prefix[0], mode, sha1, fullname);
+ free(fullname);
}
}