Commit graph

28384 commits

Author SHA1 Message Date
Junio C Hamano ead8eb8c10 Update draft release notes to 1.7.9.3 for the last time
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 22:21:30 -08:00
Junio C Hamano 57f75f3131 Merge branch 'cn/maint-branch-with-bad' into maint
* cn/maint-branch-with-bad:
  branch: don't assume the merge filter ref exists

Conflicts:
	t/t3200-branch.sh
2012-03-04 22:17:52 -08:00
Junio C Hamano 3ecd0c8b4d Merge branch 'jn/maint-gitweb-invalid-regexp' into maint
* jn/maint-gitweb-invalid-regexp:
  gitweb: Handle invalid regexp in regexp search
2012-03-04 22:17:47 -08:00
Junio C Hamano 3fc242f5ab Merge branch 'nd/maint-verify-objects' into maint
* nd/maint-verify-objects:
  rev-list: fix --verify-objects --quiet becoming --objects
  rev-list: remove BISECT_SHOW_TRIED flag
2012-03-04 22:17:41 -08:00
Junio C Hamano a09a0c2709 Merge branch 'jk/maint-avoid-streaming-filtered-contents' into maint
* jk/maint-avoid-streaming-filtered-contents:
  do not stream large files to pack when filters are in use
  teach dry-run convert_to_git not to require a src buffer
  teach convert_to_git a "dry run" mode
2012-03-04 22:16:40 -08:00
Junio C Hamano c08afaf7b6 Merge branch 'jb/filter-ignore-sigpipe' into maint
* jb/filter-ignore-sigpipe:
  Ignore SIGPIPE when running a filter driver
2012-03-04 22:16:35 -08:00
Junio C Hamano a4d7615453 Merge branch 'sp/smart-http-failure-to-push' into maint
* sp/smart-http-failure-to-push:
  : Mask SIGPIPE on the command channel going to a transport helper
  disconnect from remote helpers more gently

Conflicts:
	transport-helper.c
2012-03-04 22:16:33 -08:00
Junio C Hamano 26f1e9bd68 Merge branch 'tr/maint-bundle-long-subject' into maint
* tr/maint-bundle-long-subject:
  t5704: match tests to modern style
  strbuf: improve strbuf_get*line documentation
  bundle: use a strbuf to scan the log for boundary commits
  bundle: put strbuf_readline_fd in strbuf.c with adjustments
2012-03-04 22:16:30 -08:00
Jiang Xin aa9565f7cc l10n: Update zh_CN translation for 1.7.9.2
In order to show detailed dirty status of submodules in long format,
git stripped the last ", " from the concatenate sting by a two-byte
backstep. So for keeping the two-byte backstep valid, won't touch the
end ", " for translation.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-05 13:33:43 +08:00
Johannes Sixt 4dce7d9b40 submodules: fix ambiguous absolute paths under Windows
Under Windows the "git rev-parse --git-dir" and "pwd" commands may return
either drive-letter-colon or POSIX style paths. This makes module_clone()
behave badly because it expects absolute paths to always start with a '/'.

Fix that by always converting the "c:/" notation into "/c/" when computing
the relative paths from gitdir to the submodule work tree and back.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:22:46 -08:00
Jens Lehmann 69c3051780 submodules: refactor computation of relative gitdir path
In module_clone() the rel_gitdir variable was computed differently when
"git rev-parse --git-dir" returned a relative path than when it returned
an absolute path. This is not optimal, as different code paths are used
depending on the return value of that command.

Fix that by reusing the differing path components computed for setting the
core.worktree config setting, which leaves a single code path for setting
both instead of having three and makes the code much shorter.

This also fixes the bug that in the computation of how many directories
have to be traversed up to hit the root directory of the submodule the
name of the submodule was used where the path should have been used. This
lead to problems after renaming submodules into another directory level.

Even though the "(cd $somewhere && pwd)" approach breaks the flexibility
of symlinks, that is no issue here as we have to have one relative path
pointing from the work tree to the gitdir and another pointing back, which
will never work anyway when a symlink along one of those paths is changed
because the directory it points to was moved.

Also add a test moving a submodule into a deeper directory to catch any
future breakage here and to document what has to be done when a submodule
needs to be moved until git mv learns to do that. Simply moving it to the
new location doesn't work, as the core.worktree and possibly the gitfile
setting too will be wrong. So it has to be removed from filesystem and
index, then the new location has to be added into the index and the
.gitmodules file has to be updated. After that a git submodule update will
check out the submodule at the new location.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:22:35 -08:00
Jens Lehmann d75219b4a8 submodules: always use a relative path from gitdir to work tree
Since recently a submodule with name <name> has its git directory in the
.git/modules/<name> directory of the superproject while the work tree
contains a gitfile pointing there. To make that work the git directory has
the core.worktree configuration set in its config file to point back to
the work tree.

That core.worktree is an absolute path set by the initial clone of the
submodule. A relative path is preferable here because it allows the
superproject to be moved around without invalidating that setting, so
compute and set that relative path after cloning or reactivating the
submodule.

This also fixes a bug when moving a submodule around inside the
superproject, as the current code forgot to update the setting to the new
submodule work tree location.

Enhance t7400 to ensure that future versions won't re-add absolute paths
by accident and that moving a superproject won't break submodules.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:20:27 -08:00
Jens Lehmann ea115a0d43 submodules: always use a relative path to gitdir
Since recently a submodule with name <name> has its git directory in the
.git/modules/<name> directory of the superproject while the work tree
contains a gitfile pointing there. When the submodule git directory needs
to be cloned because it is not found in .git/modules/<name> the clone
command will write an absolute path into the gitfile. When no clone is
necessary the git directory will be reactivated by the git-submodule.sh
script by writing a relative path into the gitfile.

This is inconsistent, as the behavior depends on the submodule having been
cloned before into the .git/modules of the superproject. A relative path
is preferable here because it allows the superproject to be moved around
without invalidating the gitfile. We do that by always writing the
relative path into the gitfile, which overwrites the absolute path the
clone command may have written there.

This is only the first step to make superprojects movable again like they
were before the separate-git-dir approach was introduced. The second step
is to use a relative path in core.worktree too.

Enhance t7400 to ensure that future versions won't re-add absolute paths
by accident.

While at it also replace an if/else construct evaluating the presence
of the 'reference' option with a single line of bash code.

Reported-by: Antony Male <antony.male@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:19:41 -08:00
Ramsay Jones f1589d1007 ctype.c: Fix a sparse warning
In particular, sparse complains as follows:

        SP ctype.c
    ctype.c:30:12: warning: symbol 'tolower_trans_tbl' was not declared.\
         Should it be static?

An appropriate extern declaration for the 'tolower_trans_tbl' symbol
is included in the "cache.h" header file. In order to suppress the
warning, therefore, we could replace the "git-compat-util.h" header
inclusion with "cache.h", since "cache.h" includes "git-compat-util.h"
in turn. Here, however, we choose to move the extern declaration for
'tolower_trans_tbl' into "git-compat-util.h", alongside the other
extern declaration from ctype.c for 'sane_ctype'.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:17:25 -08:00
Clemens Buchacher b2c8c6d944 http.proxy: also mention https_proxy and all_proxy
The current wording of the http.proxy documentation suggests that
http_proxy is somehow equivalent to http.proxy. However, while
http.proxy (by the means of curl's CURLOPT_PROXY option) overrides the
proxy for both HTTP and HTTPS protocols, the http_proxy environment
variable is used only for HTTP. But since the docs mention only
http_proxy, a user might expect it to apply to all HTTP-like protocols.

Avoid any such misunderstanding by explicitly mentioning https_proxy and
all_proxy as well.

Also replace linkgit:curl[1] with a literal 'curl(1)', because the
former gets translated to a dead link in the HTML pages.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 21:11:06 -08:00
René Scharfe 38916c5b47 parse-options: typo check for unknown switches
The user specifies a long option but forgets to type the second
leading dash, we currently detect and report that fact if its first
letter is a valid short option. This is done for safety, to avoid
ambiguity between short options (and their arguments) and a long
option with a missing dash.

This diagnostic message is also helpful for long options whose first
letter is not a valid short option, however. Print it in that case,
too, as a courtesy.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-04 18:28:59 -08:00
Jared Hance 15438d5a56 Add threaded versions of functions in symlinks.c.
check_leading_path() and has_dirs_only_path() both always use the default
cache, which could be a caveat for adding parallelism (which is a concern
and even a GSoC proposal).

Reimplement these two in terms of new threaded_check_leading_path() and
threaded_has_dirs_only_path() that take their own copy of the cache.

Signed-off-by: Jared Hance <jaredhance@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 23:56:28 -08:00
Michael J Gruber 78ed1d2d63 t0300: work around bug in dash 0.5.6
The construct 'while IFS== read' makes dash 0.5.6 execute
read without changing IFS, which results in test breakages
all over the place in t0300.  Neither dash 0.5.5.1 and older
nor dash 0.5.7 and newer are affected: The problem was
introduded resp. fixed by the commits

  55c46b7 ([BUILTIN] Honor tab as IFS whitespace when
           splitting fields in readcmd, 2009-08-11)

  1d806ac ([VAR] Do not poplocalvars prematurely on regular
           utilities, 2010-05-27)

in http://git.kernel.org/?p=utils/dash/dash.git

Putting 'IFS==' before that line makes all versions of dash
work.

This looks like a dash bug, not a misinterpretation of the
standard. However, it's worth working around for two
reasons. One, this version of dash was released in Fedora
14-16, so the bug is found in the wild. And two, at least
one other shell, Solaris /bin/sh, choked on this by
persisting IFS after the read invocation. That is not a
shell we usually care about, and I think this use of IFS is
acceptable by POSIX (which allows other behavior near
"special builtins", but "read" is not one of those). But it
seems that this may be a subtle, not-well-tested case for
some shells. Given that the workaround is so simple, it's
worth just being defensive.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 23:06:08 -08:00
Tom Grennan fe6c64ab0b t5512 (ls-remote): modernize style
Prepare expected output inside test_expect_success that uses it.
Also remove excess blank lines.

Signed-off-by: Tom Grennan <tmgrennan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 22:26:34 -08:00
Jakub Narebski b22939a286 gitweb: Fix passing parameters to git_project_search_form
The git_project_search_form() subroutine, introduced in a1e1b2d
(gitweb: improve usability of projects search form, 2012-01-31) didn't
get its arguments from caller correctly.  Gitweb worked correctly
thanks to sticky-ness of form fields in CGI.pm... but it make UTF-8
fix for project search not working.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 15:55:09 -08:00
Stefano Lattarini 1b5b2b641a t0000: modernise style
Match the style to more modern test scripts, namely:

 - Prefer tabs for indentation.

 - The first line of each test has prereq, title and opening sq for the
   script body.

 - Move cleanup or initialization of data used by a test inside the test
   itself.

 - Put a newline before the closing sq for each test.

 - Don't conclude the test descriptions with a full stop.

 - Prefer 'test_line_count = COUNT FILE' over 'test $(wc -l <FILE) = COUNT'

 - Prefer 'test_line_count = 0 FILE' over 'cmp -s /dev/null FILE'

 - Use '<<-EOF' style for here documents, so that they can be indented
   as well.  Bot don't do that in case the resulting lines would be too
   long.  Also when there is no $variable_substitution in the body of a
   here document, quote \EOF.

 - Don't redirect the output of commands to /dev/null unconditionally,
   the git testing framework should already take care of handling test
   verbosity transparently and uniformly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 15:19:59 -08:00
Stefano Lattarini 661bfd13b4 tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
If any test script is run directly with Solaris 10 /usr/xpg4/bin/sh or
/bin/ksh, it fails spuriously with a message like:

  t0000-basic.sh[31]: unset: bad argument count

This happens because those shells bail out when encountering a call to
"unset" with no arguments, and such unset call could take place in
'test-lib.sh'.  Fix that issue, and add a proper comment to ensure we
don't regress in this respect.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 14:41:06 -08:00
Nelson Benitez Leon dd6139971a http: support proxies that require authentication
When the proxy server specified by the http.proxy configuration or the
http_proxy environment variable requires authentication, git failed to
connect to the proxy, because we did not configure the cURL handle with
CURLOPT_PROXYAUTH.

When a proxy is in use, and you tell git that the proxy requires
authentication by having username in the http.proxy configuration, an
extra request needs to be made to the proxy to find out what
authentication method it supports, as this patch uses CURLAUTH_ANY to let
the library pick the most secure method supported by the proxy server.

The extra round-trip adds extra latency, but relieves the user from the
burden to configure a specific authentication method.  If it becomes
problem, a later patch could add a configuration option to specify what
method to use, but let's start simple for the time being.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 14:40:14 -08:00
Junio C Hamano 222433ee4b Update draft release notes to 1.7.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 11:49:41 -08:00
Junio C Hamano 2fa91bd391 Merge branch 'maint'
* maint:
  Documentation: do not assume that n > 1 in <rev>~$n
2012-03-02 11:49:06 -08:00
Junio C Hamano 70eb130768 Documentation: do not assume that n > 1 in <rev>~$n
We explained <rev>~<n> as <n>th generation grand-parent, but a reader got
confused by the "grand-" part when <n> is 1.

Reword it with "ancestor"; with the "generation" and "following only the
first parents" around there, what we try to describe should be clear
enough now.

Noticed-by: Luke Diamand <luke@diamand.org>
Helped-by: Thomas Rast <trast@inf.ethz.ch>
Helped-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-02 09:33:29 -08:00
Thynson 2d0dc47464 l10n: Improve commit msg for zh_CN translation
Signed-off-by: Thynson <lanxingcan@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-02 16:50:35 +08:00
Thynson 1b150dc96f l10n: Improve zh_CN translation for msg that make empty commit when amend.
Signed-off-by: Thynson <lanxingcan@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-02 16:37:15 +08:00
Thynson a9ce45430b l10n: Improve zh_CN translation for empty cherry-pick msg.
Signed-off-by: Thynson <lanxingcan@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-02 16:28:10 +08:00
Thynson 70fc47bf56 l10n: Improve zh_CN translation for msg about branch deletion deny
Signed-off-by: Thynson <lanxingcan@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-02 16:18:22 +08:00
Thynson 8ea38f47bb l10n: Improve zh_CN translation for lines insertion and deletion.
Signed-off-by: Thynson <lanxingcan@gmail.com>
2012-03-02 16:09:21 +08:00
Junio C Hamano 7bb3beaf4f Merge branch 'cb/fsck-squelch-dangling'
* cb/fsck-squelch-dangling:
  fsck: --no-dangling omits "dangling object" information
2012-03-01 20:59:41 -08:00
Junio C Hamano 66b8800e53 Merge branch 'rs/no-no-no-parseopt'
* rs/no-no-no-parseopt:
  parse-options: remove PARSE_OPT_NEGHELP
  parse-options: allow positivation of options starting, with no-
  test-parse-options: convert to OPT_BOOL()

Conflicts:
	builtin/grep.c
2012-03-01 20:59:31 -08:00
Junio C Hamano 260eb7e389 Merge branch 'th/git-diffall'
* th/git-diffall:
  contrib: add git-diffall script
2012-03-01 20:59:25 -08:00
Junio C Hamano bfabdfe2dd Merge the initial l10n effort in
* l10n:
  Update l10n guide: change the repository URL, etc
  l10n: leave leading space unchanged for zh_CN.po
  Update l10n guide
  l10n: update Chinese translation to the new git.po
  l10n: Update git.pot (12 new messages)
  l10n: fast-forward here is ff-only merge, not push
  l10n: update zh_CN translation for "Fetching %s"
  l10n: po for zh_CN
  l10n: initial git.pot for 1.7.10 upcoming release
2012-03-01 20:52:03 -08:00
Junio C Hamano 11ec817fed Merge branch 'master' of https://github.com/git-l10n/git-po into l10n
* 'master' of https://github.com/git-l10n/git-po:
  l10n: leave leading space unchanged for zh_CN.po
2012-03-01 20:51:37 -08:00
Jiang Xin 75b182aee7 Update l10n guide: change the repository URL, etc
Host the l10n coordinator repository in a dedicated github organization
account "git-l10n", so that the team may have a more permanent home.
Also add a hint about reference of TEAMS file for l10n contributors.

Update TEAMS file with new zh_CN l10n team members and a repository URL.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 20:50:49 -08:00
Junio C Hamano 797166cfaf Merge branch 'maint'
* maint:
  Documentation fixes in git-config
2012-03-01 14:45:14 -08:00
Junio C Hamano 0f559f5720 Merge branch 'nd/maint-verify-objects'
* nd/maint-verify-objects:
  rev-list: fix --verify-objects --quiet becoming --objects
  rev-list: remove BISECT_SHOW_TRIED flag
2012-03-01 14:44:42 -08:00
Junio C Hamano 6a3a3db73f Merge branch 'jn/maint-gitweb-invalid-regexp'
* jn/maint-gitweb-invalid-regexp:
  gitweb: Handle invalid regexp in regexp search
2012-03-01 14:44:38 -08:00
Junio C Hamano 57a424917b Merge branch 'cn/maint-rev-list-doc'
* cn/maint-rev-list-doc:
  Documentation: use {asterisk} in rev-list-options.txt when needed
2012-03-01 14:44:28 -08:00
Junio C Hamano 7d47367a47 Merge branch 'cn/maint-branch-with-bad'
* cn/maint-branch-with-bad:
  branch: don't assume the merge filter ref exists

Conflicts:
	t/t3200-branch.sh
2012-03-01 14:44:17 -08:00
Thomas Rast efe4be1249 bundle: keep around names passed to add_pending_object()
The 'name' field passed to add_pending_object() is used to later
deduplicate in object_array_remove_duplicates().

git-bundle had a bug in this area since 18449ab (git-bundle: avoid
packing objects which are in the prerequisites, 2007-03-08): it passed
the name of each boundary object in a static buffer.  In other words,
all that object_array_remove_duplicates() saw was the name of the
*last* added boundary object.

The recent switch to a strbuf in bc2fed4 (bundle: use a strbuf to scan
the log for boundary commits, 2012-02-22) made this slightly worse: we
now free the buffer at the end, so it is not even guaranteed that it
still points into addressable memory by the time object_array_remove_
duplicates looks at it.  On the plus side however, it was now
detectable by valgrind.

The fix is easy: pass a copy of the string to add_pending_object.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:34:42 -08:00
Thomas Rast aa9828561e t5510: ensure we stay in the toplevel test dir
The last test descended into a subdir without ever re-emerging, which
is not so nice to the next test writer.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:34:14 -08:00
Thomas Rast 61821aaa12 t5510: refactor bundle->pack conversion
It's not so much a conversion as a "strip everything up to and
including the first blank line", but it will come in handy again.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:25:57 -08:00
Junio C Hamano b3f01ff29f diff -p: squelch "diff --git" header for stat-dirty paths
The plumbing "diff" commands look at the working tree files without
refreshing the index themselves for performance reasons (the calling
script is expected to do that upfront just once, before calling one or
more of them).  In the early days of git, they showed the "diff --git"
header before they actually ask the xdiff machinery to produce patches,
and ended up showing only these headers if the real contents are the same
and the difference they noticed was only because the stat info cached in
the index did not match that of the working tree. It was too late for the
implementation to take the header that it already emitted back.

But 3e97c7c (No diff -b/-w output for all-whitespace changes, 2009-11-19)
introduced necessary logic to keep the meta-information headers in a
strbuf and delay their output until the xdiff machinery noticed actual
changes. This was primarily in order to generate patches that ignore
whitespaces. When operating under "-w" mode, we wouldn't know if the
header is needed until we actually look at the resulting patch, so it was
a sensible thing to do, but we did not realize that the same reasoning
applies to stat-dirty paths.

Later, 296c6bb (diff: fix "git show -C -C" output when renaming a binary
file, 2010-05-26) generalized this machinery and added must_show_header
toggle.  This is turned on when the header must be shown even when there
is no patch to be produced, e.g. only the mode was changed, or the path
was renamed, without changing the contents.  However, when it did so, it
still kept the special case for the "-w" mode, which meant that the
plumbing would keep showing these phantom changes.

This corrects this historical inconsistency by allowing the plumbing to
omit paths that are only stat-dirty from its output in the same way as it
handles whitespace only changes under "-w" option.

The change in the behaviour can be seen in the updated test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 12:00:01 -08:00
Junio C Hamano 5597e84b51 t4011: illustrate "diff-index -p" on stat-dirty paths
The plumbing that looks at the working tree, i.e. "diff-index" and
"diff-files", always emit the "diff --git a/path b/path" header lines
without anything else for paths that are only stat-dirty (i.e. different
only because the cached stat information in the index no longer matches
that of the working tree, but the real contents are the same), when
these commands are run with "-p" option to produce patches.

Illustrate this current behaviour.  Also demonstrate that with the "-w"
option, we (correctly) hold off showing a "diff --git" header until actual
differences have been found.  This also suppresses the header for merely
stat-dirty files, which is inconsistent.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 12:00:01 -08:00
Junio C Hamano 13a4899886 t4011: modernise style
Match the style to more modern test scripts, namely:

 - The first line of each test has prereq, title and opening sq for the
   script body.  This makes the test shorter while reducing the need for
   backslashes.

 - Be prepared for the case in which the previous test may have failed.
   If a test wants to start from not having "frotz" that the previous test
   may have created, write "rm -f frotz", not "rm frotz".

 - Prepare the expected output inside your own test.

 - The order of comparison to check the result is "diff expected actual",
   so that the output will show how the output from the git you just broke
   is different from what is expected.

 - Write no SP between redirection '>' (or '<' for that matter) and the
   filename.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 11:59:51 -08:00
Zbigniew Jędrzejewski-Szmek df44483a5d diff --stat: add config option to limit graph width
Config option diff.statGraphWidth=<width> is equivalent to
--stat-graph-width=<width>, except that the config option is ignored
by format-patch.

For the graph-width limiting to be usable, it should happen
'automatically' once configured, hence the config option.
Nevertheless, graph width limiting only makes sense when used on a
wide terminal, so it should not influence the output of format-patch,
which adheres to the 80-column standard.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 09:15:58 -08:00
Zbigniew Jędrzejewski-Szmek 969fe57b84 diff --stat: enable limiting of the graph part
A new option --stat-graph-width=<width> can be used to limit the width
of the graph part even is more space is available. Up to <width>
columns will be used for the graph.

If commits changing a lot of lines are displayed in a wide terminal
window (200 or more columns), and the +- graph uses the full width,
the output can be hard to comfortably scan with a horizontal movement
of human eyes. Messages wrapped to about 80 columns would be
interspersed with very long +- lines. It makes sense to limit the
width of the graph part to a fixed value (e.g. 70 columns), even if
more columns are available.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 09:15:47 -08:00