Code

git.git
12 years agol10n: Improve zh_CN translation for lines insertion and deletion.
Thynson [Tue, 28 Feb 2012 17:57:24 +0000 (01:57 +0800)]
l10n: Improve zh_CN translation for lines insertion and deletion.

Signed-off-by: Thynson <lanxingcan@gmail.com>
12 years agoMerge branch 'cb/fsck-squelch-dangling'
Junio C Hamano [Fri, 2 Mar 2012 04:59:41 +0000 (20:59 -0800)]
Merge branch 'cb/fsck-squelch-dangling'

* cb/fsck-squelch-dangling:
  fsck: --no-dangling omits "dangling object" information

12 years agoMerge branch 'rs/no-no-no-parseopt'
Junio C Hamano [Fri, 2 Mar 2012 04:59:31 +0000 (20:59 -0800)]
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

12 years agoMerge branch 'th/git-diffall'
Junio C Hamano [Fri, 2 Mar 2012 04:59:25 +0000 (20:59 -0800)]
Merge branch 'th/git-diffall'

* th/git-diffall:
  contrib: add git-diffall script

12 years agoMerge the initial l10n effort in
Junio C Hamano [Fri, 2 Mar 2012 04:52:03 +0000 (20:52 -0800)]
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

12 years agoMerge branch 'master' of https://github.com/git-l10n/git-po into l10n
Junio C Hamano [Fri, 2 Mar 2012 04:51:37 +0000 (20:51 -0800)]
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

12 years agoUpdate l10n guide: change the repository URL, etc
Jiang Xin [Fri, 2 Mar 2012 02:29:53 +0000 (10:29 +0800)]
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>
12 years agoMerge branch 'maint'
Junio C Hamano [Thu, 1 Mar 2012 22:45:14 +0000 (14:45 -0800)]
Merge branch 'maint'

* maint:
  Documentation fixes in git-config

12 years agoMerge branch 'nd/maint-verify-objects'
Junio C Hamano [Thu, 1 Mar 2012 22:44:42 +0000 (14:44 -0800)]
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

12 years agoMerge branch 'jn/maint-gitweb-invalid-regexp'
Junio C Hamano [Thu, 1 Mar 2012 22:44:38 +0000 (14:44 -0800)]
Merge branch 'jn/maint-gitweb-invalid-regexp'

* jn/maint-gitweb-invalid-regexp:
  gitweb: Handle invalid regexp in regexp search

12 years agoMerge branch 'cn/maint-rev-list-doc'
Junio C Hamano [Thu, 1 Mar 2012 22:44:28 +0000 (14:44 -0800)]
Merge branch 'cn/maint-rev-list-doc'

* cn/maint-rev-list-doc:
  Documentation: use {asterisk} in rev-list-options.txt when needed

12 years agoMerge branch 'cn/maint-branch-with-bad'
Junio C Hamano [Thu, 1 Mar 2012 22:44:17 +0000 (14:44 -0800)]
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

12 years agobundle: keep around names passed to add_pending_object()
Thomas Rast [Thu, 1 Mar 2012 21:40:51 +0000 (22:40 +0100)]
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>
12 years agot5510: ensure we stay in the toplevel test dir
Thomas Rast [Thu, 1 Mar 2012 21:40:49 +0000 (22:40 +0100)]
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>
12 years agot5510: refactor bundle->pack conversion
Thomas Rast [Thu, 1 Mar 2012 21:40:48 +0000 (22:40 +0100)]
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>
12 years agodiff -p: squelch "diff --git" header for stat-dirty paths
Junio C Hamano [Thu, 1 Mar 2012 02:14:16 +0000 (18:14 -0800)]
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>
12 years agot4011: illustrate "diff-index -p" on stat-dirty paths
Junio C Hamano [Thu, 1 Mar 2012 02:14:15 +0000 (18:14 -0800)]
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>
12 years agot4011: modernise style
Junio C Hamano [Thu, 1 Mar 2012 02:14:14 +0000 (18:14 -0800)]
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>
12 years agodiff --stat: add config option to limit graph width
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:46 +0000 (13:26 +0100)]
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>
12 years agodiff --stat: enable limiting of the graph part
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:45 +0000 (13:26 +0100)]
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>
12 years agodiff --stat: add a test for output with COLUMNS=40
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:44 +0000 (13:26 +0100)]
diff --stat: add a test for output with COLUMNS=40

In preparation for the introduction on the limit of the width of the
graph part, a new test with COLUMNS=40 is added to check that the
environment variable influences diff, show, log, but not format-patch.
A new test is added because limiting the graph part makes COLUMNS=200
stop influencing diff --stat behaviour, which isn't wide enough now.
The old test with COLUMNS=200 is retained to check for regressions.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --stat: use a maximum of 5/8 for the filename part
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:43 +0000 (13:26 +0100)]
diff --stat: use a maximum of 5/8 for the filename part

The way that available columns are divided between the filename part
and the graph part is modified to use as many columns as necessary for
the filenames and the rest for the graph.

If there isn't enough columns to print both the filename and the
graph, at least 5/8 of available space is devoted to filenames. On a
standard 80 column terminal, or if not connected to a terminal and
using the default of 80 columns, this gives the same partition as
before.

The effect of this change is visible in the patch to the test vector
in t4052; with a small change with long filename, it stops truncating
the name part too short, and also allocates a bit more columns to the
graph for larger changes.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge --stat: use the full terminal width
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:42 +0000 (13:26 +0100)]
merge --stat: use the full terminal width

Make merge --stat behave like diff --stat and use the full terminal
width.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agolog --stat: use the full terminal width
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:41 +0000 (13:26 +0100)]
log --stat: use the full terminal width

Make log --stat behave like diff --stat and use the full terminal
width.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoshow --stat: use the full terminal width
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:40 +0000 (13:26 +0100)]
show --stat: use the full terminal width

Make show --stat behave like diff --stat and use the full terminal
width.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --stat: use the full terminal width
Zbigniew Jędrzejewski-Szmek [Thu, 1 Mar 2012 12:26:39 +0000 (13:26 +0100)]
diff --stat: use the full terminal width

Default to the real terminal width for diff --stat output, instead
of the hard-coded 80 columns.

Some projects (especially in Java), have long filename paths, with
nested directories or long individual filenames. When files are
renamed, the filename part in stat output can be almost useless. If
the middle part between { and } is long (because the file was moved to
a completely different directory), then most of the path would be
truncated.

It makes sense to detect and use the full terminal width and display
full filenames if possible.

The are commands like diff, show, and log, which can adapt the output
to the terminal width. There are also commands like format-patch,
whose output should be independent of the terminal width. Since it is
safer to use the 80-column default, the real terminal width is only
used if requested by the calling code by setting diffopts.stat_width=-1.
Normally this value is 0, and can be set by the user only to a
non-negative value, so -1 is safe to use internally.

This patch only changes the diff builtin to use the full terminal width.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --stat: tests for long filenames and big change counts
Junio C Hamano [Thu, 1 Mar 2012 12:26:38 +0000 (13:26 +0100)]
diff --stat: tests for long filenames and big change counts

In preparation for updates to the "diff --stat" that updates the logic
to split the allotted columns into the name part and the graph part to
make the output more readable, add a handful of tests to document the
corner case behaviour in which long filenames and big changes are shown.

When a pathname is so long that it cannot fit on the column, the current
code truncates it to make sure that the graph part has enough room to show
a meaningful graph.  If the actual change is small (e.g. only one line
changed), this results in the final output that is shorter than the width
we aim for.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation fixes in git-config
Libor Pechacek [Thu, 1 Mar 2012 10:59:45 +0000 (11:59 +0100)]
Documentation fixes in git-config

Variable names must start with an alphabetic character, regexp config key
matching has its limits, sentence grammar.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: leave leading space unchanged for zh_CN.po
ws3389 [Wed, 29 Feb 2012 12:53:26 +0000 (20:53 +0800)]
l10n: leave leading space unchanged for zh_CN.po

Signed-off-by: ws3389 <willsmith3389@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoUpdate l10n guide
Junio C Hamano [Wed, 29 Feb 2012 08:10:30 +0000 (00:10 -0800)]
Update l10n guide

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopickaxe: allow -i to search in patch case-insensitively
Junio C Hamano [Tue, 21 Feb 2012 09:02:46 +0000 (01:02 -0800)]
pickaxe: allow -i to search in patch case-insensitively

"git log -S<string>" is a useful way to find the last commit in the
codebase that touched the <string>. As it was designed to be used by a
porcelain script to dig the history starting from a block of text that
appear in the starting commit, it never had to look for anything but an
exact match.

When used by an end user who wants to look for the last commit that
removed a string (e.g. name of a variable) that he vaguely remembers,
however, it is useful to support case insensitive match.

When given the "--regexp-ignore-case" (or "-i") option, which originally
was designed to affect case sensitivity of the search done in the commit
log part, e.g. "log --grep", the matches made with -S/-G pickaxe search is
done case insensitively now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofsck: --no-dangling omits "dangling object" information
Junio C Hamano [Tue, 28 Feb 2012 22:55:39 +0000 (14:55 -0800)]
fsck: --no-dangling omits "dangling object" information

The default output from "fsck" is often overwhelmed by informational
message on dangling objects, especially if you do not repack often, and a
real error can easily be buried.

Add "--no-dangling" option to omit them, and update the user manual to
demonstrate its use.

Based on a patch by Clemens Buchacher, but reverted the part to change
the default to --no-dangling, which is unsuitable for the first patch.
The usual three-step procedure to break the backward compatibility over
time needs to happen on top of this, if we were to go in that direction.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: use static trans-case table
Junio C Hamano [Tue, 28 Feb 2012 22:20:53 +0000 (14:20 -0800)]
grep: use static trans-case table

In order to prepare the kwset machinery for a case-insensitive search, we
used to use a static table of 256 elements and filled it every time before
calling kwsalloc().  Because the kwset machinery will never modify this
table, just allocate a single instance globally and fill it at the compile
time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.10
Junio C Hamano [Tue, 28 Feb 2012 21:31:05 +0000 (13:31 -0800)]
Update draft release notes to 1.7.10

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'pj/completion-remote-set-url-branches'
Junio C Hamano [Tue, 28 Feb 2012 21:26:04 +0000 (13:26 -0800)]
Merge branch 'pj/completion-remote-set-url-branches'

* pj/completion-remote-set-url-branches:
  completion: normalize increment/decrement style
  completion: remote set-* <name> and <branch>

12 years agoMerge branch 'ph/cherry-pick-advice-refinement'
Junio C Hamano [Tue, 28 Feb 2012 21:26:01 +0000 (13:26 -0800)]
Merge branch 'ph/cherry-pick-advice-refinement'

* ph/cherry-pick-advice-refinement:
  cherry-pick: No advice to commit if --no-commit

12 years agoMerge branch 'jb/required-filter'
Junio C Hamano [Tue, 28 Feb 2012 21:25:57 +0000 (13:25 -0800)]
Merge branch 'jb/required-filter'

* jb/required-filter:
  Add a setting to require a filter to be successful

Conflicts:
convert.c

12 years agoDocumentation: use {asterisk} in rev-list-options.txt when needed
Carlos Martín Nieto [Tue, 28 Feb 2012 15:35:48 +0000 (16:35 +0100)]
Documentation: use {asterisk} in rev-list-options.txt when needed

Text between two '*' is emphasized in AsciiDoc and makes explanations in
rev-list-options.txt on glob-related options very confusing, as the
rendered text would be missing two asterisks and the text between them
would be emphasized instead.

Use '{asterisk}' where needed to make them show up as asterisks in the
rendered text.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoparse-options: remove PARSE_OPT_NEGHELP
René Scharfe [Tue, 28 Feb 2012 19:06:09 +0000 (20:06 +0100)]
parse-options: remove PARSE_OPT_NEGHELP

PARSE_OPT_NEGHELP is confusing because short options defined with that
flag do the opposite of what the helptext says. It is also not needed
anymore now that options starting with no- can be negated by removing
that prefix. Convert its only two users to OPT_NEGBIT() and OPT_BOOL()
and then remove support for PARSE_OPT_NEGHELP.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Handle invalid regexp in regexp search
Jakub Narebski [Tue, 28 Feb 2012 18:41:47 +0000 (19:41 +0100)]
gitweb: Handle invalid regexp in regexp search

When using regexp search ('sr' parameter / $search_use_regexp variable
is true), check first that regexp is valid.

Without this patch we would get an error from Perl during search (if
searching is performed by gitweb), or highlighting matches substring
(if applicable), if user provided invalid regexp... which means broken
HTML, with error page (including HTTP headers) generated after gitweb
already produced some output.

Add test that illustrates such error: for example for regexp "*\.git"
we would get the following error:

  Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE \.git/
  at /var/www/cgi-bin/gitweb.cgi line 3084.

Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorev-list: fix --verify-objects --quiet becoming --objects
Nguyễn Thái Ngọc Duy [Tue, 28 Feb 2012 14:00:00 +0000 (21:00 +0700)]
rev-list: fix --verify-objects --quiet becoming --objects

When --quiet is specified, finish_object() is called instead of
show_object(). The latter is in charge of --verify-objects and
will be skipped  if --quiet is specified.

Move the code up to finish_object(). Also pass the quiet flag along
and make it always call show_* functions to avoid similar problems in
future.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorev-list: remove BISECT_SHOW_TRIED flag
Nguyễn Thái Ngọc Duy [Tue, 28 Feb 2012 13:59:59 +0000 (20:59 +0700)]
rev-list: remove BISECT_SHOW_TRIED flag

Since c99f069 (bisect--helper: remove "--next-vars" option as it is
now useless - 2009-04-21), this flag has always been off. Remove the
flag and all related code.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge pull request from jiangxin/master
Jiang Xin [Tue, 28 Feb 2012 16:40:07 +0000 (00:40 +0800)]
Merge pull request from jiangxin/master

l10n: translation for Simplified Chinese.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agol10n: update Chinese translation to the new git.po
Jiang Xin [Tue, 28 Feb 2012 04:24:54 +0000 (12:24 +0800)]
l10n: update Chinese translation to the new git.po

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agol10n: Update git.pot (12 new messages)
Jiang Xin [Tue, 28 Feb 2012 04:24:20 +0000 (12:24 +0800)]
l10n: Update git.pot (12 new messages)

Update file 'po/git.pot' to v1.7.9.2-315-g25a78 (Merge branch 'maint'),
with 12 new string additions.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoMerge branch 'master' into git-po
Jiang Xin [Tue, 28 Feb 2012 04:23:26 +0000 (12:23 +0800)]
Merge branch 'master' into git-po

12 years agosymbolic-ref --short: abbreviate the output unambiguously
Jan Krüger [Mon, 27 Feb 2012 22:10:38 +0000 (23:10 +0100)]
symbolic-ref --short: abbreviate the output unambiguously

It can be helpful to resolve a symbolic ref and output the result in a
shortened form, such as for use in shell prompts.  Add a "--short" option
to do so.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Mon, 27 Feb 2012 23:37:02 +0000 (15:37 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.7.9.3
  CodingGuidelines: do not use 'which' in shell scripts
  CodingGuidelines: Add a note about spaces after redirection
  post-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly
  post-receive-email: remove unused variable

12 years agoUpdate draft release notes to 1.7.9.3
Junio C Hamano [Mon, 27 Feb 2012 23:36:08 +0000 (15:36 -0800)]
Update draft release notes to 1.7.9.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'pj/remote-set-branches-usage-fix' into maint
Junio C Hamano [Mon, 27 Feb 2012 23:33:33 +0000 (15:33 -0800)]
Merge branch 'pj/remote-set-branches-usage-fix' into maint

* pj/remote-set-branches-usage-fix:
  remote: fix set-branches usage and documentation

Conflicts:
builtin/remote.c

12 years agoMerge branch 'jn/gitweb-unborn-head' into maint
Junio C Hamano [Mon, 27 Feb 2012 23:33:26 +0000 (15:33 -0800)]
Merge branch 'jn/gitweb-unborn-head' into maint

* jn/gitweb-unborn-head:
  gitweb: Fix "heads" view when there is no current branch

12 years agoMerge branch 'jn/ancient-meld-support' into maint
Junio C Hamano [Mon, 27 Feb 2012 23:33:07 +0000 (15:33 -0800)]
Merge branch 'jn/ancient-meld-support' into maint

* jn/ancient-meld-support:
  mergetools/meld: Use --help output to detect --output support

12 years agoMerge branch 'tr/merge-edit-guidance' into maint
Junio C Hamano [Mon, 27 Feb 2012 23:31:50 +0000 (15:31 -0800)]
Merge branch 'tr/merge-edit-guidance' into maint

* tr/merge-edit-guidance:
  merge: add instructions to the commit message when editing

12 years agoCodingGuidelines: do not use 'which' in shell scripts
Tim Henigan [Fri, 24 Feb 2012 23:12:58 +0000 (18:12 -0500)]
CodingGuidelines: do not use 'which' in shell scripts

During the code review of a recent patch, it was noted that shell scripts
must not use 'which $cmd' to check the availability of the command $cmd.
The output of the command is not machine parseable and its exit code is
not reliable across platforms.

It is better to use 'type' to accomplish this task.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoCodingGuidelines: Add a note about spaces after redirection
Tim Henigan [Fri, 24 Feb 2012 23:12:57 +0000 (18:12 -0500)]
CodingGuidelines: Add a note about spaces after redirection

During code review of some patches, it was noted that redirection operators
should have space before, but no space after them.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocontrib: add git-diffall script
Tim Henigan [Fri, 24 Feb 2012 19:48:57 +0000 (14:48 -0500)]
contrib: add git-diffall script

The 'git difftool' allows the user to view diffs using an external tool.
It runs a separate instance of the tool for each file in the diff. This
makes it tedious to review changes spanning multiple files.

The 'git-diffall' script instead prepares temporary directories with the
files to be compared and launches a single instance of the external diff
tool to view them (i.e. a directory diff).

The 'diff.tool' or 'merge.tool' configuration variable is used to specify
which external tool is used.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: missing she-bang line in t9804 confuses prove
Zbigniew Jędrzejewski-Szmek [Mon, 27 Feb 2012 17:40:14 +0000 (18:40 +0100)]
git-p4: missing she-bang line in t9804 confuses prove

Without the magic line, prove shows lots and lots of errors:
% prove ./t9804-git-p4-label.sh
./t9804-git-p4-label.sh .. syntax error at ./t9804-git-p4-label.sh line 3, near ". ."
...

When #!/bin/sh is added, tests are skipped (I have no p4d).

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep -P: add tests for matching ^ and $
Michał Kiedrowicz [Mon, 27 Feb 2012 16:45:49 +0000 (17:45 +0100)]
grep -P: add tests for matching ^ and $

Earlier, fba4f1 (grep -P: Fix matching ^ and $) fixed an ancient bug.  Add
some tests to protect the change from future breakages; a slightly broken
version of this was a part of the originally submitted patch.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobranch: don't assume the merge filter ref exists
Carlos Martín Nieto [Mon, 27 Feb 2012 15:11:53 +0000 (16:11 +0100)]
branch: don't assume the merge filter ref exists

print_ref_list looks up the merge_filter_ref and assumes that a valid
pointer is returned. When the object doesn't exist, it tries to
dereference a NULL pointer. This can be the case when git branch
--merged is given an argument that isn't a valid commit name.

Check whether the lookup returns a NULL pointer and die with an error
if it does. Add a test, while we're at it.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopost-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly
Michael Haggerty [Mon, 27 Feb 2012 18:34:10 +0000 (19:34 +0100)]
post-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopost-receive-email: remove unused variable
Michael Haggerty [Mon, 27 Feb 2012 18:34:09 +0000 (19:34 +0100)]
post-receive-email: remove unused variable

prep_for_email neither is passed a fourth argument nor uses it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agosend-email: document the --smtp-debug option
Zbigniew Jędrzejewski-Szmek [Mon, 27 Feb 2012 16:22:53 +0000 (17:22 +0100)]
send-email: document the --smtp-debug option

The option was already shown in -h output, so it should be documented
in the man page.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Suggested-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: fast-forward here is ff-only merge, not push
Yichao Yu [Thu, 2 Feb 2012 08:43:01 +0000 (03:43 -0500)]
l10n: fast-forward here is ff-only merge, not push

Signed-off-by: Yichao Yu <yyc1992@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agol10n: update zh_CN translation for "Fetching %s"
Riku [Thu, 2 Feb 2012 08:40:12 +0000 (16:40 +0800)]
l10n: update zh_CN translation for "Fetching %s"

Signed-off-by: Riku <lu.riku@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoUpdate draft release notes to 1.7.10
Junio C Hamano [Mon, 27 Feb 2012 07:11:10 +0000 (23:11 -0800)]
Update draft release notes to 1.7.10

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jn/gitweb-search-optim'
Junio C Hamano [Mon, 27 Feb 2012 07:05:56 +0000 (23:05 -0800)]
Merge branch 'jn/gitweb-search-optim'

* jn/gitweb-search-optim:
  gitweb: Faster project search
  gitweb: Option for filling only specified info in fill_project_list_info
  gitweb: Refactor checking if part of project info need filling

12 years agoMerge branch 'tr/maint-bundle-long-subject'
Junio C Hamano [Mon, 27 Feb 2012 07:05:51 +0000 (23:05 -0800)]
Merge branch 'tr/maint-bundle-long-subject'

* 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

12 years agoMerge branch 'sp/smart-http-failure-to-push'
Junio C Hamano [Mon, 27 Feb 2012 07:05:48 +0000 (23:05 -0800)]
Merge branch 'sp/smart-http-failure-to-push'

* 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

12 years agoMerge branch 'fc/push-prune'
Junio C Hamano [Mon, 27 Feb 2012 07:05:45 +0000 (23:05 -0800)]
Merge branch 'fc/push-prune'

* fc/push-prune:
  push: add '--prune' option
  remote: refactor code into alloc_delete_ref()
  remote: reorganize check_pattern_match()
  remote: use a local variable in match_push_refs()

Conflicts:
builtin/push.c

12 years agoMerge branch 'jc/doc-merge-options'
Junio C Hamano [Mon, 27 Feb 2012 07:05:42 +0000 (23:05 -0800)]
Merge branch 'jc/doc-merge-options'

* jc/doc-merge-options:
  Documentation/merge-options.txt: group "ff" related options together

12 years agoMerge branch 'jk/maint-avoid-streaming-filtered-contents'
Junio C Hamano [Mon, 27 Feb 2012 07:05:38 +0000 (23:05 -0800)]
Merge branch 'jk/maint-avoid-streaming-filtered-contents'

* 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

12 years agoMerge branch 'jb/filter-ignore-sigpipe'
Junio C Hamano [Mon, 27 Feb 2012 07:05:31 +0000 (23:05 -0800)]
Merge branch 'jb/filter-ignore-sigpipe'

* jb/filter-ignore-sigpipe:
  Ignore SIGPIPE when running a filter driver

12 years agotest: "am -3" can accept non-standard -p<num>
Junio C Hamano [Mon, 27 Feb 2012 07:00:47 +0000 (23:00 -0800)]
test: "am -3" can accept non-standard -p<num>

This adds a test for the previous one to make sure that "am -3 -p0" can
read patches created with the --no-prefix option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Highlight matched part of shortened project description
Jakub Narebski [Mon, 27 Feb 2012 01:55:22 +0000 (02:55 +0100)]
gitweb: Highlight matched part of shortened project description

Previous commit make gitweb use esc_html_match_hl() to mark match in
the _whole_ description of a project when searching projects.

This commit makes gitweb highlight match in _shortened_ description,
based on match in whole description, using esc_html_match_hl_chopped()
subroutine.

If match is in removed (chopped) part, even partially, then trailing
"... " is highlighted.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Highlight matched part of project description when searching projects
Jakub Narebski [Mon, 27 Feb 2012 01:55:21 +0000 (02:55 +0100)]
gitweb: Highlight matched part of project description when searching projects

Use esc_html_match_hl() from earlier commit to mark match in the
_whole_ description when searching projects.

Currently, with this commit, when searching projects there is always
shown full description of a project, and not a shortened one (like for
ordinary projects list view), even if the match is on project name and
not project description.  Because we always show full description of a
project, and not possibly shortened name, there is no need for having
full description on mouseover via title attribute.

Showing full description when there is match on it is useful to avoid
situation where match is in shortened, invisible part.  On the other
hand that makes project search different than projects list view; also
there can be problems with overly-long project descriptions.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Highlight matched part of project name when searching projects
Jakub Narebski [Mon, 27 Feb 2012 01:55:20 +0000 (02:55 +0100)]
gitweb: Highlight matched part of project name when searching projects

Use esc_html_match_hl() introduced in previous commit to escape HTML
and mark match, using span element with 'match' class.  Currently only
the 'path' part (i.e. the project name) is highlighted; match might be
on the project description.  Highlighting match in description is left
for next commit.

The code makes use of the fact that defined $search_regexp means that
there was search going on.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Introduce esc_html_match_hl and esc_html_hl_regions
Jakub Narebski [Mon, 27 Feb 2012 01:55:19 +0000 (02:55 +0100)]
gitweb: Introduce esc_html_match_hl and esc_html_hl_regions

The esc_html_match_hl() subroutine added in this commit will be used
to highlight *all* matches of given regexp, using 'match' class.
Ultimately it is to be used in all match highlighting, starting
with project search, which does not have it yet.

It uses the esc_html_hl_regions() subroutine, which is meant to
highlight in a given string a list of regions (given as a list of
[ beg, end ] pairs of positions in string), using HTML <span> element
with given class.  It could probably be used in other places that
do highlighting of part of ready line, like highlighting of changes
in a diff (diff refinement highlighting).

Implementation and enhancement notes:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Currently esc_html_hl_regions() subroutine doesn't accept any
  parameters, like esc_html() does.  We might want for example to
  pass  nbsp=>1  to it.

  It can easily be done with the following code:

    my %opts = grep { ref($_) ne "ARRAY" } @sel;
    @sel     = grep { ref($_) eq "ARRAY" } @sel;

  This allow adding parameters after or before regions, e.g.:

    esc_html_hl_regions("foo bar", "mark", [ 0, 3 ], -nbsp => 1);

* esc_html_hl_regions() escapes like esc_html(); if we wanted to
  highlight with esc_path(), we could pass subroutine reference
  to now named esc_gen_hl_regions().

    esc_html_hl_regions("foo bar", "mark", \&esc_path, [ 0, 3 ]);

  Note that this way we can handle -nbsp=>1 case automatically,
  e.g.

    esc_html_hl_regions("foo bar", "mark",
                        sub { esc_html(@_, -nbsp=>1) },
                        [ 0, 3 ]);

* Alternate solution for highlighting region of a string would be to
  use the idea that strings are to be HTML-escaped, and references to
  scalars are HTML (like in the idea for generic committags).

  This would require modifying gitweb code or esc_html to get list of
  fragments, e.g.:

    esc_html(\'<span class="mark">', 'foo', \'</span>', ' bar',
             { -nbsp => 1 });

  or

    esc_html([\'<span class="mark">', 'foo', \'</span>', ' bar'],
             -nbsp=>1);

  esc_html_match_hl() could be then simple wrapper around "match
  formatter", e.g.

    esc_html([ render_match_hl($str, $regexp) ], -nbsp=>1);

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopack-objects: Fix compilation with NO_PTHREDS
Michał Kiedrowicz [Sat, 25 Feb 2012 08:16:09 +0000 (09:16 +0100)]
pack-objects: Fix compilation with NO_PTHREDS

It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Mon, 27 Feb 2012 01:13:07 +0000 (17:13 -0800)]
Merge branch 'maint'

* maint:
  Document accumulated fixes since 1.7.9.2
  Git 1.7.8.5
  grep -P: Fix matching ^ and $
  am: don't infloop for an empty input file
  rebase -m: only call "notes copy" when rewritten exists and is non-empty
  git-p4: remove bash-ism in t9800
  git-p4: remove bash-ism in t9809
  git-p4: fix submit regression with clientSpec and subdir clone
  git-p4: set useClientSpec variable on initial clone
  Makefile: add thread-utils.h to LIB_H

Conflicts:
RelNotes
t/t9809-git-p4-client-view.sh

12 years agoDocument accumulated fixes since 1.7.9.2
Junio C Hamano [Mon, 27 Feb 2012 01:08:59 +0000 (17:08 -0800)]
Document accumulated fixes since 1.7.9.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/add-refresh-unmerged' into maint
Junio C Hamano [Mon, 27 Feb 2012 01:06:23 +0000 (17:06 -0800)]
Merge branch 'jc/add-refresh-unmerged' into maint

* jc/add-refresh-unmerged:
  refresh_index: do not show unmerged path that is outside pathspec

12 years agoMerge branch 'js/configure-libintl' into maint
Junio C Hamano [Mon, 27 Feb 2012 01:04:53 +0000 (17:04 -0800)]
Merge branch 'js/configure-libintl' into maint

* js/configure-libintl:
  configure: don't use -lintl when there is no gettext support

12 years agoSync with 1.7.8.5
Junio C Hamano [Mon, 27 Feb 2012 00:42:35 +0000 (16:42 -0800)]
Sync with 1.7.8.5

12 years agoGit 1.7.8.5 v1.7.8.5
Junio C Hamano [Mon, 27 Feb 2012 00:40:20 +0000 (16:40 -0800)]
Git 1.7.8.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep -P: Fix matching ^ and $
Michał Kiedrowicz [Sat, 25 Feb 2012 09:24:28 +0000 (10:24 +0100)]
grep -P: Fix matching ^ and $

When "git grep" is run with -P/--perl-regexp, it doesn't match ^ and $ at
the beginning/end of the line.  This is because PCRE normally matches ^
and $ at the beginning/end of the whole text, not for each line, and "git
grep" passes a large chunk of text (possibly containing many lines) to
pcre_exec() and then splits the text into lines.

This makes "git grep -P" behave differently from "git grep -E" and also
from "grep -P" and "pcregrep":

$ cat file
a
 b
$ git grep --no-index -P '^ ' file
$ git grep --no-index -E '^ ' file
file: b
$ grep -c -P '^ ' file
 b
$ pcregrep -c '^ ' file
 b

Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoam: don't infloop for an empty input file
Jim Meyering [Sat, 25 Feb 2012 17:34:26 +0000 (18:34 +0100)]
am: don't infloop for an empty input file

git-am.sh's check_patch_format function would attempt to preview
the patch to guess its format, but would go into an infinite loop
when the patch file happened to be empty.  The solution: exit the
loop when "read" fails, not when the line var, "$l1" becomes empty.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorebase -m: only call "notes copy" when rewritten exists and is non-empty
Andrew Wong [Sat, 25 Feb 2012 04:31:22 +0000 (23:31 -0500)]
rebase -m: only call "notes copy" when rewritten exists and is non-empty

This prevents a shell error complaining rebase-merge/rewritten doesn't exist.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: remove bash-ism in t9800
Pete Wyckoff [Sun, 26 Feb 2012 15:37:27 +0000 (10:37 -0500)]
git-p4: remove bash-ism in t9800

This works in both bash and dash:

    $ bash -c 'VAR=1 env' | grep VAR
    VAR=1
    $ dash -c 'VAR=1 env' | grep VAR
    VAR=1

But environment variables assigned this way are not necessarily propagated
through a function in POSIX compliant shells:

    $ bash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR
    VAR=1
    $ dash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR

Fix constructs like this, in particular, setting variables through
test_must_fail.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: remove bash-ism in t9809
Pete Wyckoff [Sun, 26 Feb 2012 15:37:26 +0000 (10:37 -0500)]
git-p4: remove bash-ism in t9809

Plain old $# works to count the number of arguments in
either bash or dash, even if the arguments have spaces.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: fix submit regression with clientSpec and subdir clone
Pete Wyckoff [Sun, 26 Feb 2012 01:06:25 +0000 (20:06 -0500)]
git-p4: fix submit regression with clientSpec and subdir clone

When the --use-client-spec is given to clone, and the clone
path is a subset of the full tree as specified in the client,
future submits will go to the wrong place.

Factor out getClientSpec() so both clone/sync and submit can
use it.  Introduce getClientRoot() that is needed for the client
spec case, and use it instead of p4Where().

Test the five possible submit behaviors (add, modify, rename,
copy, delete).

Reported-by: Laurent Charrière <lcharriere@promptu.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: set useClientSpec variable on initial clone
Pete Wyckoff [Sun, 26 Feb 2012 01:06:24 +0000 (20:06 -0500)]
git-p4: set useClientSpec variable on initial clone

If --use-client-spec was given, set the matching configuration
variable.  This is necessary to ensure that future submits
work properly.

The alternatives of requiring the user to set it, or providing
a command-line option on every submit, are error prone.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoparse-options: allow positivation of options starting, with no-
René Scharfe [Sat, 25 Feb 2012 19:14:54 +0000 (20:14 +0100)]
parse-options: allow positivation of options starting, with no-

Long options can be negated by adding no- right after the leading
two dashes. This is useful e.g. to override options set by aliases.

For options that are defined to start with no- already, this looks
a bit funny. Allow such options to also be negated by removing the
prefix.

The following thirteen options are affected:

apply          --no-add
bisect--helper --no-checkout
checkout-index --no-create
clone          --no-checkout --no-hardlinks
commit         --no-verify   --no-post-rewrite
format-patch   --no-binary
hash-object    --no-filters
read-tree      --no-sparse-checkout
revert         --no-commit
show-branch    --no-name
update-ref     --no-deref

The following five are NOT affected because they are defined with
PARSE_OPT_NONEG or the non-negated version is defined as well:

branch       --no-merged
format-patch --no-stat             --no-numbered
update-index --no-assume-unchanged --no-skip-worktree

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotest-parse-options: convert to OPT_BOOL()
René Scharfe [Sat, 25 Feb 2012 19:11:16 +0000 (20:11 +0100)]
test-parse-options: convert to OPT_BOOL()

Introduce OPT_BOOL() to test-parse-options and add some tests for
these "true" boolean options. Rename OPT_BOOLEAN to OPT_COUNTUP and
OPTION_BOOLEAN to OPTION_COUNTUP as well.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: add thread-utils.h to LIB_H
Dmitry V. Levin [Fri, 24 Feb 2012 23:42:42 +0000 (03:42 +0400)]
Makefile: add thread-utils.h to LIB_H

Starting with commit v1.7.8-165-g0579f91, grep.h includes
thread-utils.h, so the latter has to be added to LIB_H.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branches zj/decimal-width, zj/term-columns and jc/diff-stat-scaler
Junio C Hamano [Sat, 25 Feb 2012 00:07:04 +0000 (16:07 -0800)]
Merge branches zj/decimal-width, zj/term-columns and jc/diff-stat-scaler

12 years agodo not stream large files to pack when filters are in use
Jeff King [Fri, 24 Feb 2012 22:10:17 +0000 (17:10 -0500)]
do not stream large files to pack when filters are in use

Because git's object format requires us to specify the
number of bytes in the object in its header, we must know
the size before streaming a blob into the object database.
This is not a problem when adding a regular file, as we can
get the size from stat(). However, when filters are in use
(such as autocrlf, or the ident, filter, or eol
gitattributes), we have no idea what the ultimate size will
be.

The current code just punts on the whole issue and ignores
filter configuration entirely for files larger than
core.bigfilethreshold. This can generate confusing results
if you use filters for large binary files, as the filter
will suddenly stop working as the file goes over a certain
size.  Rather than try to handle unknown input sizes with
streaming, this patch just turns off the streaming
optimization when filters are in use.

This has a slight performance regression in a very specific
case: if you have autocrlf on, but no gitattributes, a large
binary file will avoid the streaming code path because we
don't know beforehand whether it will need conversion or
not. But if you are handling large binary files, you should
be marking them as such via attributes (or at least not
using autocrlf, and instead marking your text files as
such). And the flip side is that if you have a large
_non_-binary file, there is a correctness improvement;
before we did not apply the conversion at all.

The first half of the new t1051 script covers these failures
on input. The second half tests the matching output code
paths. These already work correctly, and do not need any
adjustment.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoteach dry-run convert_to_git not to require a src buffer
Jeff King [Fri, 24 Feb 2012 22:05:03 +0000 (17:05 -0500)]
teach dry-run convert_to_git not to require a src buffer

When we call convert_to_git in dry-run mode, it may still
want to look at the source buffer, because some CRLF
conversion modes depend on analyzing the source to determine
whether it is in fact convertible CRLF text.

However, the main motivation for convert_to_git's dry-run
mode is that we would decide which method to use to acquire
the blob's data (streaming versus in-core). Requiring this
source analysis creates a chicken-and-egg problem. We are
better off simply guessing that anything we can't analyze
will end up needing conversion.

This patch lets a caller specify a NULL src buffer when
using dry-run mode (and only dry-run mode). A non-zero
return value goes from "we would convert" to "we might
convert"; a zero return value remains "we would definitely
not convert".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoteach convert_to_git a "dry run" mode
Jeff King [Fri, 24 Feb 2012 22:02:37 +0000 (17:02 -0500)]
teach convert_to_git a "dry run" mode

Some callers may want to know whether convert_to_git will
actually do anything before performing the conversion
itself (e.g., to decide whether to stream or handle blobs
in-core). This patch lets callers specify the dry run mode
by passing a NULL destination buffer. The return value,
instead of indicating whether conversion happened, will
indicate whether conversion would occur.

For readability, we also include a wrapper function which
makes it more obvious we are not actually performing the
conversion.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot5704: match tests to modern style
Thomas Rast [Thu, 23 Feb 2012 09:42:23 +0000 (10:42 +0100)]
t5704: match tests to modern style

The test did not adhere to the current style on several counts:

 . empty lines around the test blocks, but within the test string
 . ': > file' or even just '> file' with an extra space
 . inconsistent indentation
 . hand-rolled commits instead of using test_commit

Fix all of them.

There's a catch to the last point: test_commit creates a tag, which the
original test did not create.  We still change it to test_commit, and
explicitly delete the tags, so as to highlight that the test relies on not
having them.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agostrbuf: improve strbuf_get*line documentation
Thomas Rast [Thu, 23 Feb 2012 09:42:21 +0000 (10:42 +0100)]
strbuf: improve strbuf_get*line documentation

Clarify strbuf_getline() documentation, and add the missing documentation
for strbuf_getwholeline() and strbuf_getwholeline_fd().

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>