gitweb.git
Merge branch 'maint'Junio C Hamano Wed, 3 Sep 2008 00:10:08 +0000 (17:10 -0700)

Merge branch 'maint'

* maint:
Makefile: add merge_recursive.h to LIB_H
Improve documentation for --dirstat diff option
Bring local clone's origin URL in line with that of a remote clone
Documentation: minor cleanup in a use case in 'git stash' manual
Documentation: fix disappeared lines in 'git stash' manpage
Documentation: fix reference to a for-each-ref option

Makefile: add merge_recursive.h to LIB_HMiklos Vajna Tue, 2 Sep 2008 23:49:05 +0000 (01:49 +0200)

Makefile: add merge_recursive.h to LIB_H

When modifying merge-recursive.h, for example builtin-merge-recursive.c
have to be recompiled which was not true till now, causing various
runtime errors using an incremental build.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve documentation for --dirstat diff optionHeikki Orsila Mon, 1 Sep 2008 00:50:28 +0000 (03:50 +0300)

Improve documentation for --dirstat diff option

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bring local clone's origin URL in line with that of... Johan Herland Mon, 1 Sep 2008 19:07:33 +0000 (21:07 +0200)

Bring local clone's origin URL in line with that of a remote clone

On a local clone, "git clone" would use the fully DWIMmed path as the origin
URL in the resulting repo. This was slightly inconsistent with the case of a
remote clone where the _given_ URL was used as the origin URL (because the
DWIMming was done remotely, and was therefore not available to "git clone").

This behaviour caused problems when cloning a local non-bare repo with
relative submodule URLs, because these submodule URLs would then be resolved
against the DWIMmed URL (e.g. "/repo/.git") instead of the given URL (e.g.
"/repo").

This patch teaches "git clone" to use the _given_ URL - instead of the
DWIMmed path - as the origin URL. This causes relative submodule URLs to be
resolved correctly, as long the _given_ URL indicates the correct directory
against which the submodule URLs should be resolved.

The patch also updates a testcase that contained the old-style origin URLs.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: minor cleanup in a use case in 'git... SZEDER Gábor Tue, 2 Sep 2008 01:45:01 +0000 (03:45 +0200)

Documentation: minor cleanup in a use case in 'git stash' manual

There is no need to explicitly pass the file to be committed to 'git
commit', because it's contents is already in the index.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: fix disappeared lines in 'git stash... SZEDER Gábor Tue, 2 Sep 2008 01:35:24 +0000 (03:35 +0200)

Documentation: fix disappeared lines in 'git stash' manpage

Asciidoc removes lines starting with a dot when creating manpages.
Since those lines were comments in use case examples showing shell
commands, preceed those lines with a hash sign.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: fix reference to a for-each-ref optionSZEDER Gábor Mon, 1 Sep 2008 21:02:09 +0000 (23:02 +0200)

Documentation: fix reference to a for-each-ref option

... to match the synopsis section

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Shawn O. Pearce Mon, 1 Sep 2008 22:39:56 +0000 (15:39 -0700)

Merge branch 'maint'

* maint:
git-gui: Fix string escaping in po2msg.sh
git gui: show diffs with a minimum of 1 context line

Conflicts:
lib/option.tcl

git-gui: Fix string escaping in po2msg.shAlexander Gavrilov Sat, 30 Aug 2008 21:12:26 +0000 (01:12 +0400)

git-gui: Fix string escaping in po2msg.sh

Escape '$', because otherwise git-gui crashes while
trying to load malformed Japanese localization strings.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git gui: show diffs with a minimum of 1 context lineClemens Buchacher Sat, 30 Aug 2008 16:45:27 +0000 (18:45 +0200)

git gui: show diffs with a minimum of 1 context line

Staging hunks without context does not work, because line number
information would have to be recomputed for individual hunks.

Since it is already possible to stage individual lines using
'Stage Line for Commit', zero context diffs are not really
necessary for git gui.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Merge branch 'tr/rev-list-docs' into tr/filter-branchJunio C Hamano Sun, 31 Aug 2008 17:41:01 +0000 (10:41 -0700)

Merge branch 'tr/rev-list-docs' into tr/filter-branch

This prepares the necessary parts to merge filter-branch
fix based on simplify-merges to master.

cast pid_t's to uintmax_t to improve portabilityDavid Soria Parra Sun, 31 Aug 2008 12:09:39 +0000 (14:09 +0200)

cast pid_t's to uintmax_t to improve portability

Some systems (like e.g. OpenSolaris) define pid_t as long,
therefore all our sprintf that use %i/%d cause a compiler warning
beacuse of the implicit long->int cast. To make sure that
we fit the limits, we display pids as PRIuMAX and cast them explicitly
to uintmax_t.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 31 Aug 2008 23:52:53 +0000 (16:52 -0700)

Merge branch 'maint'

* maint:
Document sendemail.envelopesender configuration
Document clarification: gitmodules, gitattributes
config.txt: Add missing colons after option name

Document sendemail.envelopesender configurationAsk Bjørn Hansen Sun, 31 Aug 2008 20:32:43 +0000 (13:32 -0700)

Document sendemail.envelopesender configuration

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document clarification: gitmodules, gitattributesGustaf Hendeby Sun, 31 Aug 2008 16:00:27 +0000 (18:00 +0200)

Document clarification: gitmodules, gitattributes

The SYNOPSIS section of gitattibutes and gitmodule fail to clearly
specify the name of the in tree files used. This patch brings in the
initial `.' and the fact that the `.gitmodules' file should reside at
the top-level of the working tree.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add help.autocorrect to enable/disable autocorrectingAlex Riesen Sun, 31 Aug 2008 13:54:58 +0000 (15:54 +0200)

Add help.autocorrect to enable/disable autocorrecting

It is off(0) by default, to avoid scaring people unless they asked to.
If set to a non-0 value, wait for that amount of deciseconds before
running the corrected command.

Suggested by Junio, so he has a chance to hit Ctrl-C.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git wrapper: DWIM mistyped commandsJohannes Schindelin Sun, 31 Aug 2008 13:50:23 +0000 (15:50 +0200)

git wrapper: DWIM mistyped commands

This patch introduces a modified Damerau-Levenshtein algorithm into
Git's code base, and uses it with the following penalties to show some
similar commands when an unknown command was encountered:

swap = 0, insertion = 1, substitution = 2, deletion = 4

A typical output would now look like this:

$ git sm
git: 'sm' is not a git-command. See 'git --help'.

Did you mean one of these?
am
rm

The cut-off is at similarity rating 6, which was empirically determined
to give sensible results.

As a convenience, if there is only one candidate, Git continues under
the assumption that the user mistyped it. Example:

$ git reabse
WARNING: You called a Git program named 'reabse', which does
not exist.
Continuing under the assumption that you meant 'rebase'
[...]

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

'git foo' program identifies itself without dash in... Junio C Hamano Sun, 31 Aug 2008 16:39:19 +0000 (09:39 -0700)

'git foo' program identifies itself without dash in die() messages

This is a mechanical conversion of all '*.c' files with:

s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;

The result was manually inspected and no false positive was found.

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

setup_git_directory(): fix move to worktree toplevel... Nguyễn Thái Ngọc Duy Sat, 30 Aug 2008 09:15:32 +0000 (16:15 +0700)

setup_git_directory(): fix move to worktree toplevel directory

When setup_git_directory() returns successfully, it is supposed to move
current working directory to worktree toplevel directory.

However, the code recomputing prefix inside setup_git_directory() has
to move cwd back to original working directory, in order to get new
prefix. After that, it should move cwd back to worktree toplevel
directory as expected.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-index: fix worktree setupNguyễn Thái Ngọc Duy Sat, 30 Aug 2008 09:13:58 +0000 (16:13 +0700)

update-index: fix worktree setup

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: Add missing colons after option nameTeemu Likonen Fri, 29 Aug 2008 07:29:42 +0000 (10:29 +0300)

config.txt: Add missing colons after option name

gitcvs.usecrlfattr --> gitcvs.usecrlfattr::

This fixes an asciidoc markup issue.

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git commit --author=$name: look $name up in existing... Junio C Hamano Wed, 27 Aug 2008 06:13:13 +0000 (23:13 -0700)

git commit --author=$name: look $name up in existing commits

This allows "git commit --author=$name" to accept a name that is not in
the required "A U Thor <author@example.xz>" format, and use that to look
up an author name that matches from existing commits.

When using this feature, it is the user's responsibility to give a name
that uniquely matches the name s/he wants, as the logic returns the name
from the first matching commit.

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

diff: Help "less" hide ^M from the outputJunio C Hamano Thu, 28 Aug 2008 02:48:01 +0000 (19:48 -0700)

diff: Help "less" hide ^M from the output

When the tracked contents have CRLF line endings, colored diff output
shows "^M" at the end of output lines, which is distracting, even though
the pager we use by default ("less") knows to hide them.

The problem is that "less" hides a carriage-return only at the end of the
line, immediately before a line feed. The colored diff output does not
take this into account, and emits four element sequence for each line:

- force this color;
- the line up to but not including the terminating line feed;
- reset color
- line feed.

By including the carriage return at the end of the line in the second
item, we are breaking the smart our pager has in order not to show "^M".
This can be fixed by changing the sequence to:

- force this color;
- the line up to but not including the terminating end-of-line;
- reset color
- end-of-line.

where end-of-line is either a single linefeed or a CRLF pair. When the
output is not colored, "force this color" and "reset color" sequences are
both empty, so we won't have this problem with or without this patch.

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

Merge branch 'maint'Junio C Hamano Sun, 31 Aug 2008 03:31:39 +0000 (20:31 -0700)

Merge branch 'maint'

* maint:
gitattributes: -crlf is not binary
git-apply: Loosen "match_beginning" logic
Fix example in git-name-rev documentation
shell: do not play duplicated definition games to shrink the executable
Fix use of hardlinks in "make install"
pack-objects: Allow missing base objects when creating thin packs

gitattributes: -crlf is not binaryJunio C Hamano Sat, 30 Aug 2008 21:35:15 +0000 (14:35 -0700)

gitattributes: -crlf is not binary

The description of crlf attribute incorrectly said that "-crlf" means
binary. It is true that for binary files you would want "-crlf", but
that is not the same thing.

We also have supported attribute macros and via that mechanism a handy
"binary" to specify "-crlf -diff" at the same time. It was not documented
anywhere as far as I can tell, even though the support was there from
the very beginning.

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

checkout: do not check out unmerged higher stages randomlyJunio C Hamano Fri, 29 Aug 2008 20:40:36 +0000 (13:40 -0700)

checkout: do not check out unmerged higher stages randomly

During a conflicted merge when you have unmerged stages for a
path F in the index, if you said:

$ git checkout F

we rewrote F as many times as we have stages for it, and the
last one (typically "theirs") was left in the work tree, without
resolving the conflict.

This fixes it by noticing that a specified pathspec pattern
matches an unmerged path, and by erroring out.

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

Merge branch 'jc/post-simplify' (early part) into tr... Junio C Hamano Sat, 30 Aug 2008 23:03:40 +0000 (16:03 -0700)

Merge branch 'jc/post-simplify' (early part) into tr/filter-branch

* 'jc/post-simplify' (early part):
revision --simplify-merges: make it a no-op without pathspec
revision --simplify-merges: do not leave commits unprocessed
revision --simplify-merges: use decoration instead of commit->util field

Start conforming code to "git subcmd" styleHeikki Orsila Sat, 30 Aug 2008 11:12:53 +0000 (14:12 +0300)

Start conforming code to "git subcmd" style

User notifications are presented as 'git cmd', and code comments
are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-apply: Loosen "match_beginning" logicJunio C Hamano Sat, 30 Aug 2008 20:20:31 +0000 (13:20 -0700)

git-apply: Loosen "match_beginning" logic

Even after a handfle attempts, match_beginning logic still has corner
cases:

1bf1a85 (apply: treat EOF as proper context., 2006-05-23)
65aadb9 (apply: force matching at the beginning., 2006-05-24)
4be6096 (apply --unidiff-zero: loosen sanity checks ..., 2006-09-17)
ee5a317 (Fix "git apply" to correctly enforce "match ..., 2008-04-06)

This is a tricky piece of code.

We still incorrectly enforce "match_beginning" for -U0 matches.
I noticed this while trying out an example sequence from Clemens Buchacher:

$ echo a >victim
$ git add victim
$ echo b >>victim
$ git diff -U0 >patch
$ cat patch
diff --git i/victim w/victim
index 7898192..422c2b7 100644
--- i/victim
+++ w/victim
@@ -1,0 +2 @@ a
+b
$ git apply --cached --unidiff-zero <patch
$ git show :victim
b
a

The change inserts a new line before the second line, but we insist it to
be applied at the beginning. As the result, the code refuses to apply it
at the original offset, and we end up adding the line at the beginning.

Updates to the test script are by Clemens Buchacher.

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

Fix example in git-name-rev documentationJunio C Hamano Sat, 30 Aug 2008 20:08:50 +0000 (13:08 -0700)

Fix example in git-name-rev documentation

Since 59d3f54 (name-rev: avoid "^0" when unneeded, 2007-02-20), name-rev
stopped showing an unnecessary "^0" to dereference a tag down to a commit.
The patch should have made a matching update to the documentation, but we
forgot.

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

Merge branch 'sp/missing-thin-base' into maintJunio C Hamano Sat, 30 Aug 2008 15:38:19 +0000 (08:38 -0700)

Merge branch 'sp/missing-thin-base' into maint

* sp/missing-thin-base:
pack-objects: Allow missing base objects when creating thin packs

Merge branch 'sb/daemon'Junio C Hamano Sat, 30 Aug 2008 15:17:15 +0000 (08:17 -0700)

Merge branch 'sb/daemon'

* sb/daemon:
daemon.c: minor style fixup
git-daemon: rewrite kindergarden, new option --max-connections
git-daemon: Simplify dead-children reaping logic
git-daemon: use LOG_PID, simplify logging code
git-daemon: call logerror() instead of error()

Merge branch 'af/maint-install-no-handlink' into maintJunio C Hamano Sat, 30 Aug 2008 05:39:25 +0000 (22:39 -0700)

Merge branch 'af/maint-install-no-handlink' into maint

* af/maint-install-no-handlink:
Fix use of hardlinks in "make install"
Makefile: always provide a fallback when hardlinks fail

shell: do not play duplicated definition games to shrin... Junio C Hamano Wed, 20 Aug 2008 01:05:39 +0000 (18:05 -0700)

shell: do not play duplicated definition games to shrink the executable

Playing with linker games to shrink git-shell did not go well with various
other platforms and compilers.

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

Fix use of hardlinks in "make install"Alex Riesen Thu, 28 Aug 2008 13:57:32 +0000 (15:57 +0200)

Fix use of hardlinks in "make install"

The code failed to filter-out git-add properly on platforms were $X is
not empty (ATM there is only one such a platform).

Than it tried to create a hardlink to the file ($execdir/git-add) it just
removed (because git-add is first in the BUILT_INS), so ln failed (but
because stderr was redirected into /dev/null the error was never seen), and
the whole install ended up using "ln -s" instead.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fixup_pack_header_footer(): use nicely aligned buffer... Nicolas Pitre Fri, 29 Aug 2008 20:08:02 +0000 (16:08 -0400)

fixup_pack_header_footer(): use nicely aligned buffer sizes

It should be more efficient to use nicely aligned buffer sizes, either
for filesystem operations or SHA1 checksums. Also, using a relatively
small nominal size might allow for the data to remain in L1 cache
between both SHA1_Update() calls.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: use fixup_pack_header_footer()'s validation... Nicolas Pitre Fri, 29 Aug 2008 20:08:01 +0000 (16:08 -0400)

index-pack: use fixup_pack_header_footer()'s validation mode

When completing a thin pack, a new header has to be written to
the pack and a new SHA1 computed. Make sure that the SHA1 of what
is being read back matches the SHA1 of what was written for both:
the original pack and the appended objects.

To do so, a couple write_or_die() calls were converted to sha1write()
which has the advantage of doing some buffering as well as handling
SHA1 and CRC32 checksum already.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: use fixup_pack_header_footer()'s validati... Nicolas Pitre Fri, 29 Aug 2008 20:08:00 +0000 (16:08 -0400)

pack-objects: use fixup_pack_header_footer()'s validation mode

When limiting the pack size, a new header has to be written to the
pack and a new SHA1 computed. Make sure that the SHA1 of what is being
read back matches the SHA1 of what was written.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

improve reliability of fixup_pack_header_footer()Nicolas Pitre Fri, 29 Aug 2008 20:07:59 +0000 (16:07 -0400)

improve reliability of fixup_pack_header_footer()

Currently, this function has the potential to read corrupted pack data
from disk and give it a valid SHA1 checksum. Let's add the ability to
validate SHA1 checksum of existing data along the way, including before
and after any arbitrary point in the pack.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: improve returned information from write_one()Nicolas Pitre Fri, 29 Aug 2008 20:07:58 +0000 (16:07 -0400)

pack-objects: improve returned information from write_one()

This function returns 0 when the current object couldn't be written
due to the pack size limit, otherwise the current offset in the pack.
There is a problem with this approach however, since current object
could be a delta and its delta base might just have been written in
the same write_one() call, but those successfully written objects are
not accounted in the offset variable tracked by the caller. Currently
this is not an issue but a subsequent patch will need this.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'np/verify-pack' into maintJunio C Hamano Sat, 30 Aug 2008 04:48:02 +0000 (21:48 -0700)

Merge branch 'np/verify-pack' into maint

* np/verify-pack:
discard revindex data when pack list changes

builtin-help: fallback to GIT_MAN_VIEWER before manRomain Francoise Fri, 29 Aug 2008 15:00:43 +0000 (17:00 +0200)

builtin-help: fallback to GIT_MAN_VIEWER before man

In some situations it is useful to be able to switch viewers via the
environment, e.g. in Emacs shell buffers. So check the GIT_MAN_VIEWER
environment variable and try it before falling back to "man".

Signed-off-by: Romain Francoise <romain@orebokech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 29 Aug 2008 07:16:39 +0000 (00:16 -0700)

Merge branch 'maint'

* maint:
tutorial: gentler illustration of Alice/Bob workflow using gitk
pretty=format: respect date format options
make git-shell paranoid about closed stdin/stdout/stderr
Document gitk --argscmd flag.
Fix '--dirstat' with cross-directory renaming
for-each-ref: Allow a trailing slash in the patterns

git-p4: Fix checkout bug when using --import-local.Tor Arvid Lund Wed, 27 Aug 2008 22:36:12 +0000 (00:36 +0200)

git-p4: Fix checkout bug when using --import-local.

When this option is passed to git p4 clone, the checkout at the end would
previously fail. This patch fixes it by optionally creating the master branch
from refs/heads/p4/master, which is the correct one for this option.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-By: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tutorial: gentler illustration of Alice/Bob workflow... Paolo Ciarrocchi Thu, 28 Aug 2008 12:23:52 +0000 (14:23 +0200)

tutorial: gentler illustration of Alice/Bob workflow using gitk

Update to gitutorial as discussedin the git mailing list:

http://marc.info/?t=121969390900002&r=1&w=2

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty=format: respect date format optionsJeff King Fri, 29 Aug 2008 00:54:59 +0000 (20:54 -0400)

pretty=format: respect date format options

When running a command like:

git log --pretty=format:%ad --date=short

the date option was ignored. This patch causes it to use whatever
format was specified by --date (or by --relative-date, etc), just
as the non-user formats would do.

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

make git-shell paranoid about closed stdin/stdout/stderrPaolo Bonzini Wed, 27 Aug 2008 15:20:35 +0000 (17:20 +0200)

make git-shell paranoid about closed stdin/stdout/stderr

It is in general unsafe to start a program with one or more of file
descriptors 0/1/2 closed. Karl Chen for example noticed that stat_command
does this in order to rename a pipe file descriptor to 0:

dup2(from, 0);
close(from);

... but if stdin was closed (for example) from == 0, so that

dup2(0, 0);
close(0);

just ends up closing the pipe. Another extremely rare but nasty problem
would occur if an "important" file ends up in file descriptor 2, and is
corrupted by a call to die().

Fixing this in git was considered to be overkill, so this patch works
around it only for git-shell. The fix is simply to open all the "low"
descriptors to /dev/null in main.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Acked-by: Stephen R. van den Berg <srb@cuci.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document gitk --argscmd flag.Yann Dirson Thu, 28 Aug 2008 22:00:28 +0000 (00:00 +0200)

Document gitk --argscmd flag.

This was part of my original patch, but appears to have been lost.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix '--dirstat' with cross-directory renamingLinus Torvalds Thu, 28 Aug 2008 23:19:08 +0000 (16:19 -0700)

Fix '--dirstat' with cross-directory renaming

The dirstat code depends on the fact that we always generate diffs with
the names sorted, since it then just does a single-pass walk-over of the
sorted list of names and how many changes there were. The sorting means
that all files are nicely grouped by directory.

That all works fine.

Except when we have rename detection, and suddenly the nicely sorted list
of pathnames isn't all that sorted at all. And now the single-pass dirstat
walk gets all confused, and you can get results like this:

[torvalds@nehalem linux]$ git diff --dirstat=2 -M v2.6.27-rc4..v2.6.27-rc5
3.0% arch/powerpc/configs/
6.8% arch/arm/configs/
2.7% arch/powerpc/configs/
4.2% arch/arm/configs/
5.6% arch/powerpc/configs/
8.4% arch/arm/configs/
5.5% arch/powerpc/configs/
23.3% arch/arm/configs/
8.6% arch/powerpc/configs/
4.0% arch/
4.4% drivers/usb/musb/
4.0% drivers/watchdog/
7.6% drivers/
3.5% fs/

The trivial fix is to add a sorting pass, fixing it to:

[torvalds@nehalem linux]$ git diff --dirstat=2 -M v2.6.27-rc4..v2.6.27-rc5
43.0% arch/arm/configs/
25.5% arch/powerpc/configs/
5.3% arch/
4.4% drivers/usb/musb/
4.0% drivers/watchdog/
7.6% drivers/
3.5% fs/

Spot the difference. In case anybody wonders: it's because of a ton of
renames from {include/asm-blackfin => arch/blackfin/include/asm} that just
totally messed up the file ordering in between arch/arm and arch/powerpc.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: Allow a trailing slash in the patternsBjörn Steinbrink Thu, 28 Aug 2008 02:14:02 +0000 (04:14 +0200)

for-each-ref: Allow a trailing slash in the patterns

More often than not, I end up using something like refs/remotes/ as the
pattern for for-each-ref, but that doesn't work, because it expects to see
the slash in the ref name right after the matched pattern. So teach it to
accept the slash as the final character in the pattern as well.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-tree: setup worktree if merge is requiredNguyễn Thái Ngọc Duy Thu, 28 Aug 2008 13:03:22 +0000 (20:03 +0700)

read-tree: setup worktree if merge is required

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: fix worktree setupNguyễn Thái Ngọc Duy Thu, 28 Aug 2008 13:04:30 +0000 (20:04 +0700)

grep: fix worktree setup

Unless used with --cached or grepping on a tree, "git grep" will
search on working directory, so set up worktree properly

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

list_commands: only call git_exec_path if it is neededAlex Riesen Thu, 28 Aug 2008 17:19:42 +0000 (19:19 +0200)

list_commands: only call git_exec_path if it is needed

Even if it always needed

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow git help work without PATH setAlex Riesen Thu, 28 Aug 2008 17:19:07 +0000 (19:19 +0200)

Allow git help work without PATH set

Just because we can

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make main_cmds and other_cmds local to builtin-help.cAlex Riesen Thu, 28 Aug 2008 17:17:46 +0000 (19:17 +0200)

Make main_cmds and other_cmds local to builtin-help.c

These are not used anywhere else.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove useless memset of static command name lists... Alex Riesen Thu, 28 Aug 2008 17:17:13 +0000 (19:17 +0200)

Remove useless memset of static command name lists in builtin-merge.c

The statics are always initialized with 0

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove calculation of the longest command name from... Alex Riesen Thu, 28 Aug 2008 17:15:33 +0000 (19:15 +0200)

Remove calculation of the longest command name from where it is not used

Just calculate it where it is needed - it is cheap and trivial,
as all the lengths are already there (stored when creating the
command lists).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: Avoid c99 array initializationBrandon Casey Thu, 28 Aug 2008 22:47:22 +0000 (17:47 -0500)

dir.c: Avoid c99 array initialization

The following syntax:

char foo[] = {
[0] = 1,
[7] = 2,
[15] = 3
};

is a c99 construct which some compilers do not support even though they
support other c99 constructs. This construct can be avoided by folding
these 'special' test cases into the sane_ctype array and making use of
the related infrastructure.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff*: fix worktree setupNguyễn Thái Ngọc Duy Thu, 28 Aug 2008 13:02:12 +0000 (20:02 +0700)

diff*: fix worktree setup

This fixes "git diff", "git diff-files" and "git diff-index" to work
correctly under worktree setup. Because diff* family works in many modes
and not all of them require worktree, Junio made a nice summary
(with a little modification from me):

* diff-files is about comparing with work tree, so it obviously needs a
work tree;

* diff-index also does, except "diff-index --cached" or "diff --cached TREE"

* no-index is about random files outside git context, so it obviously
doesn't need any work tree;

* comparing two (or more) trees doesn't;

* comparing two blobs doesn't;

* comparing a blob with a random file doesn't;

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash-completion: Add all submodule subcommands to the... Matthias Kestenholz Thu, 28 Aug 2008 08:57:55 +0000 (10:57 +0200)

bash-completion: Add all submodule subcommands to the completion list

Signed-off-by: Matthias Kestenholz <mk@spinlock.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mv/merge-custom'Junio C Hamano Thu, 28 Aug 2008 00:28:31 +0000 (17:28 -0700)

Merge branch 'mv/merge-custom'

* mv/merge-custom:
t7606: fix custom merge test
Fix "git-merge -s bogo" help text
Update .gitignore to ignore git-help
Builtin git-help.
builtin-help: always load_command_list() in cmd_help()
Add a second testcase for handling invalid strategies in git-merge
Add a new test for using a custom merge strategy
builtin-merge: allow using a custom strategy
builtin-help: make some internal functions available to other builtins

Conflicts:
help.c

Merge branch 'ml/submodule'Junio C Hamano Thu, 28 Aug 2008 00:16:30 +0000 (17:16 -0700)

Merge branch 'ml/submodule'

* ml/submodule:
git-submodule.sh - Remove trailing / from URL if found
git-submodule.sh - Remove trailing / from URL if found

Merge branch 'am/cherry-pick-rerere'Junio C Hamano Wed, 27 Aug 2008 23:40:09 +0000 (16:40 -0700)

Merge branch 'am/cherry-pick-rerere'

* am/cherry-pick-rerere:
Make cherry-pick use rerere for conflict resolution.

Merge branch 'jc/add-addremove'Junio C Hamano Wed, 27 Aug 2008 23:39:57 +0000 (16:39 -0700)

Merge branch 'jc/add-addremove'

* jc/add-addremove:
builtin-add.c: optimize -A option and "git add ."
builtin-add.c: restructure the code for maintainability

Merge branch 'np/verify-pack'Junio C Hamano Wed, 27 Aug 2008 23:39:46 +0000 (16:39 -0700)

Merge branch 'np/verify-pack'

* np/verify-pack:
discard revindex data when pack list changes

Merge branch 'da/submodule-sync'Junio C Hamano Wed, 27 Aug 2008 23:39:19 +0000 (16:39 -0700)

Merge branch 'da/submodule-sync'

* da/submodule-sync:
git-submodule: add "sync" command

Merge branch 'maint'Junio C Hamano Wed, 27 Aug 2008 23:23:54 +0000 (16:23 -0700)

Merge branch 'maint'

* maint:
ctype.c: protect tiny C preprocessor constants
index-pack: be careful after fixing up the header/footer

ctype.c: protect tiny C preprocessor constantsJunio C Hamano Wed, 27 Aug 2008 23:14:22 +0000 (16:14 -0700)

ctype.c: protect tiny C preprocessor constants

Some platforms contaminate the preprocessor token namespace with their own
definition of SS without being asked. Avoid getting hit by redefinition
warning messages by explicitly undef SS, AA and DD shorthand we use in this
table definition.

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

index-pack: be careful after fixing up the header/footerLinus Torvalds Wed, 27 Aug 2008 19:48:00 +0000 (12:48 -0700)

index-pack: be careful after fixing up the header/footer

The index-pack command, when processing a thin pack, fixed up the pack
after-the-fact. It forgets to fsync the result, because it only did that
in one path rather in all cases of fixup.

This moves the fsync_or_die() to the fix-up routine itself, rather than
doing it in one of the callers, so that all cases are covered.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make it possible to abort the submission of a change... Simon Hausmann Wed, 27 Aug 2008 07:30:29 +0000 (09:30 +0200)

Make it possible to abort the submission of a change to Perforce

Currently it is not possible to skip the submission of a change to Perforce
when running git-p4 submit. This patch compares the modification time before
and after the submit editor invokation and offers a prompt for skipping if
the submit template file was not saved.

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

Merge branch 'af/maint-install-no-handlink'Junio C Hamano Wed, 27 Aug 2008 00:08:25 +0000 (17:08 -0700)

Merge branch 'af/maint-install-no-handlink'

* af/maint-install-no-handlink:
Makefile: always provide a fallback when hardlinks fail

Merge branch 'jc/no-slim-shell'Junio C Hamano Wed, 27 Aug 2008 00:08:22 +0000 (17:08 -0700)

Merge branch 'jc/no-slim-shell'

* jc/no-slim-shell:
Revert "Build-in "git-shell""

Merge branch 'maint'Junio C Hamano Wed, 27 Aug 2008 00:08:19 +0000 (17:08 -0700)

Merge branch 'maint'

* maint:
index-pack: setup git repository
Suppress some bash redirection error messages
Fix a warning (on cygwin) to allow -Werror
Fix "git log -i --grep"

format-patch: use default diff format even with patch... Jeff King Mon, 25 Aug 2008 02:10:29 +0000 (22:10 -0400)

format-patch: use default diff format even with patch options

Previously, running "git format-patch -U5" would cause the
low-level diff machinery to change the diff output format
from "not specified" to "patch". This meant that
format-patch thought we explicitly specified a diff output
format, and would not use the default format. The resulting
message lacked both the diffstat and the summary, as well as
the separating "---".

Now format-patch explicitly checks for this condition and
uses the default. That means that "git format-patch -p" will
now have the "-p" ignored.

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

index-pack: setup git repositoryNguyễn Thái Ngọc Duy Tue, 26 Aug 2008 14:32:42 +0000 (21:32 +0700)

index-pack: setup git repository

"git index-pack" is an independent command and does not setup git
repository while still need pack.indexversion. It may miss the
info if it is in a subdirectory of the repository.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Suppress some bash redirection error messagesRamsay Jones Tue, 26 Aug 2008 17:52:57 +0000 (18:52 +0100)

Suppress some bash redirection error messages

In particular, when testing if the filesystem allows tabs in
filenames, bash issues an error something like:

./t4016-diff-quote.sh: pathname with HT: No such file or directory

which is caused by the failure of the (stdout) redirection,
since the file cannot be created. In order to suppress the
error message, you must redirect stderr to /dev/null, *before*
the stdout redirection on the command-line.

Also, remove a redundant filesystem check from the begining of
the t3902-quoted.sh test and standardise the "test skipped"
message to 'say' on exit.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix a warning (on cygwin) to allow -WerrorRamsay Jones Tue, 26 Aug 2008 17:50:37 +0000 (18:50 +0100)

Fix a warning (on cygwin) to allow -Werror

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Add menu item for calling git gui blameAlexander Gavrilov Sat, 23 Aug 2008 08:29:08 +0000 (12:29 +0400)

gitk: Add menu item for calling git gui blame

This adds a new item to the file list popup menu, that calls git gui
blame for the selected file, starting with the first parent of the
current commit.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Add option to specify the default commit on comma... Alexander Gavrilov Sat, 23 Aug 2008 08:27:44 +0000 (12:27 +0400)

gitk: Add option to specify the default commit on command line

Other GUI tools may need to start gitk and make it automatically
select a certain commit. This adds a new command-line option
--select-commit=id to make that possible.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Makefile: always provide a fallback when hardlinks... Andreas Färber Mon, 25 Aug 2008 15:33:03 +0000 (17:33 +0200)

Makefile: always provide a fallback when hardlinks fail

We make hardlinks from "git" to "git-<cmd>" built-ins and have been
careful to avoid cross-device links when linking "git-<cmd>" to
gitexecdir.

However, we were not prepared to deal with a build directory that is
incapable of making hard links within itself. This patch corrects it.

Instead of temporarily linking "git" to gitexecdir, directly link "git-
add", falling back to "cp". Try hardlinking that as "git-<cmd>", falling
back to symlinks or "cp" on error.

While at it, avoid 100+ error messages from hardlink failures when we are
going to fall back to symlinks or "cp" by redirecting the standard error
to /dev/null.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon.c: minor style fixupJunio C Hamano Sun, 24 Aug 2008 20:27:10 +0000 (13:27 -0700)

daemon.c: minor style fixup

* "else" on the same line as "}" that closes corresponding "if (...) {";

* multi-line comments begin with "/*\n";

* sizeof, even it is not a function, is written as "sizeof(...)";

* no need to check x?alloc() return value -- it would have died;

* "if (...) { ... }" that covers the whole function body can be dedented
by returning from the function early with "if (!...) return;";

* SP on each side of an operator, i.e. "a > 0", not "a>0";

Also removes stale comment describing how remove_child() used to do its
thing.

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

git-submodule: add "sync" commandDavid Aguilar Sun, 24 Aug 2008 19:43:37 +0000 (12:43 -0700)

git-submodule: add "sync" command

When a submodule's URL changes upstream, existing submodules
will be out of sync since their remote."$origin".url will still
be set to the old value.

This adds a "git submodule sync" command that reads submodules'
URLs from .gitmodules and updates them accordingly.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Build-in "git-shell""Junio C Hamano Tue, 26 Aug 2008 05:39:17 +0000 (22:39 -0700)

Revert "Build-in "git-shell""

This reverts commit daa0cc9a92c9c2c714aa5f7da6d0ff65b93e0698.
It was a stupid idea to do this; when run as a log-in shell,
it is spawned with argv[0] set to "-git-shell", so the usual
name-based dispatch would not work to begin with.

Fix "git log -i --grep"Jeff King Mon, 25 Aug 2008 06:15:05 +0000 (02:15 -0400)

Fix "git log -i --grep"

This has been broken in v1.6.0 due to the reorganization of
the revision option parsing code. The "-i" is completely
ignored, but works fine in "git log --grep -i".

What happens is that the code for "-i" looks for
revs->grep_filter; if it is NULL, we do nothing, since there
are no grep filters. But that is obviously not correct,
since we want it to influence the later --grep option. Doing
it the other way around works, since "-i" just impacts the
existing grep_filter option.

Instead, we now always initialize the grep_filter member and
just fill in options and patterns as we get them. This means
that we can no longer check grep_filter for NULL, but
instead must check the pattern list to see if we have any
actual patterns.

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

git-gui: Allow specifying an initial line for git gui... Alexander Gavrilov Sat, 23 Aug 2008 08:32:20 +0000 (12:32 +0400)

git-gui: Allow specifying an initial line for git gui blame.

Add a command-line option to make git gui blame automatically
scroll to a specific line in the file. Useful for integration
with other tools.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Better positioning in Blame Parent CommitAlexander Gavrilov Sat, 23 Aug 2008 08:31:35 +0000 (12:31 +0400)

git-gui: Better positioning in Blame Parent Commit

Invoke diff-tree between the commit and its parent,
and use the hunks to fix the target line number,
accounting for addition and removal of lines.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Support passing blame to a parent commit.Alexander Gavrilov Sat, 23 Aug 2008 08:30:51 +0000 (12:30 +0400)

git-gui: Support passing blame to a parent commit.

Add a context menu item that switches the view to the
parent of the commit under cursor. It is useful to see
how the file looked before the change, and find older
changes in the same lines.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Support starting gitk from Gui BlameAlexander Gavrilov Sat, 23 Aug 2008 08:30:00 +0000 (12:30 +0400)

git-gui: Support starting gitk from Gui Blame

Add a context menu command to load commits
that are within a certain time range from the
selected commit into gitk.

It can be useful for understanding of the code,
especially if the repository is imported from
a VCS that does not support atomic commits.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Teach git gui about file type changesGustaf Hendeby Fri, 22 Aug 2008 20:10:27 +0000 (22:10 +0200)

git-gui: Teach git gui about file type changes

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Install git-shell in bindir, tooTommi Virtanen Sun, 24 Aug 2008 20:23:25 +0000 (23:23 +0300)

Install git-shell in bindir, too

/etc/passwd shell field must be something execable, you can't enter
"/usr/bin/git shell" there. git-shell must be present as a separate
executable, or it is useless.

Signed-off-by: Tommi Virtanen <tv@eagain.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/no-slim-shell'Junio C Hamano Sun, 24 Aug 2008 23:14:22 +0000 (16:14 -0700)

Merge branch 'jc/no-slim-shell'

* jc/no-slim-shell:
Build-in "git-shell"
shell: do not play duplicated definition games to shrink the executable

Merge branch 'maint' to sync with 1.6.0.1Junio C Hamano Sun, 24 Aug 2008 21:48:36 +0000 (14:48 -0700)

Merge branch 'maint' to sync with 1.6.0.1

GIT 1.6.0.1 v1.6.0.1Junio C Hamano Sun, 24 Aug 2008 21:47:24 +0000 (14:47 -0700)

GIT 1.6.0.1

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

Merge branch 'ag/maint-combine-diff-fix' into maintJunio C Hamano Sun, 24 Aug 2008 21:32:18 +0000 (14:32 -0700)

Merge branch 'ag/maint-combine-diff-fix' into maint

* ag/maint-combine-diff-fix:
Respect core.autocrlf in combined diff

Merge branch 'mv/maint-merge-fix' into maintJunio C Hamano Sun, 24 Aug 2008 21:29:37 +0000 (14:29 -0700)

Merge branch 'mv/maint-merge-fix' into maint

* mv/maint-merge-fix:
merge: fix numerus bugs around "trivial merge" area

git-submodule - Use "get_default_remote" from git-parse... Mark Levedahl Sun, 24 Aug 2008 18:46:10 +0000 (14:46 -0400)

git-submodule - Use "get_default_remote" from git-parse-remote

Resolve_relative_url was using its own code for this function, but
this is duplication with the best result that this continues to work.
Replace with the common function provided by git-parse-remote.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify pager configurationJonathan Nieder Sun, 24 Aug 2008 05:28:32 +0000 (00:28 -0500)

Documentation: clarify pager configuration

The unwary user may not know how to disable the -FRSX options.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify pager.<cmd> configurationJonathan Nieder Sun, 24 Aug 2008 05:38:06 +0000 (00:38 -0500)

Documentation: clarify pager.<cmd> configuration

It was not obvious from the text that pager.<cmd> is a boolean
setting.

While we're changing the description, make some other
improvements: lest we forget and fret, clarify that -p and
pager.<cmd> do not kick in when stdout is not a tty; point to
related core.pager and GIT_PAGER settings; use renamed --paginate
option.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Clean up the git-p4 documentationSimon Hausmann Sun, 24 Aug 2008 14:12:23 +0000 (16:12 +0200)

Clean up the git-p4 documentation

This patch massages the documentation a bit for improved readability and cleans
it up from outdated options/commands.

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

Respect core.autocrlf in combined diffAlexander Gavrilov Sat, 23 Aug 2008 19:21:21 +0000 (23:21 +0400)

Respect core.autocrlf in combined diff

Fix git-diff to make it produce useful 3-way diffs for merge conflicts in
repositories with autocrlf enabled. Otherwise it always reports that the
whole file was changed, because it uses the contents from the working tree
without necessary conversion.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>