gitweb.git
parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION... René Scharfe Mon, 9 Mar 2009 20:57:38 +0000 (21:57 +0100)

parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together

As suggested by Junio, disallow the flags PARSE_OPT_KEEP_UNKNOWN and
PARSE_OPT_STOP_AT_NON_OPTION to be turned on at the same time, as a
value of an unknown option could be mistakenly classified as a
non-option, stopping the parser early. E.g.:

git cmd --known --unknown value arg0 arg1

The parser should have stopped at "arg0", but it already stops at
"value".

This patch makes parse_options() die if the two flags are used in
combination.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: document KEEP_ARGV0, KEEP_UNKNOWN, NO_INTERNA... René Scharfe Mon, 9 Mar 2009 20:26:56 +0000 (21:26 +0100)

parseopt: document KEEP_ARGV0, KEEP_UNKNOWN, NO_INTERNAL_HELP

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: support intermediate paths when matching tags... Michael Lai Mon, 9 Mar 2009 18:45:47 +0000 (11:45 -0700)

git-svn: support intermediate paths when matching tags/branches

For repositories laid out like the following:

[svn-remote "svn"]
url = http://foo.com/svn/repos/bar
fetch = myproject/trunk:refs/remotes/trunk
branches = bar/myproject/branches/*:refs/remotes/*
tags = bar/myproject/tags/*:refs/remotes/tags/*

The "bar" component above is considered the intermediate path
and was not handled correctly.

Signed-off-by: Michael Lai <myllai@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

grep: cast printf %.*s "precision" argument explicitly... Junio C Hamano Mon, 9 Mar 2009 01:22:44 +0000 (18:22 -0700)

grep: cast printf %.*s "precision" argument explicitly to int

On some systems, regoff_t that is the type of rm_so/rm_eo members are
wider than int; %.*s precision specifier expects an int, so use an explicit
cast.

A breakage reported on Darwin by Brian Gernhardt should be fixed with
this patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Set compiler switch for USE_NSECBrian Gernhardt Sun, 8 Mar 2009 21:22:51 +0000 (17:22 -0400)

Makefile: Set compiler switch for USE_NSEC

The comments indicated that setting a Makefile variable USE_NSEC would
enable the code for sub-second [cm]times. However, the Makefile
variable was never turned into a compiler switch so the code was never
enabled. This patch allows USE_NSEC to be noticed by the compiler.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Create USE_ST_TIMESPEC and turn it on for DarwinBrian Gernhardt Sun, 8 Mar 2009 20:04:28 +0000 (16:04 -0400)

Create USE_ST_TIMESPEC and turn it on for Darwin

Not all OSes use st_ctim and st_mtim in their struct stat. In
particular, it appears that OS X uses st_*timespec instead. So add a
Makefile variable and #define called USE_ST_TIMESPEC to switch the
USE_NSEC defines to use st_*timespec.

This also turns it on by default for OS X (Darwin) machines. Likely
this is a sane default for other BSD kernels as well, but I don't have
any to test that assumption on.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Not all systems use st_[cm]tim field for ns resolution... Junio C Hamano Sun, 8 Mar 2009 20:51:33 +0000 (13:51 -0700)

Not all systems use st_[cm]tim field for ns resolution file timestamp

Some codepaths do not still use the ST_[CM]TIME_NSEC() pair of macros
introduced by the previous commit but assumes all systems use st_mtim
and st_ctim fields in "struct stat" to record nanosecond resolution part
of the file timestamps.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: use parseopt for local-only optionsRené Scharfe Sun, 8 Mar 2009 18:21:53 +0000 (19:21 +0100)

archive: use parseopt for local-only options

Replace the hand-rolled parsers that find and remove --remote and --exec
by a parseopt parser that also handles --output.

All three options only have a meaning if no remote server is used or on
the local side. They must be rejected by upload-archive and should not
be sent to the server by archive.

We can't use a single parser for both remote and local side because the
remote end possibly understands a different set of options than the
local side. A local parser would then wrongly accuse options valid on
the other side as being incorrect.

This patch implements a very forgiving parser that understands only the
three options mentioned above. All others are passed to the normal,
complete parser in archive.c (running either locally in archive, or
remotely in upload-archive). This normal parser definition contains
dummy entries for the three options, in order for them to appear in the
help screen.

The parseopt parser allows multiple occurrences of --remote and --exec
unlike the previous one; the one specified last wins. This looseness
is acceptable, I think.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: make usage optionalRené Scharfe Sun, 8 Mar 2009 18:16:58 +0000 (19:16 +0100)

parseopt: make usage optional

Allow usagestr to be NULL and don't display any help screen in
this case. This is useful to implement incremental parsers.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: add PARSE_OPT_NO_INTERNAL_HELPRené Scharfe Sun, 8 Mar 2009 18:15:08 +0000 (19:15 +0100)

parseopt: add PARSE_OPT_NO_INTERNAL_HELP

Add a parseopt flag, PARSE_OPT_NO_INTERNAL_HELP, that turns off internal
handling of -h, --help and --help-all. This allows the implementation
of custom help option handlers or incremental parsers.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parseopt: add PARSE_OPT_KEEP_UNKNOWNRené Scharfe Sun, 8 Mar 2009 18:12:47 +0000 (19:12 +0100)

parseopt: add PARSE_OPT_KEEP_UNKNOWN

Add a parseopt flag, PARSE_OPT_KEEP_UNKNOWN, that can be used to keep
unknown options in argv, similar to the existing KEEP flags.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Adjust js/remote-improvements and db/refspec-wildcard... Junio C Hamano Sun, 8 Mar 2009 08:12:33 +0000 (00:12 -0800)

Adjust js/remote-improvements and db/refspec-wildcard-in-the-middle

The latter topic changes the definition of how refspec's src and dst side
is stored in-core; it used to be that the asterisk for pattern was
omitted, but now it is included. The former topic handcrafts an old style
refspec to feed the refspec matching machinery that lacks the asterisk and
triggers an error.

This resolves the semantic clash between the two topics early before they
need to be merged to integration branches.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-remote.c: no "commented out" code, pleaseJunio C Hamano Sun, 8 Mar 2009 08:10:33 +0000 (00:10 -0800)

builtin-remote.c: no "commented out" code, please

And especially do not use // comment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 8 Mar 2009 06:34:13 +0000 (22:34 -0800)

Merge branch 'maint'

* maint:
builtin-revert.c: release index lock when cherry-picking an empty commit
document config --bool-or-int
t1300: use test_must_fail as appropriate
cleanup: add isascii()
Documentation: fix badly indented paragraphs in "--bisect-all" description

Merge branch 'maint-1.6.1' into maintJunio C Hamano Sun, 8 Mar 2009 05:00:27 +0000 (21:00 -0800)

Merge branch 'maint-1.6.1' into maint

* maint-1.6.1:
builtin-revert.c: release index lock when cherry-picking an empty commit

http.c: use strbuf API in quote_ref_urlTay Ray Chuan Sat, 7 Mar 2009 16:47:21 +0000 (00:47 +0800)

http.c: use strbuf API in quote_ref_url

In addition, ''quote_ref_url'' inserts a slash between the base URL and
remote ref path only if needed. Previously, this insertion wasn't
contingent on the lack of a separating slash.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move local variables to narrower scopesBenjamin Kramer Sat, 7 Mar 2009 20:02:26 +0000 (21:02 +0100)

Move local variables to narrower scopes

These weren't used outside and can be safely moved

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove unused function scope local variablesBenjamin Kramer Sat, 7 Mar 2009 20:02:10 +0000 (21:02 +0100)

Remove unused function scope local variables

These variables were unused and can be removed safely:

builtin-clone.c::cmd_clone(): use_local_hardlinks, use_separate_remote
builtin-fetch-pack.c::find_common(): len
builtin-remote.c::mv(): symref
diff.c::show_stats():show_stats(): total
diffcore-break.c::should_break(): base_size
fast-import.c::validate_raw_date(): date, sign
fsck.c::fsck_tree(): o_sha1, sha1
xdiff-interface.c::parse_num(): read_some

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MinGW: fix diff --no-index /dev/null ...Johannes Schindelin Sat, 7 Mar 2009 15:51:33 +0000 (16:51 +0100)

MinGW: fix diff --no-index /dev/null ...

When launching "diff --no-index" with a parameter "/dev/null", the MSys
bash converts the "/dev/null" to a "nul", which usually makes sense. But

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: remove tabs from usermap filePete Wyckoff Fri, 27 Feb 2009 18:53:59 +0000 (10:53 -0800)

git-p4: remove tabs from usermap file

Some users have tabs in their names, oddly enough. This
causes problems when loading the usercache from disk,
as split separates the fields on the wrong tabs. When
fast-import's parse_ident() tries to parse the committer
field, it is unhappy about the unbalanced <..> angle brackets.

It is easy enough to convert the tabs to single spaces.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add an (optional, since expensive) test for >2gb clonesJohannes Schindelin Fri, 6 Mar 2009 09:48:53 +0000 (10:48 +0100)

Add an (optional, since expensive) test for >2gb clones

Define GIT_TEST_CLONE_2GB=t if you want the test not to be skipped.

The test works by constructing a repository larger than 2gb, and then
cloning it.

The repository is forced larger than 2gb by setting compression and
delta depth to zero, and then adding just enough unique objects of
a given size.

The objects consist of a running decimal number in ASCII, padded by
spaces. Should that break in the future, e.g. when pack v4 becomes
default, there is a commented-out call to test-genrandom which can be
substituted, but that uses more cycles than the current method.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Record ns-timestamps if possible, but do not use it... Kjetil Barvik Wed, 4 Mar 2009 17:47:40 +0000 (18:47 +0100)

Record ns-timestamps if possible, but do not use it without USE_NSEC

Traditionally, the lack of USE_NSEC meant "do not record nor use the
nanosecond resolution part of the file timestamps". To avoid problems on
filesystems that lose the ns part when the metadata is flushed to the disk
and then later read back in, disabling USE_NSEC has been a good idea in
general.

If you are on a filesystem without such an issue, it does not hurt to read
and store them in the cached stat data in the index entries even if your
git is compiled without USE_NSEC. The index left with such a version of
git can be read by git compiled with USE_NSEC and it can make use of the
nanosecond part to optimize the check to see if the path on the filesystem
hsa been modified since we last looked at.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: teach fetch, pull, and push to complet... Jay Soffian Fri, 6 Mar 2009 04:39:33 +0000 (23:39 -0500)

bash completion: teach fetch, pull, and push to complete their options

fetch, pull, and push didn't know their options. They do now. merge's
options are factored into a variable so they can be shared between
_git_merge and _git_pull

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: refactor --strategy completionJay Soffian Fri, 6 Mar 2009 16:30:44 +0000 (11:30 -0500)

bash completion: refactor --strategy completion

The code to complete --strategy was duplicated between _git_rebase and
_git_merge, and is about to gain a third caller (_git_pull). This patch
factors it into its own function.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: fix completion issues with fetch,... Jay Soffian Fri, 6 Mar 2009 04:39:31 +0000 (23:39 -0500)

bash completion: fix completion issues with fetch, pull, and push

Sverre Rabbelier noticed a completion issue with push:

$ git push ori<tab>
git push origin

$ git push -f ori<tab>
git push -f origin/

Markus Heidelberg pointed out that the issue extends to fetch and pull.

The reason is that the current code naively assumes that if
COMP_CWORD=2, it should complete a remote name, otherwise it should
complete a refspec. This assumption fails if there are any --options.

This patch fixes that issue by instead scanning COMP_CWORDS to see if
the remote has been completed yet (we now assume the first non-dashed
argument is the remote). The new logic is factored into a function,
shared by fetch, pull, and push.

The new function also properly handles '.' as the remote.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-files: fix broken --no-empty-directoryJeff King Sun, 8 Mar 2009 01:27:22 +0000 (20:27 -0500)

ls-files: fix broken --no-empty-directory

Commit ce8e880 converted ls-files to use parseopt; the
--no-empty-directory option was converted as an
OPT_BIT for "empty-directory" to set the
DIR_HIDE_EMPTY_DIRECTORY flag. However, that makes it do the
opposite of what it should: --empty-directory would hide,
but --no-empty-directory would turn off hiding.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3000: use test_cmp instead of diffJeff King Sun, 8 Mar 2009 01:22:07 +0000 (20:22 -0500)

t3000: use test_cmp instead of diff

These ancient tests predate test_cmp.

While we're at it, let's switch to our usual "expected
before actual" order of arguments; this makes the diff
output "here's what is changed from expected" instead of the
reverse.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brown paper bag fix for MinGW 64-bit statJohannes Schindelin Sat, 7 Mar 2009 14:37:18 +0000 (15:37 +0100)

Brown paper bag fix for MinGW 64-bit stat

When overriding the identifier "stat" so that "struct stat" will be
substituted with "struct _stati64" everywhere, I tried to fix the calls
to the _function_ stat(), too, but I forgot to change the earlier
attempt "stat64" to "_stati64" there.

So, the stat() calls were overridden by calls to _stati64() instead.

Unfortunately, there is a function _stati64() so that I missed that
calls to stat() were not actually overridden by calls to mingw_lstat(),
but t4200-rerere.sh showed the error.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-revert.c: release index lock when cherry-pickin... Chris Johnsen Sat, 7 Mar 2009 09:30:51 +0000 (03:30 -0600)

builtin-revert.c: release index lock when cherry-picking an empty commit

When a cherry-pick of an empty commit is done, release the lock
held on the index.

The fix is the same as was applied to similar code in 4271666046.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Support '*' in the middle of a refspecDaniel Barkalow Sat, 7 Mar 2009 06:11:39 +0000 (01:11 -0500)

Support '*' in the middle of a refspec

In order to keep the requirements strict, each * has to be a full path
component, and there may only be one * per side. This requirement is
enforced entirely by check_ref_format(); the matching implementation
will substitute the whatever matches the * in the lhs for the * in the
rhs.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Keep '*' in pattern refspecsDaniel Barkalow Sat, 7 Mar 2009 06:11:36 +0000 (01:11 -0500)

Keep '*' in pattern refspecs

In order to do anything more capable with refspecs, the first step is
to keep the entire input. Additionally, validate patterns by checking
for the ref matching the rules for a pattern as given by
check_ref_format(). This requires a slight change to
check_ref_format() to make it enforce the requirement that the '*'
immediately follow a '/'.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use the matching function to generate the match resultsDaniel Barkalow Sat, 7 Mar 2009 06:11:34 +0000 (01:11 -0500)

Use the matching function to generate the match results

This puts all of the interpretation of the pattern representation in a
single function for easy manipulation.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use a single function to match names against patternsDaniel Barkalow Sat, 7 Mar 2009 06:11:29 +0000 (01:11 -0500)

Use a single function to match names against patterns

This will help when the matching changes.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make clone parse the default refspec with the normal... Daniel Barkalow Fri, 6 Mar 2009 04:56:16 +0000 (23:56 -0500)

Make clone parse the default refspec with the normal code

Instead of creating a refspec by hand, go through the refspec parsing
code, so that changes in the refspec storage will be accounted for.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: add support for coloring with external grepsRené Scharfe Sat, 7 Mar 2009 12:34:46 +0000 (13:34 +0100)

grep: add support for coloring with external greps

Add the config variable color.grep.external, which can be used to
switch on coloring of external greps. To enable auto coloring with
GNU grep, one needs to set color.grep.external to --color=always to
defeat the pager started by git grep. The value of the config
variable will be passed to the external grep only if it would
colorize internal grep's output, so automatic terminal detected
works. The default is to not pass any option, because the external
grep command could be a program without color support.

Also set the environment variables GREP_COLOR and GREP_COLORS to
pass the configured color for matches to the external grep. This
works with GNU grep; other variables could be added as needed.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: color patterns in outputRené Scharfe Sat, 7 Mar 2009 12:32:32 +0000 (13:32 +0100)

grep: color patterns in output

Coloring matches makes them easier to spot in the output.

Add two options and two parameters: color.grep (to turn coloring on
or off), color.grep.match (to set the color of matches), --color
and --no-color (to turn coloring on or off, respectively).

The output of external greps is not changed.

This patch is based on earlier ones by Nguyễn Thái Ngọc Duy and
Thiago Alves.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: add pmatch and eflags arguments to match_one_patt... René Scharfe Sat, 7 Mar 2009 12:30:27 +0000 (13:30 +0100)

grep: add pmatch and eflags arguments to match_one_pattern()

Push pmatch and eflags to the callers of match_one_pattern(), which
allows them to specify regex execution flags and to get the location
of a match.

Since we only use the first element of the matches array and aren't
interested in submatches, no provision is made for callers to
provide a larger array.

eflags are ignored for fixed patterns, but that's OK, since they
only have a meaning in connection with regular expressions
containing ^ or $.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: remove grep_opt argument from match_expr_eval()René Scharfe Sat, 7 Mar 2009 12:28:40 +0000 (13:28 +0100)

grep: remove grep_opt argument from match_expr_eval()

The only use of the struct grep_opt argument of match_expr_eval()
is to pass the option word_regexp to match_one_pattern(). By adding
a pattern flag for it we can reduce the number of function arguments
of these two functions, as a cleanup and preparation for adding more
in the next patch.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: micro-optimize hit collection for AND nodesRené Scharfe Sat, 7 Mar 2009 12:27:15 +0000 (13:27 +0100)

grep: micro-optimize hit collection for AND nodes

In addition to returning if an expression matches a line,
match_expr_eval() updates the expression's hit flag if the parameter
collect_hits is set. It never sets collect_hits for children of AND
nodes, though, so their hit flag will never be updated. Because of
that we can return early if the first child didn't match, no matter
if collect_hits is set or not.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

document config --bool-or-intJeff King Sat, 7 Mar 2009 17:14:06 +0000 (12:14 -0500)

document config --bool-or-int

The documentation is just a pointer to the --bool and --int
options, but it makes sense to at least mention that it
exists.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: set help text for --bool-or-intJeff King Sat, 7 Mar 2009 17:14:05 +0000 (12:14 -0500)

config: set help text for --bool-or-int

The conversion to parse_opt left this as NULL; on glibc
systems, the usage message prints

--bool-or-int (null)

and on other ones, segfaults.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1300: use test_must_fail as appropriateJeff King Sat, 7 Mar 2009 17:14:04 +0000 (12:14 -0500)

t1300: use test_must_fail as appropriate

Some of the tests checked the exit code manually, even going
so far as to run git outside of the test_expect harness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cleanup: add isascii()René Scharfe Sat, 7 Mar 2009 13:06:49 +0000 (14:06 +0100)

cleanup: add isascii()

Add a standard definition of isascii() and use it to replace an open
coded high-bit test in pretty.c. While we're there, write the ESC
char as the more commonly used '\033' instead of as 0x1b to enhance
its grepability.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: fix badly indented paragraphs in "-... Christian Couder Sat, 7 Mar 2009 12:37:24 +0000 (13:37 +0100)

Documentation: fix badly indented paragraphs in "--bisect-all" description

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.6.3Junio C Hamano Fri, 6 Mar 2009 09:37:22 +0000 (01:37 -0800)

Update draft release notes to 1.6.3

Make git blame's date output format configurable, like... Eugene Letuchy Fri, 20 Feb 2009 22:51:11 +0000 (14:51 -0800)

Make git blame's date output format configurable, like git log

Add the following:

- git config value blame.date that expects one of the git log date
formats (e.g. relative,local,default,iso,...);

- git blame command line option --date expects one of the git
log date formats;

- documentation in blame-options.txt;

- git blame uses the appropriate date.c functions and enums to
make sense of the date format and provide appropriate data;

git blame continues to line up the output columns by padding the date
column up to the max width of the chosen date format.

The date format for git blame without both blame.date and --date continues
to be ISO for backwards compatibility.

git annotate ignores the date format specifiers and continues to uses the
ISO format, as before.

Signed-off-by: Eugene Letuchy <eugene@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'en/maint-hash-object'Junio C Hamano Thu, 5 Mar 2009 23:58:42 +0000 (15:58 -0800)

Merge branch 'en/maint-hash-object'

* en/maint-hash-object:
Ensure proper setup of git_dir for git-hash-object

Conflicts:
hash-object.c

Merge branch 'jc/blame'Junio C Hamano Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)

Merge branch 'jc/blame'

* jc/blame:
blame: show "previous" information in --porcelain/--incremental format
git-blame: refactor code to emit "porcelain format" output

Merge branch 'ns/pretty-format'Junio C Hamano Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)

Merge branch 'ns/pretty-format'

* ns/pretty-format:
bash completion: add --format= and --oneline options for "git log"
Add tests for git log --pretty, --format and --oneline.
Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit"
Give short-hands to --pretty=tformat:%formatstring
Add --format that is a synonym to --pretty

Merge branch 'jk/sane-relative-time'Junio C Hamano Thu, 5 Mar 2009 23:41:43 +0000 (15:41 -0800)

Merge branch 'jk/sane-relative-time'

* jk/sane-relative-time:
never fallback relative times to absolute

Merge branch 'fc/config-editor'Junio C Hamano Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)

Merge branch 'fc/config-editor'

* fc/config-editor:
git config: trivial cleanup for editor action
git config: codestyle cleanups
config: Add new option to open an editor.

Merge branch 'js/send-email'Junio C Hamano Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)

Merge branch 'js/send-email'

* js/send-email:
send-email: add --confirm option and configuration setting
send-email: don't create temporary compose file until it is needed
send-email: --suppress-cc improvements
send-email: handle multiple Cc addresses when reading mbox message
send-email: allow send-email to run outside a repo

Merge branch 'sg/rerere-cleanup'Junio C Hamano Thu, 5 Mar 2009 23:41:42 +0000 (15:41 -0800)

Merge branch 'sg/rerere-cleanup'

* sg/rerere-cleanup:
rerere: remove duplicated functions

Merge branch 'jc/add-p-unquote'Junio C Hamano Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)

Merge branch 'jc/add-p-unquote'

* jc/add-p-unquote:
git-add -i/-p: learn to unwrap C-quoted paths

Merge branch 'jw/imap-preformatted-html'Junio C Hamano Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)

Merge branch 'jw/imap-preformatted-html'

* jw/imap-preformatted-html:
imap.preformattedHTML to tell Thunderbird to send non-flowed text

Merge branch 'jw/format-patch-attach'Junio C Hamano Thu, 5 Mar 2009 23:41:41 +0000 (15:41 -0800)

Merge branch 'jw/format-patch-attach'

* jw/format-patch-attach:
Enable setting attach as the default in .gitconfig for git-format-patch.

Merge branch 'sr/force-rebase'Junio C Hamano Thu, 5 Mar 2009 23:41:40 +0000 (15:41 -0800)

Merge branch 'sr/force-rebase'

* sr/force-rebase:
Teach rebase to rebase even if upstream is up to date

Merge branch 'fg/exclude-bq'Junio C Hamano Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)

Merge branch 'fg/exclude-bq'

* fg/exclude-bq:
Support "\" in non-wildcard exclusion entries

Merge branch 'dm/add-i-edit-abort'Junio C Hamano Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)

Merge branch 'dm/add-i-edit-abort'

* dm/add-i-edit-abort:
add -i: revisit hunk on editor failure

Merge branch 'tp/completion'Junio C Hamano Thu, 5 Mar 2009 23:41:39 +0000 (15:41 -0800)

Merge branch 'tp/completion'

* tp/completion:
Fixup: Add bare repository indicator for __git_ps1
Add bare repository indicator for __git_ps1
completion: More fixes to prevent unbound variable errors
completion: Better __git_ps1 support when not in working directory
completion: Use consistent if [...] convention, not "test"
completion: For consistency, change "git rev-parse" to __gitdir calls

Merge branch 'js/branch-symref'Junio C Hamano Thu, 5 Mar 2009 23:41:35 +0000 (15:41 -0800)

Merge branch 'js/branch-symref'

* js/branch-symref:
add basic branch display tests
branch: clean up repeated strlen
Avoid segfault with 'git branch' when the HEAD is detached
builtin-branch: improve output when displaying remote branches

Conflicts:
builtin-branch.c

Merge branch 'al/ansi-color'Junio C Hamano Thu, 5 Mar 2009 23:41:19 +0000 (15:41 -0800)

Merge branch 'al/ansi-color'

* al/ansi-color:
builtin-branch.c: Rename branch category color names
Clean up use of ANSI color sequences

Merge branch 'js/valgrind'Junio C Hamano Thu, 5 Mar 2009 23:41:18 +0000 (15:41 -0800)

Merge branch 'js/valgrind'

* js/valgrind:
valgrind: do not require valgrind 3.4.0 or newer
test-lib: avoid assuming that templates/ are in the GIT_EXEC_PATH
Tests: let --valgrind imply --verbose and --tee
Add a script to coalesce the valgrind outputs
t/Makefile: provide a 'valgrind' target
test-lib.sh: optionally output to test-results/$TEST.out, too
Valgrind support: check for more than just programming errors
valgrind: ignore ldso and more libz errors
Add valgrind support in test scripts

MinGW: 64-bit file offsetsJohannes Schindelin Thu, 5 Mar 2009 16:05:12 +0000 (17:05 +0100)

MinGW: 64-bit file offsets

The type 'off_t' should be used everywhere so that the bit-depth of that
type can be adjusted in the standard C library, and you just need to
recompile your program to benefit from the extended precision.

Only that it was not done that way in the MS runtime library.

This patch reroutes off_t to off64_t and provides the other necessary
changes so that finally, clones larger than 2 gigabyte work on Windows
(provided you are on a file system that allows files larger than 2gb).

Initial patch by Sickboy <sb@dev-heaven.net>.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation - More examples for git bisectJohn Tapsell Thu, 5 Mar 2009 12:36:14 +0000 (12:36 +0000)

Documentation - More examples for git bisect

Including passing parameters to the programs, and running more
complicated checks without requiring a seperate shell script.

Signed-off-by: John Tapsell <johnflux@gmail.com>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Draft release notes: Carry forward the warning for... Junio C Hamano Thu, 5 Mar 2009 22:50:00 +0000 (14:50 -0800)

Draft release notes: Carry forward the warning for behaviour changes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 5 Mar 2009 07:43:23 +0000 (23:43 -0800)

Merge branch 'maint'

* maint:
Make the 'lock file' exists error more informative

improve missing repository error messageJeff King Wed, 4 Mar 2009 08:32:29 +0000 (03:32 -0500)

improve missing repository error message

Certain remote commands, when asked to do something in a
particular directory that was not actually a git repository,
would say "unable to chdir or not a git archive". The
"chdir" bit is an unnecessary detail, and the term "git
archive" is much less common these days than "git repository".

So let's switch them all to:

fatal: '%s' does not appear to be a git repository

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stat_tracking_info(): only count real commitsKjetil Barvik Wed, 4 Mar 2009 17:47:39 +0000 (18:47 +0100)

stat_tracking_info(): only count real commits

stat_tracking_info() in remote.c is used to collect the statistics to
be able to say (for instance) from the output of "git checkout':

Your branch and 'foo' have diverged,
and have X and Y different commit(s) each, respectively.

Currently X and Y also includes the count of merges. This patch
excludes the merges from being counted.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make the 'lock file' exists error more informativeJohn Tapsell Wed, 4 Mar 2009 15:00:44 +0000 (15:00 +0000)

Make the 'lock file' exists error more informative

It looks like someone did 90% of the work, then forgot to actually use
the function in one place.

Also the helper function did not use the correct variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-archive: add --output=<file> to send output to... Carlos Manuel Duclos Vergara Mon, 16 Feb 2009 17:20:25 +0000 (18:20 +0100)

git-archive: add --output=<file> to send output to a file

When archiving a repository there is no way to specify a file as output.
This patch adds a new option "--output" that redirects the output to a
file instead of stdout.

Signed-off-by: Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve error message for git-filter-branchJohn Tapsell Thu, 19 Feb 2009 07:36:35 +0000 (07:36 +0000)

Improve error message for git-filter-branch

Tell the user that a backup (original) already exists, and how to solve
this problem (with -f option)

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Google has renamed the imap folderJohn Tapsell Thu, 19 Feb 2009 07:36:11 +0000 (07:36 +0000)

Google has renamed the imap folder

Also add a comment that the web interface wraps the lines

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Modify description file to say what this file isJohn Tapsell Thu, 19 Feb 2009 07:36:00 +0000 (07:36 +0000)

Modify description file to say what this file is

A lot of people see this message for the first time on the gitweb
interface, where there is no clue as to what 'this file' means.

Signed-off-by: John Tapsell <johnflux@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: estimate number of bisection step leftChristian Couder Sat, 21 Feb 2009 08:26:01 +0000 (09:26 +0100)

rev-list: estimate number of bisection step left

This patch teaches "git rev-list --bisect-vars" to output an estimate
of the number of bisection step left _after the current one_ along with
the other variables it already outputs.

This patch also makes "git-bisect.sh" display this number of steps left
_after the current one_, along with the estimate of the number of
revisions left to test (after the current one).

Here is a table to help analyse what should be the best estimate for
the number of bisect steps left.

N : linear case --> probabilities --> best
-------------------------------------------------------------
1 : G-B --> 0 --> 0
2 : G-U1-B --> 0 --> 0
3 : G-U1-U2-B --> 0(1/3) 1(2/3) --> 1
4 : G-U1-U2-U3-B --> 1 --> 1
5 : G-U1-U2-U3-U4-B --> 1(3/5) 2(2/5) --> 1
6 : G-U1-U2-U3-U4-U5-B --> 1(2/6) 2(4/6) --> 2
7 : G-U1-U2-U3-U4-U5-U6-B --> 1(1/7) 2(6/7) --> 2
8 : G-U1-U2-U3-U4-U5-U6-U7-B --> 2 --> 2
9 : G-U1-U2-U3-U4-U5-U6-U7-U8-B --> 2(7/9) 3(2/9) --> 2
10: G-U1-U2-U3-U4-U5-U6-U7-U8-U9-B --> 2(6/10)3(4/10)--> 2

In the column "N", there is the number of revisions that could _now_
be the first bad commit we are looking for.

The "linear case" column describes the linear history corresponding to
the number in column N. G means good, B means bad, and Ux means
unknown. Note that the first bad revision we are looking for can be
any Ux or B.

In the "probabilities" column, there are the different outcomes in
number of steps with the odds of each outcome in parenthesis
corresponding to the linear case.

The "best" column gives the most accurate estimate among the different
outcomes in the "probabilities" column.

We have the following:

best(2^n) == n - 1

and for any x between 0 included and 2^n excluded, the probability for
n - 1 steps left looks like:

P(2^n + x) == (2^n - x) / (2^n + x)

and P(2^n + x) < 0.5 means 2^n < 3x

So the algorithm used in this patch calculates 2^n and x, and then
choose between returning n - 1 and n.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix neglect of diff_setup()/diff_setup_done() symmetry.Keith Cascio Tue, 17 Feb 2009 02:59:00 +0000 (18:59 -0800)

Fix neglect of diff_setup()/diff_setup_done() symmetry.

Code that calls diff_setup(), including via init_revisions(), should later call
diff_setup_done(), possibly via setup_revisions(). Failure to do so could cause
errors, especially in the future when we add responsibilities to
diff_setup_done(). This instance causes no known errors with the present code.
But it resulted in an error with an experimental patch.

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use DIFF_XDL_SET/DIFF_OPT_SET instead of raw bit-maskingKeith Cascio Tue, 17 Feb 2009 03:26:49 +0000 (19:26 -0800)

Use DIFF_XDL_SET/DIFF_OPT_SET instead of raw bit-masking

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Beginning of 1.6.3 development trackJunio C Hamano Wed, 4 Mar 2009 08:41:01 +0000 (00:41 -0800)

Beginning of 1.6.3 development track

Beginning of 1.6.2 maintenance trackJunio C Hamano Wed, 4 Mar 2009 08:37:50 +0000 (00:37 -0800)

Beginning of 1.6.2 maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>

GIT 1.6.2 v1.6.2Junio C Hamano Wed, 4 Mar 2009 07:02:16 +0000 (23:02 -0800)

GIT 1.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make git-clone respect branch.autosetuprebaseJunio C Hamano Wed, 4 Mar 2009 06:29:55 +0000 (22:29 -0800)

Make git-clone respect branch.autosetuprebase

When git-clone creates an initial branch it was not checking the
branch.autosetuprebase configuration option (which may exist in
~/.gitconfig). Refactor the code used by "git branch" to create
a new branch, and use it instead of the insufficiently duplicated code
in builtin-clone.

Changes are partly, and the test is mostly, based on the previous work by
Pat Notz.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git submodule: Fix adding of submodules at paths with... Michael J Gruber Tue, 3 Mar 2009 15:08:21 +0000 (16:08 +0100)

git submodule: Fix adding of submodules at paths with ./, .. and //

Make 'git submodule add' normalize the submodule path in the
same way as 'git ls-files' does, so that 'git submodule init' looks up
the information in .gitmodules with the same key under which 'git
submodule add' stores it.

This fixes 4 known breakages.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git submodule: Add test cases for git submodule addMichael J Gruber Tue, 3 Mar 2009 15:08:20 +0000 (16:08 +0100)

git submodule: Add test cases for git submodule add

Add simple test cases for adding and initialising submodules. The
init step is necessary in order to verify the added information.

The second test exposes a known breakage due to './' in the path: git
ls-files simplifies the path but git add does not, which leads to git
init looking for different lines in .gitmodules than git add adds.

The other tests add test cases for '//' and '..' in the path which
currently fail for the same reason.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Typo / spelling / formatting fixesMike Ralphson Tue, 3 Mar 2009 19:29:22 +0000 (19:29 +0000)

Documentation: Typo / spelling / formatting fixes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Expand a couple of abbreviationsMike Ralphson Tue, 3 Mar 2009 19:29:21 +0000 (19:29 +0000)

Documentation: Expand a couple of abbreviations

These may not be obvious to non-native English speakers

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Typos / spelling fixes in RelNotesMike Ralphson Tue, 3 Mar 2009 19:29:20 +0000 (19:29 +0000)

Documentation: Typos / spelling fixes in RelNotes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-archive.txt: Note attributesRoy Lee Tue, 3 Mar 2009 16:49:29 +0000 (00:49 +0800)

Documentation/git-archive.txt: Note attributes

Signed-off-by: Roy Lee <roylee17@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: avoid 'git reset' when possibleJohannes Schindelin Tue, 3 Mar 2009 09:55:31 +0000 (10:55 +0100)

rebase -i: avoid 'git reset' when possible

When picking commits whose parents have not changed, we do not need to
rewrite the commit. We do not need to reset the working directory to
the parent's state, either.

Requested by Sverre Rabbelier.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: run post-checkout hook when checking outJeff King Tue, 3 Mar 2009 05:37:51 +0000 (00:37 -0500)

clone: run post-checkout hook when checking out

The mental model for clone is that the branch is "checked
out" (and it even says this in Documentation/git-clone.txt:
"...creates and checks out an initial branch"). Therefore it
is reasonable for users to expect that any post-checkout
hook would be run.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: add --confirm option and configuration... Jay Soffian Tue, 3 Mar 2009 04:52:18 +0000 (23:52 -0500)

send-email: add --confirm option and configuration setting

send-email violates the principle of least surprise by automatically
cc'ing additional recipients without confirming this with the user.

This patch teaches send-email a --confirm option. It takes the
following values:

--confirm=always always confirm before sending
--confirm=never never confirm before sending
--confirm=cc confirm before sending when send-email has
automatically added addresses from the patch to
the Cc list
--confirm=compose confirm before sending the first message when
using --compose. (Needed to maintain backwards
compatibility with existing behavior.)
--confirm=auto 'cc' + 'compose'

If sendemail.confirm is unconfigured, the option defaults to 'compose'
if any suppress-Cc related options have been used, otherwise it defaults
to 'auto'.

Unfortunately, it is impossible to introduce this patch such that it
helps new users without potentially annoying some existing users. We
attempt to mitigate the latter by:

* Allowing the user to set 'git config sendemail.confirm never'
* Allowing the user to say 'all' after the first prompt to not be
prompted on remaining emails during the same invocation.
* Telling the user about the 'sendemail.confirm' setting if it is
unconfigured whenever we prompt due to Cc before sending.
* Only prompting if no --suppress related options have been passed, as
using such an option is likely to indicate an experienced send-email
user.

There is a slight fib in message informing the user of the
sendemail.confirm setting and this is intentional. Setting 'auto'
differs from leaving sendemail.confirm unset in two ways: 1) 'auto'
obviously squelches the informational message; 2) 'auto' prompts when
the Cc list has been expanded even in the presence of a --suppress
related option, where leaving sendemail.confirm unset does not. This is
intentional to keep the message simple, and to avoid adding another
sendemail.confirm value ('auto-except-suppress'?).

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-pull: Allow --stat and --no-stat to be used with... Tor Arne Vestbø Sun, 1 Mar 2009 21:28:28 +0000 (22:28 +0100)

git-pull: Allow --stat and --no-stat to be used with --rebase

Forwards the --stat, --no-stat, and --summary options on to git-rebase.

Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase: Add --stat and --no-stat for producing... Tor Arne Vestbø Sun, 1 Mar 2009 22:11:38 +0000 (23:11 +0100)

git-rebase: Add --stat and --no-stat for producing diffstat on rebase

The behavior of --verbose is unchanged, but uses a different state
variable internally, so that the meaning of verbose output may be
expanded without affecting the diffstat. This is also reflected in
the documentation.

The configuration option rebase.stat works the same was as merg.stat,
but the default is currently false.

Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: respect in-reply-to regardless of threadingThomas Rast Sun, 1 Mar 2009 22:45:41 +0000 (23:45 +0100)

send-email: respect in-reply-to regardless of threading

git-send-email supports the --in-reply-to option even with
--no-thread. However, the code that adds the relevant mail headers
was guarded by a test for --thread.

Remove the test, so that the user's choice is respected.

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

optimize compat/ memmem()René Scharfe Mon, 2 Mar 2009 23:19:30 +0000 (00:19 +0100)

optimize compat/ memmem()

When memmem() was imported from glibc 2.2 into compat/, an optimization
was dropped in the process, in order to make the code smaller and simpler.
It was OK because memmem() wasn't used in performance-critical code. Now
the situation has changed and we can benefit from this optimization.

The trick is to avoid calling memcmp() if the first character of the needle
already doesn't match. Checking one character directly is much cheaper
than the function call overhead. We keep the first character of the needle
in the variable named point and the rest in the one named tail.

The following commands were run in a Linux kernel repository and timed, the
best of five results is shown:

$ STRING='Ensure that the real time constraints are schedulable.'
$ git log -S"$STRING" HEAD -- kernel/sched.c >/dev/null

On Windows Vista x64, before:

real 0m8.470s
user 0m0.000s
sys 0m0.000s

And after the patch:

real 0m1.887s
user 0m0.000s
sys 0m0.000s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: use memmem()René Scharfe Mon, 2 Mar 2009 23:00:55 +0000 (00:00 +0100)

diffcore-pickaxe: use memmem()

Use memmem() instead of open-coding it. The system libraries usually have a
much faster version than the memcmp()-loop here. Even our own fall-back in
compat/, which is used on Windows, is slightly faster.

The following commands were run in a Linux kernel repository and timed, the
best of five results is shown:

$ STRING='Ensure that the real time constraints are schedulable.'
$ git log -S"$STRING" HEAD -- kernel/sched.c >/dev/null

On Ubuntu 8.10 x64, before (v1.6.2-rc2):

8.09user 0.04system 0:08.14elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+30952minor)pagefaults 0swaps

And with the patch:

1.50user 0.04system 0:01.54elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+30645minor)pagefaults 0swaps

On Fedora 10 x64, before:

8.34user 0.05system 0:08.39elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+29268minor)pagefaults 0swaps

And with the patch:

1.15user 0.05system 0:01.20elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+32253minor)pagefaults 0swaps

On Windows Vista x64, before:

real 0m9.204s
user 0m0.000s
sys 0m0.000s

And with the patch:

real 0m8.470s
user 0m0.000s
sys 0m0.000s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: minor grammatical fixes.David J. Mellor Mon, 2 Mar 2009 06:42:44 +0000 (22:42 -0800)

Documentation: minor grammatical fixes.

The final hunk in this patch corrects what appears to be a typo:

of --> or

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: minor grammatical fixes.David J. Mellor Mon, 2 Mar 2009 06:38:36 +0000 (22:38 -0800)

Documentation: minor grammatical fixes.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: minor grammatical fixes.David J. Mellor Mon, 2 Mar 2009 06:37:41 +0000 (22:37 -0800)

Documentation: minor grammatical fixes.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3400-rebase: Move detached HEAD check earlierJohannes Sixt Sun, 1 Mar 2009 10:20:03 +0000 (11:20 +0100)

t3400-rebase: Move detached HEAD check earlier

Short story: There is a section in t3400 that tests fundamental rebase
properties. 3ec7371f (Add two extra tests for git rebase, 2009-02-09)
added a check that rebase works on a detached HEAD, but the test was put
near the end of the file. This moves it to a more suitable place.

Long story: The test that preceded the one in question tests that a
rebased commit degrades from a content change with mode change to a
mere mode change. But on Windows, where we have core.filemode=false,
the original commit did not record the mode change, and so the rebase
operation did not rebase anything. This caused the subsequent detached
HEAD test to fail.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano Mon, 2 Mar 2009 06:20:52 +0000 (22:20 -0800)

Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Fix possible infinite loop and display corruption