Merge branch 'jc/fmt-req-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 1 Jun 2011 21:03:07 +0000 (14:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Jun 2011 21:03:07 +0000 (14:03 -0700)
* jc/fmt-req-fix:
userformat_find_requirements(): find requirement for the correct format

98 files changed:
Documentation/RelNotes/1.7.5.3.txt [new file with mode: 0644]
Documentation/RelNotes/1.7.5.4.txt [new file with mode: 0644]
Documentation/SubmittingPatches
Documentation/config.txt
Documentation/diff-config.txt [new file with mode: 0644]
Documentation/diff-options.txt
Documentation/git-add.txt
Documentation/git-checkout.txt
Documentation/git-clone.txt
Documentation/git-cvsserver.txt
Documentation/git-diff-index.txt
Documentation/git-diff-tree.txt
Documentation/git-format-patch.txt
Documentation/git-imap-send.txt
Documentation/git-init-db.txt
Documentation/git-init.txt
Documentation/git-remote-helpers.txt
Documentation/git-reset.txt
Documentation/git-send-email.txt
Documentation/git-stash.txt
Documentation/git-status.txt
Documentation/git-svn.txt
Documentation/git.txt
Documentation/technical/api-diff.txt
GIT-VERSION-GEN
Makefile
RelNotes
builtin/checkout.c
builtin/clone.c
builtin/diff-tree.c
builtin/diff.c
builtin/init-db.c
builtin/log.c
builtin/merge.c
builtin/revert.c
builtin/send-pack.c
cache.h
config.mak.in
connect.c
contrib/completion/git-completion.bash
diff.c
diff.h
diffcore-rename.c
fsck.c
git-add--interactive.perl
git-submodule.sh
gitweb/gitweb.perl
ident.c
merge-recursive.c
rerere.c
revision.c
run-command.c
setup.c
t/README
t/lib-httpd.sh
t/t0001-init.sh
t/t0061-run-command.sh
t/t0081-line-buffer.sh
t/t1200-tutorial.sh
t/t2019-checkout-ambiguous-ref.sh
t/t2020-checkout-detach.sh
t/t2200-add-update.sh
t/t2204-add-ignored.sh
t/t3030-merge-recursive.sh
t/t3200-branch.sh
t/t3203-branch-output.sh
t/t3501-revert-cherry-pick.sh
t/t3503-cherry-pick-root.sh
t/t3507-cherry-pick-conflict.sh
t/t3700-add.sh
t/t4001-diff-rename.sh
t/t4014-format-patch.sh
t/t4034-diff-words.sh
t/t5526-fetch-submodules.sh
t/t5532-fetch-proxy.sh [new file with mode: 0755]
t/t5541-http-push.sh
t/t5601-clone.sh
t/t6017-rev-list-stdin.sh
t/t6040-tracking-info.sh
t/t6120-describe.sh
t/t7004-tag.sh
t/t7012-skip-worktree-writing.sh
t/t7060-wtstatus.sh
t/t7102-reset.sh
t/t7110-reset-merge.sh
t/t7201-co.sh
t/t7500-commit.sh
t/t7501-commit.sh
t/t7502-commit.sh
t/t7506-status-submodule.sh
t/t7508-status.sh
t/t7600-merge.sh
t/t7607-merge-overwrite.sh
t/t7611-merge-abort.sh
t/t7811-grep-open.sh
t/test-lib.sh
test-run-command.c
transport.c
diff --git a/Documentation/RelNotes/1.7.5.3.txt b/Documentation/RelNotes/1.7.5.3.txt
new file mode 100644 (file)
index 0000000..9c03353
--- /dev/null
@@ -0,0 +1,32 @@
+Git v1.7.5.3 Release Notes
+==========================
+
+Fixes since v1.7.5.2
+--------------------
+
+ * The bash completion scripts should correctly work using zsh's bash
+   completion emulation layer now.
+
+ * Setting $(prefix) in config.mak did not affect where etc/gitconfig
+   file is read from, even though passing it from the command line of
+   $(MAKE) did.
+
+ * The logic to handle "&" (expand to UNIX username) in GECOS field
+   miscounted the length of the name it formatted.
+
+ * "git cherry-pick -s resolve" failed to cherry-pick a root commit.
+
+ * "git diff --word-diff" misbehaved when diff.suppress-blank-empty was
+   in effect.
+
+ * "git log --stdin path" with an input that has additional pathspec
+   used to corrupt memory.
+
+ * "git send-pack" (hence "git push") over smalt-HTTP protocol could
+   deadlock when the client side pack-object died early.
+
+ * Compressed tarball gitweb generates used to be made with the timestamp
+   of the tarball generation; this was bad because snapshot from the same
+   tree should result in a same tarball.
+
+And other minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.5.4.txt b/Documentation/RelNotes/1.7.5.4.txt
new file mode 100644 (file)
index 0000000..f3412ce
--- /dev/null
@@ -0,0 +1,18 @@
+Git v1.7.5.4 Release Notes
+==========================
+
+Fixes since v1.7.5.3
+--------------------
+
+ * The single-key mode of "git add -p" was easily fooled into thinking
+   that it was told to add everthing ('a') when up-arrow was pressed by
+   mistake.
+
+ * "git diff -C -C" used to disable the rename detection entirely when
+   there are too many copy candidate paths in the tree; now it falls
+   back to "-C" when doing so would keep the copy candidate paths
+   under the rename detection limit.
+
+ * "git rerere" did not diagnose a corrupt MERGE_RR file in some cases.
+
+And other minor fixes and documentation updates.
index c6a503291205f0b8047a213d1ebeb6a509ff6fa8..938eccf2a5ac9dd629be1bc6bb53a59723c99083 100644 (file)
@@ -344,50 +344,20 @@ MUA specific hints
 
 Some of patches I receive or pick up from the list share common
 patterns of breakage.  Please make sure your MUA is set up
-properly not to corrupt whitespaces.  Here are two common ones
-I have seen:
+properly not to corrupt whitespaces.
 
-* Empty context lines that do not have _any_ whitespace.
+See the DISCUSSION section of git-format-patch(1) for hints on
+checking your patch by mailing it to yourself and applying with
+git-am(1).
 
-* Non empty context lines that have one extra whitespace at the
-  beginning.
-
-One test you could do yourself if your MUA is set up correctly is:
-
-* Send the patch to yourself, exactly the way you would, except
-  To: and Cc: lines, which would not contain the list and
-  maintainer address.
-
-* Save that patch to a file in UNIX mailbox format.  Call it say
-  a.patch.
-
-* Try to apply to the tip of the "master" branch from the
-  git.git public repository:
-
-    $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply
-    $ git checkout test-apply
-    $ git reset --hard
-    $ git am a.patch
-
-If it does not apply correctly, there can be various reasons.
-
-* Your patch itself does not apply cleanly.  That is _bad_ but
-  does not have much to do with your MUA.  Please rebase the
-  patch appropriately.
-
-* Your MUA corrupted your patch; "am" would complain that
-  the patch does not apply.  Look at .git/rebase-apply/ subdirectory and
-  see what 'patch' file contains and check for the common
-  corruption patterns mentioned above.
-
-* While you are at it, check what are in 'info' and
-  'final-commit' files as well.  If what is in 'final-commit' is
-  not exactly what you would want to see in the commit log
-  message, it is very likely that your maintainer would end up
-  hand editing the log message when he applies your patch.
-  Things like "Hi, this is my first patch.\n", if you really
-  want to put in the patch e-mail, should come after the
-  three-dash line that signals the end of the commit message.
+While you are at it, check the resulting commit log message from
+a trial run of applying the patch.  If what is in the resulting
+commit is not exactly what you would want to see, it is very
+likely that your maintainer would end up hand editing the log
+message when he applies your patch.  Things like "Hi, this is my
+first patch.\n", if you really want to put in the patch e-mail,
+should come after the three-dash line that signals the end of the
+commit message.
 
 
 Pine
@@ -443,89 +413,10 @@ that or Gentoo did it.) So you need to set the
 it.
 
 
-Thunderbird
------------
-
-(A Large Angry SCM)
-
-By default, Thunderbird will both wrap emails as well as flag them as
-being 'format=flowed', both of which will make the resulting email unusable
-by git.
-
-Here are some hints on how to successfully submit patches inline using
-Thunderbird.
-
-There are two different approaches.  One approach is to configure
-Thunderbird to not mangle patches.  The second approach is to use
-an external editor to keep Thunderbird from mangling the patches.
-
-Approach #1 (configuration):
-
-This recipe is current as of Thunderbird 2.0.0.19.  Three steps:
-  1.  Configure your mail server composition as plain text
-      Edit...Account Settings...Composition & Addressing,
-        uncheck 'Compose Messages in HTML'.
-  2.  Configure your general composition window to not wrap
-      Edit..Preferences..Composition, wrap plain text messages at 0
-  3.  Disable the use of format=flowed
-      Edit..Preferences..Advanced..Config Editor.  Search for:
-        mailnews.send_plaintext_flowed
-      toggle it to make sure it is set to 'false'.
-
-After that is done, you should be able to compose email as you
-otherwise would (cut + paste, git-format-patch | git-imap-send, etc),
-and the patches should not be mangled.
-
-Approach #2 (external editor):
-
-This recipe appears to work with the current [*1*] Thunderbird from Suse.
-
-The following Thunderbird extensions are needed:
-       AboutConfig 0.5
-               http://aboutconfig.mozdev.org/
-       External Editor 0.7.2
-               http://globs.org/articles.php?lng=en&pg=8
-
-1) Prepare the patch as a text file using your method of choice.
-
-2) Before opening a compose window, use Edit->Account Settings to
-uncheck the "Compose messages in HTML format" setting in the
-"Composition & Addressing" panel of the account to be used to send the
-patch. [*2*]
-
-3) In the main Thunderbird window, _before_ you open the compose window
-for the patch, use Tools->about:config to set the following to the
-indicated values:
-       mailnews.send_plaintext_flowed  => false
-       mailnews.wraplength             => 0
-
-4) Open a compose window and click the external editor icon.
-
-5) In the external editor window, read in the patch file and exit the
-editor normally.
-
-6) Back in the compose window: Add whatever other text you wish to the
-message, complete the addressing and subject fields, and press send.
-
-7) Optionally, undo the about:config/account settings changes made in
-steps 2 & 3.
+Thunderbird, KMail, GMail
+-------------------------
 
-
-[Footnotes]
-*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse
-9.3 professional updates.
-
-*2* It may be possible to do this with about:config and the following
-settings but I haven't tried, yet.
-       mail.html_compose                       => false
-       mail.identity.default.compose_html      => false
-       mail.identity.id?.compose_html          => false
-
-(Lukas Sandström)
-
-There is a script in contrib/thunderbird-patch-inline which can help
-you include patches with Thunderbird in an easy way. To use it, do the
-steps above and then use the script as the external editor.
+See the MUA-SPECIFIC HINTS section of git-format-patch(1).
 
 Gnus
 ----
@@ -540,71 +431,3 @@ characters (most notably in people's names), and also
 whitespaces (fatal in patches).  Running 'C-u g' to display the
 message in raw form before using '|' to run the pipe can work
 this problem around.
-
-
-KMail
------
-
-This should help you to submit patches inline using KMail.
-
-1) Prepare the patch as a text file.
-
-2) Click on New Mail.
-
-3) Go under "Options" in the Composer window and be sure that
-"Word wrap" is not set.
-
-4) Use Message -> Insert file... and insert the patch.
-
-5) Back in the compose window: add whatever other text you wish to the
-message, complete the addressing and subject fields, and press send.
-
-
-Gmail
------
-
-GMail does not appear to have any way to turn off line wrapping in the web
-interface, so this will mangle any emails that you send.  You can however
-use "git send-email" and send your patches through the GMail SMTP server, or
-use any IMAP email client to connect to the google IMAP server and forward
-the emails through that.
-
-To use "git send-email" and send your patches through the GMail SMTP server,
-edit ~/.gitconfig to specify your account settings:
-
-[sendemail]
-       smtpencryption = tls
-       smtpserver = smtp.gmail.com
-       smtpuser = user@gmail.com
-       smtppass = p4ssw0rd
-       smtpserverport = 587
-
-Once your commits are ready to be sent to the mailing list, run the
-following commands:
-
-  $ git format-patch --cover-letter -M origin/master -o outgoing/
-  $ edit outgoing/0000-*
-  $ git send-email outgoing/*
-
-To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your
-account settings:
-
-[imap]
-       folder = "[Gmail]/Drafts"
-       host = imaps://imap.gmail.com
-       user = user@gmail.com
-       pass = p4ssw0rd
-       port = 993
-       sslverify = false
-
-You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
-that the "Folder doesn't exist".
-
-Once your commits are ready to be sent to the mailing list, run the
-following commands:
-
-  $ git format-patch --cover-letter -M --stdout origin/master | git imap-send
-
-Just make sure to disable line wrapping in the email client (GMail web
-interface will line wrap no matter what, so you need to use a real
-IMAP client).
index 0906499e7d26ac1e808f3a598675a32a7ad72739..d16136210a010a3ff502f80969c97667605170a1 100644 (file)
@@ -706,9 +706,16 @@ second is the background.  The position of the attribute, if any,
 doesn't matter.
 
 color.diff::
-       When set to `always`, always use colors in patch.
-       When false (or `never`), never.  When set to `true` or `auto`, use
-       colors only when the output is to the terminal. Defaults to false.
+       Whether to use ANSI escape sequences to add color to patches.
+       If this is set to `always`, linkgit:git-diff[1],
+       linkgit:git-log[1], and linkgit:git-show[1] will use color
+       for all patches.  If it is set to `true` or `auto`, those
+       commands will only use color when output is to the terminal.
+       Defaults to false.
++
+This does not affect linkgit:git-format-patch[1] nor the
+'git-diff-{asterisk}' plumbing commands.  Can be overridden on the
+command line with the `--color[=<when>]` option.
 
 color.diff.<slot>::
        Use customized color for diff colorization.  `<slot>` specifies
@@ -794,11 +801,15 @@ color.status.<slot>::
        color.branch.<slot>.
 
 color.ui::
-       When set to `always`, always use colors in all git commands which
-       are capable of colored output. When false (or `never`), never. When
-       set to `true` or `auto`, use colors only when the output is to the
-       terminal. When more specific variables of color.* are set, they always
-       take precedence over this setting. Defaults to false.
+       This variable determines the default value for variables such
+       as `color.diff` and `color.grep` that control the use of color
+       per command family. Its scope will expand as more commands learn
+       configuration to set a default for the `--color` option.  Set it
+       to `always` if you want all output not intended for machine
+       consumption to use color, to `true` or `auto` if you want such
+       output to use color when written to the terminal, or to `false` or
+       `never` if you prefer git commands not to use color unless enabled
+       explicitly with some other configuration or the `--color` option.
 
 commit.status::
        A boolean to enable/disable inclusion of status information in the
@@ -810,68 +821,7 @@ commit.template::
        "{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the
        specified user's home directory.
 
-diff.autorefreshindex::
-       When using 'git diff' to compare with work tree
-       files, do not consider stat-only change as changed.
-       Instead, silently run `git update-index --refresh` to
-       update the cached stat information for paths whose
-       contents in the work tree match the contents in the
-       index.  This option defaults to true.  Note that this
-       affects only 'git diff' Porcelain, and not lower level
-       'diff' commands such as 'git diff-files'.
-
-diff.external::
-       If this config variable is set, diff generation is not
-       performed using the internal diff machinery, but using the
-       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.mnemonicprefix::
-       If set, 'git diff' uses a prefix pair that is different from the
-       standard "a/" and "b/" depending on what is being compared.  When
-       this configuration is in effect, reverse diff output also swaps
-       the order of the prefixes:
-`git diff`;;
-       compares the (i)ndex and the (w)ork tree;
-`git diff HEAD`;;
-        compares a (c)ommit and the (w)ork tree;
-`git diff --cached`;;
-       compares a (c)ommit and the (i)ndex;
-`git diff HEAD:file1 file2`;;
-       compares an (o)bject and a (w)ork tree entity;
-`git diff --no-index a b`;;
-       compares two non-git things (1) and (2).
-
-diff.noprefix::
-       If set, 'git diff' does not show any source or destination prefix.
-
-diff.renameLimit::
-       The number of files to consider when performing the copy/rename
-       detection; equivalent to the 'git diff' option '-l'.
-
-diff.renames::
-       Tells git to detect renames.  If set to any boolean value, it
-       will enable basic rename detection.  If set to "copies" or
-       "copy", it will detect copies, as well.
-
-diff.ignoreSubmodules::
-       Sets the default value of --ignore-submodules. Note that this
-       affects only 'git diff' Porcelain, and not lower level 'diff'
-       commands such as 'git diff-files'. 'git checkout' also honors
-       this setting when reporting uncommitted changes.
-
-diff.suppressBlankEmpty::
-       A boolean to inhibit the standard behavior of printing a space
-       before each empty output line. Defaults to false.
-
-diff.tool::
-       Controls which diff tool is used.  `diff.tool` overrides
-       `merge.tool` when used by linkgit:git-difftool[1] and has
-       the same valid values as `merge.tool` minus "tortoisemerge"
-       and plus "kompare".
+include::diff-config.txt[]
 
 difftool.<tool>.path::
        Override the path for the given tool.  This is useful in case
@@ -975,6 +925,16 @@ format.signoff::
     the rights to submit this work under the same open source license.
     Please see the 'SubmittingPatches' document for further discussion.
 
+filter.<driver>.clean::
+       The command which is used to convert the content of a worktree
+       file to a blob upon checkin.  See linkgit:gitattributes[5] for
+       details.
+
+filter.<driver>.smudge::
+       The command which is used to convert the content of a blob
+       object to a worktree file upon checkout.  See
+       linkgit:gitattributes[5] for details.
+
 gc.aggressiveWindow::
        The window size parameter used in the delta compression
        algorithm used by 'git gc --aggressive'.  This defaults
@@ -1347,8 +1307,9 @@ instaweb.port::
 interactive.singlekey::
        In interactive commands, allow the user to provide one-letter
        input with a single key (i.e., without hitting enter).
-       Currently this is used only by the `\--patch` mode of
-       linkgit:git-add[1].  Note that this setting is silently
+       Currently this is used by the `\--patch` mode of
+       linkgit:git-add[1], linkgit:git-reset[1], linkgit:git-stash[1] and
+       linkgit:git-checkout[1]. Note that this setting is silently
        ignored if portable keystroke input is not available.
 
 log.date::
diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
new file mode 100644 (file)
index 0000000..2b1605f
--- /dev/null
@@ -0,0 +1,92 @@
+diff.autorefreshindex::
+       When using 'git diff' to compare with work tree
+       files, do not consider stat-only change as changed.
+       Instead, silently run `git update-index --refresh` to
+       update the cached stat information for paths whose
+       contents in the work tree match the contents in the
+       index.  This option defaults to true.  Note that this
+       affects only 'git diff' Porcelain, and not lower level
+       'diff' commands such as 'git diff-files'.
+
+diff.external::
+       If this config variable is set, diff generation is not
+       performed using the internal diff machinery, but using the
+       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.ignoreSubmodules::
+       Sets the default value of --ignore-submodules. Note that this
+       affects only 'git diff' Porcelain, and not lower level 'diff'
+       commands such as 'git diff-files'. 'git checkout' also honors
+       this setting when reporting uncommitted changes.
+
+diff.mnemonicprefix::
+       If set, 'git diff' uses a prefix pair that is different from the
+       standard "a/" and "b/" depending on what is being compared.  When
+       this configuration is in effect, reverse diff output also swaps
+       the order of the prefixes:
+`git diff`;;
+       compares the (i)ndex and the (w)ork tree;
+`git diff HEAD`;;
+        compares a (c)ommit and the (w)ork tree;
+`git diff --cached`;;
+       compares a (c)ommit and the (i)ndex;
+`git diff HEAD:file1 file2`;;
+       compares an (o)bject and a (w)ork tree entity;
+`git diff --no-index a b`;;
+       compares two non-git things (1) and (2).
+
+diff.noprefix::
+       If set, 'git diff' does not show any source or destination prefix.
+
+diff.renameLimit::
+       The number of files to consider when performing the copy/rename
+       detection; equivalent to the 'git diff' option '-l'.
+
+diff.renames::
+       Tells git to detect renames.  If set to any boolean value, it
+       will enable basic rename detection.  If set to "copies" or
+       "copy", it will detect copies, as well.
+
+diff.suppressBlankEmpty::
+       A boolean to inhibit the standard behavior of printing a space
+       before each empty output line. Defaults to false.
+
+diff.<driver>.command::
+       The custom diff driver command.  See linkgit:gitattributes[5]
+       for details.
+
+diff.<driver>.xfuncname::
+       The regular expression that the diff driver should use to
+       recognize the hunk header.  A built-in pattern may also be used.
+       See linkgit:gitattributes[5] for details.
+
+diff.<driver>.binary::
+       Set this option to true to make the diff driver treat files as
+       binary.  See linkgit:gitattributes[5] for details.
+
+diff.<driver>.textconv::
+       The command that the diff driver should call to generate the
+       text-converted version of a file.  The result of the
+       conversion is used to generate a human-readable diff.  See
+       linkgit:gitattributes[5] for details.
+
+diff.<driver>.wordregex::
+       The regular expression that the diff driver should use to
+       split words in a line.  See linkgit:gitattributes[5] for
+       details.
+
+diff.<driver>.cachetextconv::
+       Set this option to true to make the diff driver cache the text
+       conversion outputs.  See linkgit:gitattributes[5] for details.
+
+diff.tool::
+       The diff tool to be used by linkgit:git-difftool[1].  This
+       option overrides `merge.tool`, and has the same valid built-in
+       values as `merge.tool` minus "tortoisemerge" and plus
+       "kompare".  Any other value is treated as a custom diff tool,
+       and there must be a corresponding `difftool.<tool>.cmd`
+       option.
index c32105f1ed35f53a0922f32ad3fb271592d79d28..80fd817c28029d1b13e21b6c80da20b564ce9e42 100644 (file)
@@ -124,12 +124,19 @@ any of those replacements occurred.
 
 --color[=<when>]::
        Show colored diff.
-       The value must be always (the default), never, or auto.
+       The value must be `always` (the default for `<when>`), `never`, or `auto`.
+       The default value is `never`.
+ifdef::git-diff[]
+       It can be changed by the `color.ui` and `color.diff`
+       configuration settings.
+endif::git-diff[]
 
 --no-color::
-       Turn off colored diff, even when the configuration file
-       gives the default to color output.
-       Same as `--color=never`.
+       Turn off colored diff.
+ifdef::git-diff[]
+       This can be used to override configuration settings.
+endif::git-diff[]
+       It is the same as `--color=never`.
 
 --word-diff[=<mode>]::
        Show a word diff, using the <mode> to delimit changed words.
index 35cb5d3f643905d124445ecdae3d2949ac0067a6..9c1d3957223355e00eea917d4a7dff6d50343f32 100644 (file)
@@ -274,7 +274,8 @@ patch::
   This lets you choose one path out of a 'status' like selection.
   After choosing the path, it presents the diff between the index
   and the working tree file and asks you if you want to stage
-  the change of each hunk.  You can say:
+  the change of each hunk.  You can select one of the following
+  options and type return:
 
        y - stage this hunk
        n - do not stage this hunk
@@ -293,6 +294,9 @@ patch::
 +
 After deciding the fate for all hunks, if there is any hunk
 that was chosen, the index is updated with the selected hunks.
++
+You can omit having to type return here, by setting the configuration
+variable `interactive.singlekey` to `true`.
 
 diff::
 
index 1063f69023f97357c747cf73f8a4bcc9d9a59c4b..c0a96e6c1eede3b511689f35e9130a26ea81e003 100644 (file)
@@ -12,7 +12,7 @@ SYNOPSIS
 'git checkout' [-q] [-f] [-m] [--detach] [<commit>]
 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>]
 'git checkout' [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
-'git checkout' --patch [<tree-ish>] [--] [<paths>...]
+'git checkout' [-p|--patch] [<tree-ish>] [--] [<paths>...]
 
 DESCRIPTION
 -----------
@@ -45,7 +45,7 @@ $ git checkout <branch>
 that is to say, the branch is not reset/created unless "git checkout" is
 successful.
 
-'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...::
+'git checkout' [-p|--patch] [<tree-ish>] [--] <pathspec>...::
 
        When <paths> or `--patch` are given, 'git checkout' does *not*
        switch branches.  It updates the named paths in the working tree
@@ -183,7 +183,8 @@ the conflicted merge in the specified paths.
        working tree (and if a <tree-ish> was specified, the index).
 +
 This means that you can use `git checkout -p` to selectively discard
-edits from your current working tree.
+edits from your current working tree. See the ``Interactive Mode''
+section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
 
 <branch>::
        Branch to checkout; if it refers to a branch (i.e., a name that,
index 86eb4c93682aa3d92fe001ae871913fc0dec8607..b093e45497248076c335391f3e95b6384520ef6b 100644 (file)
@@ -12,7 +12,7 @@ SYNOPSIS
 'git clone' [--template=<template_directory>]
          [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
          [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
-         [--separate-git-dir|-L <git dir>]
+         [--separate-git-dir <git dir>]
          [--depth <depth>] [--recursive|--recurse-submodules] [--] <repository>
          [<directory>]
 
@@ -177,7 +177,6 @@ objects from the source repository into a pack in the cloned repository.
        repository does not have a worktree/checkout (i.e. if any of
        `--no-checkout`/`-n`, `--bare`, or `--mirror` is given)
 
--L=<git dir>::
 --separate-git-dir=<git dir>::
        Instead of placing the cloned repository where it is supposed
        to be, place the cloned repository at the specified directory,
index 88d814af0e050eb3b31f5763cbf12f03a5f6cbc3..827bc988ed5562c2dbc6566d6732b01f20bb4f05 100644 (file)
@@ -252,7 +252,7 @@ Configuring database backend
 
 'git-cvsserver' uses the Perl DBI module. Please also read
 its documentation if changing these variables, especially
-about `DBI->connect()`.
+about `DBI\->connect()`.
 
 gitcvs.dbname::
        Database name. The exact meaning depends on the
index 6d184864022cef90e284113a627103db99327052..2ea22abca2bc72abb0cedfe6f47616c52a60d3f4 100644 (file)
@@ -96,8 +96,8 @@ show that. So let's say that you have edited `kernel/sched.c`, but
 have not actually done a 'git update-index' on it yet - there is no
 "object" associated with the new state, and you get:
 
-  torvalds@ppc970:~/v2.6/linux> git diff-index HEAD
-  *100644->100664 blob    7476bb......->000000......      kernel/sched.c
+  torvalds@ppc970:~/v2.6/linux> git diff-index --abbrev HEAD
+  :100644 100664 7476bb... 000000...      kernel/sched.c
 
 i.e., it shows that the tree has changed, and that `kernel/sched.c` has is
 not up-to-date and may contain new stuff. The all-zero sha1 means that to
index 4e5f127efa634dd4ea68bb73508c59bd1cad32e5..1439486e40ec4a8a1146310bf929d688eb01d533 100644 (file)
@@ -138,8 +138,8 @@ so it can be used to name subdirectories.
 
 An example of normal usage is:
 
-  torvalds@ppc970:~/git> git diff-tree 5319e4......
-  *100664->100664 blob    ac348b.......->a01513.......      git-fsck-objects.c
+  torvalds@ppc970:~/git> git diff-tree --abbrev 5319e4
+  :100664 100664 ac348b... a01513...   git-fsck-objects.c
 
 which tells you that the last commit changed just one file (it's from
 this one:
index 66aba8a2e9928c20f4e24f6f8ecd39c66acf9f63..d13c9b23f7bce6379f638e5bf86b30c95abef30e 100644 (file)
@@ -289,6 +289,175 @@ title is likely to be different from the subject of the discussion the
 patch is in response to, so it is likely that you would want to keep
 the Subject: line, like the example above.
 
+Checking for patch corruption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Many mailers if not set up properly will corrupt whitespace.  Here are
+two common types of corruption:
+
+* Empty context lines that do not have _any_ whitespace.
+
+* Non-empty context lines that have one extra whitespace at the
+  beginning.
+
+One way to test if your MUA is set up correctly is:
+
+* Send the patch to yourself, exactly the way you would, except
+  with To: and Cc: lines that do not contain the list and
+  maintainer address.
+
+* Save that patch to a file in UNIX mailbox format.  Call it a.patch,
+  say.
+
+* Apply it:
+
+    $ git fetch <project> master:test-apply
+    $ git checkout test-apply
+    $ git reset --hard
+    $ git am a.patch
+
+If it does not apply correctly, there can be various reasons.
+
+* The patch itself does not apply cleanly.  That is _bad_ but
+  does not have much to do with your MUA.  You might want to rebase
+  the patch with linkgit:git-rebase[1] before regenerating it in
+  this case.
+
+* The MUA corrupted your patch; "am" would complain that
+  the patch does not apply.  Look in the .git/rebase-apply/ subdirectory and
+  see what 'patch' file contains and check for the common
+  corruption patterns mentioned above.
+
+* While at it, check the 'info' and 'final-commit' files as well.
+  If what is in 'final-commit' is not exactly what you would want to
+  see in the commit log message, it is very likely that the
+  receiver would end up hand editing the log message when applying
+  your patch.  Things like "Hi, this is my first patch.\n" in the
+  patch e-mail should come after the three-dash line that signals
+  the end of the commit message.
+
+MUA-SPECIFIC HINTS
+------------------
+Here are some hints on how to successfully submit patches inline using
+various mailers.
+
+GMail
+~~~~~
+GMail does not have any way to turn off line wrapping in the web
+interface, so it will mangle any emails that you send.  You can however
+use "git send-email" and send your patches through the GMail SMTP server, or
+use any IMAP email client to connect to the google IMAP server and forward
+the emails through that.
+
+For hints on using 'git send-email' to send your patches through the
+GMail SMTP server, see the EXAMPLE section of linkgit:git-send-email[1].
+
+For hints on submission using the IMAP interface, see the EXAMPLE
+section of linkgit:git-imap-send[1].
+
+Thunderbird
+~~~~~~~~~~~
+By default, Thunderbird will both wrap emails as well as flag
+them as being 'format=flowed', both of which will make the
+resulting email unusable by git.
+
+There are three different approaches: use an add-on to turn off line wraps,
+configure Thunderbird to not mangle patches, or use
+an external editor to keep Thunderbird from mangling the patches.
+
+Approach #1 (add-on)
+^^^^^^^^^^^^^^^^^^^^
+
+Install the Toggle Word Wrap add-on that is available from
+https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/
+It adds a menu entry "Enable Word Wrap" in the composer's "Options" menu
+that you can tick off. Now you can compose the message as you otherwise do
+(cut + paste, 'git format-patch' | 'git imap-send', etc), but you have to
+insert line breaks manually in any text that you type.
+
+Approach #2 (configuration)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Three steps:
+
+1. Configure your mail server composition as plain text:
+   Edit...Account Settings...Composition & Addressing,
+   uncheck "Compose Messages in HTML".
+
+2. Configure your general composition window to not wrap.
++
+In Thunderbird 2:
+Edit..Preferences..Composition, wrap plain text messages at 0
++
+In Thunderbird 3:
+Edit..Preferences..Advanced..Config Editor.  Search for
+"mail.wrap_long_lines".
+Toggle it to make sure it is set to `false`.
+
+3. Disable the use of format=flowed:
+Edit..Preferences..Advanced..Config Editor.  Search for
+"mailnews.send_plaintext_flowed".
+Toggle it to make sure it is set to `false`.
+
+After that is done, you should be able to compose email as you
+otherwise would (cut + paste, 'git format-patch' | 'git imap-send', etc),
+and the patches will not be mangled.
+
+Approach #3 (external editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following Thunderbird extensions are needed:
+AboutConfig from http://aboutconfig.mozdev.org/ and
+External Editor from http://globs.org/articles.php?lng=en&pg=8
+
+1. Prepare the patch as a text file using your method of choice.
+
+2. Before opening a compose window, use Edit->Account Settings to
+   uncheck the "Compose messages in HTML format" setting in the
+   "Composition & Addressing" panel of the account to be used to
+   send the patch.
+
+3. In the main Thunderbird window, 'before' you open the compose
+   window for the patch, use Tools->about:config to set the
+   following to the indicated values:
++
+----------
+       mailnews.send_plaintext_flowed  => false
+       mailnews.wraplength             => 0
+----------
+
+4. Open a compose window and click the external editor icon.
+
+5. In the external editor window, read in the patch file and exit
+   the editor normally.
+
+Side note: it may be possible to do step 2 with
+about:config and the following settings but no one's tried yet.
+
+----------
+       mail.html_compose                       => false
+       mail.identity.default.compose_html      => false
+       mail.identity.id?.compose_html          => false
+----------
+
+There is a script in contrib/thunderbird-patch-inline which can help
+you include patches with Thunderbird in an easy way. To use it, do the
+steps above and then use the script as the external editor.
+
+KMail
+~~~~~
+This should help you to submit patches inline using KMail.
+
+1. Prepare the patch as a text file.
+
+2. Click on New Mail.
+
+3. Go under "Options" in the Composer window and be sure that
+   "Word wrap" is not set.
+
+4. Use Message -> Insert file... and insert the patch.
+
+5. Back in the compose window: add whatever other text you wish to the
+   message, complete the addressing and subject fields, and press send.
+
 
 EXAMPLES
 --------
index d3013d6a29f2696e05e3c77b0d6f0159d0a98a76..4e09708cc96fbf88b468141c0234095ee35fee3c 100644 (file)
@@ -111,6 +111,31 @@ Using direct mode with SSL:
 ..........................
 
 
+EXAMPLE
+-------
+To submit patches using GMail's IMAP interface, first, edit your ~/.gitconfig
+to specify your account settings:
+
+---------
+[imap]
+       folder = "[Gmail]/Drafts"
+       host = imaps://imap.gmail.com
+       user = user@gmail.com
+       port = 993
+       sslverify = false
+---------
+
+You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
+that the "Folder doesn't exist".
+
+Once the commits are ready to be sent, run the following command:
+
+  $ git format-patch --cover-letter -M --stdout origin/master | git imap-send
+
+Just make sure to disable line wrapping in the email client (GMail's web
+interface will wrap lines no matter what, so you need to use a real
+IMAP client).
+
 CAUTION
 -------
 It is still your responsibility to make sure that the email message
@@ -124,6 +149,10 @@ Thunderbird in particular is known to be problematic.  Thunderbird
 users may wish to visit this web page for more information:
   http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
 
+SEE ALSO
+--------
+linkgit:git-format-patch[1], linkgit:git-send-email[1], mbox(5)
+
 GIT
 ---
 Part of the linkgit:git[1] suite
index 2c4c716f33f9dd3f0b876a013e22ac115ac3c936..9f97f5a91584a7469a3b0d2f8705febbe5c5ab58 100644 (file)
@@ -8,7 +8,7 @@ git-init-db - Creates an empty git repository
 
 SYNOPSIS
 --------
-'git init-db' [-q | --quiet] [--bare] [--template=<template_directory>] [--shared[=<permissions>]]
+'git init-db' [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]]
 
 
 DESCRIPTION
index 58cd01145ab8605d30a9c670ee70391b9d974a32..f2777a7786e6bf9c0cb907c77134b06321523654 100644 (file)
@@ -9,7 +9,7 @@ git-init - Create an empty git repository or reinitialize an existing one
 SYNOPSIS
 --------
 'git init' [-q | --quiet] [--bare] [--template=<template_directory>]
-         [--separate-git-dir|-L <git dir>]
+         [--separate-git-dir <git dir>]
          [--shared[=<permissions>]] [directory]
 
 
@@ -54,7 +54,6 @@ current working directory.
 Specify the directory from which templates will be used.  (See the "TEMPLATE
 DIRECTORY" section below.)
 
--L=<git dir>::
 --separate-git-dir=<git dir>::
 
 Instead of initializing the repository where it is supposed to be,
index 87cd11f2c47b66387d31c38f648c02f4c2734955..58f6ad4994dae770b1898888d3073fca777743af 100644 (file)
@@ -181,11 +181,11 @@ CAPABILITIES
        When using the import command, expect the source ref to have
        been written to the destination ref. The earliest applicable
        refspec takes precedence. For example
-       "refs/heads/*:refs/svn/origin/branches/*" means that, after an
-       "import refs/heads/name", the script has written to
+       "refs/heads/{asterisk}:refs/svn/origin/branches/{asterisk}" means
+       that, after an "import refs/heads/name", the script has written to
        refs/svn/origin/branches/name. If this capability is used at
        all, it must cover all refs reported by the list command; if
-       it is not used, it is effectively "*:*"
+       it is not used, it is effectively "{asterisk}:{asterisk}"
 
 REF LIST ATTRIBUTES
 -------------------
index 8481f9db746b70c10a2f20a97a8ef4a68cb56d75..b2832fc7eb809af9865d83cdb20829354165f62e 100644 (file)
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git reset' [-q] [<commit>] [--] <paths>...
-'git reset' --patch [<commit>] [--] [<paths>...]
+'git reset' [--patch|-p] [<commit>] [--] [<paths>...]
 'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
 
 DESCRIPTION
@@ -39,8 +39,9 @@ working tree in one go.
        and <commit> (defaults to HEAD).  The chosen hunks are applied
        in reverse to the index.
 +
-This means that `git reset -p` is the opposite of `git add -p` (see
-linkgit:git-add[1]).
+This means that `git reset -p` is the opposite of `git add -p`, i.e.
+you can use it to selectively reset hunks. See the ``Interactive Mode''
+section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
 
 'git reset' [--<mode>] [<commit>]::
        This form resets the current branch head to <commit> and
index ee14f74fd3af8dd6cfd9e52002993355d63b97c8..5a168cfab2206cf67453bb5f1fd93dbe75bb4ef0 100644 (file)
@@ -348,10 +348,12 @@ sendemail.confirm::
        one of 'always', 'never', 'cc', 'compose', or 'auto'. See '--confirm'
        in the previous section for the meaning of these values.
 
+EXAMPLE
+-------
 Use gmail as the smtp server
-----------------------------
-
-Add the following section to the config file:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+To use 'git send-email' to send your patches through the GMail SMTP server,
+edit ~/.gitconfig to specify your account settings:
 
        [sendemail]
                smtpencryption = tls
@@ -359,9 +361,20 @@ Add the following section to the config file:
                smtpuser = yourname@gmail.com
                smtpserverport = 587
 
+Once your commits are ready to be sent to the mailing list, run the
+following commands:
+
+       $ git format-patch --cover-letter -M origin/master -o outgoing/
+       $ edit outgoing/0000-*
+       $ git send-email outgoing/*
+
 Note: the following perl modules are required
       Net::SMTP::SSL, MIME::Base64 and Authen::SASL
 
+SEE ALSO
+--------
+linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)
+
 GIT
 ---
 Part of the linkgit:git[1] suite
index 79abc38e50a9a82243085383401b2d93468efaf3..15f051fa44e4b2e90da8383318c62695359772ce 100644 (file)
@@ -13,7 +13,7 @@ SYNOPSIS
 'git stash' drop [-q|--quiet] [<stash>]
 'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
 'git stash' branch <branchname> [<stash>]
-'git stash' [save [--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
+'git stash' [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [<message>]]
 'git stash' clear
 'git stash' create
 
@@ -42,7 +42,7 @@ is also possible).
 OPTIONS
 -------
 
-save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
+save [-p|--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
 
        Save your local modifications to a new 'stash', and run `git reset
        --hard` to revert them.  The <message> part is optional and gives
@@ -54,12 +54,13 @@ save [--patch] [--[no-]keep-index] [-q|--quiet] [<message>]::
 If the `--keep-index` option is used, all changes already added to the
 index are left intact.
 +
-With `--patch`, you can interactively select hunks from in the diff
+With `--patch`, you can interactively select hunks from the diff
 between HEAD and the working tree to be stashed.  The stash entry is
 constructed such that its index state is the same as the index state
 of your repository, and its worktree contains only the changes you
 selected interactively.  The selected changes are then rolled back
-from your worktree.
+from your worktree. See the ``Interactive Mode'' section of
+linkgit:git-add[1] to learn how to operate the `\--patch` mode.
 +
 The `--patch` option implies `--keep-index`.  You can use
 `--no-keep-index` to override this.
index 00b699fef71b45c78e298fa48609b553a32fd175..38cb741f180e0869a91a61a5f7706eb664b86d91 100644 (file)
@@ -32,9 +32,10 @@ OPTIONS
        Show the branch and tracking info even in short-format.
 
 --porcelain::
-       Give the output in a stable, easy-to-parse format for scripts.
-       Currently this is identical to --short output, but is guaranteed
-       not to change in the future, making it safe for scripts.
+       Give the output in an easy-to-parse format for scripts.
+       This is similar to the short output, but will remain stable
+       across git versions and regardless of user configuration. See
+       below for details.
 
 -u[<mode>]::
 --untracked-files[=<mode>]::
@@ -78,23 +79,27 @@ OUTPUT
 The output from this command is designed to be used as a commit
 template comment, and all the output lines are prefixed with '#'.
 The default, long format, is designed to be human readable,
-verbose and descriptive.  They are subject to change in any time.
+verbose and descriptive.  Its contents and format are subject to change
+at any time.
 
 The paths mentioned in the output, unlike many other git commands, are
 made relative to the current directory if you are working in a
 subdirectory (this is on purpose, to help cutting and pasting). See
 the status.relativePaths config option below.
 
-In short-format, the status of each path is shown as
+Short Format
+~~~~~~~~~~~~
+
+In the short-format, the status of each path is shown as
 
        XY PATH1 -> PATH2
 
-where `PATH1` is the path in the `HEAD`, and -> PATH2` part is
+where `PATH1` is the path in the `HEAD`, and the ` \-> PATH2` part is
 shown only when `PATH1` corresponds to a different path in the
 index/worktree (i.e. the file is renamed). The 'XY' is a two-letter
 status code.
 
-The fields (including the `->`) are separated from each other by a
+The fields (including the `\->`) are separated from each other by a
 single space. If a filename contains whitespace or other nonprintable
 characters, that field will be quoted in the manner of a C string
 literal: surrounded by ASCII double quote (34) characters, and with
@@ -143,10 +148,25 @@ If -b is used the short-format status is preceded by a line
 
 ## branchname tracking info
 
-There is an alternate -z format recommended for machine parsing.  In
+Porcelain Format
+~~~~~~~~~~~~~~~~
+
+The porcelain format is similar to the short format, but is guaranteed
+not to change in a backwards-incompatible way between git versions or
+based on user configuration. This makes it ideal for parsing by scripts.
+The description of the short format above also describes the porcelain
+format, with a few exceptions:
+
+1. The user's color.status configuration is not respected; color will
+   always be off.
+
+2. The user's status.relativePaths configuration is not respected; paths
+   shown will always be relative to the repository root.
+
+There is also an alternate -z format recommended for machine parsing. In
 that format, the status field is the same, but some other things
-change.  First, the '->' is omitted from rename entries and the field
-order is reversed (e.g 'from -> to' becomes 'to from'). Second, a NUL
+change.  First, the '\->' is omitted from rename entries and the field
+order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
 (ASCII 0) follows each filename, replacing space as a field separator
 and the terminating newline (but a space still separates the status
 field from the first filename).  Third, filenames containing special
index 509dc03376178362472bcdc45be675df70e027c8..39feb62129d9527f08db69175bcba19ea5d253aa 100644 (file)
@@ -774,10 +774,9 @@ use `git svn rebase` to update your work branch instead of `git pull` or
 when committing into SVN, which can lead to merge commits reversing
 previous commits in SVN.
 
-DESIGN PHILOSOPHY
------------------
-Merge tracking in Subversion is lacking and doing branched development
-with Subversion can be cumbersome as a result.  While 'git svn' can track
+MERGE TRACKING
+--------------
+While 'git svn' can track
 copy history (including branches and tags) for repositories adopting a
 standard layout, it cannot yet represent merge history that happened
 inside git back upstream to SVN users.  Therefore it is advised that
@@ -787,16 +786,15 @@ compatibility with SVN (see the CAVEATS section below).
 CAVEATS
 -------
 
-For the sake of simplicity and interoperating with a less-capable system
-(SVN), it is recommended that all 'git svn' users clone, fetch and dcommit
+For the sake of simplicity and interoperating with Subversion,
+it is recommended that all 'git svn' users clone, fetch and dcommit
 directly from the SVN server, and avoid all 'git clone'/'pull'/'merge'/'push'
 operations between git repositories and branches.  The recommended
 method of exchanging code between git branches and users is
 'git format-patch' and 'git am', or just 'dcommit'ing to the SVN repository.
 
 Running 'git merge' or 'git pull' is NOT recommended on a branch you
-plan to 'dcommit' from.  Subversion does not represent merges in any
-reasonable or useful fashion; so users using Subversion cannot see any
+plan to 'dcommit' from because Subversion users cannot see any
 merges you've made.  Furthermore, if you merge or pull from a git branch
 that is a mirror of an SVN branch, 'dcommit' may commit to the wrong
 branch.
@@ -846,7 +844,7 @@ Renamed and copied directories are not detected by git and hence not
 tracked when committing to SVN.  I do not plan on adding support for
 this as it's quite difficult and time-consuming to get working for all
 the possible corner cases (git doesn't do it, either).  Committing
-renamed and copied files are fully supported if they're similar enough
+renamed and copied files is fully supported if they're similar enough
 for git to detect them.
 
 CONFIGURATION
index e639c8315d45f51ee8204eb8a8a3a1831e3dfebe..504e1b118711c727cd621a98084a17e56e0d874f 100644 (file)
@@ -44,9 +44,10 @@ unreleased) version of git, that is available from 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v1.7.5.2/git.html[documentation for release 1.7.5.2]
+* link:v1.7.5.3/git.html[documentation for release 1.7.5.3]
 
 * release notes for
+  link:RelNotes/1.7.5.3.txt[1.7.5.3],
   link:RelNotes/1.7.5.2.txt[1.7.5.2],
   link:RelNotes/1.7.5.1.txt[1.7.5.1],
   link:RelNotes/1.7.5.txt[1.7.5].
index 20b0241d30026747391fa4b6b38de5cf959cee70..2d2ebc04b74ef2b1bf39df892d303d37076325d1 100644 (file)
@@ -32,7 +32,7 @@ Calling sequence
 
 * As you find different pairs of files, call `diff_change()` to feed
   modified files, `diff_addremove()` to feed created or deleted files,
-  or `diff_unmerged()` to feed a file whose state is 'unmerged' to the
+  or `diff_unmerge()` to feed a file whose state is 'unmerged' to the
   API.  These are thin wrappers to a lower-level `diff_queue()` function
   that is flexible enough to record any of these kinds of changes.
 
@@ -50,7 +50,7 @@ Data structures
 This is the internal representation for a single file (blob).  It
 records the blob object name (if known -- for a work tree file it
 typically is a NUL SHA-1), filemode and pathname.  This is what the
-`diff_addremove()`, `diff_change()` and `diff_unmerged()` synthesize and
+`diff_addremove()`, `diff_change()` and `diff_unmerge()` synthesize and
 feed `diff_queue()` function with.
 
 * `struct diff_filepair`
index fa54b5dd6e24a4944ef63df349f8da4bd5878966..85e25a6dd86852126ae864054f9bbf05d01bf7c1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.5.2
+DEF_VER=v1.7.5.3
 
 LF='
 '
index d0c577b1b38efaab2a89e2d8ad208c44ba768dba..d2e2ea1c4f26f9e604234420845045b60db5bbfd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -274,8 +274,7 @@ STRIP ?= strip
 #   mandir
 #   infodir
 #   htmldir
-#   ETC_GITCONFIG (but not sysconfdir)
-#   ETC_GITATTRIBUTES
+#   sysconfdir
 # can be specified as a relative path some/where/else;
 # this is interpreted as relative to $(prefix) and "git" at
 # runtime figures out where they are based on the path to the executable.
@@ -291,15 +290,8 @@ sharedir = $(prefix)/share
 gitwebdir = $(sharedir)/gitweb
 template_dir = share/git-core/templates
 htmldir = share/doc/git-doc
-ifeq ($(prefix),/usr)
-sysconfdir = /etc
 ETC_GITCONFIG = $(sysconfdir)/gitconfig
 ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
-else
-sysconfdir = $(prefix)/etc
-ETC_GITCONFIG = etc/gitconfig
-ETC_GITATTRIBUTES = etc/gitattributes
-endif
 lib = lib
 # DESTDIR=
 pathsep = :
@@ -1192,6 +1184,14 @@ endif
 -include config.mak.autogen
 -include config.mak
 
+ifndef sysconfdir
+ifeq ($(prefix),/usr)
+sysconfdir = /etc
+else
+sysconfdir = etc
+endif
+endif
+
 ifdef CHECK_HEADER_DEPENDENCIES
 COMPUTE_HEADER_DEPENDENCIES =
 USE_COMPUTED_HEADER_DEPENDENCIES =
index 430d7f1b62878329bb02b5fed5f68c507363a37e..313a3c02902b13c324e22cde6866ada96b4c1501 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/1.7.5.2.txt
\ No newline at end of file
+Documentation/RelNotes/1.7.5.4.txt
\ No newline at end of file
index eece5d6ac0f48ae76dc76c0f2ebda633cc0ded58..38632fc39805085e3b134e0574f3846931c150c6 100644 (file)
@@ -648,18 +648,30 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
                if (more == 1)
                        describe_one_orphan(&sb, last);
                else
-                       strbuf_addf(&sb, " ... and %d more.\n", more);
+                       strbuf_addf(&sb, _(" ... and %d more.\n"), more);
        }
 
        fprintf(stderr,
-               "Warning: you are leaving %d commit%s behind, "
+               Q_(
+               /* The singular version */
+               "Warning: you are leaving %d commit behind, "
+               "not connected to\n"
+               "any of your branches:\n\n"
+               "%s\n"
+               "If you want to keep it by creating a new branch, "
+               "this may be a good time\nto do so with:\n\n"
+               " git branch new_branch_name %s\n\n",
+               /* The plural version */
+               "Warning: you are leaving %d commits behind, "
                "not connected to\n"
                "any of your branches:\n\n"
                "%s\n"
                "If you want to keep them by creating a new branch, "
                "this may be a good time\nto do so with:\n\n"
                " git branch new_branch_name %s\n\n",
-               lost, ((1 < lost) ? "s" : ""),
+               /* Give ngettext() the count */
+               lost),
+               lost,
                sb.buf,
                sha1_to_hex(commit->object.sha1));
        strbuf_release(&sb);
@@ -961,9 +973,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                die (_("--patch is incompatible with all other options"));
 
        if (opts.force_detach && (opts.new_branch || opts.new_orphan_branch))
-               die("--detach cannot be used with -b/-B/--orphan");
+               die(_("--detach cannot be used with -b/-B/--orphan"));
        if (opts.force_detach && 0 < opts.track)
-               die("--detach cannot be used with -t");
+               die(_("--detach cannot be used with -t"));
 
        /* --track without -b should DWIM */
        if (0 < opts.track && !opts.new_branch) {
@@ -1043,7 +1055,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                }
 
                if (opts.force_detach)
-                       die("git checkout: --detach does not take a path argument");
+                       die(_("git checkout: --detach does not take a path argument"));
 
                if (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)
                        die(_("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index."));
index 4144bcf5ca320057b5ef1f5dac9c2df19aba250b..f579794d9a93a0e55289921f20b8f68b85211ca1 100644 (file)
@@ -81,7 +81,7 @@ static struct option builtin_clone_options[] = {
                   "path to git-upload-pack on the remote"),
        OPT_STRING(0, "depth", &option_depth, "depth",
                    "create a shallow clone of that depth"),
-       OPT_STRING('L', "separate-git-dir", &real_git_dir, "gitdir",
+       OPT_STRING(0, "separate-git-dir", &real_git_dir, "gitdir",
                   "separate git dir from working tree"),
 
        OPT_END()
@@ -417,7 +417,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        if (path)
                repo = xstrdup(absolute_path(repo_name));
        else if (!strchr(repo_name, ':'))
-               die("repository '%s' does not exist", repo_name);
+               die(_("repository '%s' does not exist"), repo_name);
        else
                repo = repo_name;
        is_local = path && !is_bundle;
index 0d2a3e9fa2023cc673f1f6d9e17d3deeca1c7e9d..be6417d166abf428d379a70b9d67f894da4641d1 100644 (file)
@@ -163,6 +163,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
        }
 
        if (read_stdin) {
+               int saved_nrl = 0;
+               int saved_dcctc = 0;
+
                if (opt->diffopt.detect_rename)
                        opt->diffopt.setup |= (DIFF_SETUP_USE_SIZE_CACHE |
                                               DIFF_SETUP_USE_CACHE);
@@ -173,9 +176,16 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
                                fputs(line, stdout);
                                fflush(stdout);
                        }
-                       else
+                       else {
                                diff_tree_stdin(line);
+                               if (saved_nrl < opt->diffopt.needed_rename_limit)
+                                       saved_nrl = opt->diffopt.needed_rename_limit;
+                               if (opt->diffopt.degraded_cc_to_c)
+                                       saved_dcctc = 1;
+                       }
                }
+               opt->diffopt.degraded_cc_to_c = saved_dcctc;
+               opt->diffopt.needed_rename_limit = saved_nrl;
        }
 
        return diff_result_code(&opt->diffopt, 0);
index 717fa1a3414e18cbdd4c6eb1e0785761687688d7..14bd14fce0fa6b9c9b047142d23d4a2237b57a36 100644 (file)
@@ -202,7 +202,6 @@ static void refresh_index_quietly(void)
 
 static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv)
 {
-       int result;
        unsigned int options = 0;
 
        while (1 < argc && argv[1][0] == '-') {
@@ -236,8 +235,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
                perror("read_cache_preload");
                return -1;
        }
-       result = run_diff_files(revs, options);
-       return diff_result_code(&revs->diffopt, result);
+       return run_diff_files(revs, options);
 }
 
 int cmd_diff(int argc, const char **argv, const char *prefix)
index b7370d9bb8f235f1cf39b1ffa768498ca1e88654..025aa47c804e4400cfa16ae8acd8dc2a5175e7c0 100644 (file)
@@ -319,10 +319,10 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir,
                struct stat st;
 
                if (!exist_ok && !stat(git_dir, &st))
-                       die("%s already exists", git_dir);
+                       die(_("%s already exists"), git_dir);
 
                if (!exist_ok && !stat(real_git_dir, &st))
-                       die("%s already exists", real_git_dir);
+                       die(_("%s already exists"), real_git_dir);
 
                /*
                 * make sure symlinks are resolved because we'll be
@@ -351,15 +351,15 @@ static void separate_git_dir(const char *git_dir)
                else if (S_ISDIR(st.st_mode))
                        src = git_link;
                else
-                       die("unable to handle file type %d", st.st_mode);
+                       die(_("unable to handle file type %d"), st.st_mode);
 
                if (rename(src, git_dir))
-                       die_errno("unable to move %s to %s", src, git_dir);
+                       die_errno(_("unable to move %s to %s"), src, git_dir);
        }
 
        fp = fopen(git_link, "w");
        if (!fp)
-               die("Could not create git link %s", git_link);
+               die(_("Could not create git link %s"), git_link);
        fprintf(fp, "gitdir: %s\n", git_dir);
        fclose(fp);
 }
@@ -490,7 +490,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
                        "specify that the git repository is to be shared amongst several users",
                        PARSE_OPT_OPTARG | PARSE_OPT_NONEG, shared_callback, 0},
                OPT_BIT('q', "quiet", &flags, "be quiet", INIT_DB_QUIET),
-               OPT_STRING('L', "separate-git-dir", &real_git_dir, "gitdir",
+               OPT_STRING(0, "separate-git-dir", &real_git_dir, "gitdir",
                           "separate git dir from working tree"),
                OPT_END()
        };
index c6dce9b8950410b08e13c11aa940404a7fcd2b78..55abe07610bce0a959b1878be128e09906f8fea4 100644 (file)
@@ -256,6 +256,8 @@ static void finish_early_output(struct rev_info *rev)
 static int cmd_log_walk(struct rev_info *rev)
 {
        struct commit *commit;
+       int saved_nrl = 0;
+       int saved_dcctc = 0;
 
        if (rev->early_output)
                setup_early_output(rev);
@@ -286,7 +288,14 @@ static int cmd_log_walk(struct rev_info *rev)
                }
                free_commit_list(commit->parents);
                commit->parents = NULL;
+               if (saved_nrl < rev->diffopt.needed_rename_limit)
+                       saved_nrl = rev->diffopt.needed_rename_limit;
+               if (rev->diffopt.degraded_cc_to_c)
+                       saved_dcctc = 1;
        }
+       rev->diffopt.degraded_cc_to_c = saved_dcctc;
+       rev->diffopt.needed_rename_limit = saved_nrl;
+
        if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF &&
            DIFF_OPT_TST(&rev->diffopt, CHECK_FAILED)) {
                return 02;
index 0f03dff1160f68de6f406f038c1b5c2bbd6529c8..24445f411b4823c92d5335491d03ed9df59970fd 100644 (file)
@@ -599,6 +599,14 @@ static void write_tree_trivial(unsigned char *sha1)
                die(_("git write-tree failed to write a tree"));
 }
 
+static const char *merge_argument(struct commit *commit)
+{
+       if (commit)
+               return sha1_to_hex(commit->object.sha1);
+       else
+               return EMPTY_TREE_SHA1_HEX;
+}
+
 int try_merge_command(const char *strategy, size_t xopts_nr,
                      const char **xopts, struct commit_list *common,
                      const char *head_arg, struct commit_list *remotes)
@@ -619,11 +627,11 @@ int try_merge_command(const char *strategy, size_t xopts_nr,
                args[i++] = s;
        }
        for (j = common; j; j = j->next)
-               args[i++] = xstrdup(sha1_to_hex(j->item->object.sha1));
+               args[i++] = xstrdup(merge_argument(j->item));
        args[i++] = "--";
        args[i++] = head_arg;
        for (j = remotes; j; j = j->next)
-               args[i++] = xstrdup(sha1_to_hex(j->item->object.sha1));
+               args[i++] = xstrdup(merge_argument(j->item));
        args[i] = NULL;
        ret = run_command_v_opt(args, RUN_GIT_CMD);
        strbuf_release(&buf);
@@ -831,7 +839,7 @@ static void read_merge_msg(void)
 {
        strbuf_reset(&merge_msg);
        if (strbuf_read_file(&merge_msg, git_path("MERGE_MSG"), 0) < 0)
-               die_errno("Could not read from '%s'", git_path("MERGE_MSG"));
+               die_errno(_("Could not read from '%s'"), git_path("MERGE_MSG"));
 }
 
 static void run_prepare_commit_msg(void)
@@ -971,16 +979,16 @@ static int setup_with_upstream(const char ***argv)
        const char **args;
 
        if (!branch)
-               die("No current branch.");
+               die(_("No current branch."));
        if (!branch->remote)
-               die("No remote for the current branch.");
+               die(_("No remote for the current branch."));
        if (!branch->merge_nr)
-               die("No default upstream defined for the current branch.");
+               die(_("No default upstream defined for the current branch."));
 
        args = xcalloc(branch->merge_nr + 1, sizeof(char *));
        for (i = 0; i < branch->merge_nr; i++) {
                if (!branch->merge[i]->dst)
-                       die("No remote tracking branch for %s from %s",
+                       die(_("No remote tracking branch for %s from %s"),
                            branch->merge[i]->src, branch->remote_name);
                args[i] = branch->merge[i]->dst;
        }
@@ -1054,10 +1062,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
        }
        if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
                if (advice_resolve_conflict)
-                       die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
-                           "Please, commit your changes before you can merge.");
+                       die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+                           "Please, commit your changes before you can merge."));
                else
-                       die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).");
+                       die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
        }
        resolve_undo_clear();
 
index f697e6695374d06e7b08c9faac1ebaefe4ff31d7..1f27c63343904a969e60ab19408495007f59d133 100644 (file)
@@ -408,8 +408,6 @@ static int do_pick_commit(void)
        discard_cache();
 
        if (!commit->parents) {
-               if (action == REVERT)
-                       die (_("Cannot revert a root commit"));
                parent = NULL;
        }
        else if (commit->parents->next) {
@@ -467,7 +465,7 @@ static int do_pick_commit(void)
                strbuf_addstr(&msgbuf, "\"\n\nThis reverts commit ");
                strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
 
-               if (commit->parents->next) {
+               if (commit->parents && commit->parents->next) {
                        strbuf_addstr(&msgbuf, ", reversing\nchanges made to ");
                        strbuf_addstr(&msgbuf, sha1_to_hex(parent->object.sha1));
                }
index 8b0911c0d2ac5a60f8a3c7a43e7960617ded9d7a..c1f6ddd927d61fbc2558ee3624224af405d918c3 100644 (file)
@@ -228,8 +228,11 @@ static void print_helper_status(struct ref *ref)
 
 static int sideband_demux(int in, int out, void *data)
 {
-       int *fd = data;
-       int ret = recv_sideband("send-pack", fd[0], out);
+       int *fd = data, ret;
+#ifdef NO_PTHREADS
+       close(fd[1]);
+#endif
+       ret = recv_sideband("send-pack", fd[0], out);
        close(out);
        return ret;
 }
@@ -339,6 +342,10 @@ int send_pack(struct send_pack_args *args,
                if (pack_objects(out, remote_refs, extra_have, args) < 0) {
                        for (ref = remote_refs; ref; ref = ref->next)
                                ref->status = REF_STATUS_NONE;
+                       if (args->stateless_rpc)
+                               close(out);
+                       if (git_connection_is_socket(conn))
+                               shutdown(fd[0], SHUT_WR);
                        if (use_sideband)
                                finish_async(&demux);
                        return -1;
diff --git a/cache.h b/cache.h
index 28899b7b7881474eed4a6f3b6fda8db79d5cbc9c..dd34fede9d2c7b91766c59c26b631e476e7bd937 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -965,6 +965,7 @@ extern struct ref *find_ref_by_name(const struct ref *list, const char *name);
 extern char *git_getpass(const char *prompt);
 extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
 extern int finish_connect(struct child_process *conn);
+extern int git_connection_is_socket(struct child_process *conn);
 extern int path_match(const char *path, int nr, char **match);
 struct extra_have_objects {
        int nr, alloc;
index e378534cbd57add4a6c75b8eb45353e8a9322914..1258528a267a48b4114e89eab56e8c901d6816fe 100644 (file)
@@ -18,6 +18,7 @@ bindir = @bindir@
 gitexecdir = @libexecdir@/git-core
 datarootdir = @datarootdir@
 template_dir = @datadir@/git-core/templates
+sysconfdir = @sysconfdir@
 
 mandir=@mandir@
 
index 57dc20c43ca1ba205ec0a18e263f9dde081390f4..2119c3f74edcd2a976ff0e375c5d8d60d40da2ec 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -395,26 +395,28 @@ static int git_use_proxy(const char *host)
        return (git_proxy_command && *git_proxy_command);
 }
 
-static void git_proxy_connect(int fd[2], char *host)
+static struct child_process *git_proxy_connect(int fd[2], char *host)
 {
        const char *port = STR(DEFAULT_GIT_PORT);
-       const char *argv[4];
-       struct child_process proxy;
+       const char **argv;
+       struct child_process *proxy;
 
        get_host_and_port(&host, &port);
 
+       argv = xmalloc(sizeof(*argv) * 4);
        argv[0] = git_proxy_command;
        argv[1] = host;
        argv[2] = port;
        argv[3] = NULL;
-       memset(&proxy, 0, sizeof(proxy));
-       proxy.argv = argv;
-       proxy.in = -1;
-       proxy.out = -1;
-       if (start_command(&proxy))
+       proxy = xcalloc(1, sizeof(*proxy));
+       proxy->argv = argv;
+       proxy->in = -1;
+       proxy->out = -1;
+       if (start_command(proxy))
                die("cannot start proxy %s", argv[0]);
-       fd[0] = proxy.out; /* read from proxy stdout */
-       fd[1] = proxy.in;  /* write to proxy stdin */
+       fd[0] = proxy->out; /* read from proxy stdout */
+       fd[1] = proxy->in;  /* write to proxy stdin */
+       return proxy;
 }
 
 #define MAX_CMD_LEN 1024
@@ -455,7 +457,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
        char *host, *path;
        char *end;
        int c;
-       struct child_process *conn;
+       struct child_process *conn = &no_fork;
        enum protocol protocol = PROTO_LOCAL;
        int free_path = 0;
        char *port = NULL;
@@ -540,7 +542,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
                 */
                char *target_host = xstrdup(host);
                if (git_use_proxy(host))
-                       git_proxy_connect(fd, host);
+                       conn = git_proxy_connect(fd, host);
                else
                        git_tcp_connect(fd, host, flags);
                /*
@@ -558,7 +560,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
                free(url);
                if (free_path)
                        free(path);
-               return &no_fork;
+               return conn;
        }
 
        conn = xcalloc(1, sizeof(*conn));
@@ -607,10 +609,15 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
        return conn;
 }
 
+int git_connection_is_socket(struct child_process *conn)
+{
+       return conn == &no_fork;
+}
+
 int finish_connect(struct child_process *conn)
 {
        int code;
-       if (!conn || conn == &no_fork)
+       if (!conn || git_connection_is_socket(conn))
                return 0;
 
        code = finish_command(conn);
index 840ae38760a5de84b369b208a52cc579ce478378..a7d20df233c2be8dc36452b02fb5fcabf168c69a 100755 (executable)
@@ -2710,6 +2710,10 @@ _git ()
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
+
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
 
        local cur words cword
@@ -2761,6 +2765,10 @@ _gitk ()
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
+
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
 
        __git_has_doubledash && return
diff --git a/diff.c b/diff.c
index ba45a7df112da57b567e723bae695b330cfdfdba..559bf574a88f97402f32e1bd4ab51f6f0c9d5026 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1050,8 +1050,16 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
                        emit_line(ecbdata->opt, plain, reset, line, len);
                        fputs("~\n", ecbdata->opt->file);
                } else {
-                       /* don't print the prefix character */
-                       emit_line(ecbdata->opt, plain, reset, line+1, len-1);
+                       /*
+                        * Skip the prefix character, if any.  With
+                        * diff_suppress_blank_empty, there may be
+                        * none.
+                        */
+                       if (line[0] != '\n') {
+                             line++;
+                             len--;
+                       }
+                       emit_line(ecbdata->opt, plain, reset, line, len);
                }
                return;
        }
@@ -3987,6 +3995,28 @@ static int is_summary_empty(const struct diff_queue_struct *q)
        return 1;
 }
 
+static const char rename_limit_warning[] =
+"inexact rename detection was skipped due to too many files.";
+
+static const char degrade_cc_to_c_warning[] =
+"only found copies from modified paths due to too many files.";
+
+static const char rename_limit_advice[] =
+"you may want to set your %s variable to at least "
+"%d and retry the command.";
+
+void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc)
+{
+       if (degraded_cc)
+               warning(degrade_cc_to_c_warning);
+       else if (needed)
+               warning(rename_limit_warning);
+       else
+               return;
+       if (0 < needed && needed < 32767)
+               warning(rename_limit_advice, varname, needed);
+}
+
 void diff_flush(struct diff_options *options)
 {
        struct diff_queue_struct *q = &diff_queued_diff;
@@ -4268,6 +4298,10 @@ void diffcore_std(struct diff_options *options)
 int diff_result_code(struct diff_options *opt, int status)
 {
        int result = 0;
+
+       diff_warn_rename_limit("diff.renamelimit",
+                              opt->needed_rename_limit,
+                              opt->degraded_cc_to_c);
        if (!DIFF_OPT_TST(opt, EXIT_WITH_STATUS) &&
            !(opt->output_format & DIFF_FORMAT_CHECKDIFF))
                return status;
diff --git a/diff.h b/diff.h
index 42b49d8f228fd2cc680ab9a2e332819d46f2f875..6e4d436e0ca21f2243c1b8a98319c878db3c1909 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -111,6 +111,7 @@ struct diff_options {
        int rename_score;
        int rename_limit;
        int needed_rename_limit;
+       int degraded_cc_to_c;
        int show_rename_progress;
        int dirstat_percent;
        int setup;
@@ -270,6 +271,7 @@ extern void diffcore_fix_diff_index(struct diff_options *);
 
 extern int diff_queue_is_empty(void);
 extern void diff_flush(struct diff_options*);
+extern void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
 
 /* diff-raw status letters */
 #define DIFF_STATUS_ADDED              'A'
index 0b9e99a04ee62d0d14900888f5b8b9ab3d957b5f..f639601c762ebbd12374fa739d1d63efaf265e2a 100644 (file)
@@ -55,22 +55,23 @@ static struct diff_rename_dst *locate_rename_dst(struct diff_filespec *two,
 
 /* Table of rename/copy src files */
 static struct diff_rename_src {
-       struct diff_filespec *one;
+       struct diff_filepair *p;
        unsigned short score; /* to remember the break score */
 } *rename_src;
 static int rename_src_nr, rename_src_alloc;
 
-static struct diff_rename_src *register_rename_src(struct diff_filespec *one,
-                                                  unsigned short score)
+static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
 {
        int first, last;
+       struct diff_filespec *one = p->one;
+       unsigned short score = p->score;
 
        first = 0;
        last = rename_src_nr;
        while (last > first) {
                int next = (last + first) >> 1;
                struct diff_rename_src *src = &(rename_src[next]);
-               int cmp = strcmp(one->path, src->one->path);
+               int cmp = strcmp(one->path, src->p->one->path);
                if (!cmp)
                        return src;
                if (cmp < 0) {
@@ -90,7 +91,7 @@ static struct diff_rename_src *register_rename_src(struct diff_filespec *one,
        if (first < rename_src_nr)
                memmove(rename_src + first + 1, rename_src + first,
                        (rename_src_nr - first - 1) * sizeof(*rename_src));
-       rename_src[first].one = one;
+       rename_src[first].p = p;
        rename_src[first].score = score;
        return &(rename_src[first]);
 }
@@ -205,7 +206,7 @@ static void record_rename_pair(int dst_index, int src_index, int score)
        if (rename_dst[dst_index].pair)
                die("internal error: dst already matched.");
 
-       src = rename_src[src_index].one;
+       src = rename_src[src_index].p->one;
        src->rename_used++;
        src->count++;
 
@@ -389,7 +390,7 @@ static int find_exact_renames(struct diff_options *options)
 
        init_hash(&file_table);
        for (i = 0; i < rename_src_nr; i++)
-               insert_file_table(&file_table, -1, i, rename_src[i].one);
+               insert_file_table(&file_table, -1, i, rename_src[i].p->one);
 
        for (i = 0; i < rename_dst_nr; i++)
                insert_file_table(&file_table, 1, i, rename_dst[i].two);
@@ -419,6 +420,55 @@ static void record_if_better(struct diff_score m[], struct diff_score *o)
                m[worst] = *o;
 }
 
+/*
+ * Returns:
+ * 0 if we are under the limit;
+ * 1 if we need to disable inexact rename detection;
+ * 2 if we would be under the limit if we were given -C instead of -C -C.
+ */
+static int too_many_rename_candidates(int num_create,
+                                     struct diff_options *options)
+{
+       int rename_limit = options->rename_limit;
+       int num_src = rename_src_nr;
+       int i;
+
+       options->needed_rename_limit = 0;
+
+       /*
+        * This basically does a test for the rename matrix not
+        * growing larger than a "rename_limit" square matrix, ie:
+        *
+        *    num_create * num_src > rename_limit * rename_limit
+        *
+        * but handles the potential overflow case specially (and we
+        * assume at least 32-bit integers)
+        */
+       if (rename_limit <= 0 || rename_limit > 32767)
+               rename_limit = 32767;
+       if ((num_create <= rename_limit || num_src <= rename_limit) &&
+           (num_create * num_src <= rename_limit * rename_limit))
+               return 0;
+
+       options->needed_rename_limit =
+               num_src > num_create ? num_src : num_create;
+
+       /* Are we running under -C -C? */
+       if (!DIFF_OPT_TST(options, FIND_COPIES_HARDER))
+               return 1;
+
+       /* Would we bust the limit if we were running under -C? */
+       for (num_src = i = 0; i < rename_src_nr; i++) {
+               if (diff_unmodified_pair(rename_src[i].p))
+                       continue;
+               num_src++;
+       }
+       if ((num_create <= rename_limit || num_src <= rename_limit) &&
+           (num_create * num_src <= rename_limit * rename_limit))
+               return 2;
+       return 1;
+}
+
 static int find_renames(struct diff_score *mx, int dst_cnt, int minimum_score, int copies)
 {
        int count = 0, i;
@@ -432,7 +482,7 @@ static int find_renames(struct diff_score *mx, int dst_cnt, int minimum_score, i
                dst = &rename_dst[mx[i].dst];
                if (dst->pair)
                        continue; /* already done, either exact or fuzzy. */
-               if (!copies && rename_src[mx[i].src].one->rename_used)
+               if (!copies && rename_src[mx[i].src].p->one->rename_used)
                        continue;
                record_rename_pair(mx[i].dst, mx[i].src, mx[i].score);
                count++;
@@ -444,12 +494,11 @@ void diffcore_rename(struct diff_options *options)
 {
        int detect_rename = options->detect_rename;
        int minimum_score = options->rename_score;
-       int rename_limit = options->rename_limit;
        struct diff_queue_struct *q = &diff_queued_diff;
        struct diff_queue_struct outq;
        struct diff_score *mx;
-       int i, j, rename_count;
-       int num_create, num_src, dst_cnt;
+       int i, j, rename_count, skip_unmodified = 0;
+       int num_create, dst_cnt;
        struct progress *progress = NULL;
 
        if (!minimum_score)
@@ -476,7 +525,7 @@ void diffcore_rename(struct diff_options *options)
                         */
                        if (p->broken_pair && !p->score)
                                p->one->rename_used++;
-                       register_rename_src(p->one, p->score);
+                       register_rename_src(p);
                }
                else if (detect_rename == DIFF_DETECT_COPY) {
                        /*
@@ -484,7 +533,7 @@ void diffcore_rename(struct diff_options *options)
                         * one, to indicate ourselves as a user.
                         */
                        p->one->rename_used++;
-                       register_rename_src(p->one, p->score);
+                       register_rename_src(p);
                }
        }
        if (rename_dst_nr == 0 || rename_src_nr == 0)
@@ -505,29 +554,20 @@ void diffcore_rename(struct diff_options *options)
         * files still remain as options for rename/copies!)
         */
        num_create = (rename_dst_nr - rename_count);
-       num_src = rename_src_nr;
 
        /* All done? */
        if (!num_create)
                goto cleanup;
 
-       /*
-        * This basically does a test for the rename matrix not
-        * growing larger than a "rename_limit" square matrix, ie:
-        *
-        *    num_create * num_src > rename_limit * rename_limit
-        *
-        * but handles the potential overflow case specially (and we
-        * assume at least 32-bit integers)
-        */
-       options->needed_rename_limit = 0;
-       if (rename_limit <= 0 || rename_limit > 32767)
-               rename_limit = 32767;
-       if ((num_create > rename_limit && num_src > rename_limit) ||
-           (num_create * num_src > rename_limit * rename_limit)) {
-               options->needed_rename_limit =
-                       num_src > num_create ? num_src : num_create;
+       switch (too_many_rename_candidates(num_create, options)) {
+       case 1:
                goto cleanup;
+       case 2:
+               options->degraded_cc_to_c = 1;
+               skip_unmodified = 1;
+               break;
+       default:
+               break;
        }
 
        if (options->show_rename_progress) {
@@ -549,8 +589,13 @@ void diffcore_rename(struct diff_options *options)
                        m[j].dst = -1;
 
                for (j = 0; j < rename_src_nr; j++) {
-                       struct diff_filespec *one = rename_src[j].one;
+                       struct diff_filespec *one = rename_src[j].p->one;
                        struct diff_score this_src;
+
+                       if (skip_unmodified &&
+                           diff_unmodified_pair(rename_src[j].p))
+                               continue;
+
                        this_src.score = estimate_similarity(one, two,
                                                             minimum_score);
                        this_src.name_score = basename_same(one, two);
diff --git a/fsck.c b/fsck.c
index 6f266c1ea4b8df503c211170741fa5b490a6a02a..60bd4bbf6a2206e2b1991093ea5d84be7f338f73 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -349,7 +349,7 @@ int fsck_error_function(struct object *obj, int type, const char *fmt, ...)
        va_list ap;
        struct strbuf sb = STRBUF_INIT;
 
-       strbuf_addf(&sb, "object %s:", obj->sha1?sha1_to_hex(obj->sha1):"(null)");
+       strbuf_addf(&sb, "object %s:", sha1_to_hex(obj->sha1));
 
        va_start(ap, fmt);
        strbuf_vaddf(&sb, fmt, ap);
index 4f08fe704bbaff64613ab07630a71da8bf8bbca0..8f0839d205e0c4010e256bb5cf81c73cc2f438ab 100755 (executable)
@@ -45,6 +45,9 @@
 my $normal_color = $repo->get_color("", "reset");
 
 my $use_readkey = 0;
+my $use_termcap = 0;
+my %term_escapes;
+
 sub ReadMode;
 sub ReadKey;
 if ($repo->config_bool("interactive.singlekey")) {
                Term::ReadKey->import;
                $use_readkey = 1;
        };
+       eval {
+               require Term::Cap;
+               my $termcap = Term::Cap->Tgetent;
+               foreach (values %$termcap) {
+                       $term_escapes{$_} = 1 if /^\e/;
+               }
+               $use_termcap = 1;
+       };
 }
 
 sub colored {
@@ -1067,6 +1078,14 @@ sub prompt_single_character {
                ReadMode 'cbreak';
                my $key = ReadKey 0;
                ReadMode 'restore';
+               if ($use_termcap and $key eq "\e") {
+                       while (!defined $term_escapes{$key}) {
+                               my $next = ReadKey 0.5;
+                               last if (!defined $next);
+                               $key .= $next;
+                       }
+                       $key =~ s/\e/^[/;
+               }
                print "$key" if defined $key;
                print "\n";
                return $key;
index b010a673097a9cfcf009b307114669b6221d066c..4361ae418cfc032f793d14af057e2b178922ca1f 100755 (executable)
@@ -491,7 +491,7 @@ cmd_update()
                                # Run fetch only if $sha1 isn't present or it
                                # is not reachable from a ref.
                                (clear_local_git_env; cd "$path" &&
-                                       ((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
+                                       ( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&
                                         test -z "$rev") || git-fetch)) ||
                                die "Unable to fetch in submodule path '$path'"
                        fi
index ee69ea683aedf81cd6e6eec0f500bddf2ff54450..f8db40a1c25a2cdf1c4dc1ff42aba0fe66ef8f1c 100755 (executable)
@@ -186,7 +186,7 @@ sub evaluate_uri {
                'type' => 'application/x-gzip',
                'suffix' => '.tar.gz',
                'format' => 'tar',
-               'compressor' => ['gzip']},
+               'compressor' => ['gzip', '-n']},
 
        'tbz2' => {
                'display' => 'tar.bz2',
diff --git a/ident.c b/ident.c
index 1c4adb0a9a7e94936ba64d286cedd65f4b8255a6..8e56b5e941e85c9634d420a3e8140c328bca9c30 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -34,6 +34,7 @@ static void copy_gecos(const struct passwd *w, char *name, size_t sz)
                        *dst++ = toupper(*w->pw_name);
                        memcpy(dst, w->pw_name + 1, nlen - 1);
                        dst += nlen - 1;
+                       len += nlen;
                }
        }
        if (len < sz)
index dba27643bd30768270d5c33753d6b26dea65face..ae6ade4ecbbcc77bc952d223f0ae90ae2c77a0c7 100644 (file)
 #include "dir.h"
 #include "submodule.h"
 
-static const char rename_limit_advice[] =
-"inexact rename detection was skipped because there were too many\n"
-"  files. You may want to set your merge.renamelimit variable to at least\n"
-"  %d and retry this merge.";
-
 static struct tree *shift_tree_object(struct tree *one, struct tree *two,
                                      const char *subtree_shift)
 {
@@ -1652,8 +1647,9 @@ int merge_recursive(struct merge_options *o,
                commit_list_insert(h2, &(*result)->parents->next);
        }
        flush_output(o);
-       if (o->needed_rename_limit)
-               warning(rename_limit_advice, o->needed_rename_limit);
+       if (show(o, 2))
+               diff_warn_rename_limit("merge.renamelimit",
+                                      o->needed_rename_limit, 0);
        return clean;
 }
 
index 22dfc843da1528ffd0466d496c50c56702e55a24..6ec452f7bc689c02ff663ab2cd1f6f1a068fe08c 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -47,8 +47,14 @@ static void read_rr(struct string_list *rr)
                name = xstrdup(buf);
                if (fgetc(in) != '\t')
                        die("corrupt MERGE_RR");
-               for (i = 0; i < sizeof(buf) && (buf[i] = fgetc(in)); i++)
-                       ; /* do nothing */
+               for (i = 0; i < sizeof(buf); i++) {
+                       int c = fgetc(in);
+                       if (c < 0)
+                               die("corrupt MERGE_RR");
+                       buf[i] = c;
+                       if (c == 0)
+                                break;
+               }
                if (i == sizeof(buf))
                        die("filename too long");
                string_list_insert(rr, buf)->util = name;
index 0f38364cf3f81a9088305ca802adf8b7c9260e91..707a703a09d6c7ffc1adfcd89da83d5b97da397f 100644 (file)
@@ -1096,35 +1096,34 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
        return 0;
 }
 
-static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb, const char ***prune_data)
-{
-       const char **prune = *prune_data;
-       int prune_nr;
-       int prune_alloc;
+struct cmdline_pathspec {
+       int alloc;
+       int nr;
+       const char **path;
+};
 
-       /* count existing ones */
-       if (!prune)
-               prune_nr = 0;
-       else
-               for (prune_nr = 0; prune[prune_nr]; prune_nr++)
-                       ;
-       prune_alloc = prune_nr; /* not really, but we do not know */
+static void append_prune_data(struct cmdline_pathspec *prune, const char **av)
+{
+       while (*av) {
+               ALLOC_GROW(prune->path, prune->nr+1, prune->alloc);
+               prune->path[prune->nr++] = *(av++);
+       }
+}
 
+static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,
+                                    struct cmdline_pathspec *prune)
+{
        while (strbuf_getwholeline(sb, stdin, '\n') != EOF) {
                int len = sb->len;
                if (len && sb->buf[len - 1] == '\n')
                        sb->buf[--len] = '\0';
-               ALLOC_GROW(prune, prune_nr+1, prune_alloc);
-               prune[prune_nr++] = xstrdup(sb->buf);
+               ALLOC_GROW(prune->path, prune->nr+1, prune->alloc);
+               prune->path[prune->nr++] = xstrdup(sb->buf);
        }
-       if (prune) {
-               ALLOC_GROW(prune, prune_nr+1, prune_alloc);
-               prune[prune_nr] = NULL;
-       }
-       *prune_data = prune;
 }
 
-static void read_revisions_from_stdin(struct rev_info *revs, const char ***prune)
+static void read_revisions_from_stdin(struct rev_info *revs,
+                                     struct cmdline_pathspec *prune)
 {
        struct strbuf sb;
        int seen_dashdash = 0;
@@ -1498,34 +1497,6 @@ static int for_each_good_bisect_ref(const char *submodule, each_ref_fn fn, void
        return for_each_ref_in_submodule(submodule, "refs/bisect/good", fn, cb_data);
 }
 
-static void append_prune_data(const char ***prune_data, const char **av)
-{
-       const char **prune = *prune_data;
-       int prune_nr;
-       int prune_alloc;
-
-       if (!prune) {
-               *prune_data = av;
-               return;
-       }
-
-       /* count existing ones */
-       for (prune_nr = 0; prune[prune_nr]; prune_nr++)
-               ;
-       prune_alloc = prune_nr; /* not really, but we do not know */
-
-       while (*av) {
-               ALLOC_GROW(prune, prune_nr+1, prune_alloc);
-               prune[prune_nr++] = *av;
-               av++;
-       }
-       if (prune) {
-               ALLOC_GROW(prune, prune_nr+1, prune_alloc);
-               prune[prune_nr] = NULL;
-       }
-       *prune_data = prune;
-}
-
 /*
  * Parse revision information, filling in the "rev_info" structure,
  * and removing the used arguments from the argument list.
@@ -1536,11 +1507,12 @@ static void append_prune_data(const char ***prune_data, const char **av)
 int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)
 {
        int i, flags, left, seen_dashdash, read_from_stdin, got_rev_arg = 0;
-       const char **prune_data = NULL;
+       struct cmdline_pathspec prune_data;
        const char *submodule = NULL;
        const char *optarg;
        int argcount;
 
+       memset(&prune_data, 0, sizeof(prune_data));
        if (opt)
                submodule = opt->submodule;
 
@@ -1553,7 +1525,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
                argv[i] = NULL;
                argc = i;
                if (argv[i + 1])
-                       prune_data = argv + i + 1;
+                       append_prune_data(&prune_data, argv + i + 1);
                seen_dashdash = 1;
                break;
        }
@@ -1672,8 +1644,12 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
                        got_rev_arg = 1;
        }
 
-       if (prune_data)
-               init_pathspec(&revs->prune_data, get_pathspec(revs->prefix, prune_data));
+       if (prune_data.nr) {
+               ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
+               prune_data.path[prune_data.nr++] = NULL;
+               init_pathspec(&revs->prune_data,
+                             get_pathspec(revs->prefix, prune_data.path));
+       }
 
        if (revs->def == NULL)
                revs->def = opt ? opt->def : NULL;
index f91e446c86be8e27f98554567143d7ce6f934bd1..70e8a249d0fe07b6a32b4da4ac8224d1c2f06b1b 100644 (file)
@@ -67,21 +67,24 @@ static int child_notifier = -1;
 
 static void notify_parent(void)
 {
-       ssize_t unused;
-       unused = write(child_notifier, "", 1);
+       /*
+        * execvp failed.  If possible, we'd like to let start_command
+        * know, so failures like ENOENT can be handled right away; but
+        * otherwise, finish_command will still report the error.
+        */
+       xwrite(child_notifier, "", 1);
 }
 
 static NORETURN void die_child(const char *err, va_list params)
 {
        char msg[4096];
-       ssize_t unused;
        int len = vsnprintf(msg, sizeof(msg), err, params);
        if (len > sizeof(msg))
                len = sizeof(msg);
 
-       unused = write(child_err, "fatal: ", 7);
-       unused = write(child_err, msg, len);
-       unused = write(child_err, "\n", 1);
+       write_in_full(child_err, "fatal: ", 7);
+       write_in_full(child_err, msg, len);
+       write_in_full(child_err, "\n", 1);
        exit(128);
 }
 #endif
diff --git a/setup.c b/setup.c
index 03cd84f2fcbf9cdbc25116308a9c2c9407af8e71..e7a37863ccdfe8c38e079f4d971f76a523bfd83b 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -275,7 +275,7 @@ const char *read_gitfile_gently(const char *path)
        const char *slash;
        struct stat st;
        int fd;
-       size_t len;
+       ssize_t len;
 
        if (stat(path, &st))
                return NULL;
index 428ee05c4a5b844815ff4f9356b71bb147cb42a6..cad36dd7502b81ef8e27476e9686562547b5a1c0 100644 (file)
--- a/t/README
+++ b/t/README
@@ -379,7 +379,7 @@ library for your script to use.
 
  - test_expect_success [<prereq>] <message> <script>
 
-   Usually takes two strings as parameter, and evaluates the
+   Usually takes two strings as parameters, and evaluates the
    <script>.  If it yields success, test is considered
    successful.  <message> should state what it is testing.
 
@@ -390,7 +390,7 @@ library for your script to use.
            'tree=$(git-write-tree)'
 
    If you supply three parameters the first will be taken to be a
-   prerequisite, see the test_set_prereq and test_have_prereq
+   prerequisite; see the test_set_prereq and test_have_prereq
    documentation below:
 
        test_expect_success TTY 'git --paginate rev-list uses a pager' \
@@ -446,7 +446,7 @@ library for your script to use.
    Merges the given rev using the given message.  Like test_commit,
    creates a tag and calls test_tick before committing.
 
- - test_set_prereq SOME_PREREQ
+ - test_set_prereq <prereq>
 
    Set a test prerequisite to be used later with test_have_prereq. The
    test-lib will set some prerequisites for you, see the
@@ -456,7 +456,7 @@ library for your script to use.
    test_have_prereq directly, or the three argument invocation of
    test_expect_success and test_expect_failure.
 
- - test_have_prereq SOME PREREQ
+ - test_have_prereq <prereq>
 
    Check if we have a prerequisite previously set with
    test_set_prereq. The most common use of this directly is to skip
@@ -526,12 +526,13 @@ library for your script to use.
 
    Check whether a file has the length it is expected to.
 
- - test_path_is_file <file> [<diagnosis>]
-   test_path_is_dir <dir> [<diagnosis>]
+ - test_path_is_file <path> [<diagnosis>]
+   test_path_is_dir <path> [<diagnosis>]
    test_path_is_missing <path> [<diagnosis>]
 
-   Check whether a file/directory exists or doesn't. <diagnosis> will
-   be displayed if the test fails.
+   Check if the named path is a file, if the named path is a
+   directory, or if the named path does not exist, respectively,
+   and fail otherwise, showing the <diagnosis> text.
 
  - test_when_finished <script>
 
index d3829b8d0a18d15590f4cbde4606d130a9293ead..b8996a373a7444b54823f36159ea1a8634e4aeee 100644 (file)
@@ -157,8 +157,7 @@ test_http_push_nonff() {
                grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" output
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'non-fast-forward push shows help message' '
-               grep "To prevent you from losing history, non-fast-forward updates were rejected" \
-                       output
+       test_expect_success 'non-fast-forward push shows help message' '
+               test_i18ngrep "To prevent you from losing history, non-fast-forward updates were rejected" output
        '
 }
index 54520f6fa69bef682e200497c531c9cd7367b9ea..ad664105646d4579a4e31ea5d230268acc33c0f5 100755 (executable)
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
        fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'reinit' '
+test_expect_success 'reinit' '
 
        (
                sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
@@ -190,11 +190,11 @@ test_expect_success C_LOCALE_OUTPUT 'reinit' '
                git init >out1 2>err1 &&
                git init >out2 2>err2
        ) &&
-       grep "Initialized empty" again/out1 &&
-       grep "Reinitialized existing" again/out2 &&
+       test_i18ngrep "Initialized empty" again/out1 &&
+       test_i18ngrep "Reinitialized existing" again/out2 &&
        >again/empty &&
-       test_cmp again/empty again/err1 &&
-       test_cmp again/empty again/err2
+       test_i18ncmp again/empty again/err1 &&
+       test_i18ncmp again/empty again/err2
 '
 
 test_expect_success 'init with --template' '
@@ -409,7 +409,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
        cd newdir &&
        mv .git here &&
        ln -s here .git &&
-       git init -L ../realgitdir
+       git init --separate-git-dir ../realgitdir
        ) &&
        echo "gitdir: `pwd`/realgitdir" >expected &&
        test_cmp expected newdir/.git &&
index 10b26e4d8ef3ea7b6b9b2ae7aeebbbae1ee46703..8d4938f019ca406c0f248d19d046356dff1ac09a 100755 (executable)
@@ -7,8 +7,31 @@ test_description='Test run command'
 
 . ./test-lib.sh
 
+cat >hello-script <<-EOF
+       #!$SHELL_PATH
+       cat hello-script
+EOF
+>empty
+
 test_expect_success 'start_command reports ENOENT' '
        test-run-command start-command-ENOENT ./does-not-exist
 '
 
+test_expect_success 'run_command can run a command' '
+       cat hello-script >hello.sh &&
+       chmod +x hello.sh &&
+       test-run-command run-command ./hello.sh >actual 2>err &&
+
+       test_cmp hello-script actual &&
+       test_cmp empty err
+'
+
+test_expect_success POSIXPERM 'run_command reports EACCES' '
+       cat hello-script >hello.sh &&
+       chmod -x hello.sh &&
+       test_must_fail test-run-command run-command ./hello.sh 2>err &&
+
+       grep "fatal: cannot exec.*hello.sh" err
+'
+
 test_done
index 5067d1e15b566721c1a3ae79052cbcb023a03656..bd83ed371acb5075b2b3cbb7866d36aa4bd48519 100755 (executable)
@@ -2,74 +2,14 @@
 
 test_description="Test the svn importer's input handling routines.
 
-These tests exercise the line_buffer library, but their real purpose
-is to check the assumptions that library makes of the platform's input
-routines.  Processes engaged in bi-directional communication would
-hang if fread or fgets is too greedy.
+These tests provide some simple checks that the line_buffer API
+behaves as advertised.
 
 While at it, check that input of newlines and null bytes are handled
 correctly.
 "
 . ./test-lib.sh
 
-test -n "$GIT_REMOTE_SVN_TEST_BIG_FILES" && test_set_prereq EXPENSIVE
-
-generate_tens_of_lines () {
-       tens=$1 &&
-       line=$2 &&
-
-       i=0 &&
-       while test $i -lt "$tens"
-       do
-               for j in a b c d e f g h i j
-               do
-                       echo "$line"
-               done &&
-               : $((i = $i + 1)) ||
-               return
-       done
-}
-
-long_read_test () {
-       : each line is 10 bytes, including newline &&
-       line=abcdefghi &&
-       echo "$line" >expect &&
-
-       if ! test_declared_prereq PIPE
-       then
-               echo >&4 "long_read_test: need to declare PIPE prerequisite"
-               return 127
-       fi &&
-       tens_of_lines=$(($1 / 100 + 1)) &&
-       lines=$(($tens_of_lines * 10)) &&
-       readsize=$((($lines - 1) * 10 + 3)) &&
-       copysize=7 &&
-       rm -f input &&
-       mkfifo input &&
-       {
-               (
-                       generate_tens_of_lines $tens_of_lines "$line" &&
-                       exec sleep 100
-               ) >input &
-       } &&
-       test-line-buffer input <<-EOF >output &&
-       binary $readsize
-       copy $copysize
-       EOF
-       kill $! &&
-       test_line_count = $lines output &&
-       tail -n 1 <output >actual &&
-       test_cmp expect actual
-}
-
-test_expect_success 'setup: have pipes?' '
-      rm -f frob &&
-      if mkfifo frob
-      then
-               test_set_prereq PIPE
-      fi
-'
-
 test_expect_success 'hello world' '
        echo ">HELLO" >expect &&
        test-line-buffer <<-\EOF >actual &&
@@ -79,21 +19,6 @@ test_expect_success 'hello world' '
        test_cmp expect actual
 '
 
-test_expect_success PIPE '0-length read, no input available' '
-       printf ">" >expect &&
-       rm -f input &&
-       mkfifo input &&
-       {
-               sleep 100 >input &
-       } &&
-       test-line-buffer input <<-\EOF >actual &&
-       binary 0
-       copy 0
-       EOF
-       kill $! &&
-       test_cmp expect actual
-'
-
 test_expect_success '0-length read, send along greeting' '
        echo ">HELLO" >expect &&
        test-line-buffer <<-\EOF >actual &&
@@ -104,33 +29,6 @@ test_expect_success '0-length read, send along greeting' '
        test_cmp expect actual
 '
 
-test_expect_success PIPE '1-byte read, no input available' '
-       printf ">%s" ab >expect &&
-       rm -f input &&
-       mkfifo input &&
-       {
-               (
-                       printf "%s" a &&
-                       printf "%s" b &&
-                       exec sleep 100
-               ) >input &
-       } &&
-       test-line-buffer input <<-\EOF >actual &&
-       binary 1
-       copy 1
-       EOF
-       kill $! &&
-       test_cmp expect actual
-'
-
-test_expect_success PIPE 'long read (around 8192 bytes)' '
-       long_read_test 8192
-'
-
-test_expect_success PIPE,EXPENSIVE 'longer read (around 65536 bytes)' '
-       long_read_test 65536
-'
-
 test_expect_success 'read from file descriptor' '
        rm -f input &&
        echo hello >expect &&
index 3264fefbad8b941bd90b243948f618b65fe4929f..5e29e13782ffad74915128adf163d57eef16f4e8 100755 (executable)
@@ -166,8 +166,8 @@ test_expect_success 'git resolve' '
                -e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'git resolve output' '
-       test_cmp resolve.expect resolve.output
+test_expect_success 'git resolve output' '
+       test_i18ncmp resolve.expect resolve.output
 '
 
 cat > show-branch2.expect << EOF
index cc34e5535bc5ab7441ba375540e5feec2dfb2d6b..b99d5192a96ec77ef6a99cb86518375c447b48a9 100755 (executable)
@@ -29,9 +29,9 @@ test_expect_success 'checkout chooses branch over tag' '
        test_cmp expect file
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout reports switch to branch' '
-       grep "Switched to branch" stderr &&
-       ! grep "^HEAD is now at" stderr
+test_expect_success 'checkout reports switch to branch' '
+       test_i18ngrep "Switched to branch" stderr &&
+       test_i18ngrep ! "^HEAD is now at" stderr
 '
 
 test_expect_success 'checkout vague ref succeeds' '
@@ -51,9 +51,9 @@ test_expect_success VAGUENESS_SUCCESS 'checkout chooses branch over tag' '
        test_cmp expect file
 '
 
-test_expect_success VAGUENESS_SUCCESS,C_LOCALE_OUTPUT 'checkout reports switch to branch' '
-       grep "Switched to branch" stderr &&
-       ! grep "^HEAD is now at" stderr
+test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' '
+       test_i18ngrep "Switched to branch" stderr &&
+       test_i18ngrep ! "^HEAD is now at" stderr
 '
 
 test_done
index 569b27fe8d488833c3ec0d9952ae064764a0183f..2366f0f4141656666db9cdcd8975335df57b6a8f 100755 (executable)
@@ -13,10 +13,10 @@ check_not_detached () {
 
 ORPHAN_WARNING='you are leaving .* commit.*behind'
 check_orphan_warning() {
-       grep "$ORPHAN_WARNING" "$1"
+       test_i18ngrep "$ORPHAN_WARNING" "$1"
 }
 check_no_orphan_warning() {
-       ! grep "$ORPHAN_WARNING" "$1"
+       test_i18ngrep ! "$ORPHAN_WARNING" "$1"
 }
 
 reset () {
@@ -108,21 +108,30 @@ test_expect_success 'checkout warns on orphan commits' '
        echo content >orphan &&
        git add orphan &&
        git commit -a -m orphan &&
-       git checkout master 2>stderr &&
+       git checkout master 2>stderr
+'
+
+test_expect_success 'checkout warns on orphan commits: output' '
        check_orphan_warning stderr
 '
 
 test_expect_success 'checkout does not warn leaving ref tip' '
        reset &&
        git checkout --detach two &&
-       git checkout master 2>stderr &&
+       git checkout master 2>stderr
+'
+
+test_expect_success 'checkout does not warn leaving ref tip' '
        check_no_orphan_warning stderr
 '
 
 test_expect_success 'checkout does not warn leaving reachable commit' '
        reset &&
        git checkout --detach HEAD^ &&
-       git checkout master 2>stderr &&
+       git checkout master 2>stderr
+'
+
+test_expect_success 'checkout does not warn leaving reachable commit' '
        check_no_orphan_warning stderr
 '
 
index 7206c1374127ed7c1f9ad6d422e535458cb217b4..4cdebda6a5c9b893f46e99b5b565cc4b70efb2db 100755 (executable)
@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '
 
 '
 
-test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
+test_expect_success 'add -n -u should not add but just report' '
 
        (
                echo "add '\''check'\''" &&
@@ -124,7 +124,7 @@ test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
        after=$(git ls-files -s check top) &&
 
        test "$before" = "$after" &&
-       test_cmp expect actual
+       test_i18ncmp expect actual
 
 '
 
index 49753362f0974627f1b5e5e11144484238875494..8340ac2f073446963f7f5dab39ac87771264da54 100755 (executable)
@@ -34,8 +34,8 @@ do
                ! test -s out
        '
 
-       test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i output" '
-               grep -e "Use -f if" err
+       test_expect_success "complaints for ignored $i output" '
+               test_i18ngrep -e "Use -f if" err
        '
 
        test_expect_success "complaints for ignored $i with unignored file" '
@@ -44,8 +44,8 @@ do
                git ls-files "$i" >out &&
                ! test -s out
        '
-       test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i with unignored file output" '
-               grep -e "Use -f if" err
+       test_expect_success "complaints for ignored $i with unignored file output" '
+               test_i18ngrep -e "Use -f if" err
        '
 done
 
@@ -61,10 +61,10 @@ do
                )
        '
 
-       test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in dir output" '
+       test_expect_success "complaints for ignored $i in dir output" '
                (
                        cd dir &&
-                       grep -e "Use -f if" err
+                       test_i18ngrep -e "Use -f if" err
                )
        '
 done
@@ -81,10 +81,10 @@ do
                )
        '
 
-       test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in sub output" '
+       test_expect_success "complaints for ignored $i in sub output" '
                (
                        cd sub &&
-                       grep -e "Use -f if" err
+                       test_i18ngrep -e "Use -f if" err
                )
        '
 done
index 806fdccce1db994899509cb3dd9d7801b84c48ba..0c02d569520ddc81b32db7d248197562d00bd7ea 100755 (executable)
@@ -312,20 +312,20 @@ test_expect_success 'merge-recursive result' '
 
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fail if the index has unresolved entries' '
+test_expect_success 'fail if the index has unresolved entries' '
 
        rm -fr [abcd] &&
        git checkout -f "$c1" &&
 
        test_must_fail git merge "$c5" &&
        test_must_fail git merge "$c5" 2> out &&
-       grep "not possible because you have unmerged files" out &&
+       test_i18ngrep "not possible because you have unmerged files" out &&
        git add -u &&
        test_must_fail git merge "$c5" 2> out &&
-       grep "You have not concluded your merge" out &&
+       test_i18ngrep "You have not concluded your merge" out &&
        rm -f .git/MERGE_HEAD &&
        test_must_fail git merge "$c5" 2> out &&
-       grep "Your local changes to the following files would be overwritten by merge:" out
+       test_i18ngrep "Your local changes to the following files would be overwritten by merge:" out
 '
 
 test_expect_success 'merge-recursive remove conflict' '
index 463ef1909f5e31be078f504546f5ea8ab3154d3c..9e69c8c926620f06343e64e7b3aa3e4ada5a6b69 100755 (executable)
@@ -203,10 +203,12 @@ test_expect_success 'test deleting branch deletes branch config' \
      test -z "$(git config branch.my7.remote)" &&
      test -z "$(git config branch.my7.merge)"'
 
-test_expect_success C_LOCALE_OUTPUT 'test deleting branch without config' \
+test_expect_success 'test deleting branch without config' \
     'git branch my7 s &&
      sha1=$(git rev-parse my7 | cut -c 1-7) &&
-     test "$(git branch -d my7 2>&1)" = "Deleted branch my7 (was $sha1)."'
+     echo "Deleted branch my7 (was $sha1)." >expect &&
+     git branch -d my7 >actual 2>&1 &&
+     test_i18ncmp expect actual'
 
 test_expect_success 'test --track without .fetch entries' \
     'git branch --track my8 &&
index 4ef7d09115678ff97717a5f6a3027a87490dac79..6b7c118e4fcbf3855318b2e9e3b721d07950fd25 100755 (executable)
@@ -72,10 +72,10 @@ cat >expect <<'EOF'
   branch-two
   master
 EOF
-test_expect_success C_LOCALE_OUTPUT 'git branch shows detached HEAD properly' '
+test_expect_success 'git branch shows detached HEAD properly' '
        git checkout HEAD^0 &&
        git branch >actual &&
-       test_cmp expect actual
+       test_i18ncmp expect actual
 '
 
 test_done
index 753a6c972cda61d2da3d2ecf7bd9c231004d6ad0..595d2ff990ad3305f47977431c0b7d102ca3866b 100755 (executable)
@@ -91,12 +91,12 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
        )
 '
 
-test_expect_success C_LOCALE_OUTPUT 'revert forbidden on dirty working tree' '
+test_expect_success 'revert forbidden on dirty working tree' '
 
        echo content >extra_file &&
        git add extra_file &&
        test_must_fail git revert HEAD 2>errors &&
-       grep "Your local changes would be overwritten by " errors
+       test_i18ngrep "Your local changes would be overwritten by " errors
 
 '
 
index b0faa299183df5fe06ccaf383bce47cbb9a0cf89..9aefe3a1becac200f2c29beee84fab278f9fcfa0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='test cherry-picking a root commit'
+test_description='test cherry-picking (and reverting) a root commit'
 
 . ./test-lib.sh
 
@@ -23,7 +23,30 @@ test_expect_success setup '
 test_expect_success 'cherry-pick a root commit' '
 
        git cherry-pick master &&
-       test first = $(cat file1)
+       echo first >expect &&
+       test_cmp expect file1
+
+'
+
+test_expect_success 'revert a root commit' '
+
+       git revert master &&
+       test_path_is_missing file1
+
+'
+
+test_expect_success 'cherry-pick a root commit with an external strategy' '
+
+       git cherry-pick --strategy=resolve master &&
+       echo first >expect &&
+       test_cmp expect file1
+
+'
+
+test_expect_success 'revert a root commit with an external strategy' '
+
+       git revert --strategy=resolve master &&
+       test_path_is_missing file1
 
 '
 
index c0c8330c20e80f26d51b62c8999533c5692094de..212ec54aaf0d805bbdecd93f3311d248a57d5b08 100755 (executable)
@@ -44,7 +44,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '
        test "$head" = "$newhead"
 '
 
-test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' "
+test_expect_success 'advice from failed cherry-pick' "
        pristine_detach initial &&
 
        picked=\$(git rev-parse --short picked) &&
@@ -56,7 +56,7 @@ test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' "
        EOF
        test_must_fail git cherry-pick picked 2>actual &&
 
-       test_cmp expected actual
+       test_i18ncmp expected actual
 "
 
 test_expect_success 'failed cherry-pick sets CHERRY_PICK_HEAD' '
index 7de42faf4887c6e8137c2498a96b41a4afe4e672..575d9508a09911f9d95dad2786fb2f1494abc093 100755 (executable)
@@ -271,9 +271,9 @@ test_expect_success 'git add --dry-run of non-existing file' "
        test_must_fail git add --dry-run track-this ignored-file >actual 2>&1
 "
 
-test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' "
+test_expect_success 'git add --dry-run of an existing file output' "
        echo \"fatal: pathspec 'ignored-file' did not match any files\" >expect &&
-       test_cmp expect actual
+       test_i18ncmp expect actual
 "
 
 cat >expect.err <<\EOF
@@ -290,9 +290,9 @@ test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
        test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err
 '
 
-test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+test_expect_success 'git add --dry-run --ignore-missing of non-existing file output' '
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_done
index cad85450b78891a98a0b60af1422c62c7288265c..844277cfa605f51cccd5d78a48a83fb75c03af9b 100755 (executable)
@@ -64,17 +64,42 @@ test_expect_success \
     'validate the output.' \
     'compare_diff_patch current expected'
 
-test_expect_success C_LOCALE_OUTPUT 'favour same basenames over different ones' '
+test_expect_success 'favour same basenames over different ones' '
        cp path1 another-path &&
        git add another-path &&
        git commit -m 1 &&
        git rm path1 &&
        mkdir subdir &&
        git mv another-path subdir/path1 &&
-       git status | grep "renamed: .*path1 -> subdir/path1"'
+       git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"'
 
-test_expect_success C_LOCALE_OUTPUT  'favour same basenames even with minor differences' '
+test_expect_success 'favour same basenames even with minor differences' '
        git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
-       git status | grep "renamed: .*path1 -> subdir/path1"'
+       git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"'
+
+test_expect_success 'setup for many rename source candidates' '
+       git reset --hard &&
+       for i in 0 1 2 3 4 5 6 7 8 9;
+       do
+               for j in 0 1 2 3 4 5 6 7 8 9;
+               do
+                       echo "$i$j" >"path$i$j"
+               done
+       done &&
+       git add "path??" &&
+       test_tick &&
+       git commit -m "hundred" &&
+       (cat path1; echo new) >new-path &&
+       echo old >>path1 &&
+       git add new-path path1 &&
+       git diff -l 4 -C -C --cached --name-status >actual 2>actual.err &&
+       sed -e "s/^\([CM]\)[0-9]*       /\1     /" actual >actual.munged &&
+       cat >expect <<-EOF &&
+       C       path1   new-path
+       M       path1
+       EOF
+       test_cmp expect actual.munged &&
+       grep warning actual.err
+'
 
 test_done
index dd406c44b509895cac0af3bfa08654823636f78e..4a3bf5ba4015f5581ccb1b96f5888aa1f5dfdc1d 100755 (executable)
@@ -614,13 +614,13 @@ echo "fatal: --name-only does not make sense" > expect.name-only
 echo "fatal: --name-status does not make sense" > expect.name-status
 echo "fatal: --check does not make sense" > expect.check
 
-test_expect_success C_LOCALE_OUTPUT 'options no longer allowed for format-patch' '
+test_expect_success 'options no longer allowed for format-patch' '
        test_must_fail git format-patch --name-only 2> output &&
-       test_cmp expect.name-only output &&
+       test_i18ncmp expect.name-only output &&
        test_must_fail git format-patch --name-status 2> output &&
-       test_cmp expect.name-status output &&
+       test_i18ncmp expect.name-status output &&
        test_must_fail git format-patch --check 2> output &&
-       test_cmp expect.check output'
+       test_i18ncmp expect.check output'
 
 test_expect_success 'format-patch --numstat should produce a patch' '
        git format-patch --numstat --stdout master..side > output &&
index 37aeab0d5c7415a54384c90708626f6a5807acee..c374aa4c1c60e9a12cf1ebf5587daf3656e4851a 100755 (executable)
@@ -307,4 +307,30 @@ test_language_driver python
 test_language_driver ruby
 test_language_driver tex
 
+test_expect_success 'word-diff with diff.sbe' '
+       cat >expect <<-\EOF &&
+       diff --git a/pre b/post
+       index a1a53b5..bc8fe6d 100644
+       --- a/pre
+       +++ b/post
+       @@ -1,3 +1,3 @@
+       a
+
+       [-b-]{+c+}
+       EOF
+       cat >pre <<-\EOF &&
+       a
+
+       b
+       EOF
+       cat >post <<-\EOF &&
+       a
+
+       c
+       EOF
+       test_when_finished "git config --unset diff.suppress-blank-empty" &&
+       git config diff.suppress-blank-empty true &&
+       word_diff --word-diff=plain
+'
+
 test_done
index af78e21ba913b465e7bf2e4149549d32de9d4240..a1fddd4d15fb2c3cb5d0ab6e09a461314fb4b1f1 100755 (executable)
@@ -66,12 +66,9 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "fetch --recurse-submodules recurses into submodules: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "fetch alone only fetches superproject" '
@@ -98,12 +95,9 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
                cd downstream &&
                git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
                git fetch >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
@@ -132,12 +126,9 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
                git fetch --recurse-submodules >../actual.out 2>../actual.err &&
                git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
                git config --unset submodule.submodule.fetchRecurseSubmodules
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--quiet propagates to submodules" '
@@ -154,24 +145,18 @@ test_expect_success "--dry-run propagates to submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "--dry-run propagates to submodules: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "Without --dry-run propagates to submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "Without --dry-run propagates to submodules: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "recurseSubmodules=true propagates into submodules" '
@@ -180,12 +165,9 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
                cd downstream &&
                git config fetch.recurseSubmodules true
                git fetch >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "recurseSubmodules=true propagates into submodules: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--recurse-submodules overrides config in submodule" '
@@ -197,12 +179,9 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
                        git config fetch.recurseSubmodules false
                ) &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       )
-'
-
-test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides config in submodule: output" '
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       ) &&
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides config setting" '
@@ -243,8 +222,8 @@ test_expect_success "Recursion stops when no new submodule commits are fetched"
                cd downstream &&
                git fetch >../actual.out 2>../actual.err
        ) &&
-       test_cmp expect.err.sub actual.err &&
-       test_cmp expect.out.sub actual.out
+       test_i18ncmp expect.err.sub actual.err &&
+       test_i18ncmp expect.out.sub actual.out
 '
 
 test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
@@ -261,7 +240,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
                git fetch >../actual.out 2>../actual.err
        ) &&
        ! test -s actual.out &&
-       test_cmp expect.err.file actual.err
+       test_i18ncmp expect.err.file actual.err
 '
 
 test_expect_success "Recursion picks up config in submodule" '
@@ -289,8 +268,8 @@ test_expect_success "Recursion picks up config in submodule" '
                        git config --unset fetch.recurseSubmodules
                )
        ) &&
-       test_cmp expect.err.sub actual.err &&
-       test_cmp expect.out actual.out
+       test_i18ncmp expect.err.sub actual.err &&
+       test_i18ncmp expect.out actual.out
 '
 
 test_expect_success "Recursion picks up all submodules when necessary" '
@@ -321,8 +300,8 @@ test_expect_success "Recursion picks up all submodules when necessary" '
                cd downstream &&
                git fetch >../actual.out 2>../actual.err
        ) &&
-       test_cmp expect.err.2 actual.err &&
-       test_cmp expect.out actual.out
+       test_i18ncmp expect.err.2 actual.err &&
+       test_i18ncmp expect.out actual.out
 '
 
 test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
@@ -375,8 +354,8 @@ test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necess
                        git config --unset -f .gitmodules submodule.deepsubmodule.fetchRecursive
                )
        ) &&
-       test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err
+       test_i18ncmp expect.out actual.out &&
+       test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
@@ -393,7 +372,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
                git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
        ) &&
        ! test -s actual.out &&
-       test_cmp expect.err.file actual.err
+       test_i18ncmp expect.err.file actual.err
 '
 
 test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
@@ -420,8 +399,8 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
                cd downstream &&
                git config --unset fetch.recurseSubmodules
        ) &&
-       test_cmp expect.out.sub actual.out &&
-       test_cmp expect.err.2 actual.err
+       test_i18ncmp expect.out.sub actual.out &&
+       test_i18ncmp expect.err.2 actual.err
 '
 
 test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
@@ -448,8 +427,8 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
                cd downstream &&
                git config --unset submodule.submodule.fetchRecurseSubmodules
        ) &&
-       test_cmp expect.out.sub actual.out &&
-       test_cmp expect.err.2 actual.err
+       test_i18ncmp expect.out.sub actual.out &&
+       test_i18ncmp expect.err.2 actual.err
 '
 
 test_expect_success "don't fetch submodule when newly recorded commits are already present" '
@@ -468,7 +447,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
                git fetch >../actual.out 2>../actual.err
        ) &&
        ! test -s actual.out &&
-       test_cmp expect.err actual.err
+       test_i18ncmp expect.err actual.err
 '
 
 test_done
diff --git a/t/t5532-fetch-proxy.sh b/t/t5532-fetch-proxy.sh
new file mode 100755 (executable)
index 0000000..62f2460
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+test_description='fetching via git:// using core.gitproxy'
+. ./test-lib.sh
+
+test_expect_success 'setup remote repo' '
+       git init remote &&
+       (cd remote &&
+        echo content >file &&
+        git add file &&
+        git commit -m one
+       )
+'
+
+cat >proxy <<'EOF'
+#!/bin/sh
+echo >&2 "proxying for $*"
+cmd=`perl -e '
+       read(STDIN, $buf, 4);
+       my $n = hex($buf) - 4;
+       read(STDIN, $buf, $n);
+       my ($cmd, $other) = split /\0/, $buf;
+       # drop absolute-path on repo name
+       $cmd =~ s{ /}{ };
+       print $cmd;
+'`
+echo >&2 "Running '$cmd'"
+exec $cmd
+EOF
+chmod +x proxy
+test_expect_success 'setup local repo' '
+       git remote add fake git://example.com/remote &&
+       git config core.gitproxy ./proxy
+'
+
+test_expect_success 'fetch through proxy works' '
+       git fetch fake &&
+       echo one >expect &&
+       git log -1 --format=%s FETCH_HEAD >actual &&
+       test_cmp expect actual
+'
+
+test_done
index 0492877d516b8f33a8fd1555ec77a2aa3b34352c..d924056c8a16f6029f1f3227ef806f0def326bdd 100755 (executable)
@@ -135,8 +135,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
        grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
-       grep "To prevent you from losing history, non-fast-forward updates were rejected" \
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
+       test_i18ngrep "To prevent you from losing history, non-fast-forward updates were rejected" \
                output
 '
 
index 5a068b21e4aeac79863df657d6388ec4c2732d55..151ea531bdfeb5a012e57407749beb4f26de6d2a 100755 (executable)
@@ -194,11 +194,14 @@ test_expect_success 'do not respect url-encoding of non-url path' '
 test_expect_success 'clone separate gitdir' '
        rm -rf dst &&
        git clone --separate-git-dir realgitdir src dst &&
-       echo "gitdir: `pwd`/realgitdir" >expected &&
-       test_cmp expected dst/.git &&
        test -d realgitdir/refs
 '
 
+test_expect_success 'clone separate gitdir: output' '
+       echo "gitdir: `pwd`/realgitdir" >expected &&
+       test_cmp expected dst/.git
+'
+
 test_expect_success 'clone separate gitdir where target already exists' '
        rm -rf dst &&
        test_must_fail git clone --separate-git-dir realgitdir src dst
index f1c32dba423316641197dbfe19b2b95581acebad..667b37564e3d31ca060216e841b9a5d9e385c165 100755 (executable)
@@ -58,4 +58,21 @@ check side-3 ^side-4 -- file-3
 check side-3 ^side-2
 check side-3 ^side-2 -- file-1
 
+test_expect_success 'not only --stdin' '
+       cat >expect <<-EOF &&
+       7
+
+       file-1
+       file-2
+       EOF
+       cat >input <<-EOF &&
+       ^master^
+       --
+       file-2
+       EOF
+       git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
+               <input >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 6c3719141aa567b97de1228f53a6c49eaf139e8e..a9b0ac1efc0eac3f50bd9fe26e5900307eddaba2 100755 (executable)
@@ -42,13 +42,13 @@ b3 behind 1
 b4 ahead 2
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'branch -v' '
+test_expect_success 'branch -v' '
        (
                cd test &&
                git branch -v
        ) |
        sed -n -e "$script" >actual &&
-       test_cmp expect actual
+       test_i18ncmp expect actual
 '
 
 test_expect_success 'checkout' '
index 18269962458248034598d2bb15315f0d2a121027..f67aa6ff6a3c2af2d0c1999e8203da3a922b0555 100755 (executable)
@@ -123,8 +123,8 @@ cat - >err.expect <<EOF
 warning: tag 'A' is really 'Q' here
 EOF
 check_describe A-* HEAD
-test_expect_success C_LOCALE_OUTPUT 'warning was displayed for Q' '
-       test_cmp err.expect err.actual
+test_expect_success 'warning was displayed for Q' '
+       test_i18ncmp err.expect err.actual
 '
 test_expect_success 'rename tag Q back to A' '
        mv .git/refs/tags/Q .git/refs/tags/A
index 1dedfd0c836c06eb3d2f66aa8e4e7eac54368508..2ac1c66079b7656a60a25fbbb91c48c0b1db010b 100755 (executable)
@@ -1120,13 +1120,11 @@ test_expect_success \
        ! (GIT_EDITOR=cat git tag -a initial-comment > actual)
 '
 
-test_expect_success \
-       C_LOCALE_OUTPUT \
-       'message in editor has initial comment: first line' '
+test_expect_success 'message in editor has initial comment: first line' '
        # check the first line --- should be empty
        echo >first.expect &&
        sed -e 1q <actual >first.actual &&
-       test_cmp first.expect first.actual
+       test_i18ncmp first.expect first.actual
 '
 
 test_expect_success \
index c4104009e1c1f75c5d094b92d00d82a0d7ece2ae..9ceaa4049f960f20ca37d58e58e9e6c4e9ff4398 100755 (executable)
@@ -124,16 +124,16 @@ cat >expected <<EOF
 Would remove expected
 Would remove result
 EOF
-test_expect_success C_LOCALE_OUTPUT 'git-clean, absent case' '
+test_expect_success 'git-clean, absent case' '
        setup_absent &&
        git clean -n > result &&
-       test_cmp expected result
+       test_i18ncmp expected result
 '
 
-test_expect_success C_LOCALE_OUTPUT 'git-clean, dirty case' '
+test_expect_success 'git-clean, dirty case' '
        setup_dirty &&
        git clean -n > result &&
-       test_cmp expected result
+       test_i18ncmp expected result
 '
 
 #TODO test_expect_failure 'git-apply adds file' false
index 3a5d927f83730f53a67cfec76a0625008dfb71f2..b8cb4906aa7de022543b594399b6fa9a83ffc847 100755 (executable)
@@ -38,7 +38,7 @@ cat >expect <<EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
+test_expect_success 'M/D conflict does not segfault' '
        mkdir mdconflict &&
        (
                cd mdconflict &&
@@ -50,9 +50,9 @@ test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
                git commit -m delete &&
                test_must_fail git merge master &&
                test_must_fail git commit --dry-run >../actual &&
-               test_cmp ../expect ../actual &&
+               test_i18ncmp ../expect ../actual &&
                git status >../actual &&
-               test_cmp ../expect ../actual
+               test_i18ncmp ../expect ../actual
        )
 '
 
index 7be2ff38fc92088d4caff9ea13b1d78a1b040b40..f1cfc9ac959ee281d50f7b8a51fdcefd2d0670e7 100755 (executable)
@@ -423,10 +423,10 @@ Unstaged changes after reset:
 M      file2
 EOF
 
-test_expect_success C_LOCALE_OUTPUT '--mixed refreshes the index' '
+test_expect_success '--mixed refreshes the index' '
        echo 123 >> file2 &&
        git reset --mixed HEAD > output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 test_expect_success 'disambiguation (1)' '
index b42820ad6976590fe195637d5e85d1b4db963cda..a82a07a04a8500cdac2cfb7ef39fb3f5981f437f 100755 (executable)
@@ -233,11 +233,11 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    C     --keep   (disallowed)
-test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD^" fails with pending merge' '
+test_expect_success '"reset --keep HEAD^" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD^ 2>err.log &&
-    grep "middle of a merge" err.log
+    test_i18ngrep "middle of a merge" err.log
 '
 
 # The next test will test the following:
@@ -259,11 +259,11 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
 #           working index HEAD target         working index HEAD
 #           ----------------------------------------------------
 # file1:     X       U     B    B     --keep   (disallowed)
-test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD" fails with pending merge' '
+test_expect_success '"reset --keep HEAD" fails with pending merge' '
     git reset --hard third &&
     test_must_fail git merge branch1 &&
     test_must_fail git reset --keep HEAD 2>err.log &&
-    grep "middle of a merge" err.log
+    test_i18ngrep "middle of a merge" err.log
 '
 
 test_expect_success '--merge is ok with added/deleted merge' '
@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '
     git diff --exit-code --cached
 '
 
-test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '
+test_expect_success '--keep fails with added/deleted merge' '
     git reset --hard third &&
     rm -f file2 &&
     test_must_fail git merge branch3 &&
@@ -289,7 +289,7 @@ test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '
     git diff --exit-code file3 &&
     git diff --exit-code branch3 file3 &&
     test_must_fail git reset --keep HEAD 2>err.log &&
-    grep "middle of a merge" err.log
+    test_i18ngrep "middle of a merge" err.log
 '
 
 test_done
index 37ed0931d9499791a6b3336efb97385356df6157..07fb53adcbc06e260b078de546bd07f11093071d 100755 (executable)
@@ -223,12 +223,12 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
        test_cmp two expect
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declined)' '
+test_expect_success 'checkout to detach HEAD (with advice declined)' '
 
        git config advice.detachedHead false &&
        git checkout -f renamer && git clean -f &&
        git checkout renamer^ 2>messages &&
-       grep "HEAD is now at 7329388" messages &&
+       test_i18ngrep "HEAD is now at 7329388" messages &&
        test 1 -eq $(wc -l <messages) &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
@@ -242,11 +242,11 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declin
        fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
+test_expect_success 'checkout to detach HEAD' '
        git config advice.detachedHead true &&
        git checkout -f renamer && git clean -f &&
        git checkout renamer^ 2>messages &&
-       grep "HEAD is now at 7329388" messages &&
+       test_i18ngrep "HEAD is now at 7329388" messages &&
        test 1 -lt $(wc -l <messages) &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
@@ -260,7 +260,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
        fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
+test_expect_success 'checkout to detach HEAD with branchname^' '
 
        git checkout -f master && git clean -f &&
        git checkout renamer^ &&
@@ -276,7 +276,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
        fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
+test_expect_success 'checkout to detach HEAD with :/message' '
 
        git checkout -f master && git clean -f &&
        git checkout ":/Initial" &&
@@ -292,7 +292,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
        fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with HEAD^0' '
+test_expect_success 'checkout to detach HEAD with HEAD^0' '
 
        git checkout -f master && git clean -f &&
        git checkout HEAD^0 &&
index bcdf0847d0970f544e96afa0036ec12800422fd8..47096f9014a0f36251eeb643ea302555e9ddc4d5 100755 (executable)
@@ -15,7 +15,7 @@ commit_msg_is () {
 
        printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
        printf "%s" "$1" >$actual &&
-       test_cmp $expect $actual
+       test_i18ncmp $expect $actual
 }
 
 # A sanity check to see if commit is working at all.
@@ -72,7 +72,7 @@ test_expect_success 'adding comments to a template should not commit' '
        )
 '
 
-test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should commit' '
+test_expect_success 'adding real content to a template should commit' '
        (
                test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
                git commit --template "$TEMPLATE"
@@ -80,7 +80,7 @@ test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should co
        commit_msg_is "template linecommit message"
 '
 
-test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '
+test_expect_success '-t option should be short for --template' '
        echo "short template" > "$TEMPLATE" &&
        echo "new content" >> foo &&
        git add foo &&
@@ -91,7 +91,7 @@ test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '
        commit_msg_is "short templatecommit message"
 '
 
-test_expect_success C_LOCALE_OUTPUT 'config-specified template should commit' '
+test_expect_success 'config-specified template should commit' '
        echo "new template" > "$TEMPLATE" &&
        git config commit.template "$TEMPLATE" &&
        echo "more content" >> foo &&
@@ -290,7 +290,7 @@ test_expect_success 'commit --squash works with -c for same commit' '
        commit_msg_is "squash! edited commit"
 '
 
-test_expect_success C_LOCALE_OUTPUT 'commit --squash works with editor' '
+test_expect_success 'commit --squash works with editor' '
        commit_for_rebase_autosquash_setup &&
        test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
        git commit --squash HEAD~1 &&
index a76c47419590ed16c53b8d4d82c2d92c11853154..7f7f7c7b95475b3b0673de00b68914a08098aead 100755 (executable)
@@ -16,9 +16,10 @@ test_expect_success \
        "echo 'bongo bongo' >file &&
         git add file"
 
-test_expect_success C_LOCALE_OUTPUT \
-       "Constructing initial commit" \
-       "git status | grep 'Initial commit'"
+test_expect_success "Constructing initial commit" '
+       git status >actual &&
+       test_i18ngrep "Initial commit" actual
+'
 
 test_expect_success \
        "fail initial amend" \
index cfb569eaba657501cf0361bee8c3f7c172ed1c06..3f3adc31b98773d26715089c25d8d923dd342717 100755 (executable)
@@ -22,10 +22,7 @@ check_summary_oneline() {
        SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
        echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
 
-       if test_have_prereq C_LOCALE_OUTPUT
-       then
-               test_cmp exp act
-       fi
+       test_i18ncmp exp act
 }
 
 test_expect_success 'output summary format' '
@@ -234,23 +231,19 @@ echo "sample
 # Please enter the commit message for your changes. Lines starting
 # with '#' will be ignored, and an empty message aborts the commit." >expect
 
-test_expect_success C_LOCALE_OUTPUT 'cleanup commit messages (strip,-F,-e): output' '
-       test_cmp expect actual
+test_expect_success 'cleanup commit messages (strip,-F,-e): output' '
+       test_i18ncmp expect actual
 '
 
 echo "#
 # Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
 #" >> expect
 
-test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
-
+test_expect_success 'author different from committer' '
        echo >>negative &&
-       git commit -e -m "sample"
-       head -n 7 .git/COMMIT_EDITMSG >actual
-'
-
-test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '
-       test_cmp expect actual
+       test_might_fail git commit -e -m "sample" &&
+       head -n 7 .git/COMMIT_EDITMSG >actual &&
+       test_i18ncmp expect actual
 '
 
 mv expect expect.tmp
@@ -259,7 +252,7 @@ rm -f expect.tmp
 echo "# Committer:
 #" >> expect
 
-test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
+test_expect_success 'committer is automatic' '
 
        echo >>negative &&
        (
@@ -270,10 +263,7 @@ test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
        ) &&
        head -n 8 .git/COMMIT_EDITMSG | \
        sed "s/^# Committer: .*/# Committer:/" >actual
-'
-
-test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '
-       test_cmp expect actual
+       test_i18ncmp expect actual
 '
 
 pwd=`pwd`
@@ -376,78 +366,78 @@ try_commit () {
        GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
        case "$use_template" in
        '')
-               ! grep "^## Custom template" .git/COMMIT_EDITMSG ;;
+               test_i18ngrep ! "^## Custom template" .git/COMMIT_EDITMSG ;;
        *)
-               grep "^## Custom template" .git/COMMIT_EDITMSG ;;
+               test_i18ngrep "^## Custom template" .git/COMMIT_EDITMSG ;;
        esac
 }
 
 try_commit_status_combo () {
 
-       test_expect_success C_LOCALE_OUTPUT 'commit' '
+       test_expect_success 'commit' '
                clear_config commit.status &&
                try_commit "" &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit' '
+       test_expect_success 'commit' '
                clear_config commit.status &&
                try_commit "" &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --status' '
+       test_expect_success 'commit --status' '
                clear_config commit.status &&
                try_commit --status &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --no-status' '
+       test_expect_success 'commit --no-status' '
                clear_config commit.status &&
                try_commit --no-status &&
-               ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = yes' '
+       test_expect_success 'commit with commit.status = yes' '
                clear_config commit.status &&
                git config commit.status yes &&
                try_commit "" &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = no' '
+       test_expect_success 'commit with commit.status = no' '
                clear_config commit.status &&
                git config commit.status no &&
                try_commit "" &&
-               ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = yes' '
+       test_expect_success 'commit --status with commit.status = yes' '
                clear_config commit.status &&
                git config commit.status yes &&
                try_commit --status &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = yes' '
+       test_expect_success 'commit --no-status with commit.status = yes' '
                clear_config commit.status &&
                git config commit.status yes &&
                try_commit --no-status &&
-               ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = no' '
+       test_expect_success 'commit --status with commit.status = no' '
                clear_config commit.status &&
                git config commit.status no &&
                try_commit --status &&
-               grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
-       test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = no' '
+       test_expect_success 'commit --no-status with commit.status = no' '
                clear_config commit.status &&
                git config commit.status no &&
                try_commit --no-status &&
-               ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
+               test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
 }
index c56733253fe335af9cbd12d19e776e35bd335994..c8d50a65672fdc00ccb42e6b7cece44b255623f1 100755 (executable)
@@ -20,21 +20,21 @@ test_expect_success 'setup' '
        git commit -m "Add submodule sub"
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status clean' '
+test_expect_success 'status clean' '
        git status >output &&
-       grep "nothing to commit" output
+       test_i18ngrep "nothing to commit" output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'commit --dry-run -a clean' '
+test_expect_success 'commit --dry-run -a clean' '
        test_must_fail git commit --dry-run -a >output &&
-       grep "nothing to commit" output
+       test_i18ngrep "nothing to commit" output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with modified file in submodule' '
+test_expect_success 'status with modified file in submodule' '
        (cd sub && git reset --hard) &&
        echo "changed" >sub/foo &&
        git status >output &&
-       grep "modified:   sub (modified content)" output
+       test_i18ngrep "modified:   sub (modified content)" output
 '
 
 test_expect_success 'status with modified file in submodule (porcelain)' '
@@ -46,10 +46,10 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with added file in submodule' '
+test_expect_success 'status with added file in submodule' '
        (cd sub && git reset --hard && echo >foo && git add foo) &&
        git status >output &&
-       grep "modified:   sub (modified content)" output
+       test_i18ngrep "modified:   sub (modified content)" output
 '
 
 test_expect_success 'status with added file in submodule (porcelain)' '
@@ -60,16 +60,16 @@ test_expect_success 'status with added file in submodule (porcelain)' '
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with untracked file in submodule' '
+test_expect_success 'status with untracked file in submodule' '
        (cd sub && git reset --hard) &&
        echo "content" >sub/new-file &&
        git status >output &&
-       grep "modified:   sub (untracked content)" output
+       test_i18ngrep "modified:   sub (untracked content)" output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status -uno with untracked file in submodule' '
+test_expect_success 'status -uno with untracked file in submodule' '
        git status -uno >output &&
-       grep "^nothing to commit" output
+       test_i18ngrep "^nothing to commit" output
 '
 
 test_expect_success 'status with untracked file in submodule (porcelain)' '
@@ -79,11 +79,11 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in submodule' '
+test_expect_success 'status with added and untracked file in submodule' '
        (cd sub && git reset --hard && echo >foo && git add foo) &&
        echo "content" >sub/new-file &&
        git status >output &&
-       grep "modified:   sub (modified content, untracked content)" output
+       test_i18ngrep "modified:   sub (modified content, untracked content)" output
 '
 
 test_expect_success 'status with added and untracked file in submodule (porcelain)' '
@@ -95,13 +95,13 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with modified file in modified submodule' '
+test_expect_success 'status with modified file in modified submodule' '
        (cd sub && git reset --hard) &&
        rm sub/new-file &&
        (cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
        echo "changed" >sub/foo &&
        git status >output &&
-       grep "modified:   sub (new commits, modified content)" output
+       test_i18ngrep "modified:   sub (new commits, modified content)" output
 '
 
 test_expect_success 'status with modified file in modified submodule (porcelain)' '
@@ -113,10 +113,10 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule' '
+test_expect_success 'status with added file in modified submodule' '
        (cd sub && git reset --hard && echo >foo && git add foo) &&
        git status >output &&
-       grep "modified:   sub (new commits, modified content)" output
+       test_i18ngrep "modified:   sub (new commits, modified content)" output
 '
 
 test_expect_success 'status with added file in modified submodule (porcelain)' '
@@ -127,11 +127,11 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with untracked file in modified submodule' '
+test_expect_success 'status with untracked file in modified submodule' '
        (cd sub && git reset --hard) &&
        echo "content" >sub/new-file &&
        git status >output &&
-       grep "modified:   sub (new commits, untracked content)" output
+       test_i18ngrep "modified:   sub (new commits, untracked content)" output
 '
 
 test_expect_success 'status with untracked file in modified submodule (porcelain)' '
@@ -141,11 +141,11 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
        EOF
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in modified submodule' '
+test_expect_success 'status with added and untracked file in modified submodule' '
        (cd sub && git reset --hard && echo >foo && git add foo) &&
        echo "content" >sub/new-file &&
        git status >output &&
-       grep "modified:   sub (new commits, modified content, untracked content)" output
+       test_i18ngrep "modified:   sub (new commits, modified content, untracked content)" output
 '
 
 test_expect_success 'status with added and untracked file in modified submodule (porcelain)' '
@@ -167,24 +167,24 @@ test_expect_success 'setup .git file for sub' '
         git commit -m "added .real to .gitignore" .gitignore
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule with .git file' '
+test_expect_success 'status with added file in modified submodule with .git file' '
        (cd sub && git reset --hard && echo >foo && git add foo) &&
        git status >output &&
-       grep "modified:   sub (new commits, modified content)" output
+       test_i18ngrep "modified:   sub (new commits, modified content)" output
 '
 
 test_expect_success 'rm submodule contents' '
        rm -rf sub/* sub/.git
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status clean (empty submodule dir)' '
+test_expect_success 'status clean (empty submodule dir)' '
        git status >output &&
-       grep "nothing to commit" output
+       test_i18ngrep "nothing to commit" output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status -a clean (empty submodule dir)' '
+test_expect_success 'status -a clean (empty submodule dir)' '
        test_must_fail git commit --dry-run -a >output &&
-       grep "nothing to commit" output
+       test_i18ngrep "nothing to commit" output
 '
 
 test_done
index a93e70fac446f0b062abe9109658d54b7c321819..cd6e2c5e871230a43f504e165498139d8ec7a3d2 100755 (executable)
@@ -16,7 +16,7 @@ test_expect_success 'status -h in broken repository' '
                echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
                test_expect_code 129 git status -h >usage 2>&1
        ) &&
-       grep "[Uu]sage" broken/usage
+       test_i18ngrep "[Uu]sage" broken/usage
 '
 
 test_expect_success 'commit -h in broken repository' '
@@ -28,7 +28,7 @@ test_expect_success 'commit -h in broken repository' '
                echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
                test_expect_code 129 git commit -h >usage 2>&1
        ) &&
-       grep "[Uu]sage" broken/usage
+       test_i18ngrep "[Uu]sage" broken/usage
 '
 
 test_expect_success 'setup' '
@@ -55,10 +55,8 @@ test_expect_success 'setup' '
        git add dir2/added
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (1)' '
-
-       grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
-
+test_expect_success 'status (1)' '
+       test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
 '
 
 cat >expect <<\EOF
@@ -85,11 +83,9 @@ cat >expect <<\EOF
 #      untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status (2)' '
-
+test_expect_success 'status (2)' '
        git status >output &&
-       test_cmp expect output
-
+       test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -109,17 +105,14 @@ cat >expect <<\EOF
 #      untracked
 EOF
 
-git config advice.statusHints false
-
-test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '
-
+test_expect_success 'status (advice.statusHints false)' '
+       test_when_finished "git config --unset advice.statusHints" &&
+       git config advice.statusHints false &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 
 '
 
-git config --unset advice.statusHints
-
 cat >expect <<\EOF
  M dir1/modified
 A  dir2/added
@@ -178,16 +171,16 @@ cat >expect <<EOF
 #
 # Untracked files not listed (use -u option to show untracked files)
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -uno' '
+test_expect_success 'status -uno' '
        git status -uno >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '
+test_expect_success 'status (status.showUntrackedFiles no)' '
        git config status.showuntrackedfiles no
        test_when_finished "git config --unset status.showuntrackedfiles" &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -201,9 +194,9 @@ cat >expect <<EOF
 # Untracked files not listed
 EOF
 git config advice.statusHints false
-test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '
+test_expect_success 'status -uno (advice.statusHints false)' '
        git status -uno >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 git config --unset advice.statusHints
 
@@ -246,16 +239,16 @@ cat >expect <<EOF
 #      output
 #      untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
+test_expect_success 'status -unormal' '
        git status -unormal >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '
+test_expect_success 'status (status.showUntrackedFiles normal)' '
        git config status.showuntrackedfiles normal
        test_when_finished "git config --unset status.showuntrackedfiles" &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -305,15 +298,16 @@ cat >expect <<EOF
 #      output
 #      untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -uall' '
+test_expect_success 'status -uall' '
        git status -uall >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '
+
+test_expect_success 'status (status.showUntrackedFiles all)' '
        git config status.showuntrackedfiles all
        test_when_finished "git config --unset status.showuntrackedfiles" &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 test_expect_success 'teardown dir3' '
@@ -367,11 +361,9 @@ cat >expect <<\EOF
 #      ../untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
-
+test_expect_success 'status with relative paths' '
        (cd dir1 && git status) >output &&
-       test_cmp expect output
-
+       test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -440,22 +432,18 @@ cat >expect <<\EOF
 #      <BLUE>untracked<RESET>
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
-
+test_expect_success 'status with color.ui' '
        git config color.ui always &&
        test_when_finished "git config --unset color.ui" &&
        git status | test_decode_color >output &&
-       test_cmp expect output
-
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with color.status' '
-
+test_expect_success 'status with color.status' '
        git config color.status always &&
        test_when_finished "git config --unset color.status" &&
        git status | test_decode_color >output &&
-       test_cmp expect output
-
+       test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -570,12 +558,12 @@ cat >expect <<\EOF
 EOF
 
 
-test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '
+test_expect_success 'status without relative paths' '
 
        git config status.relativePaths false &&
        test_when_finished "git config --unset status.relativePaths" &&
        (cd dir1 && git status) >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 
 '
 
@@ -616,11 +604,8 @@ cat <<EOF >expect
 #      untracked
 EOF
 test_expect_success 'dry-run of partial commit excluding new file in index' '
-       git commit --dry-run dir1/modified >output
-'
-
-test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '
-       test_cmp expect output
+       git commit --dry-run dir1/modified >output &&
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -667,15 +652,15 @@ cat >expect <<EOF
 #      output
 #      untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '
+test_expect_success 'status submodule summary is disabled by default' '
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 # we expect the same as the previous test
-test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '
+test_expect_success 'status --untracked-files=all does not show submodule' '
        git status --untracked-files=all >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -731,10 +716,10 @@ cat >expect <<EOF
 #      output
 #      untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
+test_expect_success 'status submodule summary' '
        git config status.submodulesummary 10 &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -773,15 +758,12 @@ cat >expect <<EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 test_expect_success 'status submodule summary (clean submodule): commit' '
-       git commit -m "commit submodule"
-'
-
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
+       git commit -m "commit submodule" &&
        git config status.submodulesummary 10 &&
        test_must_fail git commit --dry-run >output &&
-       test_cmp expect output &&
+       test_i18ncmp expect output &&
        git status >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -827,10 +809,10 @@ cat >expect <<EOF
 #      output
 #      untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '
+test_expect_success 'commit --dry-run submodule summary (--amend)' '
        git config status.submodulesummary 10 &&
        git commit --dry-run --amend >output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
@@ -882,84 +864,84 @@ cat > expect << EOF
 #      untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '
-       echo modified > sm/untracked &&
-       git status --ignore-submodules=untracked > output &&
-       test_cmp expect output
+test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
+       echo modified  sm/untracked &&
+       git status --ignore-submodules=untracked >output &&
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '
+test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
        git config diff.ignoreSubmodules dirty &&
        git status >output &&
-       test_cmp expect output &&
+       test_i18ncmp expect output &&
        git config --add -f .gitmodules submodule.subname.ignore untracked &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname &&
        git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '
+test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore untracked &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config --remove-section -f .gitmodules submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '
-       git status --ignore-submodules=dirty > output &&
-       test_cmp expect output
+test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
+       git status --ignore-submodules=dirty >output &&
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '
+test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
        git config diff.ignoreSubmodules dirty &&
        git status >output &&
        ! test -s actual &&
        git config --add -f .gitmodules submodule.subname.ignore dirty &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname &&
        git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '
+test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore dirty &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '
-       echo modified > sm/foo &&
-       git status --ignore-submodules=dirty > output &&
-       test_cmp expect output
+test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
+       echo modified >sm/foo &&
+       git status --ignore-submodules=dirty >output &&
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '
+test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
        git config --add -f .gitmodules submodule.subname.ignore dirty &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '
+test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore dirty &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -996,26 +978,26 @@ cat > expect << EOF
 #      untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
+test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
        git status --ignore-submodules=untracked > output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
        git config --add -f .gitmodules submodule.subname.ignore untracked &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore untracked &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -1058,49 +1040,49 @@ cat > expect << EOF
 #      untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodule summary" '
+test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
        git status --ignore-submodules=untracked > output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodule summary" '
+test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
        git config --add -f .gitmodules submodule.subname.ignore untracked &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodule summary" '
+test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore untracked &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=dirty doesn't suppress submodule summary" '
+test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
        git status --ignore-submodules=dirty > output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=dirty doesn't suppress submodule summary" '
+test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
        git config --add -f .gitmodules submodule.subname.ignore dirty &&
        git config --add -f .gitmodules submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=dirty doesn't suppress submodule summary" '
+test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
        git config --add -f .gitmodules submodule.subname.ignore none &&
        git config --add -f .gitmodules submodule.subname.path sm &&
        git config --add submodule.subname.ignore dirty &&
        git config --add submodule.subname.path sm &&
-       git status > output &&
-       test_cmp expect output &&
+       git status >output &&
+       test_i18ncmp expect output &&
        git config --remove-section submodule.subname &&
        git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -1126,9 +1108,9 @@ cat > expect << EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=all suppresses submodule summary" '
+test_expect_success "--ignore-submodules=all suppresses submodule summary" '
        git status --ignore-submodules=all > output &&
-       test_cmp expect output
+       test_i18ncmp expect output
 '
 
 test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
index 5463f87e6864eca224d63ede6b3a246924689cc6..2d4ed206e122f78dac05daf51da4446a24181301 100755 (executable)
@@ -527,10 +527,10 @@ test_expect_success 'merge fast-forward in a dirty tree' '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
-test_expect_success C_LOCALE_OUTPUT 'in-index merge' '
+test_expect_success 'in-index merge' '
        git reset --hard c0 &&
        git merge --no-ff -s resolve c1 >out &&
-       grep "Wonderful." out &&
+       test_i18ngrep "Wonderful." out &&
        verify_parents $c0 $c1
 '
 
index ef84f04102ed067768c66ea9608b98d47851eb8b..72a8731d5e28d71577d0c53fc25a5ddc1d2ad6de 100755 (executable)
@@ -150,11 +150,8 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
        git rm -fr . &&
        git checkout --orphan new &&
        cp important c0.c &&
-       test_must_fail git merge c0 2>out
-'
-
-test_expect_success C_LOCALE_OUTPUT 'will not overwrite untracked file on unborn branch: output' '
-       test_cmp out expect
+       test_must_fail git merge c0 2>out &&
+       test_i18ncmp out expect
 '
 
 test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '
index cdb3f444cd4a5970df6f375382f5cea82ccaee06..7b4798e8e4791c78e94da1354ef7279fa456983d 100755 (executable)
@@ -46,11 +46,8 @@ test_expect_success 'setup' '
 pre_merge_head="$(git rev-parse HEAD)"
 
 test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
-       test_must_fail git merge --abort 2>output
-'
-
-test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (unstarted merge): fatal output' '
-       grep -q MERGE_HEAD output
+       test_must_fail git merge --abort 2>output &&
+       test_i18ngrep MERGE_HEAD output
 '
 
 test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
@@ -63,11 +60,8 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
        test ! -f .git/MERGE_HEAD &&
        # Merge successfully completed
        post_merge_head="$(git rev-parse HEAD)" &&
-       test_must_fail git merge --abort 2>output
-'
-
-test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (completed merge): output' '
-       grep -q MERGE_HEAD output
+       test_must_fail git merge --abort 2>output &&
+       test_i18ngrep MERGE_HEAD output
 '
 
 test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
index aedf484feeb9da05054f18ab2f4913865048fe35..a8957782cfb8fae4b7c171d4c9db24ce6cd5505e 100755 (executable)
@@ -61,9 +61,9 @@ test_expect_success SIMPLEPAGER 'git grep -O' '
        test_cmp empty out
 '
 
-test_expect_success C_LOCALE_OUTPUT 'git grep -O --cached' '
+test_expect_success 'git grep -O --cached' '
        test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
-       grep open-files-in-pager msg
+       test_i18ngrep open-files-in-pager msg
 '
 
 test_expect_success 'git grep -O --no-index' '
index 8a274fbe7916c6c2b661757e496788ee8463e664..a3fe16d2b0d1ce8383a7d8d22f3effa291f3eab0 100644 (file)
@@ -1080,6 +1080,32 @@ else
        test_set_prereq C_LOCALE_OUTPUT
 fi
 
+# Use this instead of test_cmp to compare files that contain expected and
+# actual output from git commands that can be translated.  When running
+# under GETTEXT_POISON this pretends that the command produced expected
+# results.
+test_i18ncmp () {
+       test -n "$GETTEXT_POISON" || test_cmp "$@"
+}
+
+# Use this instead of "grep expected-string actual" to see if the
+# output from a git command that can be translated either contains an
+# expected string, or does not contain an unwanted one.  When running
+# under GETTEXT_POISON this pretends that the command produced expected
+# results.
+test_i18ngrep () {
+       if test -n "$GETTEXT_POISON"
+       then
+           : # pretend success
+       elif test "x!" = "x$1"
+       then
+               shift
+               ! grep "$@"
+       else
+               grep "$@"
+       fi
+}
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
index 0612bfa7cd1909c8c4292b384fd7a56b8baf3c2a..37918e15f5ce06d0079ce09ae1a7be7b14533c48 100644 (file)
@@ -29,6 +29,8 @@ int main(int argc, char **argv)
                fprintf(stderr, "FAIL %s\n", argv[1]);
                return 1;
        }
+       if (!strcmp(argv[1], "run-command"))
+               exit(run_command(&proc));
 
        fprintf(stderr, "check usage\n");
        return 1;
index a02f79aae3d91ea4109d21a9ed9ca2d962125375..69dae711037ea7a54d86910932d74ac2b24b57fd 100644 (file)
@@ -156,7 +156,7 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
                        continue;
                if (!ref->peer_ref)
                        continue;
-               if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
+               if (is_null_sha1(ref->new_sha1))
                        continue;
 
                /* Follow symbolic refs (mainly for HEAD). */