gitweb.git
Merge branch 'jn/gitweb-dependency' into maintJunio C Hamano Mon, 16 May 2011 23:37:12 +0000 (16:37 -0700)

Merge branch 'jn/gitweb-dependency' into maint

* jn/gitweb-dependency:
Remove gitweb/gitweb.cgi and other legacy targets from main Makefile
git-instaweb: Simplify build dependency on gitweb

Merge branch 'jc/maint-branch-mergeoptions' into maintJunio C Hamano Mon, 16 May 2011 23:37:07 +0000 (16:37 -0700)

Merge branch 'jc/maint-branch-mergeoptions' into maint

* jc/maint-branch-mergeoptions:
merge: make branch.<name>.mergeoptions correctly override merge.<option>

Conflicts:
builtin/merge.c

Merge branch 'jc/maint-add-p-overlapping-hunks' into... Junio C Hamano Mon, 16 May 2011 23:36:46 +0000 (16:36 -0700)

Merge branch 'jc/maint-add-p-overlapping-hunks' into maint

* jc/maint-add-p-overlapping-hunks:
t3701: add-p-fix makes the last test to pass
"add -p": work-around an old laziness that does not coalesce hunks
add--interactive.perl: factor out repeated --recount option
t3701: Editing a split hunk in an "add -p" session
add -p: 'q' should really quit

Documentation/git-fsck.txt: fix typo: unreadable -... Jim Meyering Mon, 16 May 2011 18:23:35 +0000 (20:23 +0200)

Documentation/git-fsck.txt: fix typo: unreadable -> unreachable

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-pack: avoid deadlock on git:// push with failed... Jeff King Mon, 16 May 2011 06:52:57 +0000 (02:52 -0400)

send-pack: avoid deadlock on git:// push with failed pack-objects

Commit 09c9957c fixes a deadlock in which pack-objects
fails, the remote end is still waiting for pack data, and we
are still waiting for the remote end to say something (see
that commit for a much more in-depth explanation).

We solved the problem there by making sure the output pipe
is closed on error; thus the remote sees EOF, and proceeds
to complain and close its end of the connection.

However, in the special case of push over git://, we don't
have a pipe, but rather a full-duplex socket, with another
dup()-ed descriptor in place of the second half of the pipe.
In this case, closing the second descriptor signals nothing
to the remote end, and we still deadlock.

This patch calls shutdown() explicitly to signal EOF to the
other side.

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

connect: let callers know if connection is a socketJeff King Mon, 16 May 2011 06:52:11 +0000 (02:52 -0400)

connect: let callers know if connection is a socket

They might care because they want to do a half-duplex close.
With pipes, that means simply closing the output descriptor;
with a socket, you must actually call shutdown.

Instead of exposing the magic no_fork child_process struct,
let's encapsulate the test in a function.

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

connect: treat generic proxy processes like ssh processesJeff King Mon, 16 May 2011 06:46:07 +0000 (02:46 -0400)

connect: treat generic proxy processes like ssh processes

The git_connect function returns two ends of a pipe for
talking with a remote, plus a struct child_process
representing the other end of the pipe. If we have a direct
socket connection, then this points to a special "no_fork"
child process.

The code path for doing git-over-pipes or git-over-ssh sets
up this child process to point to the child git command or
the ssh process. When we call finish_connect eventually, we
check wait() on the command and report its return value.

The code path for git://, on the other hand, always sets it
to no_fork. In the case of a direct TCP connection, this
makes sense; we have no child process. But in the case of a
proxy command (configured by core.gitproxy), we do have a
child process, but we throw away its pid, and therefore
ignore its return code.

Instead, let's keep that information in the proxy case, and
respect its return code, which can help catch some errors
(though depending on your proxy command, it will be errors
reported by the proxy command itself, and not propagated
from git commands. Still, it is probably better to propagate
such errors than to ignore them).

It also means that the child_process field can reliably be
used to determine whether the returned descriptors are
actually a full-duplex socket, which means we should be
using shutdown() instead of a simple close.

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

sideband_demux(): fix decl-after-stmtJunio C Hamano Mon, 16 May 2011 23:19:49 +0000 (16:19 -0700)

sideband_demux(): fix decl-after-stmt

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

t3503: test cherry picking and reverting root commitsJeff King Thu, 12 May 2011 11:10:07 +0000 (07:10 -0400)

t3503: test cherry picking and reverting root commits

We already tested cherry-picking a root commit, but only
with the internal merge-recursive strategy. Let's also test
the recently-allowed reverting of a root commit, as well as
testing with external strategies (which until recently
triggered a segfault).

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

revert: allow reverting a root commitJeff King Thu, 12 May 2011 11:09:55 +0000 (07:09 -0400)

revert: allow reverting a root commit

Although it is probably an uncommon operation, there is no
reason to disallow it, as it works just fine. It is the
reverse of a cherry-pick of a root commit, which is already
allowed.

We do have to tweak one check on whether we have a merge
commit, which assumed we had at least one parent.

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

cherry-pick: handle root commits with external strategiesJeff King Thu, 12 May 2011 11:09:46 +0000 (07:09 -0400)

cherry-pick: handle root commits with external strategies

The merge-recursive strategy already handles root commits;
it cherry-picks the difference between the empty tree and
the root commit's tree.

However, for external strategies, we dereference NULL and
segfault while building the argument list. Instead, let's
handle this by passing the empty tree sha1 to the merge
script.

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

Update draft release notes to 1.7.5.2Junio C Hamano Sun, 15 May 2011 23:11:55 +0000 (16:11 -0700)

Update draft release notes to 1.7.5.2

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

Merge branch 'cn/format-patch-quiet' into maintJunio C Hamano Sun, 15 May 2011 23:10:49 +0000 (16:10 -0700)

Merge branch 'cn/format-patch-quiet' into maint

* cn/format-patch-quiet:
format-patch: document --quiet option
format-patch: don't pass on the --quiet flag

Merge branch 'jm/mergetool-submodules' into maintJunio C Hamano Sun, 15 May 2011 22:57:16 +0000 (15:57 -0700)

Merge branch 'jm/mergetool-submodules' into maint

* jm/mergetool-submodules:
mergetool: Teach about submodules

Merge branch 'jk/format-patch-quote-special-in-from... Junio C Hamano Sun, 15 May 2011 22:56:44 +0000 (15:56 -0700)

Merge branch 'jk/format-patch-quote-special-in-from' into maint

* jk/format-patch-quote-special-in-from:
pretty: quote rfc822 specials in email addresses

Merge branch 'vh/git-svn-doc' into maintJunio C Hamano Sun, 15 May 2011 22:52:40 +0000 (15:52 -0700)

Merge branch 'vh/git-svn-doc' into maint

* vh/git-svn-doc:
git-svn.txt: small typeface improvements
git-svn.txt: move option descriptions
git-svn.txt: fix usage of --add-author-from

git_open_noatime(): drop unused parameterJunio C Hamano Sun, 15 May 2011 19:16:29 +0000 (12:16 -0700)

git_open_noatime(): drop unused parameter

Since commit c793430 (Limit file descriptors used by packs, 2011-02-28),
the extra parameter added in f2e872aa (Work around EMFILE when there are
too many pack files, 2010-11-01) is not used anymore.

Remove it.

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

sha1_file: typofixJunio C Hamano Sun, 15 May 2011 19:16:03 +0000 (12:16 -0700)

sha1_file: typofix

The number zero is spelled "zero", not "zer0".

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

add, merge, diff: do not use strcasecmp to compare... Jonathan Nieder Sat, 14 May 2011 20:19:21 +0000 (15:19 -0500)

add, merge, diff: do not use strcasecmp to compare config variable names

The config machinery already makes section and variable names
lowercase when parsing them, so using strcasecmp for comparison just
feels wasteful. No noticeable change intended.

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

Prepare for 1.7.5.2Junio C Hamano Fri, 13 May 2011 17:57:09 +0000 (10:57 -0700)

Prepare for 1.7.5.2

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

Merge branch 'aw/maint-rebase-i-p-no-ff' into maintJunio C Hamano Fri, 13 May 2011 17:45:21 +0000 (10:45 -0700)

Merge branch 'aw/maint-rebase-i-p-no-ff' into maint

* aw/maint-rebase-i-p-no-ff:
git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff

Merge branch 'js/blame-parsename' into maintJunio C Hamano Fri, 13 May 2011 17:45:00 +0000 (10:45 -0700)

Merge branch 'js/blame-parsename' into maint

* js/blame-parsename:
t/annotate-tests: Use echo & cat instead of sed
blame: tolerate bogus e-mail addresses a bit better

Merge branch 'gr/cvsimport-alternative-cvspass-location... Junio C Hamano Fri, 13 May 2011 17:44:54 +0000 (10:44 -0700)

Merge branch 'gr/cvsimport-alternative-cvspass-location' into maint

* gr/cvsimport-alternative-cvspass-location:
Look for password in both CVS and CVSNT password files.

Merge branch 'cj/p4merge' into maintJunio C Hamano Fri, 13 May 2011 17:44:46 +0000 (10:44 -0700)

Merge branch 'cj/p4merge' into maint

* cj/p4merge:
Pass empty file to p4merge where no base is suitable.

Merge branch 'jk/merge-one-file-working-tree' into... Junio C Hamano Fri, 13 May 2011 17:44:19 +0000 (10:44 -0700)

Merge branch 'jk/merge-one-file-working-tree' into maint

* jk/merge-one-file-working-tree:
merge-one-file: fix broken merges with alternate work trees
add tests for merge-index / merge-one-file

Merge branch 'jc/fix-diff-files-unmerged' into maintJunio C Hamano Fri, 13 May 2011 17:41:54 +0000 (10:41 -0700)

Merge branch 'jc/fix-diff-files-unmerged' into maint

* jc/fix-diff-files-unmerged:
diff-files: show unmerged entries correctly
diff: remove often unused parameters from diff_unmerge()
diff.c: return filepair from diff_unmerge()
test: use $_z40 from test-lib

Merge branch 'mz/maint-rename-unmerged' into maintJunio C Hamano Fri, 13 May 2011 17:41:24 +0000 (10:41 -0700)

Merge branch 'mz/maint-rename-unmerged' into maint

* mz/maint-rename-unmerged:
diffcore-rename: don't consider unmerged path as source

t5400: Fix a couple of typosJohan Herland Fri, 13 May 2011 16:43:29 +0000 (18:43 +0200)

t5400: Fix a couple of typos

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

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 22:05:01 +0000 (15:05 -0700)

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'

Update the fix for 1.7.5 maintenance track.

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 21:57:45 +0000 (14:57 -0700)

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'

Update the fix for 1.7.4 maintenance track.

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

setup_revisions(): take pathspec from command line... Junio C Hamano Wed, 11 May 2011 21:01:19 +0000 (14:01 -0700)

setup_revisions(): take pathspec from command line and --stdin correctly

When the command line has "--" disambiguator, we take the remainder of
argv[] as "prune_data", but when --stdin is given at the same time,
we need to append to the existing prune_data and end up attempting to
realloc(3) it. That would not work.

Fix it by consistently using append_prune_data() throughout the input
processing. Also avoid counting the number of existing paths in the
function over and over again.

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

git-completion: fix regression in zsh supportFelipe Contreras Tue, 10 May 2011 12:20:39 +0000 (15:20 +0300)

git-completion: fix regression in zsh support

The zsh support of git-completion script in contrib/ is broken for current
versions of zsh, and does not notice when there's a subcommand.

For example: "git log origi<TAB>" gives no completions because it would
try to find a "git origi..." command. This will be fixed by zsh 4.3.12,
but for now we can workaround it by backporting the same fix as zsh folks
implemented.

The problem started after commit v1.7.4-rc0~11^2~2 (bash: get
--pretty=m<tab> completion to work with bash v4), which introduced
_get_comp_words_by_ref() that comes from bash-completion[1] scripts, and
relies on the 'words' variable.

However, it turns out 'words' is a special variable used by zsh
completion. From zshcompwid(1):

[...] the parameters are reset on each function exit (including nested
function calls from within the completion widget) to the values they had
when the function was entered.

As a result, subcommand words are lost. Ouch.

This is now fixed in the latest master branch of zsh[2] by simply defining
'words' as hidden (typeset -h), which removes the special meaning inside
the emulated bash function. So let's do the same.

Jonathan Nieder helped on the commit message.

[1] http://bash-completion.alioth.debian.org/
[2] http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=e880604f029088f32fb1ecc39213d720ae526aaa

Reported-by: Stefan Haller <lists@haller-berlin.de>
Comments-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Honor $(prefix) set in config.mak* when defining ETC_GIT*Johannes Sixt Mon, 9 May 2011 08:24:55 +0000 (10:24 +0200)

Honor $(prefix) set in config.mak* when defining ETC_GIT*

Notice that the prefix specified for the build influenced the definitions
of ETC_GITCONFIG and ETC_GITATTRIBUTES only when it was exactly '/usr'.
Kacper Kornet noticed that this was furthermore only the case when the
build was triggered using 'make prefix=/usr', i.e., the prefix was given
on the command line; it did not work when the prefix was specified in
config.mak because this file is included much later in the Makefile.

To fix this, move the conditional after the inclusion of config.mak.

Additionally, it is desirable to specify the etc directory for a build
(for example, a build with prefix /usr/local may still want to have the
system configuration in /etc/gitconfig). For this purpose, promote the
variable 'sysconfdir' from a helper variable to a configuration
variable. The prefix check that was moved must now be wrapped so that it
does not override sysconfdir setting given in config.mak.

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

Revert "Honor $(prefix) set in config.mak* when definin... Junio C Hamano Mon, 9 May 2011 22:12:13 +0000 (15:12 -0700)

Revert "Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir"

This reverts commit 2910bf56a4ffc13c398fb04ba32910cb3b724091, as it
does not really solve the issue of making $(sysconfigdir) any more
useful than it currently is.

t1507: avoid "${parameter<op>'word'}" inside double... Junio C Hamano Mon, 9 May 2011 04:43:20 +0000 (21:43 -0700)

t1507: avoid "${parameter<op>'word'}" inside double-quotes

Kacper Kornet noticed that a $variable in "word" in the above construct is
not substituted by his pdksh. Modern POSIX compliant shells (e.g. dash,
ksh, bash) all seem to interpret POSIX "2.6.2 Parameter Expansion" that
says "word shall be subjected to tilde expansion, parameter expansion,
command substitution, and arithmetic expansion" in ${parameter<op>word},
to mean that the word is expanded as if it appeared in dq pairs, so if the
word were "'$variable'" (sans dq) it would expand to a single quote, the
value of the $variable and then a single quote.

Johannes Sixt reports that the behavior of quoting at the right of :- when
the ${...:-...} expansion appears in double-quotes was debated recently at
length at the Austin group. We can avoid this issue and future-proof the
test by a slight rewrite.

Helped-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3701: add-p-fix makes the last test to passJunio C Hamano Sun, 8 May 2011 20:43:04 +0000 (13:43 -0700)

t3701: add-p-fix makes the last test to pass

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

Remove gitweb/gitweb.cgi and other legacy targets from... Jakub Narebski Sat, 7 May 2011 12:45:21 +0000 (14:45 +0200)

Remove gitweb/gitweb.cgi and other legacy targets from main Makefile

Now that there is gitweb/Makefile, let's leave only "gitweb" and
"install-gitweb" targets in main Makefile. Those targets just
delegate to gitweb's Makefile.

Requested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: Simplify build dependency on gitwebJakub Narebski Sat, 7 May 2011 12:45:20 +0000 (14:45 +0200)

git-instaweb: Simplify build dependency on gitweb

Since c0cb4ed (git-instaweb: Configure it to work with new gitweb
structure, 2010-05-28) git-instaweb does not re-create gitweb.cgi
etc., but makes use of installed gitweb. Therefore simplify
git-instaweb dependency on gitweb subsystem in main Makefile from
'gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/static/gitweb.js'
to simply 'gitweb'.

This is preparation for splitting gitweb.perl script, and for
splitting gitweb.js (to be reassembled / combined on build). This way
we don't have to duplicate parts of gitweb/Makefile in main
Makefile... it is also more correct description of git-instaweb
dependency.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: make branch.<name>.mergeoptions correctly overri... Junio C Hamano Thu, 5 May 2011 00:42:51 +0000 (17:42 -0700)

merge: make branch.<name>.mergeoptions correctly override merge.<option>

The parsing of the additional command line parameters supplied to
the branch.<name>.mergeoptions configuration variable was implemented
at the wrong stage. If any merge-related variable came after we read
branch.<name>.mergeoptions, the earlier value was overwritten.

We should first read all the merge.* configuration, override them by
reading from branch.<name>.mergeoptions and then finally read from
the command line.

This patch should fix it, even though I now strongly suspect that
branch.<name>.mergeoptions that gives a single command line that
needs to be parsed was likely to be an ill-conceived idea to begin
with. Sigh...

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

Remove duplicated "is a"João Britto Fri, 6 May 2011 04:16:17 +0000 (01:16 -0300)

Remove duplicated "is a"

Signed-off-by: João Britto <jabcalves@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: fix option parser for no-arg optionsSverre Rabbelier Thu, 5 May 2011 18:56:00 +0000 (20:56 +0200)

fast-import: fix option parser for no-arg options

While refactoring the options parser in bc3c79a (fast-import: add
(non-)relative-marks feature, 2009-12-04), it was made too lenient
for options that take no argument, fix that.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc... Junio C Hamano Thu, 5 May 2011 20:46:36 +0000 (13:46 -0700)

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix

* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix:
send-pack: unbreak push over stateless rpc

send-pack: unbreak push over stateless rpcJeff King Thu, 5 May 2011 06:18:45 +0000 (02:18 -0400)

send-pack: unbreak push over stateless rpc

Commit 09c9957 (send-pack: avoid deadlock when pack-object
dies early, 2011-04-25) attempted to fix a hang in the
stateless rpc case by closing a file descriptor early, but
we still need that descriptor.

Basically the deadlock can happen when pack-objects fails,
and the descriptor to upstream is left open. We never send
the pack, so the upstream is left waiting for us to say
something, and we are left waiting for upstream to close the
connection.

In the non-rpc case, our descriptor points straight to the
upstream. We hand it off to run-command, which takes
ownership and closes the descriptor after pack-objects
finishes (whether it succeeds or not).

Commit 09c9957 tried to emulate that in the rpc case. That
isn't right, though. We actually have a descriptor going
back to the remote-helper, and we need to keep using it
after pack-objects is finished. Closing it early completely
breaks pushing via smart-http.

We still need to do something on error to signal the
remote-helper that we won't be sending any pack data
(otherwise we get the deadlock). In an ideal world, we
would send a special packet back that says "Sorry, there was
an error". But the remote-helper doesn't understand any such
packet, so the best we can do is close the descriptor and
let it report that we hung up unexpectedly.

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

git-reset.txt: better docs for '--patch'Valentin Haenel Thu, 5 May 2011 19:58:18 +0000 (21:58 +0200)

git-reset.txt: better docs for '--patch'

Describe '-p' as a short form of '--patch' in synopsis. Also include a better
explanation of this option and additionally refer the reader to the patch mode
description of git-add documentation.

Helped-by: Jeff King <peff@peff.net>
Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-checkout.txt: better docs for '--patch'Valentin Haenel Thu, 5 May 2011 18:48:48 +0000 (20:48 +0200)

git-checkout.txt: better docs for '--patch'

Describe '-p' as a short form of '--patch' in synopsis and options. Also
refer the reader to the patch mode description of git-add documentation.

Helped-by: Jeff King <peff@peff.net>
Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-stash.txt: better docs for '--patch'Valentin Haenel Thu, 5 May 2011 18:48:47 +0000 (20:48 +0200)

git-stash.txt: better docs for '--patch'

Describe '-p' as a short form of '--patch' in synopsis and options. Also
refer the reader to the patch mode description of git-add documentation.

Helped-by: Jeff King <peff@peff.net>
Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-add.txt: document 'interactive.singlekey'Valentin Haenel Thu, 5 May 2011 18:48:45 +0000 (20:48 +0200)

git-add.txt: document 'interactive.singlekey'

This is documented in the section about the 'Interactive Mode', rather than for
the option '--patch', since this is the section is where people go to learn
about '--patch'.

Helped-by: Jeff King <peff@peff.net>
Mentored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: 'interactive.singlekey; is used by...Valentin Haenel Mon, 2 May 2011 13:44:28 +0000 (15:44 +0200)

config.txt: 'interactive.singlekey; is used by...

The config variable 'interactive.singlekey' influences also '--patch' mode of
git-add, git-reset, and git-checkout.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3701: fix here documentJunio C Hamano Thu, 5 May 2011 18:28:52 +0000 (11:28 -0700)

t3701: fix here document

A broken here-document was not caught because end of file is taken by
an implicit end of the here document (POSIX does not seem to say it is
an error to lack the delimiter), and everything in the test just turned
into a single "cat into a file".

Noticed-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-fast-import.txt: --relative-marks takes no parameterMichael J Gruber Thu, 5 May 2011 09:13:38 +0000 (11:13 +0200)

git-fast-import.txt: --relative-marks takes no parameter

Remove spurious "=" after --relative-marks.

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

shell: add missing initialization of argv0_pathDima Sharov Thu, 5 May 2011 06:40:17 +0000 (09:40 +0300)

shell: add missing initialization of argv0_path

According to c6dfb39 (remote-curl: add missing initialization of
argv0_path, 2009-10-13), stand-alone programs (non-builtins)
must call git_extract_argv0_path(argv[0]) in order to help builds
that derive the installation prefix at runtime. Without this call,
the program segfaults (or raises an assertion failure).

Signed-off-by: Dima Sharov <git.avalakvista@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/annotate-tests: Use echo & cat instead of sedBrian Gernhardt Thu, 5 May 2011 04:43:37 +0000 (00:43 -0400)

t/annotate-tests: Use echo & cat instead of sed

The use of the sed command "1i No robots allowed" caused the version
of sed in OS X to die with

sed: 1: "1i "No robots allowed"\n": command i expects \ followed by
text

Since this command was just trying to add a single line to the
beginning of the file, do the same with "echo" followed by "cat".

Unbreaks t8001 and t8002 on OS X 10.6.7

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

Git 1.7.5.1 v1.7.5.1Junio C Hamano Wed, 4 May 2011 22:47:40 +0000 (15:47 -0700)

Git 1.7.5.1

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

Merge branch 'jh/dirstat' into maintJunio C Hamano Wed, 4 May 2011 21:59:07 +0000 (14:59 -0700)

Merge branch 'jh/dirstat' into maint

* jh/dirstat:
--dirstat: In case of renames, use target filename instead of source filename
Teach --dirstat not to completely ignore rearranged lines within a file
--dirstat-by-file: Make it faster and more correct
--dirstat: Describe non-obvious differences relative to --stat or regular diff

Merge branch 'sp/maint-clear-postfields' into maintJunio C Hamano Wed, 4 May 2011 21:58:56 +0000 (14:58 -0700)

Merge branch 'sp/maint-clear-postfields' into maint

* sp/maint-clear-postfields:
http: clear POSTFIELDS when initializing a slot

Merge branch 'jk/maint-stash-oob' into maintJunio C Hamano Wed, 4 May 2011 21:58:42 +0000 (14:58 -0700)

Merge branch 'jk/maint-stash-oob' into maint

* jk/maint-stash-oob:
stash: fix false positive in the invalid ref test.
stash: fix accidental apply of non-existent stashes

Conflicts:
t/t3903-stash.sh

Merge branch 'jk/maint-upload-pack-shallow' into maintJunio C Hamano Wed, 4 May 2011 21:58:13 +0000 (14:58 -0700)

Merge branch 'jk/maint-upload-pack-shallow' into maint

* jk/maint-upload-pack-shallow:
upload-pack: start pack-objects before async rev-list

Merge branch 'dm/stash-k-i-p' into maintJunio C Hamano Wed, 4 May 2011 21:57:49 +0000 (14:57 -0700)

Merge branch 'dm/stash-k-i-p' into maint

* dm/stash-k-i-p:
stash: ensure --no-keep-index and --patch can be used in any order
stash: add two more tests for --no-keep-index

Merge branch 'jc/pack-objects-bigfile' into maintJunio C Hamano Wed, 4 May 2011 21:57:38 +0000 (14:57 -0700)

Merge branch 'jc/pack-objects-bigfile' into maint

* jc/pack-objects-bigfile:
Teach core.bigfilethreashold to pack-objects

Merge branch 'mg/reflog-with-options' into maintJunio C Hamano Wed, 4 May 2011 21:57:33 +0000 (14:57 -0700)

Merge branch 'mg/reflog-with-options' into maint

* mg/reflog-with-options:
reflog: fix overriding of command line options
t/t1411: test reflog with formats
builtin/log.c: separate default and setup of cmd_log_init()

Merge branch 'jk/stash-loosen-safety' into maintJunio C Hamano Wed, 4 May 2011 21:57:15 +0000 (14:57 -0700)

Merge branch 'jk/stash-loosen-safety' into maint

* jk/stash-loosen-safety:
stash: drop dirty worktree check on apply

Merge branch 'ar/clean-rmdir-empty' into maintJunio C Hamano Wed, 4 May 2011 21:57:06 +0000 (14:57 -0700)

Merge branch 'ar/clean-rmdir-empty' into maint

* ar/clean-rmdir-empty:
clean: unreadable directory may still be rmdir-able if it is empty

Merge branch 'mg/sha1-path-advise' into maintJunio C Hamano Wed, 4 May 2011 21:56:51 +0000 (14:56 -0700)

Merge branch 'mg/sha1-path-advise' into maint

* mg/sha1-path-advise:
sha1_name: Suggest commit:./file for path in subdir
t1506: factor out test for "Did you mean..."

git-add.txt: document 'add.ignoreErrors'Valentin Haenel Wed, 4 May 2011 19:58:17 +0000 (21:58 +0200)

git-add.txt: document 'add.ignoreErrors'

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pass empty file to p4merge where no base is suitable.Ciaran Jessup Sun, 1 May 2011 22:16:02 +0000 (23:16 +0100)

Pass empty file to p4merge where no base is suitable.

Modify the p4merge client command to pass a reference to an empty file
instead of the local file when no base revision available.

In the situation where a merge tries to add a file from one branch
into a branch that already contains that file (by name), p4merge
currently seems to have successfully automatically resolved the
'conflict' when it is opened (correctly if the files differed by
just whitespace for example) but leaves the save button disabled. This
means the user of the p4merge client cannot commit the resolved
changes back to disk and merely exits, leaving the original
(merge-conflicted) file intact on the disk.

Provide an empty base file to p4merge so that it leaves the save
button enabled. This will allow saving of the auto-resolution to
disk.

Signed-off-by: Ciaran Jessup <ciaranj@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Look for password in both CVS and CVSNT password files.Guy Rouillier Sun, 1 May 2011 05:33:52 +0000 (01:33 -0400)

Look for password in both CVS and CVSNT password files.

In conn, if password is not passed on command line, look for a password
entry in both the CVS password file and the CVSNT password file. If only
one file is found and the requested repository is in that file, or if both
files are found but the requested repository is found in only one file, use
the password from the single file containing the repository entry. If both
files are found and the requested repository is found in both files, then
produce an error message.

The CVS password file separates tokens with a space character, while
the CVSNT password file separates tokens with an equal (=) character.
Add a sub find_password_entry that accepts the password file name
and a delimiter to eliminate code duplication.

Signed-off-by: Guy Rouillier <guyr@burntmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-one-file: fix broken merges with alternate work... Jeff King Fri, 29 Apr 2011 22:24:32 +0000 (18:24 -0400)

merge-one-file: fix broken merges with alternate work trees

The merge-one-file tool predates the invention of
GIT_WORK_TREE. By the time GIT_WORK_TREE was invented, most
people were using the merge-recursive strategy, which
handles resolving internally. Therefore these features have
had very little testing together.

For the most part, merge-one-file just works with
GIT_WORK_TREE; most of its heavy lifting is done by plumbing
commands which do respect GIT_WORK_TREE properly. The one
exception is a shell redirection which touches the worktree
directly, writing results to the wrong place in the presence
of a GIT_WORK_TREE variable.

This means that merges won't even fail; they will silently
produce incorrect results, throwing out the entire "theirs"
side of files which need content-level merging!

This patch makes merge-one-file chdir to the toplevel of the
working tree (and exit if we don't have one). This most
closely matches the assumption made by the original script
(before separate work trees were invented), and matches what
happens when the script is called as part of a merge
strategy.

While we're at it, we'll also error-check the call to cat.
Merging a file in a subdirectory could in fact fail, as the
redirection relies on the "checkout-index" call just prior
to create leading directories. But we never noticed, since
we ignored the error return from running cat.

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

add tests for merge-index / merge-one-fileJeff King Fri, 29 Apr 2011 22:23:54 +0000 (18:23 -0400)

add tests for merge-index / merge-one-file

There were no tests for either, except a brief use in
t1200-tutorial.

These tools are not used much these days, as most people
use the merge-recursive strategy, which handles everything
internally. However, they are used by the "octopus" and
"resolve" strategies, as well as any custom strategies
or merge scripts people have built around them.

For example, together with read-tree, they are the simplest
way to do a basic content-level merge without checking out
the entire repository contents beforehand.

This script adds a basic test of the tools to perform one
content-level merge. It also shows a failure of the tools to
work properly in the face of GIT_WORK_TREE or core.worktree.

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

"add -p": work-around an old laziness that does not... Junio C Hamano Wed, 6 Apr 2011 21:20:57 +0000 (14:20 -0700)

"add -p": work-around an old laziness that does not coalesce hunks

Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),
"git add--interactive" behaves lazily and passes overlapping hunks to the
underlying "git apply" without coalescing. This was partially corrected
by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are
still passed when the patch is edited.

Teach "git apply" the --allow-overlap option that disables a safety
feature that avoids misapplication of patches by not applying patches
to overlapping hunks, and pass this option form "add -p" codepath.

Do not even advertise the option, as this is merely a workaround, and the
correct fix is to make "add -p" correctly coalesce adjacent patch hunks.

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

add--interactive.perl: factor out repeated --recount... Junio C Hamano Wed, 6 Apr 2011 21:12:34 +0000 (14:12 -0700)

add--interactive.perl: factor out repeated --recount option

Depending on the direction and the target of patch application, we would
need to pass --cached and --reverse to underlying "git apply". Also we
only pass --check when we are not applying but just checking.

But we always pass --recount since 8cbd431 (git-add--interactive: replace
hunk recounting with apply --recount, 2008-07-02). Instead of repeating
the same --recount over and over again, move it to a single place that
actually runs the command, namely, "run_git_apply" subroutine.

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

t3701: Editing a split hunk in an "add -p" sessionJunio C Hamano Fri, 29 Apr 2011 19:41:16 +0000 (12:41 -0700)

t3701: Editing a split hunk in an "add -p" session

Arnaud Lacombe reported that with the recent change to reject overlapping
hunks fed to "git apply", the edit mode of an "add -p" session that lazily
feeds overlapping hunks without coalescing adjacent ones claim that the
patch does not apply. Expose the problem to be fixed.

Cf. http://thread.gmane.org/gmane.comp.version-control.git/170685/focus=171000

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

add -p: 'q' should really quitJunio C Hamano Fri, 29 Apr 2011 22:12:32 +0000 (15:12 -0700)

add -p: 'q' should really quit

The "quit" command was added in 9a7a1e0 (git add -p: new "quit" command at
the prompt, 2009-04-10) to allow the user to say that hunks other than
what have already been chosen are undesirable, and exit the interactive
loop immediately. It forgot that there may be an undecided hunk before
the current one. In such a case, the interactive loop still goes back to
the beginning.

Clear all the USE bit for undecided hunks and exit the loop.

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

Start 1.7.5.1 maintenance trackJunio C Hamano Fri, 29 Apr 2011 18:47:10 +0000 (11:47 -0700)

Start 1.7.5.1 maintenance track

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

Merge branch 'mg/x-years-12-months' into maintJunio C Hamano Fri, 29 Apr 2011 18:43:18 +0000 (11:43 -0700)

Merge branch 'mg/x-years-12-months' into maint

* mg/x-years-12-months:
date: avoid "X years, 12 months" in relative dates

git-send-email: fix missing space in error messageSylvain Rabot Fri, 29 Apr 2011 18:23:24 +0000 (20:23 +0200)

git-send-email: fix missing space in error message

When the command cannot make a connection to the SMTP server the error
message to diagnose the broken configuration is issued. However, when an
optional smtp-server-port is given and needs to be reported, the message
lacked a space between "hello=<smtp-domain>" and "port=<smtp-server-port>".

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: tolerate bogus e-mail addresses a bit betterJosh Stone Thu, 21 Apr 2011 22:07:36 +0000 (15:07 -0700)

blame: tolerate bogus e-mail addresses a bit better

The names and e-mails are sanitized by fmt_ident() when creating commits,
so that they do not contain "<" nor ">", and the "committer" and "author"
lines in the commit object will always be in the form:

("author" | "committer") name SP "<" email ">" SP timestamp SP zone

When parsing the email part out, the current code looks for SP starting
from the end of the email part, but the author could obfuscate the address
as "author at example dot com".

We should instead look for SP followed by "<", to match the logic of the
side that formats these lines.

Signed-off-by: Josh Stone <jistone@redhat.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Honor $(prefix) set in config.mak* when defining ETC_GI... Kacper Kornet Thu, 28 Apr 2011 19:27:51 +0000 (21:27 +0200)

Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir

Definitions of ETC_GITCONFIG, ETC_GITATTRIBUTES and sysconfdir depend on
value of prefix. As prefix can be changed in config.mak.autogen, all if
blocks with conditions based on prefix should be placed after the file
is included in Makefile.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase--interactive.sh: preserve-merges fails on... Andrew Wong Thu, 28 Apr 2011 04:35:55 +0000 (00:35 -0400)

git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff

'git rebase' uses 'git merge' to preserve merges (-p). This preserves
the original merge commit correctly, except when the original merge
commit was created by 'git merge --no-ff'. In this case, 'git rebase'
will fail to preserve the merge, because during 'git rebase', 'git
merge' will simply fast-forward and skip the commit. For example:

B
/ \
A---M
/
---o---O---P---Q

If we try to rebase M onto P, we lose the merge commit and this happens:

A---B
/
---o---O---P---Q

To correct this, we simply do a "no fast-forward" on all merge commits
when rebasing. Since by the time we decided to do a 'git merge' inside
'git rebase', it means there was a merge originally, so 'git merge'
should always create a merge commit regardless of what the merge
branches look like. This way, when rebase M onto P from the above
example, we get:

B
/ \
A---M
/
---o---O---P---Q

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt,diff-options.txt: porcelain vs. plumbing... Michael J Gruber Wed, 27 Apr 2011 07:38:27 +0000 (09:38 +0200)

config.txt,diff-options.txt: porcelain vs. plumbing for color.diff

Reading the diff-family and config man pages one may think that the
color.diff and color.ui settings apply to all diff commands. Make it
clearer that they do not apply to the plumbing variants
diff-{files,index,tree}.

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

pretty: quote rfc822 specials in email addressesJeff King Fri, 8 Apr 2011 22:40:36 +0000 (18:40 -0400)

pretty: quote rfc822 specials in email addresses

If somebody has a name that includes an rfc822 special, we
will output it literally in the "From:" header. This is
usually OK, but certain characters (like ".") are supposed
to be enclosed in double-quotes in a mail header.

In practice, whether this matters may depend on your MUA.
Some MUAs will happily take in:

From: Foo B. Bar <author@example.com>

without quotes, and properly quote the "." when they send
the actual mail. Others may not, or may screw up harder
things like:

From: Foo "The Baz" Bar <author@example.com>

For example, mutt will strip the quotes, thinking they are
actual syntactic rfc822 quotes.

So let's quote properly, and then (if necessary) we still
apply rfc2047 encoding on top of that, which should make all
MUAs happy.

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

gitweb: supply '-n' to gzip for identical outputFraser Tweedale Tue, 26 Apr 2011 01:32:00 +0000 (11:32 +1000)

gitweb: supply '-n' to gzip for identical output

For projects that do not release official archives, gitweb's snapshot
feature would be an excellent alternative, and but without the '-n'
('--no-name') argument, gzip includes a timestamp in output which results
in different files. Because some systems hash/checksum downloaded files
to ensure integrity of the tarball (e.g FreeBSD), it is desirable to
produce tarballs in a reproducible way for that purpose.

Whilst '--no-name' is more descriptive, the long version of the flag is
not supported on all systems. In particular, OpenBSD does not appear to
support it.

Supply '-n' to gzip to exclude timestamp from output and produce idential
output every time.

Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn.txt: small typeface improvementsValentin Haenel Tue, 26 Apr 2011 11:34:19 +0000 (13:34 +0200)

git-svn.txt: small typeface improvements

Mark subcommand names as 'subcommand' to make them stand out.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn.txt: move option descriptionsValentin Haenel Tue, 26 Apr 2011 11:34:18 +0000 (13:34 +0200)

git-svn.txt: move option descriptions

The options '---use-log-author' and '--add-author-from' are applicable to other
subcommands except 'fetch' -- therefore move them from the 'fetch' section to
the more general 'options' section.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn.txt: fix usage of --add-author-fromValentin Haenel Mon, 25 Apr 2011 21:36:15 +0000 (23:36 +0200)

git-svn.txt: fix usage of --add-author-from

The option '--add-author-from' is used in 'commit-diff', 'set-tree', and
'dcommit' subcommands.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: unify documentation of test function argsMathias Lafeldt Tue, 26 Apr 2011 10:33:26 +0000 (12:33 +0200)

t/README: unify documentation of test function args

Document all test function arguments in the same way.

While at it, tweak the description of test_path_is_* (thanks to Junio),
and correct some grammatical errors.

Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: clear POSTFIELDS when initializing a slotJunio C Hamano Tue, 26 Apr 2011 15:04:49 +0000 (08:04 -0700)

http: clear POSTFIELDS when initializing a slot

After posting a short request using CURLOPT_POSTFIELDS, if the slot
is reused for posting a large payload, the slot ends up having both
POSTFIELDS (which now points at a random garbage) and READFUNCTION,
in which case the curl library tries to use the stale POSTFIELDS.

Clear it as part of the general slot initialization in get_active_slot().

Heavylifting-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn Pearce <spearce@spearce.org>

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc... Junio C Hamano Mon, 25 Apr 2011 22:20:39 +0000 (15:20 -0700)

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix

* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix:
send-pack: avoid deadlock when pack-object dies early

Evil merge to adjust the way the use of pthreads in sideband-demultiplexor
was decided (earlier it was "if we are not on Windows", now it is "if we
are not using pthreads").

send-pack: avoid deadlock when pack-object dies earlyJohannes Sixt Mon, 25 Apr 2011 21:04:10 +0000 (23:04 +0200)

send-pack: avoid deadlock when pack-object dies early

Send-pack deadlocks in two ways when pack-object dies early (for example,
because there is some repo corruption).

The first deadlock happens with the smart push protocol (--stateless-rpc).
After the initial rev-exchange, the remote is waiting for the pack data
to arrive, and the sideband demuxer at the local side continues trying to
stream data from the remote repository until it gets EOF. Meanwhile,
send-pack (in function pack_objects()) has noticed that pack-objects did
not produce output and died. Back in send_pack(), it now tries to clean
up the sideband demuxer using finish_async(). The demuxer, however, waits
for the remote end to close down, the remote waits for pack data, and
the reason that it still waits is that send-pack forgot to close the
outgoing channel. Add the missing close() in pack_objects().

The second deadlock happens in a similar constellation when the sideband
demuxer runs in a forked process (rather than in a thread). Again, the
remote end waits for pack data to arrive, the sideband demuxer waits for
the remote to shut down, and send-pack (in the regular clean-up) waits for
the demuxer to terminate. This time, the send-pack parent process closes
the writable end of the outgoing channel (in start_command() that spawned
pack-objects) so that after the death of the pack-objects process all
writable ends should have been closed and the remote repo should see EOF.
This does not happen, however, because when the sideband demuxer was forked
earlier, it also inherited a writable end; it remains open and keeps the
remote repo from seeing EOF. To break this deadlock, close the writable end
in the demuxer.

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

Git 1.7.5 v1.7.5Junio C Hamano Sun, 24 Apr 2011 06:36:32 +0000 (23:36 -0700)

Git 1.7.5

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

Fix "add -u" that sometimes fails to resolve unmerged... Junio C Hamano Thu, 21 Apr 2011 01:11:19 +0000 (18:11 -0700)

Fix "add -u" that sometimes fails to resolve unmerged paths

"git add -u" updates the index with the updated contents from the working
tree by internally running "diff-files" to grab the set of paths that are
different from the index. Then it updates the index entries for the paths
that are modified in the working tree, and deletes the index entries for
the paths that are deleted in the working tree.

It ignored the output from the diff-files that indicated that a path is
unmerged. For these paths, it instead relied on the fact that an unmerged
path is followed by the result of comparison between stage #2 (ours) and
the working tree, and used that to update or delete such a path when it is
used to record the resolution of a conflict.

As the result, when a path did not have stage #2 (e.g. "we deleted while
the other side added"), these unmerged stages were left behind, instead of
recording what the user resolved in the working tree.

Since we recently fixed "diff-files" to indicate if the corresponding path
exists on the working tree for an unmerged path, we do not have to rely on
the comparison with stage #2 anymore. We can instead tell the diff-files
not to compare with higher stages, and use the unmerged output to update
the index to reflect the state of the working tree.

The changes to the test vector in t2200 illustrates the nature of the bug
and the fix. The test expected stage #1 and #3 entries be left behind,
but it was codifying the buggy behaviour.

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

diff-files: show unmerged entries correctlyJunio C Hamano Fri, 22 Apr 2011 23:19:27 +0000 (16:19 -0700)

diff-files: show unmerged entries correctly

Earlier, e9c8409 (diff-index --cached --raw: show tree entry on the LHS
for unmerged entries., 2007-01-05) taught the command to show the object
name and the mode from the entry coming from the tree side when comparing
a tree with an unmerged index.

This is a belated companion patch that teaches diff-files to show the mode
from the entry coming from the working tree side, when comparing an
unmerged index and the working tree.

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

diff: remove often unused parameters from diff_unmerge()Junio C Hamano Fri, 22 Apr 2011 23:05:58 +0000 (16:05 -0700)

diff: remove often unused parameters from diff_unmerge()

e9c8409 (diff-index --cached --raw: show tree entry on the LHS for
unmerged entries., 2007-01-05) added a <mode, object name> pair as
parameters to this function, to store them in the pre-image side of an
unmerged file pair. Now the function is fixed to return the filepair it
queued, we can make the caller on the special case codepath to do so.

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

diff.c: return filepair from diff_unmerge()Junio C Hamano Fri, 22 Apr 2011 22:55:55 +0000 (15:55 -0700)

diff.c: return filepair from diff_unmerge()

The underlying diff_queue() returns diff_filepair so that the caller can
further add information to it, and the helper function diff_unmerge()
utilizes the feature itself, but does not expose it to its callers, which
was kind of selfish.

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

test: use $_z40 from test-libJunio C Hamano Sun, 24 Apr 2011 05:34:13 +0000 (22:34 -0700)

test: use $_z40 from test-lib

There is no need to duplicate the definition of $_z40 and $_x40 that
test-lib.sh supplies the test scripts.

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

date: avoid "X years, 12 months" in relative datesMichael J Gruber Wed, 20 Apr 2011 09:12:11 +0000 (11:12 +0200)

date: avoid "X years, 12 months" in relative dates

When relative dates are more than about a year ago, we start
writing them as "Y years, M months". At the point where we
calculate Y and M, we have the time delta specified as a
number of days. We calculate these integers as:

Y = days / 365
M = (days % 365 + 15) / 30

This rounds days in the latter half of a month up to the
nearest month, so that day 16 is "1 month" (or day 381 is "1
year, 1 month").

We don't round the year at all, though, meaning we can end
up with "1 year, 12 months", which is silly; it should just
be "2 years".

Implement this differently with months of size

onemonth = 365/12

so that

totalmonths = (long)( (days + onemonth/2)/onemonth )
years = totalmonths / 12
months = totalmonths % 12

In order to do this without floats, we write the first formula as

totalmonths = (days*12*2 + 365) / (365*2)

Tests and inspiration by Jeff King.

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

run-command: handle short writes and EINTR in die_childJonathan Nieder Wed, 20 Apr 2011 10:40:05 +0000 (05:40 -0500)

run-command: handle short writes and EINTR in die_child

If start_command fails after forking and before exec finishes, there
is not much use in noticing an I/O error on top of that.
finish_command will notice that the child exited with nonzero status
anyway. So as noted in v1.7.0.3~20^2 (run-command.c: fix build
warnings on Ubuntu, 2010-01-30) and v1.7.5-rc0~29^2 (2011-03-16), it
is safe to ignore errors from write in this codepath.

Even so, the result from write contains useful information: it tells
us if the write was cancelled by a signal (EINTR) or was only
partially completed (e.g., when writing to an almost-full pipe).
Let's use write_in_full to loop until the desired number of bytes have
been written (still ignoring errors if that fails).

As a happy side effect, the assignment to a dummy variable to appease
gcc -D_FORTIFY_SOURCE is no longer needed. xwrite and write_in_full
check the return value from write(2).

Noticed with gcc -Wunused-but-set-variable.

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

tests: check error message from run_commandJonathan Nieder Wed, 20 Apr 2011 10:35:08 +0000 (05:35 -0500)

tests: check error message from run_command

In git versions starting at v1.7.5-rc0~29^2 until v1.7.5-rc3~2 (Revert
"run-command: prettify -D_FORTIFY_SOURCE workaround", 2011-04-18)
fixed it, the run_command facility would write a truncated error
message when the command is present but cannot be executed for some
other reason. For example, if I add a 'hello' command to git:

$ echo 'echo hello' >git-hello
$ chmod +x git-hello
$ PATH=.:$PATH git hello
hello

and make it non-executable, this is what I normally get:

$ chmod -x git-hello
$ git hello
fatal: cannot exec 'git-hello': Permission denied

But with the problematic versions, we get disturbing output:

$ PATH=.:$PATH git hello
fatal: $

Add some tests to make sure it doesn't happen again.

The hello-script used in these tests uses cat instead of echo because
on Windows the bash spawned by git converts LF to CRLF in text written
by echo while the bash running tests does not, causing the test to
fail if "echo" is used. Thanks to Hannes for noticing.

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

Git 1.7.5-rc3 v1.7.5-rc3Junio C Hamano Tue, 19 Apr 2011 18:51:00 +0000 (11:51 -0700)

Git 1.7.5-rc3

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

Sync with 1.7.4.5Junio C Hamano Tue, 19 Apr 2011 18:49:13 +0000 (11:49 -0700)

Sync with 1.7.4.5

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

Git 1.7.4.5 v1.7.4.5Junio C Hamano Tue, 19 Apr 2011 18:45:38 +0000 (11:45 -0700)

Git 1.7.4.5

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