aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* vcs-svn: make buffer_skip_bytes return length readJonathan Nieder2011-03-22
| | | | | | | | | | | | 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 Nieder2011-03-22
| | | | | | | | | | | | | | | | 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: allow input errors to be detected promptlyJonathan Nieder2011-03-07
| | | | | | | | | | | | | | | 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 Nieder2011-03-07
| | | | | | | | | | | | | | | 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 Nieder2011-03-07
| | | | | | | | | | | | | | | | | | | | | 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 at a pathJonathan Nieder2011-03-07
| | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-28
| | | | | | | | | 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/git into svn-feJonathan Nieder2011-02-26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: Allow change nodes for root of tree (/)Jonathan Nieder2010-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not uncommon for a svn repository to include change records for properties at the top level of the tracked tree: Node-path: Node-kind: dir Node-action: change Prop-delta: true Prop-content-length: 43 Content-length: 43 K 10 svn:ignore V 11 build-area PROPS-END Unfortunately a recent svn-fe change (vcs-svn: More dump format sanity checks, 2010-11-19) causes such nodes to be rejected with the error message fatal: invalid dump: path to be modified is missing The repo_tree module does not keep a dirent for the root of the tree. Add a block to the dump parser to take care of this case. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Implement Prop-delta handlingDavid Barr2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rules for what file is used as delta source for each file are not documented in dump-load-format.txt. Luckily, the Apache Software Foundation repository has rich enough examples to figure out most of the rules: Node-action: replace implies the empty property set and empty text as preimage for deltas. Otherwise, if a copyfrom source is given, that node is the preimage for deltas. Lastly, if none of the above applies and the node path exists in the current revision, then that version forms the basis. [jn: refactored, with tests] Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Sharpen parsing of property linesJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | Prepare to add a new type of property line (the 'D' line) to handle property deltas. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Split off function for handling of individual propertiesJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | The handle_property function is the part of read_props that would be interesting for most people: semantics of properties rather than the algorithm for parsing them. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Make source easier to read on small screensJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | Remove some newlines from handle_node() that are not needed for clarity. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: More dump format sanity checksJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Node-action: change is not appropriate when switching between file and directory or adding a new file. Current svn-fe silently accepts such nodes and the resulting tree has missing files in the "changed when meant to add" case. Node-action: add requires some content (text or directory); there is no such thing as an "intent to add" node in svn dumps. Current svn-fe accepts such contentless adds but produces an invalid fast-import stream that refers to nonexistent mark :0 in response. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Reject path nodes without Node-actionJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | It would be better to flag such errors and let the import proceed anyway, but for now it is simpler not to worry about recovery from such weird cases. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Delay read of per-path propertiesJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mode for each file in an svn-format dump is kept in the properties section. The properties section is read as soon as possible to allow the correct mode to be filled in when registering the file with the repo_tree lib. To support nodes with a missing properties section, svn-fe determines the mode in three stages: - The kind (directory or file) of the node is read from the dump and used to make an initial estimate (040000 or 100644). - Properties are read in and allowed to override this for symlinks and executables. - If there is no properties section, the mode from the previous content of the path is left alone, overriding the above considerations. This is a bit of a mess, and worse, it would get even more complicated once we start to support property deltas. If we could only register the file with a provisional value for mode and then change it later when properties say so, the procedure would be much simpler. ... oh, right, we can. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Combine repo_replace and repo_modify functionsJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two functions to change the staged content for a path in the svn importer's active commit: repo_replace, which changes the text and returns the mode, and repo_modify, which changes the text and mode and returns nothing. Worse, there are more subtle differences: - A mark of 0 passed to repo_modify means "use the existing content". repo_replace uses it as mark :0 and produces a corrupt stream. - When passed a path that is not part of the active commit, repo_replace returns without doing anything. repo_modify transparently adds a new directory entry. Get rid of both and introduce a new function with the best features of both: repo_modify_path modifies the mode, content, or both for a path, depending on which arguments are zero. If no such dirent already exists, it does nothing and reports the error by returning 0. Otherwise, the return value is the resulting mode. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Replace = Delete + AddJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | Simplify by reducing the "Node-action: replace" case to "Node-action: add". This way, the main part of handle_node() only has to deal with "add" and "change" nodes. Functional change: replacing a symlink or executable without setting properties will reset the mode. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: handle_node: Handle deletion case earlyJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | Take care of "Node-action: delete" as soon as possible, so we can stop worrying about that case in the rest of the function. Functional change: catch deletion nodes with features that would not apply to them (text, properties, or origin data) and error out for those cases. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Use mark to indicate nodes with included textJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate a mark if needed as soon as possible so later code can use "if (mark)" to check if this node has text attached rather than explicitly checking for Text-content-length. While at it, reject directory nodes with text attached; the presence of such a node would indicate a bug in the dump generator or svn-fe's understanding. In the long term, it would be nice to be able to continue parsing and save the error for later, but for now it is simpler to error out right away. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Unclutter handle_node by introducing have_props varJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible for a path node in an SVN-format dump file to leave out the properties section. svn-fe handles this by carrying over the properties (in particular, file type) from the old version of that node. To support this, handle_node tests several times whether a Prop-content-length field is present. Ancient Subversion actually leaves out the Prop-content-length field even for nodes with properties, so that's not quite the right check. Besides, this detail of mechanism is distracting when the question at hand is instead what content the new node should have. So introduce a local have_props variable. The semantics are the same as before; the adaptations to support ancient streams that leave out the prop-content-length can wait until someone needs them. Signed-off-by: Jonathan Nieder <jrnieer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Eliminate node_ctx.mark globalJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mark variable is only used in handle_node(). Its life is very short and simple: first, a new mark number is allocated if this node has text attached, then that mark is recorded in the in-core tree being built up, and lastly the mark is communicated to fast-import in the stream along with the associated text. A new reader may worry about interaction with other code, especially since mark is not initialized to zero in handle_node() itself. Disperse such worries by making it local. No functional change intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Eliminate node_ctx.srcRev globalJonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | The srcRev variable is only used in handle_node(); its purpose is to hold the old mode for a path, to only be used if properties are not being changed. Narrow its scope to make its meaningful lifetime more obvious. No functional change intended. Add some tests as a sanity-check for the simplest case (no renames). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Check for errors from open()Jonathan Nieder2010-11-24
| | | | | | | | | | | | | | | | test-svn-fe segfaults when passed a bogus path. Simplify debugging by exiting with a meaningful error message instead. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * vcs-svn: Allow simple v3 dumps (no deltas yet)David Barr2010-11-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the dumpfile version 1 days, the Subversion dump format gained some new fields: - a unique identifier for the repository (version 2 format) - whether the text and properties for a node should be interpreted as deltas - checksums for a delta's preimage - SHA-1 sums as alternatives to the existing MD5 checksums for copy source and the payload (delta). For now what is relevant to us is the Text-delta and Prop-delta fields, since not noticing these causes a dump file to be misinterpreted (see the previous commit). [jn: with tests] Signed-off-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | vcs-svn: teach line_buffer about temporary filesJonathan Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | Based-on-patch-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
* | vcs-svn: allow character-oriented inputJonathan Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-oriented inputJonathan Nieder2011-02-26
| | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | | | 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 filesJonathan Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | 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 a strbufJonathan Nieder2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-26
| | | | | | | | | | | | | | | | 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 Barr2011-02-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Nieder2011-02-22
| | | | | | | | | | 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 Nieder2011-02-22
| | | | | | | | | | Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2011-02-21
|\ \ | | | | | | | | | | | | * maint: Documentation: clarify -u<mode> option defaults
| * | Documentation: clarify -u<mode> option defaultsClemens Buchacher2011-02-21
| | | | | | | | | | | | | | | Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2011-02-21
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * 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ð Bjarmason2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 --debug --immediateÆvar Arnfjörð Bjarmason2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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ð Bjarmason2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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ð Bjarmason2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Hamano2011-02-16
|\ \ \ | |/ / | | | | | | | | | * maint: parse_tag_buffer(): do not prefixcmp() out of range
| * | Merge branch 'maint-1.7.3' into maintJunio C Hamano2011-02-16
| |\ \ | | | | | | | | | | | | * maint-1.7.3:
| | * \ Merge branch 'maint-1.7.2' into maint-1.7.3Junio C Hamano2011-02-16
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | * maint-1.7.2: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command