gitweb.git
Revert "fetch-pack: Implement no-done capability"Junio C Hamano Tue, 29 Mar 2011 06:35:39 +0000 (23:35 -0700)

Revert "fetch-pack: Implement no-done capability"

This reverts commit 761ecf0bc7b6cddf311f00877c59e6381cdbdeea.

Revert "upload-pack: Implement no-done capability"Junio C Hamano Tue, 29 Mar 2011 06:33:51 +0000 (23:33 -0700)

Revert "upload-pack: Implement no-done capability"

This reverts 3e63b21 (upload-pack: Implement no-done capability,
2011-03-14). Together with 761ecf0 (fetch-pack: Implement no-done
capability, 2011-03-14) it seems to make the fetch-pack process out of
sync and makes it keep talking long after upload-pack stopped listening to
it, terminating the process with SIGPIPE.

Kill off get_relative_cwd()Nguyễn Thái Ngọc Duy Sat, 26 Mar 2011 09:04:25 +0000 (16:04 +0700)

Kill off get_relative_cwd()

Function dir_inside_of() does something similar (correctly), but looks
easier to understand and does not bundle cwd to its business. Given
get_relative_cwd's only user is is_inside_dir, we can kill it for
good.

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

setup: return correct prefix if worktree is '/'Nguyễn Thái Ngọc Duy Sat, 26 Mar 2011 09:04:24 +0000 (16:04 +0700)

setup: return correct prefix if worktree is '/'

The same old problem reappears after setup code is reworked. We tend
to assume there is at least one path component in a path and forget
that path can be simply '/'.

Reported-by: Matthijs Kooijman <matthijs@stdin.nl>
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 Mon, 28 Mar 2011 21:17:17 +0000 (14:17 -0700)

Merge branch 'maint'

* maint:
git tag documentation grammar fixes and readability updates
grep: Add the option '--line-number'

git tag documentation grammar fixes and readability... Michael Witten Mon, 28 Mar 2011 15:11:49 +0000 (15:11 +0000)

git tag documentation grammar fixes and readability updates

... with help from Eric Raible.

In addition, describe the use of GIT_COMMITTER_DATE more comprehensively
by including "date-formats.txt"

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: fix overeager scrubbing of environment variablesJens Lehmann Mon, 28 Mar 2011 19:16:09 +0000 (21:16 +0200)

tests: fix overeager scrubbing of environment variables

In commit 95a1d12e9b9f ("tests: scrub environment of GIT_* variables") all
environment variables starting with "GIT_" were unset for the tests using
a perl script rather than unsetting them one by one. Only three exceptions
were made to make them work as before: "GIT_TRACE*", "GIT_DEBUG*" and
"GIT_USE_LOOKUP".

Unfortunately some environment variables used by the test framework itself
were not added to the exceptions and thus stopped working when given
before the make command instead of after it. Those are:

- GIT_NOTES_TIMING_TESTS
- GIT_PATCHID_TIMING_TESTS
- GIT_PROVE_OPTS
- GIT_REMOTE_SVN_TEST_BIG_FILES
- GIT_SKIP_TESTS
- GIT_TEST*
- GIT_VALGRIND_OPTIONS

I noticed that when skipping a test the way I was used to suddenly failed:

GIT_SKIP_TESTS='t1234' GIT_TEST_OPTS='--root=/dev/shm' make -j10 test

This should work according to t/README, but didn't anymore, so let's fix
that by adding them to the exception list. And to avoid having a long
regexp put the exceptions in a separate variable using nicer formatting.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks-to: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: Add the option '--line-number'Joe Ratterman Mon, 28 Mar 2011 18:11:55 +0000 (13:11 -0500)

grep: Add the option '--line-number'

This is a synonym for the existing '-n' option, matching GNU grep.

Signed-off-by: Joe Ratterman <jratt0@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve test for pthreads flagGiuseppe Bilotta Mon, 28 Mar 2011 07:39:59 +0000 (09:39 +0200)

Improve test for pthreads flag

When compiling with CC=clang using Clang 1.1 as shipped by Debian
unstable (package version 2.7-3), the -mt flag is sufficient to compile
during the `configure` test. However, building git would then fail at
link time complaining about missing symbols such as `pthread_key_create'
and `pthread_create'.

Work around this issue by adding pthread key creation to the pthreads
configure test source.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: add missing cast to printf argumentJonathan Nieder Mon, 28 Mar 2011 00:38:15 +0000 (19:38 -0500)

vcs-svn: add missing cast to printf argument

gcc -m32 correctly warns:

vcs-svn/fast_export.c: In function 'fast_export_commit':
vcs-svn/fast_export.c:54:2: warning: format '%llu' expects
argument of type 'long long unsigned int', but argument 2
has type 'unsigned int' [-Wformat]

Fix it.

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

vcs-svn: let deltas use data from preimageJonathan Nieder Wed, 13 Oct 2010 09:58:30 +0000 (04:58 -0500)

vcs-svn: let deltas use data from preimage

The copyfrom_source instruction appends data from the preimage buffer
to the end of output. Its arguments are a length and an offset
relative to the beginning of the source view.

With this change, the delta applier is able to reproduce all 5,636,613
blobs in the early history of the ASF repository. Tested with

mkfifo backflow
svn-fe <svn-asf-public-r0:940166 3<backflow |
git fast-import --cat-blob-fd=3 3>backflow

with svn-asf-public-r0:940166 produced by whatever version of
Subversion the dumps in /dump/ on svn.apache.org use (presumably
1.6.something).

Improved-by: Ramkumar Ramachandra <artagnon@gmail.com>
Improved-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: let deltas use data from postimageJonathan Nieder Wed, 13 Oct 2010 09:50:07 +0000 (04:50 -0500)

vcs-svn: let deltas use data from postimage

The copyfrom_target instruction copies appends data that is already
present in the current output view to the end of output. (The offset
argument is relative to the beginning of output produced in the
current window.)

The region copied is allowed to run past the end of the existing
output. To support that case, copy one character at a time rather
than calling memcpy or memmove. This allows copyfrom_target to be
used once to repeat a string many times. For example:

COPYFROM_DATA 2
COPYFROM_OUTPUT 10, 0
DATA "ab"

would produce the output "ababababababababababab".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: verify that deltas consume all inline dataJonathan Nieder Wed, 13 Oct 2010 09:48:07 +0000 (04:48 -0500)

vcs-svn: verify that deltas consume all inline data

By constraining the format of deltas, we can more easily detect
corruption and other breakage.

Requiring deltas not to provide unconsumed data also opens the
possibility of ignoring the declared amount of novel data and simply
streaming the data as needed to fulfill copyfrom_data requests.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: implement copyfrom_data delta instructionJonathan Nieder Wed, 13 Oct 2010 09:39:44 +0000 (04:39 -0500)

vcs-svn: implement copyfrom_data delta instruction

The copyfrom_data instruction copies a few bytes verbatim from the
novel text section of a window to the postimage.

[jn: with memory leak fix from David]

Improved-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: read instructions from deltasJonathan Nieder Wed, 13 Oct 2010 09:38:01 +0000 (04:38 -0500)

vcs-svn: read instructions from deltas

Buffer the instruction section upon encountering it for later
interpretation.

An alternative design would involve parsing the instructions
at this point and buffering them in some processed form. Using
the unprocessed form is simpler.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: read inline data from deltasJonathan Nieder Wed, 13 Oct 2010 09:35:59 +0000 (04:35 -0500)

vcs-svn: read inline data from deltas

Each window of an svndiff0-format delta includes a section for novel
text to be copied to the postimage (in the order it appears in the
window, possibly interspersed with other data).

Slurp in this data when encountering it. It is not actually necessary
to do so --- it would be just as easy to copy from delta to output
as part of interpreting the relevant instructions --- but this way,
the code that interprets svndiff0 instructions can proceed very
quickly because it does not require I/O.

Subversion's svndiff0 parser rejects deltas that do not consume all
the novel text that was provided. Omit that check for now so we can
test the new functionality right away, rather than waiting to learn
instructions that consume data.

Do check for truncated data sections. Subversion's parser rejects
deltas that end in the middle of a declared novel-text section, so it
should be safe for us to reject them, too.

Improved-by: Ramkumar Ramachandra <artagnon@gmail.com>
Improved-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: read the preimage when applying deltasJonathan Nieder Wed, 13 Oct 2010 09:30:37 +0000 (04:30 -0500)

vcs-svn: read the preimage when applying deltas

The source view offset heading each svndiff0 window represents a
number of bytes past the beginning of the preimage. Together with the
source view length, it dictates to the delta applier what portion of
the preimage instructions will refer to. Read that portion right away
using the sliding window code.

Maybe some day we will use mmap to read data more lazily.

Subversion's implementation tolerates source view offsets pointing
past the end of the preimage file but we do not, for simplicity.

This does not teach the delta applier to read instructions or copy
data from the source view. Deltas that could produce nonempty output
will still be rejected.

Improved-by: Ramkumar Ramachandra <artagnon@gmail.com>
Improved-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>

vcs-svn: parse svndiff0 window headerJonathan Nieder Wed, 13 Oct 2010 09:21:43 +0000 (04:21 -0500)

vcs-svn: parse svndiff0 window header

Each window in a subversion delta (svndiff0-format file) starts with a
window header, consisting of five integers with variable-length
representation:

source view offset
source view length
output length
instructions length
auxiliary data length

Parse it. The result is not usable for deltas with nonempty postimage
yet; in fact, this only adds support for deltas without any
instructions or auxiliary data. This is a good place to stop, though,
since that little support lets us add some simple passing tests
concerning error handling to the test suite.

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

vcs-svn: skeleton of an svn delta parserJonathan Nieder Sat, 25 Dec 2010 11:11:32 +0000 (05:11 -0600)

vcs-svn: skeleton of an svn delta parser

A delta in the subversion delta (svndiff0) format consists of the
magic bytes SVN\0 followed by a sequence of windows of a certain well
specified format (starting with five integers).

Add an svndiff0_apply function and test-svn-fe -d commandline tool to
parse such a delta in the special case of not including any windows.

Later patches will add features to turn this into a fully functional
delta applier for svn-fe to use to parse the streams produced by
"svnrdump dump" and "svnadmin dump --deltas".

The content of symlinks starts with the word "link " in Subversion's
worldview, so we need to be able to prepend that text to input for the
sake of delta application. So initialization of the input state of
the delta preimage is left to the calling program, giving callers a
chance to seed the buffer with text of their choice.

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

vcs-svn: make buffer_read_binary API more convenientJonathan Nieder Mon, 3 Jan 2011 03:37:36 +0000 (21:37 -0600)

vcs-svn: make buffer_read_binary API more convenient

buffer_read_binary is a thin wrapper around fread, but its signature
is wrong:

- fread can fill an arbitrary in-memory buffer. buffer_read_binary
is limited to buffers whose size is representable by a 32-bit
integer.
- The result from fread is the number of bytes actually read.
buffer_read_binary only reports the number of bytes read by
incrementing sb->len by that amount and returns void.

Fix both: let buffer_read_binary accept a size_t instead of uint32_t
for the number of bytes to read and as a convenience return the number
of bytes actually read.

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: learn to maintain a sliding view of a fileJonathan Nieder Mon, 3 Jan 2011 03:54:58 +0000 (21:54 -0600)

vcs-svn: learn to maintain a sliding view of a file

Each section of a Subversion-format delta only requires examining (and
keeping in random-access memory) a small portion of the preimage. At
any moment, this portion starts at a certain file offset and has a
well-defined length, and as the delta is applied, the portion advances
from the beginning to the end of the preimage. Add a move_window
function to keep track of this view into the preimage.

You can use it like this:

buffer_init(f, NULL);
struct sliding_view window = SLIDING_VIEW_INIT(f);
move_window(&window, 3, 7); /* (1) */
move_window(&window, 5, 5); /* (2) */
move_window(&window, 12, 2); /* (3) */
strbuf_release(&window.buf);
buffer_deinit(f);

The data structure is called sliding_view instead of _window to
prevent confusion with svndiff0 Windows.

In this example, (1) reads 10 bytes and discards the first 3;
(2) discards the first 2, which are not needed any more; and (3) skips
2 bytes and reads 2 new bytes to work with.

When move_window returns, the file position indicator is at position
window->off + window->width and the data from positions window->off to
the current file position are stored in window->buf.

This function performs only sequential access from the input file and
never seeks, so it can be safely used on pipes and sockets.

On end-of-file, move_window silently reads less than the caller
requested. On other errors, it prints a message and returns -1.

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

Makefile: list one vcs-svn/xdiff object or header per... Jonathan Nieder Sun, 27 Mar 2011 18:13:22 +0000 (13:13 -0500)

Makefile: list one vcs-svn/xdiff object or header per line

As the svn import infrastructure evolves, it's getting to be a pain to
tell by eye what files were added or removed from a dependency line
like

VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o

So use a style with one entry per line instead, like the existing
BUILTIN_OBJS:

# protect against environment
VCSSVN_OBJS =
...
VCSSVN_OBJS += vcs-svn/string_pool.o
VCSSVN_OBJS += vcs-svn/line_buffer.o
...

which is readable on its own and produces nice, clear diffs.

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

vcs-svn: add missing cast to printf argumentJonathan Nieder Sun, 27 Mar 2011 17:19:14 +0000 (12:19 -0500)

vcs-svn: add missing cast to printf argument

gcc -m32 correctly warns:

vcs-svn/fast_export.c: In function 'fast_export_commit':
vcs-svn/fast_export.c:54:2: warning: format '%llu' expects
argument of type 'long long unsigned int', but argument 2
has type 'unsigned int' [-Wformat]

Fix it.

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

Update draft release note to 1.7.5Junio C Hamano Sun, 27 Mar 2011 03:17:15 +0000 (20:17 -0700)

Update draft release note to 1.7.5

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

Merge branch 'mg/rev-list-n-parents'Junio C Hamano Sun, 27 Mar 2011 03:13:17 +0000 (20:13 -0700)

Merge branch 'mg/rev-list-n-parents'

* mg/rev-list-n-parents:
tests: avoid nonportable {foo,bar} glob
rev-list --min-parents,--max-parents: doc, test and completion
revision.c: introduce --min-parents and --max-parents options
t6009: use test_commit() from test-lib.sh

Merge branch 'js/remove-unused-variables'Junio C Hamano Sun, 27 Mar 2011 03:13:17 +0000 (20:13 -0700)

Merge branch 'js/remove-unused-variables'

* js/remove-unused-variables:
Remove unused variables

Merge branch 'jp/completion-help-alias'Junio C Hamano Sun, 27 Mar 2011 03:13:17 +0000 (20:13 -0700)

Merge branch 'jp/completion-help-alias'

* jp/completion-help-alias:
git-completion: Add git help completion for aliases

Merge branch 'jc/index-update-if-able'Junio C Hamano Sun, 27 Mar 2011 03:13:16 +0000 (20:13 -0700)

Merge branch 'jc/index-update-if-able'

* jc/index-update-if-able:
update $GIT_INDEX_FILE when there are racily clean entries
diff/status: refactor opportunistic index update

Merge branch 'jk/checkout-orphan-warning'Junio C Hamano Sun, 27 Mar 2011 03:13:16 +0000 (20:13 -0700)

Merge branch 'jk/checkout-orphan-warning'

* jk/checkout-orphan-warning:
checkout: tweak detached-orphan warning format
checkout: clear commit marks after detached-orphan check
checkout: add basic tests for detached-orphan warning

Merge branch 'jc/maint-rerere-in-workdir'Junio C Hamano Sun, 27 Mar 2011 03:13:16 +0000 (20:13 -0700)

Merge branch 'jc/maint-rerere-in-workdir'

* jc/maint-rerere-in-workdir:
rerere: make sure it works even in a workdir attached to a young repository

Merge branch 'nd/index-doc'Junio C Hamano Sun, 27 Mar 2011 03:13:15 +0000 (20:13 -0700)

Merge branch 'nd/index-doc'

* nd/index-doc:
doc: technical details about the index file format
doc: technical details about the index file format

Merge branch 'jc/fetch-progressive-stride'Junio C Hamano Sun, 27 Mar 2011 03:13:15 +0000 (20:13 -0700)

Merge branch 'jc/fetch-progressive-stride'

* jc/fetch-progressive-stride:
fetch-pack: use smaller handshake window for initial request
fetch-pack: progressively use larger handshake windows
fetch-pack: factor out hardcoded handshake window size

Conflicts:
builtin/fetch-pack.c

Merge branch 'svn-fe' of git://repo.or.cz/git/jrnJunio C Hamano Sat, 26 Mar 2011 18:35:41 +0000 (11:35 -0700)

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

* 'svn-fe' of git://repo.or.cz/git/jrn:
vcs-svn: handle log message with embedded NUL
vcs-svn: avoid unnecessary copying of log message and author
vcs-svn: remove buffer_read_string
vcs-svn: make reading of properties binary-safe

Merge git-gui 0.14.0Junio C Hamano Sat, 26 Mar 2011 17:42:26 +0000 (10:42 -0700)

Merge git-gui 0.14.0

vcs-svn: avoid using ls command twiceDavid Barr Mon, 13 Dec 2010 06:09:31 +0000 (17:09 +1100)

vcs-svn: avoid using ls command twice

Currently there are two functions to retrieve the mode and content
at a path:

const char *repo_read_path(const uint32_t *path);
uint32_t repo_read_mode(const uint32_t *path)

Replace them with a single function with two return values. This
means we can use one round-trip to get the same information from
fast-import that previously took two.

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

vcs-svn: handle log message with embedded NULJonathan Nieder Sat, 26 Mar 2011 05:49:37 +0000 (00:49 -0500)

vcs-svn: handle log message with embedded NUL

Pass the log message by strbuf instead of as a C-style string and use
fwrite instead of printf to write it to fast-import so embedded '\0'
bytes can be preserved.

Currently "git log" doesn't show the embedded NULs but "git cat-file
commit" can.

While at it, stop including system headers from repo_tree.h. git
source files need to include git-compat-util.h (or cache.h or
builtin.h) sooner to ensure the appropriate feature test macros are
defined.

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

vcs-svn: avoid unnecessary copying of log message and... Jonathan Nieder Fri, 25 Mar 2011 04:10:00 +0000 (23:10 -0500)

vcs-svn: avoid unnecessary copying of log message and author

Use strbuf_swap when storing the svn:log and svn:author properties, so
pointers to rather than the contents of buffers get copied. The main
effect should be to make the code a little easier to read.

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

vcs-svn: remove buffer_read_stringJonathan Nieder Fri, 25 Mar 2011 04:09:19 +0000 (23:09 -0500)

vcs-svn: remove buffer_read_string

All previous users of buffer_read_string have already been converted
to use the more intuitive buffer_read_binary, so remove the old API to
avoid some confusion.

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

vcs-svn: make reading of properties binary-safeJonathan Nieder Sat, 26 Mar 2011 05:15:10 +0000 (00:15 -0500)

vcs-svn: make reading of properties binary-safe

svn-fe errors out on revision 59151 of the ASF repository:

fatal: invalid dump: unexpected end of file

The proximate cause is a property with an embedded NUL character.
Previously such anomalies were ignored but commit c9d1c8ba
(2010-12-28) introduced a check strlen(val) == len to avoid reading
uninitialized data when a property list ends early and unfortunately
this test does not distinguish between "foo" followed by EOF and the
string "foo\0bar\0baz".

Fix it by using buffer_read_binary to read to a strbuf and checking
the actual length read. Most consumers of properties still use
C-style strings, so in practice an author or log message with embedded
NULs will be truncated, but a least this way svn-fe won't error out
(fixing the regression).

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

Sync with 1.7.4.2Junio C Hamano Sat, 26 Mar 2011 00:57:08 +0000 (17:57 -0700)

Sync with 1.7.4.2

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

Git 1.7.4.2 v1.7.4.2Junio C Hamano Sat, 26 Mar 2011 00:56:14 +0000 (17:56 -0700)

Git 1.7.4.2

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

pull: do not clobber untracked files on initial pullJeff King Fri, 25 Mar 2011 18:13:31 +0000 (14:13 -0400)

pull: do not clobber untracked files on initial pull

For a pull into an unborn branch, we do not use "git merge"
at all. Instead, we call read-tree directly. However, we
used the --reset parameter instead of "-m", which turns off
the safety features.

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

merge: merge unborn index before setting refJeff King Fri, 25 Mar 2011 18:10:38 +0000 (14:10 -0400)

merge: merge unborn index before setting ref

When we merge into an unborn branch, there are basically two
steps:

1. Write the sha1 of the new commit into the ref pointed
to by HEAD.

2. Update the index with the new content, and check it out
to the working tree.

We currently do them in this order. However, (2) is the step
that is much more likely to fail, since it can be blocked by
things like untracked working tree files. When it does, the
merge fails and we are left with an empty index but an
updated HEAD.

This patch switches the order, so that a failure in updating
the index leaves us unchanged. Of course, a failure in
updating the ref now leaves us with an updated index and
mis-matched HEAD. That is arguably not much better, but it
is probably less likely to actually happen.

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

t7607: clean up stray untracked fileJeff King Fri, 25 Mar 2011 18:09:03 +0000 (14:09 -0400)

t7607: clean up stray untracked file

This file ends up conflicting with the test just after it
(causing the "git merge" to fail). Neither test is to blame
for the bug, though. It looks like the merge in 1a9fe45
(Merge branch 'tr/merge-unborn-clobber', 2011-02-09) is what
caused the conflict.

We didn't notice because the follow-on test is already
marked as expect_failure (even though it has since been
fixed, and now succeeds once the untracked file is moved out
of the way).

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

t7607: mark known breakage in test 11 as fixedJeff King Fri, 25 Mar 2011 18:08:36 +0000 (14:08 -0400)

t7607: mark known breakage in test 11 as fixed

This was fixed by 1d718a51 (do not overwrite untracked
symlinks, 2011-02-20).

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

gitweb: Fix handling of fractional timezones in parse_dateJakub Narebski Fri, 25 Mar 2011 19:20:49 +0000 (20:20 +0100)

gitweb: Fix handling of fractional timezones in parse_date

Fractional timezones, like -0330 (NST used in Canada) or +0430
(Afghanistan, Iran DST), were not handled properly in parse_date; this
means values such as 'minute_local' and 'iso-tz' were not generated
correctly.

This was caused by two mistakes:

* sign of timezone was applied only to hour part of offset, and not
as it should be also to minutes part (this affected only negative
fractional timezones).

* 'int $h + $m/60' is 'int($h + $m/60)' and not 'int($h) + $m/60',
so fractional part was discarded altogether ($h is hours, $m is
minutes, which is always less than 60).

Note that positive fractional timezones +0430, +0530 and +1030 can be
found as authortime in git.git repository itself.

For example http://repo.or.cz/w/git.git/commit/88d50e7 had authortime
of "Fri, 8 Jan 2010 18:48:07 +0000 (23:48 +0530)", which is not marked
with 'atnight', when "git show 88d50e7" gives correct author date of
"Sat Jan 9 00:18:07 2010 +0530".

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

Improve tree_entry_interesting() handling codeNguyễn Thái Ngọc Duy Fri, 25 Mar 2011 09:34:20 +0000 (16:34 +0700)

Improve tree_entry_interesting() handling code

t_e_i() can return -1 or 2 to early shortcut a search. Current code
may use up to two variables to handle it. One for saving return value
from t_e_i temporarily, one for saving return code 2.

The second variable is not needed. If we make sure the first variable
does not change until the next t_e_i() call, then we can do something
like this:

int ret = 0;

while (...) {
if (ret != 2) {
ret = t_e_i();
if (ret < 0) /* no longer interesting */
break;
if (ret == 0) /* skip this round */
continue;
}
/* ret > 0, interesting */
}

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

Convert read_tree{,_recursive} to support struct pathspecNguyễn Thái Ngọc Duy Fri, 25 Mar 2011 09:34:19 +0000 (16:34 +0700)

Convert read_tree{,_recursive} to support struct pathspec

This patch changes behavior of the two functions. Previously it does
prefix matching only. Now it can also do wildcard matching.

All callers are updated. Some gain wildcard matching (archive,
checkout), others reset pathspec_item.has_wildcard to retain old
behavior (ls-files, ls-tree as they are plumbing).

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

Reimplement read_tree_recursive() using tree_entry_inte... Nguyễn Thái Ngọc Duy Fri, 25 Mar 2011 09:34:18 +0000 (16:34 +0700)

Reimplement read_tree_recursive() using tree_entry_interesting()

read_tree_recursive() uses a very similar function, match_tree_entry, to
tree_entry_interesting() to do its path matching. This patch kills
match_tree_entry() in favor of tree_entry_interesting().

match_tree_entry(), like older version of tree_entry_interesting(), does
not support wildcard matching. New read_tree_recursive() retains this
behavior by forcing all pathspecs literal.

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

Merge branch 'en/object-list-with-pathspec' into 'nd... Junio C Hamano Fri, 25 Mar 2011 16:20:13 +0000 (09:20 -0700)

Merge branch 'en/object-list-with-pathspec' into 'nd/struct-pathspec'

This is to improve the process_tree() function defined in list-objects.c

* 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 'ss/git-gui-mergetool' gitgui-0.14.0Pat Thoyts Fri, 25 Mar 2011 08:26:47 +0000 (08:26 +0000)

Merge branch 'ss/git-gui-mergetool'

git-gui: detect the use of MUI langauge packs on WindowsPat Thoyts Fri, 18 Feb 2011 13:42:54 +0000 (13:42 +0000)

git-gui: detect the use of MUI langauge packs on Windows

The Tcl msgcat package doesn't detect the use of a multi-lingual language
pack on Windows 7. This means that a user may have their display language
set to Japanese but the system installed langauge was English.
This patch reads the relevent registry key to fix this before loading in
the locale specific parts of git-gui.

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

tests: avoid nonportable {foo,bar} globJonathan Nieder Thu, 24 Mar 2011 08:21:24 +0000 (03:21 -0500)

tests: avoid nonportable {foo,bar} glob

Unlike bash and ksh, dash and busybox ash do not support brace
expansion (as in 'echo {hello,world}'). So when dash is sh,
t6009.13 (set up dodecapus) ends up pass a string beginning with
"root{1,2," to "git merge" verbatim and the test fails.

Fix it by introducing a variable to hold the list of parents for
the dodecapus and populating it in a more low-tech way.

While at it, simplify a little by combining this setup code with the
test it sets up for.

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

merge: merge with the default upstream branch without... Junio C Hamano Thu, 24 Mar 2011 06:48:24 +0000 (23:48 -0700)

merge: merge with the default upstream branch without argument

"git merge" without specifying any commit is a no-op by default.

A new option merge.defaultupstream can be set to true to cause such an
invocation of the command to merge the upstream branches configured for
the current branch by using their last observed values stored in their
remote tracking branches.

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

merge: match the help text with the documentationJared Hance Thu, 10 Feb 2011 23:52:41 +0000 (18:52 -0500)

merge: match the help text with the documentation

We used to be very casual in terminology and used <branch>, <ref> and
<rev> more or less interchangeably with <commit>. Match the help text
given by "git merge -h" with that of the documentation.

Signed-off-by: Jared Hance <jaredhance@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-rename: don't consider unmerged path as sourceMartin von Zweigbergk Thu, 24 Mar 2011 02:41:01 +0000 (22:41 -0400)

diffcore-rename: don't consider unmerged path as source

Since e9c8409 (diff-index --cached --raw: show tree entry on the LHS for
unmerged entries., 2007-01-05), an unmerged entry should be detected by
using DIFF_PAIR_UNMERGED(p), not by noticing both one and two sides of
the filepair records mode=0 entries. However, it forgot to update some
parts of the rename detection logic.

This only makes difference in the "diff --cached" codepath where an
unmerged filepair carries information on the entries that came from the
tree. It probably hasn't been noticed for a long time because nobody
would run "diff -M" during a conflict resolution, but "git status" uses
rename detection when it internally runs "diff-index" and "diff-files"
and gives nonsense results.

In an unmerged pair, "one" side can have a valid filespec to record the
tree entry (e.g. what's in HEAD) when running "diff --cached". This can
be used as a rename source to other paths in the index that are not
unmerged. The path that is unmerged by definition does not have the
final content yet (i.e. "two" side cannot have a valid filespec), so it
can never be a rename destination.

Use the DIFF_PAIR_UNMERGED() to detect unmerged filepair correctly, and
allow the valid "one" side of an unmerged filepair to be considered a
potential rename source, but never to be considered a rename destination.

Commit message and first two test cases by Junio, the rest by Martin.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere: make sure it works even in a workdir attached... Junio C Hamano Fri, 11 Mar 2011 00:02:50 +0000 (16:02 -0800)

rerere: make sure it works even in a workdir attached to a young repository

The git-new-workdir script in contrib/ makes a new work tree by sharing
many subdirectories of the .git directory with the original repository.
When rerere.enabled is set in the original repository, but the user has
not encountered any conflicts yet, the original repository may not yet
have .git/rr-cache directory.

When rerere wants to run in a new work tree created from such a young
original repository, it fails to mkdir(2) .git/rr-cache that is a symlink
to a yet-to-be-created directory.

There are three possible approaches to this:

- A naive solution is not to create a symlink in the git-new-workdir
script to a directory the original does not have (yet). This is not a
solution, as we tend to lazily create subdirectories of .git/, and
having rerere.enabled configuration set is a strong indication that the
user _wants_ to have this lazy creation to happen;

- We could always create .git/rr-cache upon repository creation. This is
tempting but will not help people with existing repositories.

- Detect this case by seeing that mkdir(2) failed with EEXIST, checking
that the path is a symlink, and try running mkdir(2) on the link
target.

This patch solves the issue by doing the third one.

Strictly speaking, this is incomplete. It does not attempt to handle
relative symbolic link that points into the original repository, but this
is good enough to help people who use contrib/workdir/git-new-workdir
script.

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

doc: technical details about the index file formatJunio C Hamano Wed, 2 Mar 2011 01:51:01 +0000 (17:51 -0800)

doc: technical details about the index file format

* Clarify "string of unsigned bytes";

* Blob has two variants (regular file vs symlink), not (blob vs symlink);

* Clarify permission mode bits;

* Clarify ce_namelen() "too long to fit in the length field" case;

* Clarify "." etc are forbidden as path components;

* Match the description with the internal wording "cache-tree";

* All types of extension begin with signature and length as explained in
the first part. Don't repeat the "length" part in the description of
each extension (can be mistaken as if there is a separate 32-bit size
field inside the extension), but state what the signature for each
extension is.

* Don't say "Extension tag", as we have said "Extension signature" in the
first part---be consistent;

* Clarify the invalidation of cache-tree entries;

* Correct description on subtree_nr field in the cache-tree;

* Clarify the order of entries in cache-tree;

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

Merge branch 'kc/gitweb-pathinfo-w-anchor'Junio C Hamano Wed, 23 Mar 2011 21:55:55 +0000 (14:55 -0700)

Merge branch 'kc/gitweb-pathinfo-w-anchor'

* kc/gitweb-pathinfo-w-anchor:
gitweb: fix #patchNN anchors when path_info is enabled

Merge branch 'jn/fortify-source-workaround'Junio C Hamano Wed, 23 Mar 2011 21:55:49 +0000 (14:55 -0700)

Merge branch 'jn/fortify-source-workaround'

* jn/fortify-source-workaround:
run-command: prettify -D_FORTIFY_SOURCE workaround

Merge branch 'jn/maint-c99-format'Junio C Hamano Wed, 23 Mar 2011 21:55:46 +0000 (14:55 -0700)

Merge branch 'jn/maint-c99-format'

* jn/maint-c99-format:
unbreak and eliminate NO_C99_FORMAT
mktag: avoid %td in format string

Merge branch 'lt/default-abbrev'Junio C Hamano Wed, 23 Mar 2011 21:55:40 +0000 (14:55 -0700)

Merge branch 'lt/default-abbrev'

* lt/default-abbrev:
Rename core.abbrevlength back to core.abbrev
Make the default abbrev length configurable

Merge branch 'pk/stash-apply-status-relative'Junio C Hamano Wed, 23 Mar 2011 21:55:37 +0000 (14:55 -0700)

Merge branch 'pk/stash-apply-status-relative'

* pk/stash-apply-status-relative:
Add test: git stash shows status relative to current dir
git stash: show status relative to current directory

Merge branch 'jc/maint-diff-q-filter'Junio C Hamano Wed, 23 Mar 2011 21:55:17 +0000 (14:55 -0700)

Merge branch 'jc/maint-diff-q-filter'

* jc/maint-diff-q-filter:
diff --quiet: disable optimization when --diff-filter=X is used

Merge branch 'pw/p4'Junio C Hamano Wed, 23 Mar 2011 21:54:24 +0000 (14:54 -0700)

Merge branch 'pw/p4'

* pw/p4:
git-p4: test sync new branch
git-p4: fix sync new branch regression

rev-list --min-parents,--max-parents: doc, test and... Michael J Gruber Wed, 23 Mar 2011 09:38:51 +0000 (10:38 +0100)

rev-list --min-parents,--max-parents: doc, test and completion

This also adds test for "--merges" and "--no-merges" which we did not
have so far.

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

revision.c: introduce --min-parents and --max-parents... Michael J Gruber Mon, 21 Mar 2011 10:14:06 +0000 (11:14 +0100)

revision.c: introduce --min-parents and --max-parents options

Introduce --min-parents and --max-parents options which limit the
revisions to those commits which have at least (or at most) that many
commits, where negative arguments for --max-parents= denote infinity
(i.e. no upper limit).

In particular:

--max-parents=1 is the same as --no-merges;
--min-parents=2 is the same as --merges;
--max-parents=0 shows only roots; and
--min-parents=3 shows only octopus merges

Using --min-parents=n and --max-parents=m with n>m gives you what you ask
for (i.e. nothing) for obvious reasons, just like when you give --merges
(show only merge commits) and --no-merges (show only non-merge commits) at
the same time.

Also, introduce --no-min-parents and --no-max-parents to do the obvious
thing for convenience.

We compute the number of parents only when we limit by that, so there
is no performance impact when there are no limiters.

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

Update draft release notes to 1.7.5Junio C Hamano Wed, 23 Mar 2011 05:02:24 +0000 (22:02 -0700)

Update draft release notes to 1.7.5

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

Merge branch 'mg/rev-list-one-side-only'Junio C Hamano Wed, 23 Mar 2011 04:38:50 +0000 (21:38 -0700)

Merge branch 'mg/rev-list-one-side-only'

* mg/rev-list-one-side-only:
git-log: put space after commit mark
t6007: test rev-list --cherry
log --cherry: a synonym
rev-list: documentation and test for --cherry-mark
revision.c: introduce --cherry-mark
rev-list/log: factor out revision mark generation
rev-list: --left/right-only are mutually exclusive
rev-list: documentation and test for --left/right-only
t6007: Make sure we test --cherry-pick
revlist.c: introduce --left/right-only for unsymmetric picking

Merge branch 'js/maint-stash-index-copy'Junio C Hamano Wed, 23 Mar 2011 04:38:25 +0000 (21:38 -0700)

Merge branch 'js/maint-stash-index-copy'

* js/maint-stash-index-copy:
stash: copy the index using --index-output instead of cp -p
stash: fix incorrect quoting in cleanup of temporary files

Merge branch 'tl/p4'Junio C Hamano Wed, 23 Mar 2011 04:38:19 +0000 (21:38 -0700)

Merge branch 'tl/p4'

* tl/p4:
git-p4: Fix error message crash in P4Sync.commit.
Teach git-p4 to ignore case in perforce filenames if configured.
git-p4: Teach gitConfig method about arguments.

Merge branch 'mg/doc-bisect-tweak-worktree'Junio C Hamano Wed, 23 Mar 2011 04:38:15 +0000 (21:38 -0700)

Merge branch 'mg/doc-bisect-tweak-worktree'

* mg/doc-bisect-tweak-worktree:
git-bisect.txt: example for bisecting with hot-fix
git-bisect.txt: streamline run presentation

Merge branch 'jn/test-sanitize-git-env'Junio C Hamano Wed, 23 Mar 2011 04:38:12 +0000 (21:38 -0700)

Merge branch 'jn/test-sanitize-git-env'

* jn/test-sanitize-git-env:
tests: scrub environment of GIT_* variables
config: drop support for GIT_CONFIG_NOGLOBAL
gitattributes: drop support for GIT_ATTR_NOGLOBAL
tests: suppress system gitattributes
tests: stop worrying about obsolete environment variables

Merge branch 'sp/maint-upload-pack-stop-early'Junio C Hamano Wed, 23 Mar 2011 04:38:06 +0000 (21:38 -0700)

Merge branch 'sp/maint-upload-pack-stop-early'

* sp/maint-upload-pack-stop-early:
upload-pack: Implement no-done capability
upload-pack: More aggressively send 'ACK %s ready'

Merge branch 'sp/maint-fetch-pack-stop-early'Junio C Hamano Wed, 23 Mar 2011 04:38:03 +0000 (21:38 -0700)

Merge branch 'sp/maint-fetch-pack-stop-early'

* sp/maint-fetch-pack-stop-early:
fetch-pack: Implement no-done capability
fetch-pack: Finish negotation if remote replies "ACK %s ready"

Merge branch 'jc/maint-rev-list-culled-boundary'Junio C Hamano Wed, 23 Mar 2011 04:37:59 +0000 (21:37 -0700)

Merge branch 'jc/maint-rev-list-culled-boundary'

* jc/maint-rev-list-culled-boundary:
list-objects.c: don't add an unparsed NULL as a pending tree

Conflicts:
list-objects.c

Merge branch 'jc/maint-fetch-alt'Junio C Hamano Wed, 23 Mar 2011 04:37:53 +0000 (21:37 -0700)

Merge branch 'jc/maint-fetch-alt'

* jc/maint-fetch-alt:
fetch-pack: objects in our alternates are available to us
refs_from_alternate: helper to use refs from alternates

Conflicts:
builtin/receive-pack.c

Merge branch 'sg/complete-symmetric-diff'Junio C Hamano Wed, 23 Mar 2011 04:37:47 +0000 (21:37 -0700)

Merge branch 'sg/complete-symmetric-diff'

* sg/complete-symmetric-diff:
bash: complete 'git diff ...branc<TAB>'
bash: fix misindented esac statement in __git_complete_file()

Merge branch 'svn-fe' of git://repo.or.cz/git/jrnJunio C Hamano Wed, 23 Mar 2011 03:51:07 +0000 (20:51 -0700)

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

* 'svn-fe' of git://repo.or.cz/git/jrn:
vcs-svn: use strchr to find RFC822 delimiter
vcs-svn: implement perfect hash for top-level keys
vcs-svn: implement perfect hash for node-prop keys
vcs-svn: use strbuf for author, UUID, and URL
vcs-svn: use strbuf for revision log
vcs-svn: improve reporting of input errors
vcs-svn: make buffer_copy_bytes return length read
vcs-svn: make buffer_skip_bytes return length read
vcs-svn: improve support for reading large files
vcs-svn: allow input errors to be detected promptly
vcs-svn: simplify repo_modify_path and repo_copy
vcs-svn: handle_node: use repo_read_path
vcs-svn: introduce repo_read_path to check the content at a path

Merge branch 'db/length-as-hash' into svn-feJonathan Nieder Tue, 22 Mar 2011 23:44:49 +0000 (18:44 -0500)

Merge branch 'db/length-as-hash' into svn-fe

* db/length-as-hash:
vcs-svn: use strchr to find RFC822 delimiter
vcs-svn: implement perfect hash for top-level keys
vcs-svn: implement perfect hash for node-prop keys

Conflicts:
vcs-svn/svndump.c

vcs-svn: drop obj_poolDavid Barr Mon, 13 Dec 2010 10:26:43 +0000 (21:26 +1100)

vcs-svn: drop obj_pool

This reverts commit 4709455db3891f6cad9a96a574296b4926f70cbe (Add
memory pool library, 2010-08-09). svn-fe uses strbufs to avoid memory
allocation overhead nowadays.

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

vcs-svn: drop treapDavid Barr Mon, 13 Dec 2010 10:23:17 +0000 (21:23 +1100)

vcs-svn: drop treap

This reverts commit 951f316470acc7c785c460a4e40735b22822349f
(Add treap implementation, 2010-08-09). The string_pool was
trp.h's last user.

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

vcs-svn: drop string_poolDavid Barr Mon, 13 Dec 2010 10:17:36 +0000 (21:17 +1100)

vcs-svn: drop string_pool

This reverts commit 1d73b52f5ba4184de6acf474f14668001304a10c
(Add string-specific memory pool, 2010-08-09). Now that svn-fe
does not need to maintain a growing collection of strings (paths)
over a long period of time, the string_pool is not needed.

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

vcs-svn: pass paths through to fast-importDavid Barr Mon, 13 Dec 2010 05:41:12 +0000 (16:41 +1100)

vcs-svn: pass paths through to fast-import

Now that there is no internal representation of the repo, it is not
necessary to tokenise paths. Use strbuf instead and bypass
string_pool.

This means svn-fe can handle arbitrarily long paths (as long as a
strbuf can fit them), with arbitrarily many path components.

While at it, since we now treat paths in their entirety, only quote
when necessary.

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

Merge branch 'db/strbufs-for-metadata' into db/svn... Jonathan Nieder Tue, 22 Mar 2011 23:19:46 +0000 (18:19 -0500)

Merge branch 'db/strbufs-for-metadata' into db/svn-fe-code-purge

* db/strbufs-for-metadata:
vcs-svn: use strbuf for author, UUID, and URL
vcs-svn: use strbuf for revision log

Conflicts:
vcs-svn/fast_export.c
vcs-svn/fast_export.h
vcs-svn/repo_tree.c
vcs-svn/svndump.c

Merge branch 'db/length-as-hash' (early part) into... Jonathan Nieder Tue, 22 Mar 2011 23:11:59 +0000 (18:11 -0500)

Merge branch 'db/length-as-hash' (early part) into db/svn-fe-code-purge

* 'db/length-as-hash' (early part):
vcs-svn: implement perfect hash for top-level keys
vcs-svn: implement perfect hash for node-prop keys
vcs-svn: improve reporting of input errors
vcs-svn: make buffer_copy_bytes return length read
vcs-svn: make buffer_skip_bytes return length read
vcs-svn: improve support for reading large files

Conflicts:
vcs-svn/fast_export.c
vcs-svn/svndump.c

vcs-svn: use strchr to find RFC822 delimiterDavid Barr Tue, 14 Dec 2010 00:06:43 +0000 (11:06 +1100)

vcs-svn: use strchr to find RFC822 delimiter

This is a small optimisation (4% reduction in user time) but is the
largest artifact within the parsing portion of svndump.c

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

vcs-svn: implement perfect hash for top-level keysDavid Barr Mon, 13 Dec 2010 08:56:01 +0000 (19:56 +1100)

vcs-svn: implement perfect hash for top-level keys

Instead of interning property names and comparing their string_pool
keys, look them up in a table by string length, which should be about
as fast.

Another small step towards removing dependence on string_pool
altogether.

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

vcs-svn: implement perfect hash for node-prop keysDavid Barr Mon, 13 Dec 2010 08:13:24 +0000 (19:13 +1100)

vcs-svn: implement perfect hash for node-prop keys

Instead of interning property names and comparing their string_pool
keys, look them up in a table by string length, which should be about
as fast.

This is a small step towards removing dependence on string_pool.

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

vcs-svn: use strbuf for author, UUID, and URLDavid Barr Tue, 22 Mar 2011 22:52:17 +0000 (17:52 -0500)

vcs-svn: use strbuf for author, UUID, and URL

Use strbufs and strings instead of interned strings for values of rev,
dump, and node fields that happen to be strings. After this change,
the only remaining string_pool use is for paths in the repo_tree API
and internals.

Functional change: treat an empty author, UUID, or URL as none at all.
So for example, in repos where the first revision has an empty
svn:author property, the first rev will be treated as by "nobody"
rather than by a person with empty name and email address created by
prepending an @ sign to the repository UUID.

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

Merge branch 'maint'Junio C Hamano Tue, 22 Mar 2011 21:56:13 +0000 (14:56 -0700)

Merge branch 'maint'

* maint:
git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply'
bisect: visualize with git-log if gitk is unavailable

vcs-svn: use strbuf for revision logDavid Barr Mon, 21 Mar 2011 23:49:50 +0000 (10:49 +1100)

vcs-svn: use strbuf for revision log

obj_pool is overkill for this application: all that is needed is a
buffer that can resize from rev to rev to accomodate differently-sized
strings. In the spirit of commit deadcef4 (2010-11-06), use a strbuf
instead.

This is a small step towards removing dependence on obj_pool.h.

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

vcs-svn: improve reporting of input errorsJonathan Nieder Tue, 28 Dec 2010 10:30:54 +0000 (04:30 -0600)

vcs-svn: improve reporting of input errors

Catch input errors and exit early enough to print a reasonable
diagnosis based on 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: make buffer_copy_bytes return length readJonathan Nieder Tue, 28 Dec 2010 10:26:17 +0000 (04:26 -0600)

vcs-svn: make buffer_copy_bytes return length read

Currently buffer_copy_bytes does not report to its caller whether
it encountered an early end of file.

Add a return value representing the number of bytes read (but not
the number of bytes copied). This way all three unusual conditions
can be distinguished: input error with buffer_ferror, output error
with ferror(outfile), early end of input by checking the return
value.

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: make buffer_skip_bytes return length readJonathan Nieder Mon, 11 Oct 2010 02:44:21 +0000 (21:44 -0500)

vcs-svn: make buffer_skip_bytes return length read

Currently there is no way to detect when input ended if it ended
early during buffer_skip_bytes. Tell the calling program how many
bytes were actually skipped for easier debugging.

Existing callers will still ignore early EOF.

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: improve support for reading large filesJonathan Nieder Mon, 11 Oct 2010 02:46:24 +0000 (21:46 -0500)

vcs-svn: improve support for reading large files

Move from uint32_t to off_t as the fundamental unit of length used by
the line_buffer library. Performance would get worse if anything but
I think it's worth it for support of deltas that need to skip large
pieces (> 4 GiB).

Exception: buffer_read_string still takes a uint32_t, since it keeps
its result in an in-core obj_pool.

Callers still have to be updated to take advantage of this.

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>

git-am.txt: advertise 'git am --abort' instead of ... SZEDER Gábor Tue, 22 Mar 2011 18:42:25 +0000 (19:42 +0100)

git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply'

'git am --abort' is around for quite a long time now, and users should
normally not poke around inside the .git directory, yet the
documentation of 'git am' still recommends the following:

... if you decide to start over from scratch,
run `rm -f -r .git/rebase-apply` ...

Suggest 'git am --abort' instead.

It's not quite the same as the original, because 'git am --abort' will
restore the original branch, while simply removing '.git/rebase-apply'
won't, but that's rather a thinko in the original wording, because
that won't actually "start over _from scratch_".

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

diffcore-rename: fall back to -C when -C -C busts the... Junio C Hamano Thu, 6 Jan 2011 21:50:06 +0000 (13:50 -0800)

diffcore-rename: fall back to -C when -C -C busts the rename limit

When there are too many paths in the project, the number of rename source
candidates "git diff -C -C" finds will exceed the rename detection limit,
and no inexact rename detection is performed. We however could fall back
to "git diff -C" if the number of modified paths is sufficiently small.

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

diffcore-rename: record filepair for rename srcJunio C Hamano Thu, 6 Jan 2011 21:50:05 +0000 (13:50 -0800)

diffcore-rename: record filepair for rename src

This will allow us to later skip unmodified entries added due to "-C -C".
We might also want to do something similar to rename_dst side, but that
would only be for the sake of symmetry and not necessary for this series.

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

diffcore-rename: refactor "too many candidates" logicJunio C Hamano Thu, 6 Jan 2011 21:50:04 +0000 (13:50 -0800)

diffcore-rename: refactor "too many candidates" logic

Move the logic to a separate function, to be enhanced by later patches in
the series.

While at it, swap the condition used in the if statement from "if it is
too big then do this" to "if it would fit then do this".

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

Rebased to 'master' as the logic to use the result of this logic was
updated recently, together with the addition of eye-candy.