gitweb.git
Submodules: Add 'on-demand' value for the 'fetchRecurse... Jens Lehmann Sun, 6 Mar 2011 22:12:19 +0000 (23:12 +0100)

Submodules: Add 'on-demand' value for the 'fetchRecurseSubmodule' option

Now the behavior of fetch and pull can be configured to the recently added
'on-demand' mode separately for each submodule too.

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

config: teach the fetch.recurseSubmodules option the... Jens Lehmann Sun, 6 Mar 2011 22:11:48 +0000 (23:11 +0100)

config: teach the fetch.recurseSubmodules option the 'on-demand' value

To enable the user to change the default behavior of "git fetch" and "git
pull" regarding submodule recursion add the new "on-demand" value which
has just been added to the "--recurse-submodules" command line option.

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

fetch/pull: Add the 'on-demand' value to the --recurse... Jens Lehmann Sun, 6 Mar 2011 22:11:21 +0000 (23:11 +0100)

fetch/pull: Add the 'on-demand' value to the --recurse-submodules option

Until now the --recurse-submodules option could only be used to either
fetch all populated submodules recursively or to disable recursion
completely. As fetch and pull now by default just fetch those submodules
for which new commits have been fetched in the superproject, a command
line option to enforce that behavior is needed to be able to override
configuration settings.

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

fetch/pull: recurse into submodules when necessaryJens Lehmann Sun, 6 Mar 2011 22:10:46 +0000 (23:10 +0100)

fetch/pull: recurse into submodules when necessary

To be able to access all commits of populated submodules referenced by the
superproject it is sufficient to only then let "git fetch" recurse into a
submodule when the new commits fetched in the superproject record new
commits for it. Having these commits present is extremely useful when
using the "--submodule" option to "git diff" (which is what "git gui" and
"gitk" do since 1.6.6), as all submodule commits needed for creating a
descriptive output can be accessed. Also merging submodule commits (added
in 1.7.3) depends on the submodule commits in question being present to
work. Last but not least this enables disconnected operation when using
submodules, as all commits necessary for a successful "git submodule
update -N" will have been fetched automatically. So we choose this mode as
the default for fetch and pull.

Before a new or changed ref from upstream is updated in update_local_ref()
"git rev-list <new-sha1> --not --branches --remotes" is used to determine
all newly fetched commits. These are then walked and diffed against their
parent(s) to see if a submodule has been changed. If that is the case, its
path is stored to be fetched after the superproject fetch is completed.

Using the "--recurse-submodules" or the "--no-recurse-submodules" option
disables the examination of the fetched refs because the result will be
ignored anyway.

There is currently no infrastructure for storing deleted and new
submodules in the .git directory of the superproject. That's why fetch and
pull for now only fetch submodules that are already checked out and are
not renamed.

In t7403 the "--no-recurse-submodules" argument had to be added to "git
pull" to avoid failure because of the moved upstream submodule repo.

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix typo in t/READMEMathias Lafeldt Wed, 9 Mar 2011 20:25:09 +0000 (21:25 +0100)

Fix typo in t/README

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

ls-remote documentation: <refs> argument is optionalPiotr Krukowiecki Wed, 9 Mar 2011 20:03:48 +0000 (21:03 +0100)

ls-remote documentation: <refs> argument is optional

Correct SYNOPSIS section.

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add Author and Documentation sections to git-for-each... Alexei Sholik Tue, 8 Mar 2011 13:16:10 +0000 (15:16 +0200)

Add Author and Documentation sections to git-for-each-ref.txt

Signed-off-by: Alexei Sholik <alcosholik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: remove redundant colons in git-for-each... Alexei Sholik Tue, 8 Mar 2011 13:16:09 +0000 (15:16 +0200)

Documentation: remove redundant colons in git-for-each-ref.txt

Signed-off-by: Alexei Sholik <alcosholik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Quote tag names in event bindings to avoid proble... Pat Thoyts Tue, 1 Mar 2011 23:50:50 +0000 (23:50 +0000)

gitk: Quote tag names in event bindings to avoid problems with % chars

Tag names that contain a % character require quoting when used in event
bindings or the name may be mis-recognised for percent substitution in
the event script.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Allow user to control how much of the SHA1 ID... Paul Mackerras Wed, 9 Mar 2011 09:52:38 +0000 (20:52 +1100)

gitk: Allow user to control how much of the SHA1 ID gets auto-selected

This adds a new spinbox on the Edit Preferences pane to allow the user
to control how many characters of the SHA1 ID get autoselected.

Signed-off-by: Paul Mackerras <paulus@samba.org>

Merge branch 'maint'Junio C Hamano Wed, 9 Mar 2011 05:37:23 +0000 (21:37 -0800)

Merge branch 'maint'

* maint:
SubmittingPatches: clarify the expected commit log description
diff format documentation: clarify --cc and -c
rev-list-options.txt: typo fix

transport-helper.c: fix check for (size_t < 0)Nicolas Kaiser Fri, 4 Mar 2011 23:16:26 +0000 (00:16 +0100)

transport-helper.c: fix check for (size_t < 0)

'bytes' is of type size_t which is unsigned thus can't be negative. But
the assigned write() returns ssize_t, and -1 on error.

For testing < 0, 'bytes' needs to be of a signed type.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: clarify the expected commit log... Junio C Hamano Wed, 9 Mar 2011 00:58:19 +0000 (16:58 -0800)

SubmittingPatches: clarify the expected commit log description

Earlier, 47afed5 (SubmittingPatches: itemize and reflect upon well written
changes, 2009-04-28) added a discussion on the contents of the commit log
message, but the last part of the new paragraph didn't make much sense.
Reword it slightly to make it more readable.

Update the "quicklist" to clarify what we mean by "motivation" and
"contrast". Also mildly discourage external references.

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

diff format documentation: clarify --cc and -cAdam Monsen Tue, 8 Mar 2011 20:51:37 +0000 (12:51 -0800)

diff format documentation: clarify --cc and -c

The description was unclear if -c or --cc was the default (--cc is for
some commands), and incorrectly implied that the default applies to
all the diff generating commands.

Most importantly, "log" does not default to "--cc" (it defaults to
"--no-merges") and "log -p" obeys the user's wish to see non-combined
format. Only "diff" (during merge and three-blob comparison) and
"show" use --cc as the default.

Signed-off-by: Adam Monsen <haircut@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit, status: use status_printf{,_ln,_more} helpersJonathan Nieder Sat, 26 Feb 2011 05:11:37 +0000 (23:11 -0600)

commit, status: use status_printf{,_ln,_more} helpers

wt-status code is used to provide a reminder of changes included and
not included for the commit message template opened in the operator's
text editor by "git commit". Therefore each line of its output begins
with the comment character "#":

# Please enter the commit message for your changes. Lines starting

Use the new status_printf{,_ln,_more} functions to take care of adding
"#" to the beginning of such status lines automatically. Using these
will have two advantages over the current code:

- The obvious one is to force separation of the "#" from the
translatable part of the message when git learns to translate its
output.

- Another advantage is that this makes it easier for us to drop "#"
prefix in "git status" output in later versions of git if we want
to.

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

commit: refer to commit template as s->fpJonathan Nieder Sat, 26 Feb 2011 05:10:49 +0000 (23:10 -0600)

commit: refer to commit template as s->fp

Instead of maintaining a local variable for it, use s->fp to keep
track of where the commit message template should be written.

This prepares us to take advantage of the status_printf functions,
which use a struct wt_status instead of a FILE pointer to determine
where to send their output.

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

wt-status: add helpers for printing wt-status linesJonathan Nieder Sat, 26 Feb 2011 05:09:41 +0000 (23:09 -0600)

wt-status: add helpers for printing wt-status lines

Introduce status_printf{,_ln,_more} wrapper functions around
color_vfprintf() which take care of adding "#" to the beginning of
status lines automatically. The semantics:

- status_printf() is just like color_fprintf() but it adds a "# "
at the beginning of each line of output;

- status_printf_ln() is a convenience function that additionally
adds "\n" at the end;

- status_printf_more() is a variant of status_printf() used to
continue lines that have already started. It suppresses the "#" at
the beginning of the first line.

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

trace: give repo_setup trace its own keyJeff King Thu, 24 Feb 2011 14:30:30 +0000 (09:30 -0500)

trace: give repo_setup trace its own key

You no longer get this output with GIT_TRACE=1; instead, you
can do GIT_TRACE_SETUP=1.

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

add packet tracing debug codeJeff King Thu, 24 Feb 2011 14:30:19 +0000 (09:30 -0500)

add packet tracing debug code

This shows a trace of all packets coming in or out of a given
program. This can help with debugging object negotiation or
other protocol issues.

To keep the code changes simple, we operate at the lowest
level, meaning we don't necessarily understand what's in the
packets. The one exception is a packet starting with "PACK",
which causes us to skip that packet and turn off tracing
(since the gigantic pack data will not be interesting to
read, at least not in the trace format).

We show both written and read packets. In the local case,
this may mean you will see packets twice (written by the
sender and read by the receiver). However, for cases where
the other end is remote, this allows you to see the full
conversation.

Packet tracing can be enabled with GIT_TRACE_PACKET=<foo>,
where <foo> takes the same arguments as GIT_TRACE.

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

trace: add trace_strbufJeff King Thu, 24 Feb 2011 14:29:50 +0000 (09:29 -0500)

trace: add trace_strbuf

If you happen to have a strbuf, it is a little more readable
and a little more efficient to be able to print it directly
instead of jamming it through the trace_printf interface.

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

trace: factor out "do we want to trace" logicJeff King Thu, 24 Feb 2011 14:28:59 +0000 (09:28 -0500)

trace: factor out "do we want to trace" logic

As we add more tracing areas, this will avoid repeated code.

Technically, trace_printf already checks this and will avoid
printing if the trace key is not set. However, callers may
want to find out early whether or not tracing is enabled so
they can avoid doing work in the common non-trace case.

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

trace: refactor to support multiple env variablesJeff King Thu, 24 Feb 2011 14:28:41 +0000 (09:28 -0500)

trace: refactor to support multiple env variables

Right now you turn all tracing off and on with GIT_TRACE. To
support new types of tracing without forcing the user to see
all of them, we will soon support turning each tracing area
on with GIT_TRACE_*.

This patch lays the groundwork by providing an interface
which does not assume GIT_TRACE. However, we still maintain
the trace_printf interface so that existing callers do not
need to be refactored.

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

trace: add trace_vprintfJeff King Thu, 24 Feb 2011 14:28:15 +0000 (09:28 -0500)

trace: add trace_vprintf

This is a necessary cleanup to adding new types of trace
functions.

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

i18n: do not poison translations unless GIT_GETTEXT_POI... Jonathan Nieder Tue, 22 Feb 2011 23:41:22 +0000 (23:41 +0000)

i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set

Tweak the GETTEXT_POISON facility so it is activated at run time
instead of compile time. If the GIT_GETTEXT_POISON environment
variable is set, _(msg) will result in gibberish as before; but if the
GIT_GETTEXT_POISON variable is not set, it will return the message for
human-readable output. So the behavior of mistranslated and
untranslated git can be compared without rebuilding git in between.

For simplicity we always set the GIT_GETTEXT_POISON variable in tests.

This does not affect builds without the GETTEXT_POISON compile-time
option set, so non-i18n git will not be slowed down.

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

i18n: add GETTEXT_POISON to simulate unfriendly translatorÆvar Arnfjörð Bjarmason Tue, 22 Feb 2011 23:41:21 +0000 (23:41 +0000)

i18n: add GETTEXT_POISON to simulate unfriendly translator

Add a new GETTEXT_POISON compile-time parameter to make _(msg) always
return gibberish. So now you can run

make GETTEXT_POISON=YesPlease

to get a copy of git that functions correctly (one hopes) but produces
output that is in nobody's native language at all.

This is a debugging aid for people who are working on the i18n part of
the system, to make sure that they are not marking plumbing messages
that should never be translated with _().

As new strings get marked for translation, naturally a number of tests
will be broken in this mode. Tests that depend on output from
Porcelain will need to be marked with the new C_LOCALE_OUTPUT test
prerequisite. Newly failing tests that do not depend on output from
Porcelain would be bugs due to messages that should not have been
marked for translation.

Note that the string we're using ("# GETTEXT POISON #") intentionally
starts the pound sign. Some of Git's tests such as
t3404-rebase-interactive.sh rely on interactive editing with a fake
editor, and will needlessly break if the message doesn't start with
something the interactive editor considers a comment.

A future patch will fix fix the underlying cause of that issue by
adding "#" characters to the commit advice automatically.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: add no-op _() and N_() wrappersÆvar Arnfjörð Bjarmason Tue, 22 Feb 2011 23:41:20 +0000 (23:41 +0000)

i18n: add no-op _() and N_() wrappers

The _ function is for translating strings into the user's chosen
language. The N_ macro just marks translatable strings for the
xgettext(1) tool without translating them; it is intended for use in
contexts where a function call cannot be used. So, for example:

fprintf(stderr, _("Expansion of alias '%s' failed; "
"'%s' is not a git command\n"),
cmd, argv[0]);

and

const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
/* ERROR_WOULD_OVERWRITE */
N_("Entry '%s' would be overwritten by merge. Cannot merge."),
[...]

Define such _ and N_ in a new gettext.h and include it in cache.h, so
they can be used everywhere. Each just returns its argument for now.
_ is a function rather than a macro like N_ to avoid the temptation to
use _("foo") as a string literal (which would be a compile-time error
once _(s) expands to an expression for the translation of s).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit, status: use status_printf{,_ln,_more} helpersJonathan Nieder Sat, 26 Feb 2011 05:11:37 +0000 (23:11 -0600)

commit, status: use status_printf{,_ln,_more} helpers

wt-status code is used to provide a reminder of changes included and
not included for the commit message template opened in the operator's
text editor by "git commit". Therefore each line of its output begins
with the comment character "#":

# Please enter the commit message for your changes. Lines starting

Use the new status_printf{,_ln,_more} functions to take care of adding
"#" to the beginning of such status lines automatically. Using these
will have two advantages over the current code:

- The obvious one is to force separation of the "#" from the
translatable part of the message when git learns to translate its
output.

- Another advantage is that this makes it easier for us to drop "#"
prefix in "git status" output in later versions of git if we want
to.

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

commit: refer to commit template as s->fpJonathan Nieder Sat, 26 Feb 2011 05:10:49 +0000 (23:10 -0600)

commit: refer to commit template as s->fp

Instead of maintaining a local variable for it, use s->fp to keep
track of where the commit message template should be written.

This prepares us to take advantage of the status_printf functions,
which use a struct wt_status instead of a FILE pointer to determine
where to send their output.

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

wt-status: add helpers for printing wt-status linesJonathan Nieder Sat, 26 Feb 2011 05:09:41 +0000 (23:09 -0600)

wt-status: add helpers for printing wt-status lines

Introduce status_printf{,_ln,_more} wrapper functions around
color_vfprintf() which take care of adding "#" to the beginning of
status lines automatically. The semantics:

- status_printf() is just like color_fprintf() but it adds a "# "
at the beginning of each line of output;

- status_printf_ln() is a convenience function that additionally
adds "\n" at the end;

- status_printf_more() is a variant of status_printf() used to
continue lines that have already started. It suppresses the "#" at
the beginning of the first line.

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

compat: fall back on __va_copy if availableJonathan Nieder Tue, 8 Mar 2011 08:33:44 +0000 (02:33 -0600)

compat: fall back on __va_copy if available

Since an obvious implementation of va_list is to make it a pointer
into the stack frame, implementing va_copy as "dst = src" will work on
many systems. Platforms that use something different (e.g., a size-1
array of structs, to be assigned with *(dst) = *(src)) will need some
other compatibility macro, though.

Luckily, as the glibc manual hints, such systems tend to provide the
__va_copy macro (introduced in GCC in March, 1997). By using that if
it is available, we can cover our bases pretty well.

Discovered by building with CC="gcc -std=c89" on an amd64 machine:

$ make CC=c89 strbuf.o
[...]
strbuf.c: In function 'strbuf_vaddf':
strbuf.c:211:2: error: incompatible types when assigning to type 'va_list'
from type 'struct __va_list_tag *'
make: *** [strbuf.o] Error 1

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

git-log.txt,rev-list-options.txt: -n/--max-count is... Michael J Gruber Tue, 8 Mar 2011 08:31:25 +0000 (09:31 +0100)

git-log.txt,rev-list-options.txt: -n/--max-count is commit limiting

They are applied after commit ordering and formatting options, in
particular --reverse.

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

rev-list-options.txt: typo fixMichael J Gruber Tue, 8 Mar 2011 08:31:24 +0000 (09:31 +0100)

rev-list-options.txt: typo fix

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

git-compat-util.h: Honor HP C's noreturn attributeMichal Rokos Mon, 7 Mar 2011 12:13:15 +0000 (13:13 +0100)

git-compat-util.h: Honor HP C's noreturn attribute

HP C for Integrity servers (Itanium) gained support for noreturn
attribute sometime in 2006. It was released in Compiler Version
A.06.10 and made available in July 2006.

The __HP_cc define detects the HP C compiler version. Precede the
__GNUC__ check so it works well when compiling with HP C using -Agcc
option that enables partial support for the GNU C dialect. The -Agcc
defines the __GNUC__ too.

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add NO_FNMATCH_CASEFOLD to HP-UX sectionMichal Rokos Mon, 7 Mar 2011 11:43:11 +0000 (12:43 +0100)

Makefile: add NO_FNMATCH_CASEFOLD to HP-UX section

fnmatch() on HP-UX does not support the GNU FNM_CASEFOLD extension,
so set NO_FNMATCH_CASEFOLD to use the internal fnmatch implementation.

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: allow input errors to be detected promptlyJonathan Nieder Mon, 11 Oct 2010 02:51:21 +0000 (21:51 -0500)

vcs-svn: allow input errors to be detected promptly

The line_buffer library silently flags input errors until
buffer_deinit time; unfortunately, by that point usually errno is
invalid. Expose the error flag so callers can check for and
report errors early for easy debugging.

some_error_prone_operation(...);
if (buffer_ferror(buf))
return error("input error: %s", strerror(errno));

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: simplify repo_modify_path and repo_copyJonathan Nieder Fri, 10 Dec 2010 06:53:54 +0000 (00:53 -0600)

vcs-svn: simplify repo_modify_path and repo_copy

Restrict the repo_tree API to functions that are actually needed.

- decouple reading the mode and content of dirents from other
operations.
- remove repo_modify_path. It is only used to read the mode from
dirents.
- remove the ability to use repo_read_mode on a missing path. The
existing code only errors out in that case, anyway.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: handle_node: use repo_read_pathJonathan Nieder Fri, 10 Dec 2010 10:28:06 +0000 (04:28 -0600)

vcs-svn: handle_node: use repo_read_path

svn-fe processes each commit in two stages: first decide on the
correct content for all paths and export the relevant blobs, then
export a commit with the result.

But we can keep less state and simplify svn-fe a great deal by
exporting the commit in one step: use 'inline' blobs for each path and
remember nothing. This way, the repo_tree structure could be
eliminated, and we would get support for incremental imports 'for
free'.

Reorganize handle_node along these lines. This is just a code
cleanup; the changes in repo_tree and handle_revision will come later.

[db: backported to apply without text delta support]

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: introduce repo_read_path to check the content... Jonathan Nieder Sat, 20 Nov 2010 19:25:28 +0000 (13:25 -0600)

vcs-svn: introduce repo_read_path to check the content at a path

The repo_tree structure remembers, for each path in each revision, a
mode (regular file, executable, symlink, or directory) and content
(blob mark or directory structure). Maintaining a second copy of all
this information when it's already in the target repository is
wasteful, it does not persist between svn-fe invocations, and most
importantly, there is no convenient way to transfer it from one
machine to another. So it would be nice to get rid of it.

As a first step, let's change the repo_tree API to match fast-import's
read commands more closely. Currently to read the mode for a path,
one uses

repo_modify_path(path, new_mode, new_content);

which changes the mode and content as a side effect. There is no
function to read the content at a path; add one.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

apply -v: show offset count when patch did not apply... Junio C Hamano Fri, 4 Mar 2011 22:43:45 +0000 (14:43 -0800)

apply -v: show offset count when patch did not apply exactly

When the line number the patch intended to touch does not match
the line in the version being patched, GNU patch reports that
it applied the hunk at a different line number, with how big an
offset.

Teach "git apply" to do the same under --verbose option.

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

Merge branch 'maint'Junio C Hamano Fri, 4 Mar 2011 23:02:45 +0000 (15:02 -0800)

Merge branch 'maint'

* maint:
Documentation: fix a typo in git-apply.txt
init: remove unnecessary check

Merge branch 'mh/p4'Junio C Hamano Fri, 4 Mar 2011 23:02:28 +0000 (15:02 -0800)

Merge branch 'mh/p4'

* mh/p4:
git-p4 submit: prevent 'Jobs' section from being removed from p4 change log

Merge branch 'mg/maint-difftool-vim-readonly'Junio C Hamano Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)

Merge branch 'mg/maint-difftool-vim-readonly'

* mg/maint-difftool-vim-readonly:
mergetool-lib: call vim in readonly mode for diffs

Merge branch 'jn/maint-commit-missing-template'Junio C Hamano Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)

Merge branch 'jn/maint-commit-missing-template'

* jn/maint-commit-missing-template:
commit: error out for missing commit message template

Merge branch 'jk/diffstat-binary'Junio C Hamano Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)

Merge branch 'jk/diffstat-binary'

* jk/diffstat-binary:
diff: don't retrieve binary blobs for diffstat
diff: handle diffstat of rewritten binary files

Merge branch 'lt/rename-no-extra-copy-detection'Junio C Hamano Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)

Merge branch 'lt/rename-no-extra-copy-detection'

* lt/rename-no-extra-copy-detection:
diffcore-rename: improve estimate_similarity() heuristics
diffcore-rename: properly honor the difference between -M and -C
for_each_hash: allow passing a 'void *data' pointer to callback

Merge branch 'jn/test-terminal-punt-on-osx-breakage'Junio C Hamano Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)

Merge branch 'jn/test-terminal-punt-on-osx-breakage'

* jn/test-terminal-punt-on-osx-breakage:
tests: skip terminal output tests on OS X

Merge branch 'jk/fail-null-clone'Junio C Hamano Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)

Merge branch 'jk/fail-null-clone'

* jk/fail-null-clone:
clone: die when trying to clone missing local path

Merge branch 'jc/grep--no-index-pathspec-fix'Junio C Hamano Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)

Merge branch 'jc/grep--no-index-pathspec-fix'

* jc/grep--no-index-pathspec-fix:
grep --no-index: honor pathspecs correctly

apply: do not patch lines that were already patchedJunio C Hamano Fri, 4 Mar 2011 20:25:34 +0000 (12:25 -0800)

apply: do not patch lines that were already patched

When looking for a place to apply a hunk, we used to check lines that
match the preimage of it, starting from the line that the patch wants to
apply the hunk at, looking forward and backward with increasing offsets
until we find a match.

Colin Guthrie found an interesting case where this misapplied a patch that
wanted to touch a preimage that consists of

}
}

return 0;
}

which is a rather unfortunately common pattern.

The target version of the file originally had only one such location, but
the hunk immediately before that created another instance of such block of
lines, and find_pos() happily reported that the preimage of the hunk
matched what it wanted to modify.

Oops.

By marking the lines application of earlier hunks touched and preventing
match_fragment() from considering them as a match with preimage of other
hunks, we can reduce such an accident.

I also considered to teach apply_one_fragment() to take the offset we have
found while applying the previous hunk into account when looking for a
match with find_pos(), but dismissed that approach, because it would
sometimes work better but sometimes worse, depending on the difference
between the version the patch was created against and the version the
patch is being applied.

This does _not_ prevent misapplication of patches to a file that has many
similar looking blocks of lines and a preimage cannot identify which one
of them should be applied. For that, we would need to scan beyond the
first match in find_pos(), and issue a warning (or error out). That will
be a separate topic.

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

Documentation: fix a typo in git-apply.txtMichał Kiedrowicz Thu, 3 Mar 2011 09:28:30 +0000 (10:28 +0100)

Documentation: fix a typo in git-apply.txt

git-apply accepts the --cached option, not --cache.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

init: remove unnecessary checkNguyễn Thái Ngọc Duy Thu, 3 Mar 2011 12:34:51 +0000 (19:34 +0700)

init: remove unnecessary check

git_dir must always be non-NULL so "if (git_dir)" is unnecessary.
Before this code, if git_dir == NULL, it will default to
DEFAULT_GIT_DIR_ENVIRONMENT.

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

push: better error message when no remote configuredMatthieu Moy Wed, 2 Mar 2011 20:12:11 +0000 (21:12 +0100)

push: better error message when no remote configured

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

push: better error messages when push.default = trackingMatthieu Moy Wed, 2 Mar 2011 20:12:10 +0000 (21:12 +0100)

push: better error messages when push.default = tracking

A common scenario is to create a new branch and push it (checkout -b &&
push [--set-upstream]). In this case, the user was getting "The current
branch %s has no upstream branch.", which doesn't help much.

Provide the user a command to push the current branch. To avoid the
situation in the future, suggest --set-upstream.

While we're there, also improve the error message in the "detached HEAD"
case. We mention explicitly "detached HEAD" since this is the keyword to
look for in documentations.

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

Merge branch 'maint'Junio C Hamano Wed, 2 Mar 2011 23:26:44 +0000 (15:26 -0800)

Merge branch 'maint'

* maint:
verify-pack: add --stat-only to the synopsis section

git-request-pull: open-code the only invocation of... Uwe Kleine-König Tue, 1 Mar 2011 09:21:37 +0000 (10:21 +0100)

git-request-pull: open-code the only invocation of get_remote_url

So sh:get_remote_url can go now and git-request-pull
doesn't need to source git-parse-remote. anymore.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_remote_url(): use the same data source as ls-remote... Uwe Kleine-König Tue, 1 Mar 2011 09:21:36 +0000 (10:21 +0100)

get_remote_url(): use the same data source as ls-remote to get remote urls

The formerly implemented algorithm behaved differently to
remote.c:remote_get() at least for remotes that contain a slash. While the
former just assumes a/b is a path the latter checks the config for
remote."a/b" first which is more reasonable.

This removes the last user of git-parse-remote.sh:get_data_source(), so
this function is removed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere forget: deprecate invocation without pathspecJohannes Sixt Tue, 1 Mar 2011 13:21:05 +0000 (14:21 +0100)

rerere forget: deprecate invocation without pathspec

rerere forget is a destructive command. When invoked without a path, it
operates on the current directory, potentially deleting many recorded
conflict resolutions.

To make the command safer, a path must be specified as of git 1.8.0. Until
then, give users time to write 'git rerere forget .' if they really mean
the entire current directory.

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

sha1_file.c: Don't retain open fds on small packsShawn O. Pearce Wed, 2 Mar 2011 18:01:54 +0000 (10:01 -0800)

sha1_file.c: Don't retain open fds on small packs

If a pack file is small enough that its entire contents fits within
one mmap window, mmap the file and then immediately close its file
descriptor. This reduces the number of file descriptors that are
needed to read from repositories with many tiny pack files, such
as one that has received 1000 pushes (and created 1000 small pack
files) since its last repack.

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

mingw: add minimum getrlimit() compatibility stubErik Faye-Lund Mon, 28 Feb 2011 21:13:22 +0000 (22:13 +0100)

mingw: add minimum getrlimit() compatibility stub

We don't have getrlimit on Windows :( Limit of 2048 taken from MSDN:

http://msdn.microsoft.com/en-us/library/6e3b887c(v=vs.71).aspx

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>

verify-pack: add --stat-only to the synopsis sectionJunio C Hamano Tue, 1 Mar 2011 19:26:22 +0000 (11:26 -0800)

verify-pack: add --stat-only to the synopsis section

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

Merge branch 'svn-fe' of git://repo.or.cz/git/jrnJunio C Hamano Tue, 1 Mar 2011 00:33:45 +0000 (16:33 -0800)

Merge branch 'svn-fe' of git://repo.or.cz/git/jrn

* 'svn-fe' of git://repo.or.cz/git/jrn: (31 commits)
fast-import: make code "-Wpointer-arith" clean
vcs-svn: teach line_buffer about temporary files
vcs-svn: allow input from file descriptor
vcs-svn: allow character-oriented input
vcs-svn: add binary-safe read function
t0081 (line-buffer): add buffering tests
vcs-svn: tweak test-line-buffer to not assume line-oriented input
tests: give vcs-svn/line_buffer its own test script
vcs-svn: make test-line-buffer input format more flexible
vcs-svn: teach line_buffer to handle multiple input files
vcs-svn: collect line_buffer data in a struct
vcs-svn: replace buffer_read_string memory pool with a strbuf
vcs-svn: eliminate global byte_buffer
fast-import: add 'ls' command
vcs-svn: Allow change nodes for root of tree (/)
vcs-svn: Implement Prop-delta handling
vcs-svn: Sharpen parsing of property lines
vcs-svn: Split off function for handling of individual properties
vcs-svn: Make source easier to read on small screens
vcs-svn: More dump format sanity checks
...

fast-import: make code "-Wpointer-arith" cleanJonathan Nieder Mon, 28 Feb 2011 21:16:59 +0000 (15:16 -0600)

fast-import: make code "-Wpointer-arith" clean

The dereference() function to peel a tree-ish and find the underlying
tree expects arithmetic to (void *) to work on byte addresses. We
should be reading the text of objects through a char * anyway.

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

Limit file descriptors used by packsShawn O. Pearce Mon, 28 Feb 2011 20:52:39 +0000 (12:52 -0800)

Limit file descriptors used by packs

Rather than using 'errno == EMFILE' after a failed open() call
to indicate the process is out of file descriptors and an LRU
pack window should be closed, place a hard upper limit on the
number of open packs based on the actual rlimit of the process.

By using a hard upper limit that is below the rlimit of the current
process it is not necessary to check for EMFILE on every single
fd-allocating system call. Instead reserving 25 file descriptors
makes it safe to assume the system call won't fail due to being over
the filedescriptor limit. Here 25 is chosen as a WAG, but considers
3 for stdin/stdout/stderr, and at least a few for other Git code
to operate on temporary files. An additional 20 is reserved as it
is not known what the C library needs to perform other services on
Git's behalf, such as nsswitch or name resolution.

This fixes a case where running `git gc --auto` in a repository
with more than 1024 packs (but an rlimit of 1024 open fds) fails
due to the temporary output file not being able to allocate a
file descriptor. The output file is opened by pack-objects after
object enumeration and delta compression are done, both of which
have already opened all of the packs and fully populated the file
descriptor table.

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

mergetool--lib: Add Beyond Compare 3 as a toolSebastian Schuberth Sun, 27 Feb 2011 11:32:46 +0000 (12:32 +0100)

mergetool--lib: Add Beyond Compare 3 as a tool

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool--lib: Sort tools alphabetically for easier... Sebastian Schuberth Sun, 27 Feb 2011 11:31:37 +0000 (12:31 +0100)

mergetool--lib: Sort tools alphabetically for easier lookup

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Start preparing release notes to 1.7.5Junio C Hamano Mon, 28 Feb 2011 20:28:20 +0000 (12:28 -0800)

Start preparing release notes to 1.7.5

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

git-instaweb: Change how gitweb.psgi is made runnable... Jakub Narebski Sat, 26 Feb 2011 22:32:33 +0000 (23:32 +0100)

git-instaweb: Change how gitweb.psgi is made runnable as standalone app

According to blog post "FindBin, __FILE__, $0 and PSGI woes"

http://bulknews.typepad.com/blog/2011/02/findbin-__file__-0-and-psgi-woes.html

by Tatsuhiko Miyagawa, using 'if (__FILE__ eq $0)' in .psgi code
(to check if script was run from command line), is not supposed to work
since Plack 0.9971.

Replace it with one of proposed solutions; while at it return $app
explicitely, rather than implicitely by being a last expression.

This affects 'plackup' web server.

While at it cleanup whitespace.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jh/push-default-upstream-configname'Junio C Hamano Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)

Merge branch 'jh/push-default-upstream-configname'

* jh/push-default-upstream-configname:
push.default: Rename 'tracking' to 'upstream'

Merge branch 'lp/config-vername-check'Junio C Hamano Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)

Merge branch 'lp/config-vername-check'

* lp/config-vername-check:
Disallow empty section and variable names
Sanity-check config variable names

Merge branch 'mg/placeholders-are-lowercase'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'mg/placeholders-are-lowercase'

* mg/placeholders-are-lowercase:
Make <identifier> lowercase in Documentation
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
CodingGuidelines: downcase placeholders in usage messages

Merge branch 'mg/patch-id'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'mg/patch-id'

* mg/patch-id:
git-patch-id: do not trip over "no newline" markers
git-patch-id: test for "no newline" markers

Merge branch 'mz/rerere-remaining'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'mz/rerere-remaining'

* mz/rerere-remaining:
mergetool: don't skip modify/remove conflicts
rerere "remaining"

Merge branch 'nd/sorted-builtin-command-list'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'nd/sorted-builtin-command-list'

* nd/sorted-builtin-command-list:
git.c: reorder builtin command list

Merge branch 'js/maint-merge-use-prepare-commit-msg... Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'js/maint-merge-use-prepare-commit-msg-hook'

* js/maint-merge-use-prepare-commit-msg-hook:
merge: honor prepare-commit-msg hook

Merge branch 'nd/hash-object-sanity'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'nd/hash-object-sanity'

* nd/hash-object-sanity:
Make hash-object more robust against malformed objects

Conflicts:
cache.h

Merge branch 'js/detach-doc'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'js/detach-doc'

* js/detach-doc:
git-checkout.txt: improve detached HEAD documentation

Merge branch 'va/p4'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'va/p4'

* va/p4:
git-p4: Add copy detection support
git-p4: Improve rename detection support

Merge branch 'pw/p4'Junio C Hamano Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)

Merge branch 'pw/p4'

* pw/p4:
git-p4: support clone --bare
git-p4: decode p4 wildcard characters
git-p4: better message for "git-p4 sync" when not cloned
git-p4: reinterpret confusing p4 message
git-p4: accommodate new move/delete type in p4
git-p4: add missing newline in initial import message
git-p4: fix key error for p4 problem
git-p4: test script

Merge branch 'uk/checkout-ambiguous-ref'Junio C Hamano Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)

Merge branch 'uk/checkout-ambiguous-ref'

* uk/checkout-ambiguous-ref:
Rename t2019 with typo "amiguous" that meant "ambiguous"
checkout: rearrange update_refs_for_switch for clarity
checkout: introduce --detach synonym for "git checkout foo^{commit}"
checkout: split off a function to peel away branchname arg
checkout: fix bug with ambiguous refs

Conflicts:
builtin/checkout.c

Merge branch 'sp/maint-smart-http-sans-100-continue'Junio C Hamano Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)

Merge branch 'sp/maint-smart-http-sans-100-continue'

* sp/maint-smart-http-sans-100-continue:
smart-http: Don't use Expect: 100-Continue

Merge branch 'mo/perl-bidi-pipe-envfix'Junio C Hamano Mon, 28 Feb 2011 05:58:28 +0000 (21:58 -0800)

Merge branch 'mo/perl-bidi-pipe-envfix'

* mo/perl-bidi-pipe-envfix:
perl: command_bidi_pipe() method should set-up git environmens

Merge branch 'hv/mingw-fs-funnies'Junio C Hamano Mon, 28 Feb 2011 05:17:37 +0000 (21:17 -0800)

Merge branch 'hv/mingw-fs-funnies'

* hv/mingw-fs-funnies:
mingw_rmdir: set errno=ENOTEMPTY when appropriate
mingw: add fallback for rmdir in case directory is in use
mingw: make failures to unlink or move raise a question
mingw: work around irregular failures of unlink on windows
mingw: move unlink wrapper to mingw.c

Merge branch 'en/object-list-with-pathspec'Junio C Hamano Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)

Merge branch 'en/object-list-with-pathspec'

* en/object-list-with-pathspec:
Add testcases showing how pathspecs are handled with rev-list --objects
Make rev-list --objects work together with pathspecs

Merge branch 'nd/struct-pathspec'Junio C Hamano Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)

Merge branch 'nd/struct-pathspec'

* nd/struct-pathspec: (22 commits)
t6004: add pathspec globbing test for log family
t7810: overlapping pathspecs and depth limit
grep: drop pathspec_matches() in favor of tree_entry_interesting()
grep: use writable strbuf from caller for grep_tree()
grep: use match_pathspec_depth() for cache/worktree grepping
grep: convert to use struct pathspec
Convert ce_path_match() to use match_pathspec_depth()
Convert ce_path_match() to use struct pathspec
struct rev_info: convert prune_data to struct pathspec
pathspec: add match_pathspec_depth()
tree_entry_interesting(): optimize wildcard matching when base is matched
tree_entry_interesting(): support wildcard matching
tree_entry_interesting(): fix depth limit with overlapping pathspecs
tree_entry_interesting(): support depth limit
tree_entry_interesting(): refactor into separate smaller functions
diff-tree: convert base+baselen to writable strbuf
glossary: define pathspec
Move tree_entry_interesting() to tree-walk.c and export it
tree_entry_interesting(): remove dependency on struct diff_options
Convert struct diff_options to use struct pathspec
...

gitweb: Make i18n (encoding) tests in t9500 leave clean... Jakub Narebski Sun, 27 Feb 2011 16:58:32 +0000 (17:58 +0100)

gitweb: Make i18n (encoding) tests in t9500 leave clean state

The most important issue is that after unsetting `i18n.commitencoding'
config variable t9500 no longer will use author and comitter name
containing ISO-8859-1 characters, which are invalid UTF-8 characters.

Besides it is good practice in general to clean up the state in tests.

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

git-add: make -A description clearer vs. -uMichael J Gruber Sun, 27 Feb 2011 15:50:10 +0000 (16:50 +0100)

git-add: make -A description clearer vs. -u

Currently, it sounds as if "notice removal of files" distinguishes "-A"
from "-u", and there is no mention of the worktree.

But both notice the removal, and only "-A" adds changes from untracked
files. Say so.

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

git-cvsimport.perl: Bail out right away when reading... Fabian Keil Mon, 31 Jan 2011 19:29:46 +0000 (20:29 +0100)

git-cvsimport.perl: Bail out right away when reading from the server fails

If the CVS server is down, this reduced the git-cvsimport output from:

ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused
Use of uninitialized value $rep in scalar chomp at /usr/local/libexec/git-core/git-cvsimport line 369.
Use of uninitialized value $rep in substitution (s///) at /usr/local/libexec/git-core/git-cvsimport line 370.
Expected Valid-requests from server, but got: <unknown>

to the less noisy:

ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused
Failed to read from server at /usr/local/libexec/git-core/git-cvsimport line 370.

In this case a silent exit() instead of the die() would probably do,
but I assume that there could be cases where the connection attempt
succeeds, but reading from the server fails for other reasons.

Signed-off-by: Fabian Keil <fk@fabiankeil.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: technical details about the index file formatNguyễn Thái Ngọc Duy Mon, 6 Sep 2010 10:37:10 +0000 (20:37 +1000)

doc: technical details about the index file format

This bases on the original work by Robin Rosenberg.

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

Merge branch 'maint'Junio C Hamano Sun, 27 Feb 2011 08:52:15 +0000 (00:52 -0800)

Merge branch 'maint'

* maint:
branch_merged: fix grammar in warning

mergetool--lib: Add Beyond Compare 3 as a toolSebastian Schuberth Sat, 26 Feb 2011 10:52:17 +0000 (11:52 +0100)

mergetool--lib: Add Beyond Compare 3 as a tool

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool--lib: Sort tools alphabetically for easier... Sebastian Schuberth Sat, 26 Feb 2011 10:51:14 +0000 (11:51 +0100)

mergetool--lib: Sort tools alphabetically for easier lookup

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch_merged: fix grammar in warningEric Hanchrow Sat, 26 Feb 2011 03:29:42 +0000 (19:29 -0800)

branch_merged: fix grammar in warning

Signed-off-by: Eric Hanchrow <eric.hanchrow@gmail.com>
Helped-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge commit 'jn/svn-fe' of git://github.com/gitster... Jonathan Nieder Sat, 26 Feb 2011 11:21:29 +0000 (05:21 -0600)

Merge commit 'jn/svn-fe' of git://github.com/gitster/git into svn-fe

* git://github.com/gitster/git:
vcs-svn: Allow change nodes for root of tree (/)
vcs-svn: Implement Prop-delta handling
vcs-svn: Sharpen parsing of property lines
vcs-svn: Split off function for handling of individual properties
vcs-svn: Make source easier to read on small screens
vcs-svn: More dump format sanity checks
vcs-svn: Reject path nodes without Node-action
vcs-svn: Delay read of per-path properties
vcs-svn: Combine repo_replace and repo_modify functions
vcs-svn: Replace = Delete + Add
vcs-svn: handle_node: Handle deletion case early
vcs-svn: Use mark to indicate nodes with included text
vcs-svn: Unclutter handle_node by introducing have_props var
vcs-svn: Eliminate node_ctx.mark global
vcs-svn: Eliminate node_ctx.srcRev global
vcs-svn: Check for errors from open()
vcs-svn: Allow simple v3 dumps (no deltas yet)

Conflicts:
t/t9010-svn-fe.sh
vcs-svn/svndump.c

vcs-svn: teach line_buffer about temporary filesJonathan Nieder Mon, 3 Jan 2011 03:10:59 +0000 (21:10 -0600)

vcs-svn: teach line_buffer about temporary files

It can sometimes be useful to write information temporarily to file,
to read back later. These functions allow a program to use the
line_buffer facilities when doing so.

It works like this:

1. find a unique filename with buffer_tmpfile_init.
2. rewind with buffer_tmpfile_rewind. This returns a stdio
handle for writing.
3. when finished writing, declare so with
buffer_tmpfile_prepare_to_read. The return value indicates
how many bytes were written.
4. read whatever portion of the file is needed.
5. if finished, remove the temporary file with buffer_deinit.
otherwise, go back to step 2,

The svn support would use this to buffer the postimage from delta
application until the length is known and fast-import can receive
the resulting blob.

Based-on-patch-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: allow input from file descriptorJonathan Nieder Mon, 3 Jan 2011 03:09:38 +0000 (21:09 -0600)

vcs-svn: allow input from file descriptor

Based-on-patch-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: allow character-oriented inputJonathan Nieder Mon, 3 Jan 2011 03:06:32 +0000 (21:06 -0600)

vcs-svn: allow character-oriented input

buffer_read_char can be used in place of buffer_read_string(1) to
avoid consuming valuable static buffer space. The delta applier will
use this to read variable-length integers one byte at a time.

Underneath, it is fgetc, wrapped so the line_buffer library can
maintain its role as gatekeeper of input.

Later it might be worth checking if fgetc_unlocked is faster ---
most line_buffer functions are not thread-safe anyway.

Helpd-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: add binary-safe read functionJonathan Nieder Mon, 3 Jan 2011 03:05:46 +0000 (21:05 -0600)

vcs-svn: add binary-safe read function

buffer_read_string works well for non line-oriented input except for
one problem: it does not tell the caller how many bytes were actually
written. This means that unless one is very careful about checking
for errors (and eof) the calling program cannot tell the difference
between the string "foo" followed by an early end of file and the
string "foo\0bar\0baz".

So introduce a variant that reports the length, too, a thinner wrapper
around strbuf_fread. Its result is written to a strbuf so the caller
does not need to keep track of the number of bytes read.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

t0081 (line-buffer): add buffering testsJonathan Nieder Mon, 3 Jan 2011 01:07:16 +0000 (19:07 -0600)

t0081 (line-buffer): add buffering tests

POSIX makes the behavior of read(2) from a pipe fairly clear: a read
from an empty pipe will block until there is data available and any
other read will not block, prefering to return a partial result.
Likewise, fread(3) and fgets(3) are clearly specified to act as
though implemented by calling fgetc(3) in a simple loop. But the
buffering behavior of fgetc is less clear.

Luckily, no sane platform is going to implement fgetc by calling the
equivalent of read(2) more than once. fgetc has to be able to
return without filling its buffer to preserve errno when errors are
encountered anyway. So let's assume the simpler behavior (trust) but
add some tests to catch insane platforms that violate that when they
come (verify).

First check that fread can handle a 0-length read from an empty fifo.
Because open(O_RDONLY) blocks until the writing end is open, open the
writing end of the fifo in advance in a subshell.

Next try short inputs from a pipe that is not filled all the way.

Lastly (two tests) try very large inputs from a pipe that will not fit
in the relevant buffers. The first of these tests reads a little
more than 8192 bytes, which is BUFSIZ (the size of stdio's buffers)
on this Linux machine. The second reads a little over 64 KiB (the
pipe capacity on Linux) and is not run unless requested by setting
the GIT_REMOTE_SVN_TEST_BIG_FILES environment variable.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

vcs-svn: tweak test-line-buffer to not assume line... Jonathan Nieder Mon, 3 Jan 2011 00:52:28 +0000 (18:52 -0600)

vcs-svn: tweak test-line-buffer to not assume line-oriented input

Do not expect an implicit newline after each input record.
Use a separate command to exercise buffer_skip_bytes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

tests: give vcs-svn/line_buffer its own test scriptJonathan Nieder Mon, 3 Jan 2011 00:51:07 +0000 (18:51 -0600)

tests: give vcs-svn/line_buffer its own test script

Split the line_buffer test into small pieces and move it to its
own file as preparation for adding more tests.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>