gitweb.git
Merge branch 'maint'Junio C Hamano Tue, 9 Nov 2010 17:45:16 +0000 (09:45 -0800)

Merge branch 'maint'

* maint:
Documentation: document show -s
dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout

rebase: teach --autosquash to match on sha1 in addition... Kevin Ballard Thu, 4 Nov 2010 22:36:32 +0000 (15:36 -0700)

rebase: teach --autosquash to match on sha1 in addition to message

Support lines of the form "fixup! 7a235b" that specify an exact commit
in addition to the normal "squash! Old commit message" form.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: better rearranging of fixup!/squash! lines... Kevin Ballard Thu, 4 Nov 2010 22:36:31 +0000 (15:36 -0700)

rebase: better rearranging of fixup!/squash! lines with --autosquash

The current behvaior of --autosquash can duplicate fixup!/squash! lines
if they match multiple commits, and it can also apply them to commits
that come after them in the todo list. Even more oddly, a commit that
looks like "fixup! fixup!" will match itself and be duplicated in the
todo list.

Change the todo list rearranging to mark all commits as used as soon
as they are emitted, and to avoid emitting a fixup/squash commit if the
commit has already been marked as used.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: document show -sJonathan Nieder Tue, 9 Nov 2010 17:12:48 +0000 (11:12 -0600)

Documentation: document show -s

Git's diff machinery has supported a -s (silence diff output) option
as far back as v0.99~900 (Silent flag for show-diff, 2005-04-13), but
the option is only advertised in an odd corner of the git diff-tree
manual.

The main use is to retrieve basic metadata about a commit:

git show -s rev

Explain this in the 'git log' manual and provide an example in the
'git show' examples section. This is kind of a cop-out, since it
would be more useful to explain it in the 'git show' manual proper,
which says:

The command takes options applicable to the git
diff-tree command to control how the changes the
commit introduces are shown.

This manual page describes only the most frequently
used options.

Fixing that is a larger task for another day.

Reported-by: Will Hall <will@gnatter.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkoutNguyễn Thái Ngọc Duy Sun, 7 Nov 2010 18:04:58 +0000 (01:04 +0700)

dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout

Commit c84de70 (excluded_1(): support exclude files in index -
2009-08-20) tries to work around the fact that there is no
directory/file information in index entries, therefore
EXC_FLAG_MUSTBEDIR match would fail.

Unfortunately the workaround is flawed. This fixes it.

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

test: git-apply -p2 rename/chmod onlyJunio C Hamano Fri, 22 Oct 2010 05:09:40 +0000 (22:09 -0700)

test: git-apply -p2 rename/chmod only

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

Fix git-apply with -p greater than 1Federico Cuello Thu, 21 Oct 2010 22:12:02 +0000 (19:12 -0300)

Fix git-apply with -p greater than 1

Fix the case when the patch is a rename or mode-change only
and -p is used with a value greater than one.
The git_header_name function did not remove more than one path
component.

Signed-off-by: Federico Cuello <fedux@lugmen.org.ar>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9001: send-email interation with --in-reply-to and... Junio C Hamano Tue, 19 Oct 2010 18:46:31 +0000 (11:46 -0700)

t9001: send-email interation with --in-reply-to and --chain-reply-to

1. When --in-reply-to gives $reply_to, the first one becomes a reply to
that message, with or without --chain-reply-to.

2. When --chain-reply-to is in effect, all the messages are strung
together to form a single chain. The first message may be in reply to
the $reply_to given by --in-reply-to command line option (see
previous), or the root of the discussion thread. The second one is a
response to the first one, and the third one is a response to the
second one, etc.

3. When --chain-reply-to is not in effect:

a. When --in-reply-to is used, too, the second and the subsequent ones
become replies to $reply_to. Together with the first rule, all
messages become replies to $reply_to given by --in-reply-to.

b. When --in-reply-to is not used, presumably the second and
subsequent ones become replies to the first one, which would be the
root.

The documentation is reasonably clear about the 1., 2. and 3a. above, I
think, even though I do not think 3b. is clearly specified.

The two tests added by this patch at least documents what happens between
these two options.

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

Merge branch 'aw/git-p4-deletion'Junio C Hamano Fri, 5 Nov 2010 17:42:46 +0000 (10:42 -0700)

Merge branch 'aw/git-p4-deletion'

* aw/git-p4-deletion:
Fix handling of git-p4 on deleted files

Merge branch 'master' of git://repo.or.cz/git-guiJunio C Hamano Fri, 5 Nov 2010 17:41:09 +0000 (10:41 -0700)

Merge branch 'master' of git://repo.or.cz/git-gui

* 'master' of git://repo.or.cz/git-gui:
git-gui: apply color information from git diff output
git-gui: use wordprocessor tab style to ensure tabs work as expected
git-gui: correct assignment of work-tree
git-gui: use full dialog width for old name when renaming branch
git-gui: generic version trimming
git-gui: enable the Tk console when tracing/debugging on Windows
git-gui: show command-line errors in a messagebox on Windows
On Windows, avoid git-gui to call Cygwin's nice utility

Merge branch 'maint'Junio C Hamano Fri, 5 Nov 2010 17:36:49 +0000 (10:36 -0700)

Merge branch 'maint'

* maint:
Fix a formatting error in git-merge.txt

daemon: opt-out on features that require posixErik Faye-Lund Thu, 4 Nov 2010 01:35:24 +0000 (02:35 +0100)

daemon: opt-out on features that require posix

Windows does not supply the POSIX-functions fork(), setuuid(), setgid(),
setsid() and initgroups(). Error out if --user or --detach is specified
when if so.

MinGW doesn't have prototypes and headers for inet_ntop and inet_pton,
so include our implementation instead. MSVC does, so avoid doing so
there.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: make --inetd and --detach incompatibleErik Faye-Lund Thu, 4 Nov 2010 01:35:23 +0000 (02:35 +0100)

daemon: make --inetd and --detach incompatible

Since --inetd makes main return with the result of execute() before
daemonize is gets called, these two options are already incompatible.

Document it, and add an error if attempted.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: use socklen_tErik Faye-Lund Thu, 4 Nov 2010 01:35:22 +0000 (02:35 +0100)

daemon: use socklen_t

Windows's accept()-function takes the last argument as an int, but glibc
takes an unsigned int. Use socklen_t to get rid of a warning. This is
basically a revert of 7fa0908, but we have already been depending on
socklen_t existing since June 2006 (commit 5b276ee4). I guess this means
that socklen_t IS defined on OSX after all - at least in recent headers.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: use poll-emulation from gnulibErik Faye-Lund Thu, 4 Nov 2010 01:35:21 +0000 (02:35 +0100)

mingw: use poll-emulation from gnulib

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: import poll-emulation from gnulibErik Faye-Lund Thu, 4 Nov 2010 01:35:20 +0000 (02:35 +0100)

mingw: import poll-emulation from gnulib

copy lib/poll.c and lib/poll.in.h verbatim from commit 0a05120 in
git://git.savannah.gnu.org/gnulib.git to compat/win32/sys/poll.[ch]

To upgrade this code in the future, branch out from this commit, copy
new versions of the files above on top, and merge back the result.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: get remote host address from root-processErik Faye-Lund Thu, 4 Nov 2010 01:35:19 +0000 (02:35 +0100)

daemon: get remote host address from root-process

Get remote host in the process that accept() and pass it through
the REMOTE_ADDR environment variable to the handler-process.
Introduce the REMOTE_PORT environmen variable for the port.

Use these variables for reporting instead of doing
getpeername(0, ...), which doesn't work on Windows.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve the mingw getaddrinfo stub to handle more use... Martin Storsjö Thu, 4 Nov 2010 01:35:18 +0000 (02:35 +0100)

Improve the mingw getaddrinfo stub to handle more use cases

Allow the node parameter to be null, which is used for getting
the default bind address.

Also allow the hints parameter to be null, to improve standard
conformance of the stub implementation a little.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: use full buffered mode for stderrErik Faye-Lund Thu, 4 Nov 2010 01:35:17 +0000 (02:35 +0100)

daemon: use full buffered mode for stderr

Windows doesn't support line buffered mode for file
streams, so let's just use full buffered mode with
a big buffer ("4096 should be enough for everyone")
and add explicit flushing.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: use run-command api for async servingErik Faye-Lund Thu, 4 Nov 2010 01:35:16 +0000 (02:35 +0100)

daemon: use run-command api for async serving

fork() is only available on POSIX, so to support git-daemon
on Windows we have to use something else.

Instead we invent the flag --serve, which is a stripped down
version of --inetd-mode. We use start_command() to call
git-daemon with this flag appended to serve clients.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: add kill emulationErik Faye-Lund Thu, 4 Nov 2010 01:35:15 +0000 (02:35 +0100)

mingw: add kill emulation

This is a quite limited kill-emulation; it can only handle
SIGTERM on positive pids. However, it's enough for git-daemon.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: support waitpid with pid > 0 and WNOHANGErik Faye-Lund Thu, 4 Nov 2010 01:35:14 +0000 (02:35 +0100)

mingw: support waitpid with pid > 0 and WNOHANG

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: use real pidErik Faye-Lund Thu, 4 Nov 2010 01:35:13 +0000 (02:35 +0100)

mingw: use real pid

The Windows port have so far been using process handles in place
of PID. However, this is not work consistent with what getpid
returns.

PIDs are system-global identifiers, but process handles are local
to a process. Using PIDs instead of process handles allows, for
instance, a user to kill a hung process with the Task Manager,
something that would have been impossible with process handles.

Change the code to use the real PID, and use OpenProcess to get a
process-handle. Store the PID and the process handle in a linked
list protected by a critical section, so we can safely close the
process handle later.

Linked list code written by Pat Thoyts.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

inet_ntop: fix a couple of old-style declsErik Faye-Lund Thu, 4 Nov 2010 01:35:12 +0000 (02:35 +0100)

inet_ntop: fix a couple of old-style decls

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat: add inet_pton and inet_ntop prototypesMike Pape Thu, 4 Nov 2010 01:35:11 +0000 (02:35 +0100)

compat: add inet_pton and inet_ntop prototypes

Windows doesn't have inet_pton and inet_ntop, so
add prototypes in git-compat-util.h for them.

At the same time include git-compat-util.h in
the sources for these functions, so they use the
network-wrappers from there on Windows.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: implement syslogMike Pape Thu, 4 Nov 2010 01:35:10 +0000 (02:35 +0100)

mingw: implement syslog

Syslog does not usually exist on Windows, so implement our own using
Window's ReportEvent mechanism.

Strings containing "%1" gets expanded into them selves by ReportEvent,
resulting in an unreadable string. "%2" and above is not a problem.
Unfortunately, on Windows an IPv6 address can contain "%1", so expand
"%1" to "% 1" before reporting. "%%1" is also a problem for ReportEvent,
but that string cannot occur in an IPv6 address.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: add network-wrappers for daemonMike Pape Thu, 4 Nov 2010 01:35:09 +0000 (02:35 +0100)

mingw: add network-wrappers for daemon

git-daemon requires some socket-functionality that is not yet
supported in the Windows-port. This patch adds said functionality,
and makes sure WSAStartup gets called by socket(), since it is the
first network-call in git-daemon.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: Remove --tags option from manpageJens Lehmann Wed, 3 Nov 2010 20:55:48 +0000 (21:55 +0100)

pull: Remove --tags option from manpage

"Fetch all tags and merge them" does not make any sense as a request at
the logical level, even though it might be more convenient to type.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: only preserve flags across recursive status... Kevin Ballard Wed, 3 Nov 2010 06:26:25 +0000 (23:26 -0700)

submodule: only preserve flags across recursive status/update invocations

Recursive invocations of submodule update/status preserve all arguments,
so executing

git submodule update --recursive -- foo

attempts to recursively update a submodule named "foo".

Naturally, this fails as one cannot have an infinitely-deep stack of
submodules each containing a submodule named "foo". The desired behavior
is instead to update foo and then recursively update all submodules
inside of foo.

This commit accomplishes that by only saving the flags for use in the
recursive invocation.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: preserve all arguments exactly when recursingKevin Ballard Wed, 3 Nov 2010 06:26:24 +0000 (23:26 -0700)

submodule: preserve all arguments exactly when recursing

Shell variables only hold strings, not lists of parameters,
so $orig_args after

orig_args="$@"

fails to remember where each parameter starts and ends, if
some include whitespace. So

git submodule update \
--reference='/var/lib/common objects.git' \
--recursive --init

becomes

git submodule update --reference=/var/lib/common \
objects.git --recursive --init

in the inner repositories. Use "git rev-parse --sq-quote" to
save parameters in quoted form ready for evaluation by the
shell, avoiding this problem.

Helped-By: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-blame.el: Add (require 'format-spec)David Kågedal Tue, 25 May 2010 13:44:15 +0000 (15:44 +0200)

git-blame.el: Add (require 'format-spec)

c5022f57 (git-blame.el: Change how blame information is shown,
2009-09-29) taught the "M-x git-blame" mode to format its output
in a more interesting way, making use of the format-spec function.

format-spec is included in Emacs 23 and is a useful function.
Older emacsen can get it from Gnus. In all emacsen, we need
to 'require it before use to avoid warnings:

git-blame.el:483:1:Warning: the function `format-spec' is not known to be
defined.

Reported-by: Sergei Organov <osv@javad.com>
Reported-by: Kevin Ryde <user42@zip.com.au>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-branch.txt: mention --set-upstream as a way to... Matthieu Moy Tue, 2 Nov 2010 15:31:28 +0000 (16:31 +0100)

git-branch.txt: mention --set-upstream as a way to change upstream configuration

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual: remote-tracking can be checked out, with... Jonathan Nieder Tue, 2 Nov 2010 15:31:27 +0000 (16:31 +0100)

user-manual: remote-tracking can be checked out, with detached HEAD

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual.txt: explain better the remote(-tracking... Matthieu Moy Tue, 2 Nov 2010 21:06:20 +0000 (22:06 +0100)

user-manual.txt: explain better the remote(-tracking) branch terms

Now that the documentation is mostly consistant in the use of "remote
branch" Vs "remote-tracking branch", let's make this distinction explicit
early in the user-manual.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change incorrect "remote branch" to "remote tracking... Matthieu Moy Tue, 2 Nov 2010 15:31:25 +0000 (16:31 +0100)

Change incorrect "remote branch" to "remote tracking branch" in C code

(Just like we did for documentation already)

In the process, we change "non-remote branch" to "branch outside the
refs/remotes/ hierarchy" to avoid the ugly "non-remote-tracking branch".
The new formulation actually corresponds to how the code detects this
case (i.e. prefixcmp(refname, "refs/remotes")).

Also, we use 'remote-tracking branch' in generated merge messages (by
merge an fmt-merge-msg).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change incorrect uses of "remote branch" meaning "remot... Matthieu Moy Tue, 2 Nov 2010 15:31:24 +0000 (16:31 +0100)

Change incorrect uses of "remote branch" meaning "remote-tracking"

"remote branch" is a branch hosted in a remote repository, while
"remote-tracking branch" is a copy of such branch, hosted locally.
The distinction is subtle when the copy is up-to-date, but rather
fundamental to understand what "git fetch" and "git push" do.

This patch should fix all incorrect usages in Documentation/ directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change "tracking branch" to "remote-tracking branch"Matthieu Moy Tue, 2 Nov 2010 15:31:23 +0000 (16:31 +0100)

Change "tracking branch" to "remote-tracking branch"

One more step towards consistancy. We change the documentation and the C
code in a single patch, since the only instances in the C code are in
comment and usage strings.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

everyday.txt: change "tracking branch" to "remote-track... Matthieu Moy Tue, 2 Nov 2010 15:31:22 +0000 (16:31 +0100)

everyday.txt: change "tracking branch" to "remote-tracking branch"

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change remote tracking to remote-tracking in non-trivia... Matthieu Moy Tue, 2 Nov 2010 15:31:21 +0000 (16:31 +0100)

Change remote tracking to remote-tracking in non-trivial places

To complement the straightforward perl application in previous patch,
this adds a few manual changes.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Replace "remote tracking" with "remote-tracking"Matthieu Moy Tue, 2 Nov 2010 15:31:20 +0000 (16:31 +0100)

Replace "remote tracking" with "remote-tracking"

"remote-tracking" branch makes it explicit that the branch is "tracking a
remote", as opposed to "remote, and tracking something".

See discussion in e.g.
http://mid.gmane.org/8835ADF9-45E5-4A26-9F7F-A72ECC065BB2@gmail.com
for more details.

This patch is a straightforward application of

perl -pi -e 's/remote tracking branch/remote-tracking branch/'

except in the RelNotes directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Better "Changed but not updated" message in git-statusMatthieu Moy Tue, 2 Nov 2010 15:31:19 +0000 (16:31 +0100)

Better "Changed but not updated" message in git-status

Older Gits talked about "updating" a file to add its content to the
index, but this terminology is confusing for new users. "to stage" is far
more intuitive and already used in e.g. the "git stage" command name.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: don't segfault on binary files with missing... Jeff King Mon, 18 Oct 2010 18:39:17 +0000 (14:39 -0400)

apply: don't segfault on binary files with missing data

Usually when applying a binary diff generated without
--binary, it will be rejected early, as we don't even have
the full sha1 of the pre- and post-images.

However, if the diff is generated with --full-index (but not
--binary), then we will actually try to apply it. If we have
the postimage blob, then we can take a shortcut and never
even look at the binary diff at all (e.g., this can happen
when rebasing changes within a repository).

If we don't have the postimage blob, though, we try to look
at the actual fragments, of which there are none, and get a
segfault. This patch checks explicitly for that case and
complains to the user instead of segfaulting. We need to
keep the check at a low level so that the "shortcut" case
above continues to work.

We also add a test that demonstrates the segfault. While
we're at it, let's also explicitly test the shortcut case.

Reported-by: Rafaël Carré <rafael.carre@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0003: properly quote $HOMEThomas Rast Mon, 18 Oct 2010 09:09:54 +0000 (11:09 +0200)

t0003: properly quote $HOME

6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot
to quote one instance of $HOME in the tests. This would be valid
according to POSIX, but bash 4 helpfully declines to execute the
command in question with an "ambiguous redirection" error.

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

contrib/ciabot: git-describe commit instead of HEADSven Eckelmann Mon, 20 Sep 2010 09:31:22 +0000 (11:31 +0200)

contrib/ciabot: git-describe commit instead of HEAD

For each commit a shorter version of the name will be generated. This is
either the truncated hash or the output of git-describe. The
call to git-describe was only made with an empty shell variable instead
of an actual commit hash. Thus it only described the current HEAD and
not each commit we want to submit to cia.vc.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix a formatting error in git-merge.txtNathan W. Panike Fri, 29 Oct 2010 15:33:54 +0000 (10:33 -0500)

Fix a formatting error in git-merge.txt

Inside an element of an enumerated list, the second and subsequent
paragraphs need to lose their indent and have to be strung together with a
line with a single '+' on it instead. Otherwise the lines below are shown
in typewriter face, which just looks wrong.

Signed-off-by: Nathan W. Panike <nathan.panike@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Porcelain scripts: Rewrite cryptic "needs update" error... Ramkumar Ramachandra Tue, 19 Oct 2010 14:39:28 +0000 (20:09 +0530)

Porcelain scripts: Rewrite cryptic "needs update" error message

Although Git interally has the facility to differentiate between
porcelain and plubmbing commands and appropriately print errors,
several shell scripts invoke plubming commands triggering cryptic
plumbing errors to be displayed on a porcelain interface. This patch
replaces the "needs update" message in git-pull and git-rebase, when
`git update-index` is run, with a more friendly message.

Reported-by: Joshua Jensen <jjensen@workspacewhiz.com>
Reported-by: Thore Husfeldt <thore.husfeldt@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: fix zsh check under bash with 'set -u'Mark Lodato Thu, 28 Oct 2010 01:08:21 +0000 (21:08 -0400)

completion: fix zsh check under bash with 'set -u'

Commit 06f44c3 (completion: make compatible with zsh) broke bash
compatibility with 'set -u': a warning was generated when checking
$ZSH_VERSION. The solution is to supply a default value, using
${ZSH_VERSION-}. Thanks to SZEDER Gábor for the fix.

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

git-gui: apply color information from git diff outputPat Thoyts Fri, 22 Oct 2010 15:14:38 +0000 (16:14 +0100)

git-gui: apply color information from git diff output

This patch extracts the ANSI color sequences from git diff output and
applies these to the diff view window. This ensures that the gui view
makes use of the current git configuration for whitespace display.

ANSI codes may include attributes, foreground and background in a single
sequence. Handle this and support bold and reverse attributes. Ignore
all other attributes.

Suggested-by: Tor Arvid Lund <torarvid@gmail.com>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Tested-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

git-gui: use wordprocessor tab style to ensure tabs... Pat Thoyts Wed, 27 Oct 2010 22:37:31 +0000 (23:37 +0100)

git-gui: use wordprocessor tab style to ensure tabs work as expected

The Tk text widget tab style is tabular where the first tab will align to
the first tabstop and if that position is left of the current location
then just a single character space is used. With the wordprocessor style
a tab moves the next character position to the next rightmost tabstop
as expected for viewing code.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Merge branch 'ab/send-email-perl'Junio C Hamano Wed, 27 Oct 2010 05:02:52 +0000 (22:02 -0700)

Merge branch 'ab/send-email-perl'

* ab/send-email-perl:
send-email: extract_valid_address use qr// regexes
send-email: is_rfc2047_quoted use qr// regexes
send-email: use Perl idioms in while loop
send-email: make_message_id use "require" instead of "use"
send-email: send_message die on $!, not $?
send-email: use (?:) instead of () if no match variables are needed
send-email: sanitize_address use qq["foo"], not "\"foo\""
send-email: sanitize_address use $foo, not "$foo"
send-email: use \E***\Q instead of \*\*\*
send-email: cleanup_compose_files doesn't need a prototype
send-email: unique_email_list doesn't need a prototype
send-email: file_declares_8bit_cte doesn't need a prototype
send-email: get_patch_subject doesn't need a prototype
send-email: use lexical filehandles during sending
send-email: use lexical filehandles for $compose
send-email: use lexical filehandle for opendir

Conflicts:
git-send-email.perl

Merge branch 'sb/send-email-use-to-from-input'Junio C Hamano Wed, 27 Oct 2010 05:02:03 +0000 (22:02 -0700)

Merge branch 'sb/send-email-use-to-from-input'

* sb/send-email-use-to-from-input:
send-email: Don't leak To: headers between patches
send-email: Use To: headers in patch files

Conflicts:
git-send-email.perl

Merge branch 'ab/require-perl-5.8'Junio C Hamano Wed, 27 Oct 2010 04:57:31 +0000 (21:57 -0700)

Merge branch 'ab/require-perl-5.8'

* ab/require-perl-5.8:
perl: use "use warnings" instead of -w
perl: bump the required Perl version to 5.8 from 5.6.[21]

Merge branch 'kb/merge-recursive-rename-threshold'Junio C Hamano Wed, 27 Oct 2010 04:54:04 +0000 (21:54 -0700)

Merge branch 'kb/merge-recursive-rename-threshold'

* kb/merge-recursive-rename-threshold:
diff: add synonyms for -M, -C, -B
merge-recursive: option to specify rename threshold

Conflicts:
Documentation/diff-options.txt
Documentation/merge-strategies.txt

Merge branch 'jp/send-email-to-cmd'Junio C Hamano Wed, 27 Oct 2010 04:52:26 +0000 (21:52 -0700)

Merge branch 'jp/send-email-to-cmd'

* jp/send-email-to-cmd:
git-send-email.perl: Add --to-cmd

Conflicts:
git-send-email.perl

Merge branch 'as/daemon-multi-listen'Junio C Hamano Wed, 27 Oct 2010 04:50:03 +0000 (21:50 -0700)

Merge branch 'as/daemon-multi-listen'

* as/daemon-multi-listen:
daemon: allow more than one host address given via --listen
daemon: add helper function named_sock_setup

Merge branch 'dm/mergetool-vimdiff'Junio C Hamano Wed, 27 Oct 2010 04:47:11 +0000 (21:47 -0700)

Merge branch 'dm/mergetool-vimdiff'

* dm/mergetool-vimdiff:
mergetool-lib: make the three-way diff the default for vim/gvim
mergetool-lib: add a three-way diff view for vim/gvim
mergetool-lib: combine vimdiff and gvimdiff run blocks

Merge branch 'kf/post-receive-sample-hook'Junio C Hamano Wed, 27 Oct 2010 04:41:18 +0000 (21:41 -0700)

Merge branch 'kf/post-receive-sample-hook'

* kf/post-receive-sample-hook:
post-receive-email: ensure sent messages are not empty

Merge branch 'jf/merge-ignore-ws'Junio C Hamano Wed, 27 Oct 2010 04:40:54 +0000 (21:40 -0700)

Merge branch 'jf/merge-ignore-ws'

* jf/merge-ignore-ws:
merge-recursive: options to ignore whitespace changes
merge-recursive --patience
ll-merge: replace flag argument with options struct
merge-recursive: expose merge options for builtin merge

Merge branch 'ml/completion-zsh'Junio C Hamano Wed, 27 Oct 2010 04:39:03 +0000 (21:39 -0700)

Merge branch 'ml/completion-zsh'

* ml/completion-zsh:
completion: make compatible with zsh

Merge branch 'po/sendemail'Junio C Hamano Wed, 27 Oct 2010 04:37:54 +0000 (21:37 -0700)

Merge branch 'po/sendemail'

* po/sendemail:
New send-email option smtpserveroption.
Remove @smtp_host_parts variable as not used.
Minor indentation fix.

Merge branch 'en/tree-walk-optim'Junio C Hamano Wed, 27 Oct 2010 04:37:49 +0000 (21:37 -0700)

Merge branch 'en/tree-walk-optim'

* en/tree-walk-optim:
diff_tree(): Skip skip_uninteresting() when all remaining paths interesting
tree_entry_interesting(): Make return value more specific
tree-walk: Correct bitrotted comment about tree_entry()
Document pre-condition for tree_entry_interesting

Merge branch 'maint'Junio C Hamano Tue, 26 Oct 2010 22:04:05 +0000 (15:04 -0700)

Merge branch 'maint'

* maint:
Fix copy-pasted comments related to tree diff handling.

test: allow running the tests under "prove"Michael J Gruber Thu, 14 Oct 2010 08:53:36 +0000 (10:53 +0200)

test: allow running the tests under "prove"

You can run "make DEFAULT_TEST_TARGET=prove test" to run the test under
"prove" (or $(PROVE) if set). The output is a bit easier to read when
running many tests in parallel.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Liked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Liked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix copy-pasted comments related to tree diff handling.Yann Dirson Sun, 24 Oct 2010 21:03:10 +0000 (23:03 +0200)

Fix copy-pasted comments related to tree diff handling.

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

Fix handling of git-p4 on deleted filesAndrew Waters Fri, 22 Oct 2010 12:26:02 +0000 (13:26 +0100)

Fix handling of git-p4 on deleted files

Signed-off-by: Andrew Waters <apwaters@googlemail.com>
Tested-by: Thomas Berg <merlin66b@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.7.3.2Junio C Hamano Fri, 22 Oct 2010 00:16:04 +0000 (17:16 -0700)

Sync with 1.7.3.2

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

Git 1.7.3.2 v1.7.3.2Junio C Hamano Fri, 22 Oct 2010 00:14:32 +0000 (17:14 -0700)

Git 1.7.3.2

Merge branch 'sn/doc-opt-notation' into maintJunio C Hamano Thu, 21 Oct 2010 23:26:42 +0000 (16:26 -0700)

Merge branch 'sn/doc-opt-notation' into maint

* sn/doc-opt-notation:
Fix {update,checkout}-index usage strings
Put a space between `<' and argument in pack-objects usage string
Remove stray quotes in --pretty and --format documentation
Use parentheses and `...' where appropriate
Fix odd markup in --diff-filter documentation
Use angles for placeholders consistently

Merge branch 'mg/fix-build-remote-helpers' into maintJunio C Hamano Thu, 21 Oct 2010 23:26:38 +0000 (16:26 -0700)

Merge branch 'mg/fix-build-remote-helpers' into maint

* mg/fix-build-remote-helpers:
remote-helpers: build in platform independent directory

config: treat non-existent config files as emptyJeff King Thu, 21 Oct 2010 14:45:44 +0000 (10:45 -0400)

config: treat non-existent config files as empty

The git_config() function signals error by returning -1 in
two instances:

1. An actual error occurs in opening a config file (parse
errors cause an immediate die).

2. Of the three possible config files, none was found.

However, this second case is often not an error at all; it
simply means that the user has no configuration (they are
outside a repo, and they have no ~/.gitconfig file). This
can lead to confusing errors, such as when the bash
completion calls "git config --list" outside of a repo. If
the user has a ~/.gitconfig, the command completes
succesfully; if they do not, it complains to stderr.

This patch allows callers of git_config to distinguish
between the two cases. Error is signaled by -1, and
otherwise the return value is the number of files parsed.
This means that the traditional "git_config(...) < 0" check
for error should work, but callers who want to know whether
we parsed any files or not can still do so.

[jc: with tests from Jonathan]

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

docs: give more hints about how "add -e" worksJeff King Thu, 21 Oct 2010 14:30:35 +0000 (10:30 -0400)

docs: give more hints about how "add -e" works

The previous text was not exactly accurate; it is OK to
change space and minus lines, but only in certain ways. This
patch attempts to cover explicitly what can be done at the
individual line level, and cautions the user that
conceptually larger changes (like modifying a line) require
some understanding of the patch format.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: handle lines containing only whitespace and tabs... Kevin Ballard Wed, 20 Oct 2010 22:17:26 +0000 (15:17 -0700)

diff: handle lines containing only whitespace and tabs better

When a line contains nothing but whitespace with at least one tab
and the core.whitespace config option contains blank-at-eol, the
whitespace on the line is being printed twice, once unhighlighted
(unless otherwise matched by one of the other core.whitespace values),
and a second time highlighted for blank-at-eol.

Update the leading indentation check to stop checking when it reaches
the trailing whitespace.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: extend test_decode_color to handle more color... Kevin Ballard Wed, 20 Oct 2010 22:17:25 +0000 (15:17 -0700)

test-lib: extend test_decode_color to handle more color codes

Enhance the test_decode_color function to handle all common color codes,
including background colors and escapes that contain multiple codes.
This change necessitates changing <WHITE> to <BOLD>, so update t4034
as well.

This change is necessary for the next commit in order to test
background colors properly.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: do not clear notes in do_change_note_fanout()Jonathan Nieder Wed, 20 Oct 2010 20:25:58 +0000 (15:25 -0500)

fast-import: do not clear notes in do_change_note_fanout()

Commit 5edde51 (fast-import: filemodify after M 040000 <tree> ""
crashes, 2010-10-17) taught fast-import to load trees from the
object db as needed when it is time to access them.

But it went too far. In change_note_fanout(), an empty,
not-loaded tree is not meant to destroy notes, so calling
load_tree() at that point is exactly the wrong thing to do.

Kudos to Johan Herland for t9301, which caught this failure.

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

t/gitweb-lib: Don't pass constant to decode_utf8Brian Gernhardt Wed, 20 Oct 2010 05:57:11 +0000 (01:57 -0400)

t/gitweb-lib: Don't pass constant to decode_utf8

Encode.pm started updating the string to decode in-place when a second
argument is passed in version 2.40.

This causes 'decode_utf8("", Encode::FB_CROAK)' to die with a message
like:

Modification of a read-only value attempted at .../Encode.pm line 216.

Work around this by passing an empty variable instead of a constant
string.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: correct assignment of work-treePat Thoyts Wed, 20 Oct 2010 13:29:56 +0000 (14:29 +0100)

git-gui: correct assignment of work-tree

git-gui currently uses its own logic to determine the work-tree setting
but 'git rev-parse --toplevel' directly returns git's work-tree value
by calling get_git_work_tree() and is therefore always correct.

This fixes an inability to handle some repository configurations. In
particular where .git is a file containing a path to the real directory
(a cross-platform symbolic link).
To continue to support older versions than 1.7.0, setting the work-tree
by normalizing the --show-cdup value is more reliable as git-dir might be
outside the work-tree entirely.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

t4203: do not let "git shortlog" DWIM based on ttyJunio C Hamano Wed, 20 Oct 2010 06:32:06 +0000 (23:32 -0700)

t4203: do not let "git shortlog" DWIM based on tty

The "shortlog" command defaults to HEAD only when its standard input is
connected to a terminal; otherwise it acts in the traditional "filter"
mode to read and summarize the "git log" output.

Two new tests added to t4203 assumed that the command always default to
HEAD, but when the standard input is closed (or connected to /dev/null),
it output empty, which is a summary of its empty input, causing the test
to break.

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

t9300 (fast-import): another test for the "replace... Jonathan Nieder Mon, 18 Oct 2010 01:44:04 +0000 (20:44 -0500)

t9300 (fast-import): another test for the "replace root" feature

Another test for the replace root feature. One can imagine an
implementation for which R "some/subdir" "" would free some state
associated to the subdir and leave fast-import confused.

Luckily, git's is not such an implementation.

While at it, change the previous test to use C "some/subdir" ""
instead of R (i.e., test both syntaxes).

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

{cvs,svn}import: use the new 'git read-tree --empty'Thomas Rast Mon, 18 Oct 2010 13:11:25 +0000 (15:11 +0200)

{cvs,svn}import: use the new 'git read-tree --empty'

Since fb1bb96 (read-tree: deprecate syntax without tree-ish args,
2010-09-10) not passing --empty caused a spurious warning that was
shown to the user.

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

Merge branch 'maint'Junio C Hamano Tue, 19 Oct 2010 21:15:51 +0000 (14:15 -0700)

Merge branch 'maint'

* maint:
t/t9001-send-email.sh: fix stderr redirection in 'Invalid In-Reply-To'
Clarify and extend the "git diff" format documentation
git-show-ref.txt: clarify the pattern matching
documentation: git-config minor cleanups
Update test script annotate-tests.sh to handle missing/extra authors

t/t9001-send-email.sh: fix stderr redirection in 'Inval... Antonio Ospite Tue, 19 Oct 2010 09:50:39 +0000 (11:50 +0200)

t/t9001-send-email.sh: fix stderr redirection in 'Invalid In-Reply-To'

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Clarify and extend the "git diff" format documentationAndreas Gruenbacher Thu, 14 Oct 2010 10:53:11 +0000 (12:53 +0200)

Clarify and extend the "git diff" format documentation

Move the similarity and dissimilarity index header description closer to
where those extended headers are described.

Describe and/or clarify the format used for file modes, pathnames, and
the index header.

Document that all "old" files refer to the state before applying the
*entire* output, and all "new" files refer to the state thereafter.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-show-ref.txt: clarify the pattern matchingMichael J Gruber Mon, 18 Oct 2010 11:33:32 +0000 (13:33 +0200)

git-show-ref.txt: clarify the pattern matching

git-show-ref really does not do what one would expect under the name
pattern matching, so describe it.

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

documentation: git-config minor cleanupsCliff Frey Mon, 18 Oct 2010 03:10:45 +0000 (20:10 -0700)

documentation: git-config minor cleanups

Change push.default's description to add hyphens between values and
descriptions to make the manpage easier to read. The html version is
readable either way.

Change status.showUntrackedFiles to make item descriptions be
sentences and to use the same asciidoc format as push.default. The
only visual change is the additions of "."

Signed-off-by: Cliff Frey <cliff@meraki.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update test script annotate-tests.sh to handle missing... Kevin Ballard Sat, 16 Oct 2010 11:09:20 +0000 (04:09 -0700)

Update test script annotate-tests.sh to handle missing/extra authors

The current script used by annotate-tests.sh (used by t8001 and t8002) fails
to emit a warning if any of the expected authors never show up in the output
or if authors that show up in the output were never specified as expected.
Update the script to fail in both of these scenarios.

Helped-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: Add option to show author email instead of nameKevin Ballard Sat, 16 Oct 2010 06:57:51 +0000 (23:57 -0700)

blame: Add option to show author email instead of name

Add a new option -e (or --show-email) to git-blame that will display
the author's email instead of name on each line. This option works
for both git-blame and git-annotate.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack: place temporary packs under .git/objects/pack/Thomas Rast Tue, 19 Oct 2010 09:50:43 +0000 (11:50 +0200)

repack: place temporary packs under .git/objects/pack/

git-pack-objects is already careful to start out its temporary packs
under .git/objects/pack/ (cf. 8b4eb6b, Do not perform cross-directory
renames when creating packs, 2008-09-22), but git-repack did not
respond in kind so the effort was lost when the filesystem boundary is
exactly at that directory.

Let git-repack pass a path under .git/objects/pack/ as the base for
its temporary packs.

This means we might need the $PACKDIR sooner (before the pack-objects
invocation), so move the mkdir up just to be safe.

Also note that the only use of *.pack is in the find invocation way
before the pack-objects call, so the temporary packs will not suddenly
show up in any wildcards because of the directory change.

Reported-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: tighten M 040000 syntaxJonathan Nieder Mon, 18 Oct 2010 01:08:53 +0000 (20:08 -0500)

fast-import: tighten M 040000 syntax

When tree_content_set() is asked to modify the path "foo/bar/",
it first recurses like so:

tree_content_set(root, "foo/bar/", sha1, S_IFDIR) ->
tree_content_set(root:foo, "bar/", ...) ->
tree_content_set(root:foo/bar, "", ...)

And as a side-effect of 2794ad5 (fast-import: Allow filemodify to set
the root, 2010-10-10), this last call is accepted and changes
the tree entry for root:foo/bar to refer to the specified tree.

That seems safe enough but let's reject the new syntax (we never meant
to support it) and make it harder for frontends to introduce pointless
incompatibilities with git fast-import 1.7.3.

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

fast-import: filemodify after M 040000 <tree> "" crashesJonathan Nieder Mon, 18 Oct 2010 01:03:38 +0000 (20:03 -0500)

fast-import: filemodify after M 040000 <tree> "" crashes

Until M 040000 <tree> "" syntax was introduced in commit 2794ad5
(fast-import: Allow filemodify to set the root, 2010-10-10), it
was impossible for the root entry to refer to an unloaded tree.
Update various functions to take that possibility into account.
Otherwise

M 040000 <tree> ""
M 100644 :1 "foo"

and similar commands (using D, C, or R after resetting the root
tree) segfault.

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

push: pass --progress down to git-pack-objectsJeff King Sat, 16 Oct 2010 18:37:03 +0000 (02:37 +0800)

push: pass --progress down to git-pack-objects

When pushing via builtin transports (like file://, git://), the
underlying transport helper (in this case, git-pack-objects) did not get
the --progress option, even if it was passed to git push.

Fix this, and update the tests to reflect this.

Note that according to the git-pack-objects documentation, we can safely
apply the usual --progress semantics for the transport commands like
clone and fetch (and for pushing over other smart transports).

Reported-by: Chase Brammer <cbrammer@gmail.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5523-push-upstream: test progress messagesTay Ray Chuan Sat, 16 Oct 2010 18:37:02 +0000 (02:37 +0800)

t5523-push-upstream: test progress messages

Reported-by: Chase Brammer <cbrammer@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5523-push-upstream: add function to ensure fresh upstr... Tay Ray Chuan Sat, 16 Oct 2010 18:37:01 +0000 (02:37 +0800)

t5523-push-upstream: add function to ensure fresh upstream repo

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_terminal: ensure redirections work reliablyJonathan Nieder Sun, 17 Oct 2010 00:38:07 +0000 (19:38 -0500)

test_terminal: ensure redirections work reliably

For terminal tests that capture output/stderr, the TTY prerequisite
warning does not quite work for commands like

test_terminal foo >out 2>err

because the warning gets "swallowed" up by the redirection that's
supposed only to be done by the subcommand.

Even worse, the outcome depends on whether stdout was already a
terminal (in which case test_terminal is a noop) or not (in which case
test_terminal introduces a pseudo-tty in the middle of the pipeline).

$ test_terminal.perl sh -c 'test -t 1 && echo >&2 YES' >out
YES
$ sh -c 'test -t 1 && echo >&2 YES' >out
$

So:

- use the test_terminal script even when running with "-v".

- skip tests that require a terminal when the test_terminal
script is unusable because IO::Pty is not installed.

- write the "need to declare TTY prerequisite" message to fd 4,
where it will be printed when running tests with -v, rather
than being swallowed up by an unrelated redireciton.

Noticed-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_terminal: catch use without TTY prerequisiteJonathan Nieder Sat, 16 Oct 2010 18:36:59 +0000 (02:36 +0800)

test_terminal: catch use without TTY prerequisite

It is easy to forget to declare the TTY prerequisite when
writing tests on a system where it would always be satisfied
(because IO::Pty is installed; see v1.7.3-rc0~33^2, 2010-08-16
for example). Automatically detect this problem so there is
no need to remember.

test_terminal: need to declare TTY prerequisite
test_must_fail: command not found: test_terminal echo hi

test_terminal returns status 127 in this case to simulate
not being available.

Also replace the SIMPLEPAGERTTY prerequisite on one test with
"SIMPLEPAGER,TTY", since (1) the latter is supported now and
(2) the prerequisite detection relies on the TTY prereq being
explicitly declared.

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

test-lib: allow test code to check the list of declared... Jonathan Nieder Sat, 16 Oct 2010 18:36:58 +0000 (02:36 +0800)

test-lib: allow test code to check the list of declared prerequisites

This is plumbing to prepare helpers like test_terminal to notice buggy
test scripts that do not declare all of the necessary prerequisites.

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

tests: test terminal output to both stdout and stderrJeff King Sat, 16 Oct 2010 18:36:57 +0000 (02:36 +0800)

tests: test terminal output to both stdout and stderr

Some outputs (like the pager) care whether stdout is a
terminal. Others (like progress meters) care about stderr.

This patch sets up both. Technically speaking, we could go
further and set up just one (because either the other goes
to a terminal, or because our tests are only interested in
one). This patch does both to keep the interface to
lib-terminal simple.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: factor out terminal handling from t7006Jeff King Sat, 16 Oct 2010 18:36:56 +0000 (02:36 +0800)

tests: factor out terminal handling from t7006

Other tests besides the pager ones may want to check how we handle
output to a terminal. This patch makes the code reusable.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-pack: avoid redundant "pack-objects died with... Jonathan Nieder Sat, 16 Oct 2010 17:09:54 +0000 (12:09 -0500)

send-pack: avoid redundant "pack-objects died with strange error"

Saying "pack-objects died with strange error" after "pack-objects died
of signal 13" seems kind of redundant. The latter message was
introduced when the run-command API changed to report abnormal exits
on behalf of the caller (v1.6.5-rc0~86^2~5, 2009-07-04).

Similarly, after a controlled pack-objects failure (detectable as a
normal exit with nonzero status), a "died with strange error" message
would be redundant next to the message from pack-objects itself.

So leave off the "strange error" messages.

The result should look something like this:

$ git push sf master
Counting objects: 21542, done.
Compressing objects: 100% (4179/4179), done.
fatal: Unable to create temporary file: Permission denied
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://sf.net/gitroot/project/project'
$

Or in the "controlled exit" case (contrived example):

[...]
fatal: delta size changed
error: failed to push some refs to 'ssh://example.com/foo/bar'
$

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

merge-file: correctly find files when called in subdirThomas Rast Sun, 17 Oct 2010 19:23:22 +0000 (21:23 +0200)

merge-file: correctly find files when called in subdir

Since b541248 (merge.conflictstyle: choose between "merge" and "diff3
-m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),
thus cd'ing around to find any possible config files to use.

This broke merge-file when it is called from within a subdirectory of
a repository, and the arguments are all relative paths.

Fix by prepending the prefix, as passed down from the main git
setup code, if there is any.

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

prefix_filename(): safely handle the case where pfx_len=0Thomas Rast Sun, 17 Oct 2010 19:23:21 +0000 (21:23 +0200)

prefix_filename(): safely handle the case where pfx_len=0

Current prefix_filename() is proofed against the case where the prefix
'pfx' is NULL or a 0-length string, _except on Windows_.

Change the behaviour to work the same on both platforms, and only
check pfx_len so that callers passing a NULL prefix with a nonzero
pfx_len segfault early on both.

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