gitweb.git
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: 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>

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>

vcs-svn: use mark from previous import for parent commitDavid Barr Sun, 12 Dec 2010 02:41:38 +0000 (13:41 +1100)

vcs-svn: use mark from previous import for parent commit

With this patch, overlapping incremental imports work.

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

vcs-svn: handle filenames with dq correctlyJonathan Nieder Sat, 11 Dec 2010 23:08:51 +0000 (17:08 -0600)

vcs-svn: handle filenames with dq correctly

Quote paths passed to fast-import so filenames with double quotes are
not misinterpreted.

One might imagine this could help with filenames with newlines, too,
but svn does not allow those.

Helped-by: David Barr <daivd.barr@cordelta.com>
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: quote paths correctly for ls commandDavid Barr Sat, 11 Dec 2010 16:59:31 +0000 (03:59 +1100)

vcs-svn: quote paths correctly for ls command

This bug was found while importing rev 601865 of ASF.

[jn: with test]

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

vcs-svn: eliminate repo_tree structureJonathan Nieder Fri, 10 Dec 2010 10:00:55 +0000 (04:00 -0600)

vcs-svn: eliminate repo_tree structure

Rely on fast-import for information about previous revs.

This requires always setting up backward flow of information, even for
v2 dumps. On the plus side, it simplifies the code by quite a bit and
opens the door to further simplifications.

[db: adjusted to support final version of the cat-blob patch]
[jn: avoiding hard-coding git's name for the empty tree for
portability to other backends]

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: add a comment before each commitJonathan Nieder Wed, 5 Jan 2011 03:53:33 +0000 (21:53 -0600)

vcs-svn: add a comment before each commit

Current svn-fe produces output like this:

blob
mark :7382321
data 5
hello

blob
mark :7382322
data 5
Hello

commit
mark :3
[...]
M 100644 :7382321 hello.c
M 100644 :7382322 hello2.c

This means svn-fe has to keep track of the paths modified in each
commit and the corresponding marks, instead of dealing with each file
as it arrives in input and then forgetting about it. A better
strategy would be to use inline blobs:

commit
mark :3
[...]
M 100644 inline hello.c
data 5
hello
[...]

As a first step towards that, teach svn-fe to notice when the
collection of blobs for each commit starts and write a comment
("# commit 3.") there.

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

vcs-svn: save marks for imported commitsJonathan Nieder Fri, 10 Dec 2010 00:57:13 +0000 (18:57 -0600)

vcs-svn: save marks for imported commits

This way, a person can use

svnadmin dump $path |
svn-fe |
git fast-import --relative-marks --export-marks=svn-revs

to get a list of what commit corresponds to each svn revision (plus
some irrelevant blob names) in .git/info/fast-import/svn-revs.

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: use higher mark numbers for blobsJonathan Nieder Fri, 10 Dec 2010 10:21:35 +0000 (04:21 -0600)

vcs-svn: use higher mark numbers for blobs

Prepare to use mark :5 for the commit corresponding to r5 (and so on).

1 billion seems sufficiently high for blob marks to avoid conflicting
with rev marks, while still leaving room for 3 billion blobs. Such
high mark numbers cause trouble with ancient fast-import versions, but
this topic cannot support git fast-import versions before 1.7.4 (which
introduces the cat-blob command) anyway.

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

vcs-svn: set up channel to read fast-import cat-blob... David Barr Sat, 5 Mar 2011 02:30:23 +0000 (13:30 +1100)

vcs-svn: set up channel to read fast-import cat-blob response

Set up some plumbing: teach the svndump lib to pass a file descriptor
number to the fast_export lib, representing where cat-blob/ls
responses can be read from, and add a get_response_line helper
function to the fast_export lib to read a line from that file.

Unfortunately this means that svn-fe needs file descriptor 3 to be
redirected from somewhere (preferrably the cat-blob stream of a
fast-import backend); otherwise it will fail:

$ svndump <path> | svn-fe
fatal: cannot read from file descriptor 3: Bad file descriptor

For the moment, "svn-fe 3</dev/null" works as a workaround but it
will not work for very long. A fast-import backend that can retrieve
old commits is needed in order to be able to fulfill svn
"Node-copyfrom-rev" requests that refer to revs from a previous run.

[jn: with new change description]

Based-on-patch-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: 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>

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>

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>

vcs-svn: make test-line-buffer input format more flexibleJonathan Nieder Mon, 3 Jan 2011 00:50:16 +0000 (18:50 -0600)

vcs-svn: make test-line-buffer input format more flexible

Imitate the input format of test-obj-pool to support arbitrary
sequences of commands rather than alternating read/copy. This should
make it easier to add tests that exercise other line_buffer functions.

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

vcs-svn: teach line_buffer to handle multiple input... Jonathan Nieder Mon, 11 Oct 2010 02:41:06 +0000 (21:41 -0500)

vcs-svn: teach line_buffer to handle multiple input files

Collect the line_buffer state in a newly public line_buffer struct.
Callers can use multiple line_buffers to manage input from multiple
files at a time.

svn-fe's delta applier will use this to stream a delta from svnrdump
and the preimage it applies to from fast-import at the same time.

The tests don't take advantage of the new features, but I think that's
okay. It is easier to find lingering examples of nonreentrant code by
searching for "static" in line_buffer.c.

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

vcs-svn: collect line_buffer data in a structJonathan Nieder Mon, 11 Oct 2010 02:39:21 +0000 (21:39 -0500)

vcs-svn: collect line_buffer data in a struct

Prepare for the line_buffer lib to support input from multiple files,
by collecting global state in a struct that can be easily passed
around.

No API change yet.

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

vcs-svn: replace buffer_read_string memory pool with... Jonathan Nieder Sat, 6 Nov 2010 17:01:28 +0000 (12:01 -0500)

vcs-svn: replace buffer_read_string memory pool with a strbuf

obj_pool is inherently global and does not use the standard growing
factor alloc_nr, which makes it feel out of place in the git codebase.
Plus it is overkill for this application: all that is needed is a
buffer that can grow between requests to accomodate larger strings.
Use a strbuf instead.

As a side effect, this improves the error handling: allocation
failures will result in a clean exit instead of segfaults. It would
be nice to add a test case (using ulimit or failmalloc) but that can
wait for another day.

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

vcs-svn: eliminate global byte_bufferJonathan Nieder Mon, 11 Oct 2010 02:37:10 +0000 (21:37 -0500)

vcs-svn: eliminate global byte_buffer

The data stored in byte_buffer[] is always either discarded or
written to stdout immediately. No need for it to persist between
function calls.

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

fast-import: add 'ls' commandDavid Barr Thu, 2 Dec 2010 10:40:20 +0000 (21:40 +1100)

fast-import: add 'ls' command

Lazy fast-import frontend authors that want to rely on the backend to
keep track of the content of the imported trees _almost_ have what
they need in the 'cat-blob' command (v1.7.4-rc0~30^2~3, 2010-11-28).
But it is not quite enough, since

(1) cat-blob can be used to retrieve the content of files, but
not their mode, and

(2) using cat-blob requires the frontend to keep track of a name
(mark number or object id) for each blob to be retrieved

Introduce an 'ls' command to complement cat-blob and take care of the
remaining needs. The 'ls' command finds what is at a given path
within a given tree-ish (tag, commit, or tree):

'ls' SP <dataref> SP <path> LF

or in fast-import's active commit:

'ls' SP <path> LF

The response is a single line sent through the cat-blob channel,
imitating ls-tree output. So for example:

FE> ls :1 Documentation
gfi> 040000 tree 9e6c2b599341d28a2a375f8207507e0a2a627fe9 Documentation
FE> ls 9e6c2b599341d28a2a375f8207507e0a2a627fe9 git-fast-import.txt
gfi> 100644 blob 4f92954396e3f0f97e75b6838a5635b583708870 git-fast-import.txt
FE> ls :1 RelNotes
gfi> 120000 blob b942e499449d97aeb50c73ca2bdc1c6e6d528743 RelNotes
FE> cat-blob b942e499449d97aeb50c73ca2bdc1c6e6d528743
gfi> b942e499449d97aeb50c73ca2bdc1c6e6d528743 blob 32
gfi> Documentation/RelNotes/1.7.4.txt

The most interesting parts of the reply are the first word, which is
a 6-digit octal mode (regular file, executable, symlink, directory,
or submodule), and the part from the second space to the tab, which is
a <dataref> that can be used in later cat-blob, ls, and filemodify (M)
commands to refer to the content (blob, tree, or commit) at that path.

If there is nothing there, the response is "missing some/path".

The intent is for this command to be used to read files from the
active commit, so a frontend can apply patches to them, and to copy
files and directories from previous revisions.

For example, proposed updates to svn-fe use this command in place of
its internal representation of the repository directory structure.
This simplifies the frontend a great deal and means support for
resuming an import in a separate fast-import run (i.e., incremental
import) is basically free.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>

update-index --refresh --porcelain: add missing constJonathan Nieder Tue, 22 Feb 2011 22:43:23 +0000 (22:43 +0000)

update-index --refresh --porcelain: add missing const

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

checkout: add missing const to describe_detached_headJonathan Nieder Tue, 22 Feb 2011 22:43:22 +0000 (22:43 +0000)

checkout: add missing const to describe_detached_head

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

Merge branch 'maint'Junio C Hamano Tue, 22 Feb 2011 06:46:09 +0000 (22:46 -0800)

Merge branch 'maint'

* maint:
Documentation: clarify -u<mode> option defaults

Documentation: clarify -u<mode> option defaultsClemens Buchacher Mon, 21 Feb 2011 20:05:25 +0000 (21:05 +0100)

Documentation: clarify -u<mode> option defaults

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 22 Feb 2011 01:20:11 +0000 (17:20 -0800)

Merge branch 'maint'

* maint:
t/t7500-commit.sh: use test_cmp instead of test
t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate
gitweb/gitweb.perl: don't call S_ISREG() with undef
gitweb/gitweb.perl: remove use of qw(...) as parentheses

t/t7500-commit.sh: use test_cmp instead of testÆvar Arnfjörð Bjarmason Sat, 19 Feb 2011 18:29:09 +0000 (18:29 +0000)

t/t7500-commit.sh: use test_cmp instead of test

Change commit_msg_is() in t/t7500-commit.sh to use test_cmp instead of
the shell's test function. Now if a test fails we'll get test_cmp
output showing us what failed.

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

t/gitweb-lib.sh: Ensure that errors are shown for ... Ævar Arnfjörð Bjarmason Sat, 19 Feb 2011 18:16:19 +0000 (19:16 +0100)

t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate

Because '--immediate' stops test suite after first error, therefore in
this mode

test_debug 'cat gitweb.log'

was never ran, thus in effect negating effect of '--debug' option.
This made finidng the cause of errors in gitweb test sute difficult.

Modify the gitweb_run test subroutine to run test_debug itself in the
case of errors (and also remove "test_debug 'cat gitweb.log'" from
gitweb tests).

This makes it possible to run *gitweb tests* with --immediate ---debug
combination of options; also it makes gitweb tests to not output
spurious debug data that is not considered error.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb/gitweb.perl: don't call S_ISREG() with undefÆvar Arnfjörð Bjarmason Sat, 19 Feb 2011 15:27:42 +0000 (15:27 +0000)

gitweb/gitweb.perl: don't call S_ISREG() with undef

Change S_ISREG($to_mode_oct) to S_ISREG($from_mode_oct) in the branch
that handles from modes, not to modes. This logic appears to have been
caused by copy/paste programming by Jakub Narebski in e8e41a93. It
would be better to rewrite this code not to be duplicated, but I
haven't done so.

This issue caused a failing test on perl 5.13.9, which has a warning
that turned this up:

gitweb.perl: Use of uninitialized value in subroutine entry at /home/avar/g/git/t/../gitweb/gitweb.perl line 4415.

Which caused the Git test suite to fail on this test:

./t9500-gitweb-standalone-no-errors.sh (Wstat: 256 Tests: 90 Failed: 84)
Failed tests: 1-8, 10-36, 38-45, 47-48, 50-88
Non-zero exit status: 1

Reported-by: perl 5.13.9
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb/gitweb.perl: remove use of qw(...) as parenthesesÆvar Arnfjörð Bjarmason Sat, 19 Feb 2011 15:27:41 +0000 (15:27 +0000)

gitweb/gitweb.perl: remove use of qw(...) as parentheses

Using the qw(...) construct as implicit parentheses was deprecated in
perl 5.13.5. Change the relevant code in gitweb to not use the
deprecated construct. The offending code was introduced in 3562198b by
Jakub Narebski.

The issue is that perl will now warn about this:

$ perl -wE 'for my $i qw(a b) { say $i }'
Use of qw(...) as parentheses is deprecated at -e line 1.
a
b

This caused gitweb.perl to warn on perl 5.13.5 and above, and these
tests to fail on those perl versions:

./t9501-gitweb-standalone-http-status.sh (Wstat: 256 Tests: 11 Failed: 10)
Failed tests: 2-11
Non-zero exit status: 1
./t9502-gitweb-standalone-parse-output.sh (Wstat: 256 Tests: 10 Failed: 9)
Failed tests: 2-10
Non-zero exit status: 1

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 16 Feb 2011 22:33:22 +0000 (14:33 -0800)

Merge branch 'maint'

* maint:
parse_tag_buffer(): do not prefixcmp() out of range

Merge branch 'maint-1.7.3' into maintJunio C Hamano Wed, 16 Feb 2011 22:33:11 +0000 (14:33 -0800)

Merge branch 'maint-1.7.3' into maint

* maint-1.7.3:

Merge branch 'maint-1.7.2' into maint-1.7.3Junio C Hamano Wed, 16 Feb 2011 22:32:59 +0000 (14:32 -0800)

Merge branch 'maint-1.7.2' into maint-1.7.3

* maint-1.7.2:
fast-import: introduce "feature notes" command
fast-import: clarify documentation of "feature" command

Merge branch 'maint-1.7.1' into maint-1.7.2Junio C Hamano Wed, 16 Feb 2011 22:32:54 +0000 (14:32 -0800)

Merge branch 'maint-1.7.1' into maint-1.7.2

* maint-1.7.1:
fast-import: introduce "feature notes" command
fast-import: clarify documentation of "feature" command

Merge branch 'maint-1.7.0' into maint-1.7.1Junio C Hamano Wed, 16 Feb 2011 22:32:47 +0000 (14:32 -0800)

Merge branch 'maint-1.7.0' into maint-1.7.1

* maint-1.7.0:
fast-import: introduce "feature notes" command
fast-import: clarify documentation of "feature" command

parse_tag_buffer(): do not prefixcmp() out of rangeNguyễn Thái Ngọc Duy Mon, 14 Feb 2011 13:02:51 +0000 (20:02 +0700)

parse_tag_buffer(): do not prefixcmp() out of range

There is a check (size < 64) at the beginning of the function, but
that only covers object+type lines.

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 Tue, 15 Feb 2011 19:03:22 +0000 (11:03 -0800)

Merge branch 'maint'

* maint:
pull: do not display fetch usage on --help-all
git-tag.txt: list all modes in the description
commit,status: describe -u likewise
add: describe --patch like checkout, reset
commit,merge,tag: describe -m likewise
clone,init: describe --template using the same wording
commit,status: describe --porcelain just like push
commit,tag: use same wording for -F
configure: use AC_LANG_PROGRAM consistently
string_list_append: always set util pointer to NULL
correct type of EMPTY_TREE_SHA1_BIN

pull: do not display fetch usage on --help-allMichael J Gruber Mon, 14 Feb 2011 16:48:08 +0000 (17:48 +0100)

pull: do not display fetch usage on --help-all

Currently, "git pull --help-all" displays the fetch usage info.

Make it equivalent to "git pull -h" instead since "--help-all" is
documented in gitcli(7).

Do not try to sanitize the pull option parser (aka last hair puller).

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

git-tag.txt: list all modes in the descriptionMichael J Gruber Tue, 15 Feb 2011 13:09:10 +0000 (14:09 +0100)

git-tag.txt: list all modes in the description

Currently, the description sounds as if it applied always, but most of
its content is true in "create tag mode" only.

Make this clearer by listing all modes upfront.

Also, sneak in some linguistic improvements and make it clearer that
lightweight tags are "created" because "written" may be misread as
"are output".

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

commit,status: describe -u likewiseMichael J Gruber Tue, 15 Feb 2011 13:09:09 +0000 (14:09 +0100)

commit,status: describe -u likewise

They differ by one character only. Being exactly equal should help
translations.

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

add: describe --patch like checkout, resetMichael J Gruber Tue, 15 Feb 2011 13:09:08 +0000 (14:09 +0100)

add: describe --patch like checkout, reset

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

commit,merge,tag: describe -m likewiseMichael J Gruber Tue, 15 Feb 2011 13:09:07 +0000 (14:09 +0100)

commit,merge,tag: describe -m likewise

This also removes the superfluous "specify" and rewords the misleading
"if any" which sounds as if omitting "-m" would omit the merge commit
message. (It means "if a merge commit is created at all".)

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

clone,init: describe --template using the same wordingMichael J Gruber Tue, 15 Feb 2011 13:09:06 +0000 (14:09 +0100)

clone,init: describe --template using the same wording

This also corrects a wrong description for clone.

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

commit,status: describe --porcelain just like pushMichael J Gruber Tue, 15 Feb 2011 13:09:05 +0000 (14:09 +0100)

commit,status: describe --porcelain just like push

Push has the clearer description, so take that one for all.

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

commit,tag: use same wording for -FMichael J Gruber Tue, 15 Feb 2011 13:09:04 +0000 (14:09 +0100)

commit,tag: use same wording for -F

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

Revert "unpack_trees(): skip trees that are the same... Junio C Hamano Tue, 15 Feb 2011 18:47:04 +0000 (10:47 -0800)

Revert "unpack_trees(): skip trees that are the same in all input"

This reverts commit 83c90314aa27ae3768c04375d02e4f3fb12b726d, which
seems to have broken merge to report conflicts when there should be
none.

configure: use AC_LANG_PROGRAM consistentlyRalf Wildenhues Sun, 2 Jan 2011 10:24:55 +0000 (11:24 +0100)

configure: use AC_LANG_PROGRAM consistently

Avoid warnings from Autoconf 2.68 about missing use of AC_LANG_PROGRAM
and friends.

Quoting autoconf-2.68/NEWS:

** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and
AC_RUN_IFELSE now warn if the first argument failed to use
AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file
contents. A new macro AC_LANG_DEFINES_PROVIDED exists if you have
a compelling reason why you cannot use AC_LANG_SOURCE but must
avoid the warning.

The underlying reason for that change is that AC_LANG_{SOURCE,PROGRAM}
take care to supply the previously computed set of #defines (and
include standard headers if so desired) for preprocessed languages
like C and C++.

In some cases, AC_LANG_PROGRAM is already used but not sufficiently
m4-quoted, so we just need to add another set of [quotes] to prevent
the autoconf warning from being triggered bogusly. Quoting all
arguments (except when calling special macros that need to be expanded
before recursion) is better style, anyway. These and more rules are
described in detail in 'info Autoconf "Programming in M4"'.

No change in the resulting config.mak.autogen after running
./configure intended.

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

string_list_append: always set util pointer to NULLJeff King Sat, 12 Feb 2011 05:18:51 +0000 (00:18 -0500)

string_list_append: always set util pointer to NULL

It is not immediately obvious that the util field may
contain random bytes after appending an item. Especially
since the string_list_insert* functions _do_ explicitly zero
the util pointer.

This does not appear to be a bug in any current git code, as
all callers either fill in the util field immediately or
never use it. However, it is worth it to be less surprising
to new users of the string-list API who may expect it to be
intialized to NULL.

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

correct type of EMPTY_TREE_SHA1_BINJonathan Nieder Mon, 7 Feb 2011 08:17:27 +0000 (02:17 -0600)

correct type of EMPTY_TREE_SHA1_BIN

Functions such as hashcmp that expect a binary SHA-1 value take
parameters of type "unsigned char *" to avoid accepting a textual
SHA-1 passed by mistake. Unfortunately, this means passing the string
literal EMPTY_TREE_SHA1_BIN requires an ugly cast. Tweak the
definition of EMPTY_TREE_SHA1_BIN to produce a value of more
convenient type.

In the future the definition might change to

extern const unsigned char empty_tree_sha1_bin[20];
#define EMPTY_TREE_SHA1_BIN empty_tree_sha1_bin

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

Obey p4 views when using client specIan Wienand Sat, 12 Feb 2011 00:33:48 +0000 (16:33 -0800)

Obey p4 views when using client spec

When using the p4 client spec, this attempts to obey the client's
output preferences.

For example, a view like

//depot/foo/branch/... //client/branch/foo/...
//depot/bar/branch/... //client/branch/bar/...

will result in a directory layout in the git tree of

branch/
branch/foo
branch/bar

p4 can do various other reordering that this change doesn't support,
but we should detect it and at least fail nicely.

Signed-off-by: Ian Wienand <ianw@vmware.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Acked-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitignore: add test-mktemp to ignore listÆvar Arnfjörð Bjarmason Sat, 12 Feb 2011 23:21:17 +0000 (23:21 +0000)

gitignore: add test-mktemp to ignore list

Change the .gitignore to ignore test-mktemp which is built from
test-mktemp.c. Arnout Engelen added this in 6cf6bb3 (Improve error
messages when temporary file creation fails, 2010-12-18) but forgot
to add a corresponding entry to .gitignore.

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

repo-config: add deprecation warningRené Scharfe Sat, 12 Feb 2011 13:24:10 +0000 (14:24 +0100)

repo-config: add deprecation warning

repo-config was deprecated in 5c66d0d4 on 2008-01-17. Warn the
remaining users that it has been replaced by config and is going to
be removed eventually.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sat, 12 Feb 2011 00:01:47 +0000 (16:01 -0800)

Merge branch 'maint'

* maint:
Git 1.7.4.1
clone: fixup recurse_submodules option
svn-fe: warn about experimental status

Conflicts:
contrib/examples/git-revert.sh
contrib/svn-fe/svn-fe.txt

Git 1.7.4.1 v1.7.4.1Junio C Hamano Fri, 11 Feb 2011 22:39:55 +0000 (14:39 -0800)

Git 1.7.4.1

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

Merge branch 'jc/fsck-fixes' into maintJunio C Hamano Fri, 11 Feb 2011 22:26:10 +0000 (14:26 -0800)

Merge branch 'jc/fsck-fixes' into maint

* jc/fsck-fixes:
fsck: do not give up too early in fsck_dir()
fsck: drop unused parameter from traverse_one_object()

clone: fixup recurse_submodules optionChris Packham Thu, 10 Feb 2011 22:59:31 +0000 (11:59 +1300)

clone: fixup recurse_submodules option

The recurse_submodules option was added in ccdd3da6 to bring 'git clone'
into line with 'git fetch' and future commands. The correct option should
have been "recurse-submodules".

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

svn-fe: warn about experimental statusJonathan Nieder Fri, 11 Feb 2011 10:36:44 +0000 (04:36 -0600)

svn-fe: warn about experimental status

svn-fe is young and some coming cleanups might involve backward
incompatible UI changes. Add some words of warning to the manual so
early adopters that are not following the project closely don't get
burned.

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

Merge branch 'maint'Junio C Hamano Thu, 10 Feb 2011 22:45:55 +0000 (14:45 -0800)

Merge branch 'maint'

* maint:
compat: helper for detecting unsigned overflow

compat: helper for detecting unsigned overflowJonathan Nieder Mon, 11 Oct 2010 02:59:26 +0000 (21:59 -0500)

compat: helper for detecting unsigned overflow

The idiom (a + b < a) works fine for detecting that an unsigned
integer has overflowed, but a more explicit

unsigned_add_overflows(a, b)

might be easier to read.

Define such a macro, expanding roughly to ((a) < UINT_MAX - (b)).
Because the expansion uses each argument only once outside of sizeof()
expressions, it is safe to use with arguments that have side effects.

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

Merge branch 'tr/merge-unborn-clobber'Junio C Hamano Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)

Merge branch 'tr/merge-unborn-clobber'

* tr/merge-unborn-clobber:
Exhibit merge bug that clobbers index&WT

Conflicts:
t/t7607-merge-overwrite.sh

Merge branch 'jc/unpack-trees'Junio C Hamano Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)

Merge branch 'jc/unpack-trees'

* jc/unpack-trees:
unpack_trees(): skip trees that are the same in all input
unpack-trees.c: cosmetic fix

Conflicts:
unpack-trees.c

Merge branch 'jc/fsck-fixes'Junio C Hamano Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)

Merge branch 'jc/fsck-fixes'

* jc/fsck-fixes:
fsck: do not give up too early in fsck_dir()
fsck: drop unused parameter from traverse_one_object()

Merge branch 'tr/diff-words-test'Junio C Hamano Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)

Merge branch 'tr/diff-words-test'

* tr/diff-words-test:
t4034 (diff --word-diff): add a minimum Perl drier test vector
t4034 (diff --word-diff): style suggestions
userdiff: simplify word-diff safeguard
t4034: bulk verify builtin word regex sanity

Merge branch 'rr/fi-import-marks-if-exists'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'rr/fi-import-marks-if-exists'

* rr/fi-import-marks-if-exists:
fast-import: Introduce --import-marks-if-exists

Merge branch 'jn/unpack-lstat-failure-report'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'jn/unpack-lstat-failure-report'

* jn/unpack-lstat-failure-report:
unpack-trees: handle lstat failure for existing file
unpack-trees: handle lstat failure for existing directory

Merge branch 'ef/alias-via-run-command'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'ef/alias-via-run-command'

* ef/alias-via-run-command:
alias: use run_command api to execute aliases

Merge branch 'cb/setup'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'cb/setup'

* cb/setup:
setup: translate symlinks in filename when using absolute paths

Merge branch 'ae/better-template-failure-report'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'ae/better-template-failure-report'

* ae/better-template-failure-report:
Improve error messages when temporary file creation fails

Merge branch 'jn/cherry-pick-strategy-option'Junio C Hamano Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)

Merge branch 'jn/cherry-pick-strategy-option'

* jn/cherry-pick-strategy-option:
cherry-pick/revert: add support for -X/--strategy-option

Merge branch 'maint-1.7.0' into maintJunio C Hamano Thu, 10 Feb 2011 00:40:12 +0000 (16:40 -0800)

Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
fast-import: introduce "feature notes" command
fast-import: clarify documentation of "feature" command

Conflicts:
Documentation/git-fast-import.txt

fast-import: introduce "feature notes" commandJonathan Nieder Wed, 9 Feb 2011 22:43:57 +0000 (16:43 -0600)

fast-import: introduce "feature notes" command

Here is a 'feature' command for streams to use to require support for
the notemodify (N) command.

When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
2009-10-09) and it was not obvious it deserved to be a named feature.
But now that is clear, since all major non-git fast-import backends
lack support for it.

Details: on git version with this patch applied, any "feature notes"
command in the features/options section at the beginning of a stream
will be treated as a no-op. On fast-import implementations without
the feature (and older git versions), the command instead errors out
with a message like

This version of fast-import does not support feature notes.

So by declaring use of notes at the beginning of a stream, frontends
can avoid wasting time and other resources when the backend does not
support notes. (This would be especially important for backends that
do not support rewinding history after a botched import.)

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

fast-import: clarify documentation of "feature" commandJonathan Nieder Sun, 28 Nov 2010 19:43:57 +0000 (13:43 -0600)

fast-import: clarify documentation of "feature" command

The "feature" command allows streams to specify options for the import
that must not be ignored. Logically, they are part of the stream,
even though technically most supported features are synonyms to
command-line options.

Make this more obvious by being more explicit about how the analogy
between most "feature" commands and command-line options works. Treat
the feature (import-marks) that does not fit this analogy separately.

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

Documentation/merge subtree How-To: fix typoUwe Kleine-König Wed, 9 Feb 2011 09:04:43 +0000 (10:04 +0100)

Documentation/merge subtree How-To: fix typo

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

pull: Document the "--[no-]recurse-submodules" optionsJens Lehmann Mon, 7 Feb 2011 22:24:54 +0000 (23:24 +0100)

pull: Document the "--[no-]recurse-submodules" options

In commits be254a0ea9 and 7dce19d374 the handling of the new fetch options
"--[no-]recurse-submodules" had been added to git-pull.sh. But they were
not documented as the pull options they now are, so let's fix that.

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

quote.h: simplify the inclusionJonathan Nieder Wed, 5 Jan 2011 00:36:34 +0000 (18:36 -0600)

quote.h: simplify the inclusion

Attempting to include quote.h without first including strbuf.h results
in warnings:

./quote.h:33:33: warning: ‘struct strbuf’ declared inside parameter list
./quote.h:33:33: warning: its scope is only this definition or declaration, which is probably not what you want
./quote.h:34:34: warning: ‘struct strbuf’ declared inside parameter list
...

Add a toplevel declaration for struct strbuf to avoid this.

While at it, stop including system headers from quote.h. git source
files already need to include git-compat-util.h sooner to ensure the
appropriate feature test macros are defined.

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

sha1_object_info: examine cached_object store tooNguyễn Thái Ngọc Duy Sat, 5 Feb 2011 14:03:02 +0000 (21:03 +0700)

sha1_object_info: examine cached_object store too

Cached object store was added in d66b37b (Add pretend_sha1_file()
interface. - 2007-02-04) as a way to temporarily inject some objects
to object store.

But only read_sha1_file() knows about this store. While it will return
an object from this store, sha1_object_info() will happily say
"object not found".

Teach sha1_object_info() about the cached store for consistency.

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

sha1_file.c: move find_cached_object up so sha1_object_... Nguyễn Thái Ngọc Duy Sat, 5 Feb 2011 14:03:01 +0000 (21:03 +0700)

sha1_file.c: move find_cached_object up so sha1_object_info can use it

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

Add const to parse_{commit,tag}_buffer()Nguyễn Thái Ngọc Duy Sat, 5 Feb 2011 10:52:20 +0000 (17:52 +0700)

Add const to parse_{commit,tag}_buffer()

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

diff: support --cached on unborn branchesNguyễn Thái Ngọc Duy Thu, 3 Feb 2011 06:23:34 +0000 (13:23 +0700)

diff: support --cached on unborn branches

"git diff --cached" (without revision) used to mean "git diff --cached
HEAD" (i.e. the user was too lazy to type HEAD). This "correctly"
failed when there was no commit yet. But was that correctness useful?

This patch changes the definition of what particular command means.
It is a request to show what _would_ be committed without further "git
add". The internal implementation is the same "git diff --cached HEAD"
when HEAD exists, but when there is no commit yet, it compares the index
with an empty tree object to achieve the desired result.

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

gitweb: Mention optional Perl modules in INSTALLJakub Narebski Thu, 3 Feb 2011 23:20:48 +0000 (00:20 +0100)

gitweb: Mention optional Perl modules in INSTALL

Some optional additional Perl modules are required for some of extra
features. Mention those in gitweb/INSTALL.

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

post-receive-email: suppress error if description file... Sitaram Chamarty Thu, 3 Feb 2011 01:00:32 +0000 (06:30 +0530)

post-receive-email: suppress error if description file missing

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>