Permalink
Commits on May 17, 2012
  1. README.textile: changes from git v1.7.10.2 are merged

    barrbrain committed May 17, 2012
    Signed-off-by: David Barr <davidbarr@google.com>
  2. Merge git_v1.7.10.2:contrib/svn-fe into master

    barrbrain committed May 17, 2012
    Conflicts:
    	contrib/svn-fe/svn-fe.c
    	contrib/svn-fe/svn-fe.txt
  3. Merge git_v1.7.10.2:vcs-svn into master

    barrbrain committed May 17, 2012
    Conflicts:
    	vcs-svn/fast_export.c
    	vcs-svn/fast_export.h
    	vcs-svn/line_buffer.c
    	vcs-svn/line_buffer.h
    	vcs-svn/line_buffer.txt
    	vcs-svn/repo_tree.c
    	vcs-svn/repo_tree.h
    	vcs-svn/sliding_window.c
    	vcs-svn/sliding_window.h
    	vcs-svn/svndiff.c
    	vcs-svn/svndiff.h
    	vcs-svn/svndump.c
    	vcs-svn/svndump.h
  4. vcs-svn: add warning and die_errno to compat-util

    barrbrain committed May 17, 2012
    Signed-off-by: David Barr <davidbarr@google.com>
  5. compat: restore needed functions in strbuf

    barrbrain committed May 17, 2012
    Downstream changes depend on strbuf_swap(), strbuf_remove() and strbuf_addstr().
    
    Signed-off-by: David Barr <davidbarr@google.com>
  6. compat: add quote.c from git 1.7.10.2

    barrbrain committed May 17, 2012
    Downstream changes depend on quote_c_style().
    
    Signed-off-by: David Barr <davidbarr@google.com>
  7. README.textile: reflect downstream effort

    barrbrain committed May 17, 2012
    Signed-off-by: David Barr <davidbarr@google.com>
  8. compat: separate the compatibility library

    barrbrain committed May 17, 2012
    This is to make licensing easier to follow.
    
    Signed-off-by: David Barr <davidbarr@google.com>
  9. contrib/svn-fe: separate the front-end

    barrbrain committed May 17, 2012
    This is to line up with git.git and facilitate upstreaming from there.
    
    Signed-off-by: David Barr <davidbarr@google.com>
  10. vcs-svn: separate the core library

    barrbrain committed May 17, 2012
    This is to line up with git.git and facilitate upstreaming from there.
    
    Signed-off-by: David Barr <davidbarr@google.com>
Commits on Mar 28, 2012
  1. correct spelling: an URL -> a URL

    meyering authored and gitster committed Mar 28, 2012
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 2, 2012
  1. vcs-svn: suppress a -Wtype-limits warning

    jrn authored and gitster committed Feb 2, 2012
    On 32-bit architectures with 64-bit file offsets, gcc 4.3 and earlier
    produce the following warning:
    
    	    CC vcs-svn/sliding_window.o
    	vcs-svn/sliding_window.c: In function `check_overflow':
    	vcs-svn/sliding_window.c:36: warning: comparison is always false \
    	    due to limited range of data type
    
    The warning appears even when gcc is run without any warning flags
    (this is gcc bug 12963).  In later versions the same warning can be
    reproduced with -Wtype-limits, which is implied by -Wextra.
    
    On 64-bit architectures it really is possible for a size_t not to be
    representable as an off_t so the check this is warning about is not
    actually redundant.  But even false positives are distracting.  Avoid
    the warning by making the "len" argument to check_overflow a
    uintmax_t; no functional change intended.
    
    Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. vcs-svn: allow import of > 4GiB files

    jrn authored and gitster committed Feb 2, 2012
    There is no reason in principle that an svn-format dump would not be
    able to represent a file whose length does not fit in a 32-bit
    integer.  Use off_t consistently to represent file lengths (in place
    of using uint32_t in some contexts) so we can handle that.
    
    Most svn-fe code is already ready to do that without this patch and
    passes values of type off_t around.  The type mismatch from stragglers
    was noticed with gcc -Wtype-limits.
    
    While at it, tighten the parsing of the Text-content-length field to
    make sure it is a number and does not overflow, and tighten other
    overflow checks as that value is passed around and manipulated.
    
    Inspired-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. vcs-svn: rename check_overflow arguments for clarity

    Ramsay Jones authored and gitster committed Feb 2, 2012
    Code using the argument names a and b just doesn't look right (not
    sure why!).  Use more explicit names "offset" and "len" to make their
    type and meaning clearer.
    
    Also rename check_overflow() to check_offset_overflow() to clarify
    that we are making sure that "len" bytes beyond "offset" still fits
    the type to represent an offset.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 27, 2012
  1. vcs-svn/svndiff.c: squelch false "unused" warning from gcc

    gitster committed Jan 27, 2012
    Curiously, pre_len given to read_length() does not trigger the same warning
    even though the code structure is the same. Most likely this is because
    read_offset() is used only once and inlining it will make gcc realize that
    it has a chance to do more flow analysis. Alas, the analysis is flawed, so
    it does not help X-<.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Merge branch 'svn-fe' of git://repo.or.cz/git/jrn into jn/svn-fe

    gitster committed Jan 27, 2012
    This simplifies svn-fe a great deal and fulfills a longstanding wish:
    support for dumps with deltas in them, and incremental imports.
    
    The cost is that commandline usage of the svn-fe tool becomes a little
    more complicated since it no longer keeps state itself but instead reads
    blobs back from fast-import in order to copy them between revisions and
    apply deltas to them.
    
    Also removes a couple of custom data structures and replaces them with
    strbufs like other parts of Git.
    
    * 'svn-fe' of git://repo.or.cz/git/jrn: (32 commits)
      vcs-svn: reset first_commit_done in fast_export_init
      vcs-svn: do not initialize report_buffer twice
      vcs-svn: avoid hangs from corrupt deltas
      vcs-svn: guard against overflow when computing preimage length
      vcs-svn: cap number of bytes read from sliding view
      test-svn-fe: split off "test-svn-fe -d" into a separate function
      vcs-svn: implement text-delta handling
      vcs-svn: let deltas use data from preimage
      vcs-svn: let deltas use data from postimage
      vcs-svn: verify that deltas consume all inline data
      vcs-svn: implement copyfrom_data delta instruction
      vcs-svn: read instructions from deltas
      vcs-svn: read inline data from deltas
      vcs-svn: read the preimage when applying deltas
      vcs-svn: parse svndiff0 window header
      vcs-svn: skeleton of an svn delta parser
      vcs-svn: make buffer_read_binary API more convenient
      vcs-svn: learn to maintain a sliding view of a file
      Makefile: list one vcs-svn/xdiff object or header per line
      vcs-svn: avoid using ls command twice
      ...
    
    Conflicts:
    	Makefile
    	contrib/svn-fe/svn-fe.txt
Commits on Dec 21, 2011
  1. Fix a bitwise negation assignment issue spotted by Sun Studio

    avar authored and gitster committed Dec 21, 2011
    Change direct and indirect assignments of the bitwise negation of 0 to
    uint32_t variables to have a "U" suffix. I.e. ~0U instead of ~0. This
    eliminates warnings under Sun Studio 12 Update 1:
    
        "vcs-svn/string_pool.c", line 11: warning: initializer will be sign-extended: -1 (E_INIT_SIGN_EXTEND)
        "vcs-svn/string_pool.c", line 81: warning: initializer will be sign-extended: -1 (E_INIT_SIGN_EXTEND)
        "vcs-svn/repo_tree.c", line 112: warning: initializer will be sign-extended: -1 (E_INIT_SIGN_EXTEND)
        "vcs-svn/repo_tree.c", line 112: warning: initializer will be sign-extended: -1 (E_INIT_SIGN_EXTEND)
        "test-treap.c", line 34: warning: initializer will be sign-extended: -1 (E_INIT_SIGN_EXTEND)
    
    The semantics are still the same as demonstrated by this program:
    
        $ cat test.c && make test && ./test
        #include <stdio.h>
        #include <stdint.h>
    
        int main(void)
        {
            uint32_t foo = ~0;
            uint32_t bar = ~0U;
    
            printf("foo = <%u> bar = <%u>\n", foo, bar);
    
            return 0;
        }
        cc     test.c   -o test
        "test.c", line 5: warning: initializer will be sign-extended: -1
        foo = <4294967295> bar = <4294967295>
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 23, 2011
  1. vcs-svn: reset first_commit_done in fast_export_init

    divanorama authored and jrn committed Jun 23, 2011
    first_commit_done has zero as a default value, but it
    is not reset back to zero in fast_export_init.
    
    Reset it back to zero so that each export will have
    proper initial state.
    
    Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Commits on Jun 21, 2011
  1. vcs-svn: do not initialize report_buffer twice

    divanorama authored and jrn committed Jun 20, 2011
    When importing from a dump with deltas, first fast_export_init calls
    buffer_fdinit, and then init_report_buffer calls fdopen once again
    when processing the first delta.  The second initialization is
    redundant and leaks a FILE *.
    
    Remove the redundant on-demand initialization to fix this.
    Initializing directly in fast_export_init is simpler and lets the
    caller pass an int specifying which fd to use instead of hard-coding
    REPORT_FILENO.
    
    Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Commits on Jun 15, 2011
  1. vcs-svn: avoid hangs from corrupt deltas

    jrn committed May 27, 2011
    A corrupt Subversion-format delta can request reads past the end of
    the preimage.  Set sliding_view::max_off so such corruption is caught
    when it appears rather than blocking in an impossible-to-fulfill
    read() when input is coming from a socket or pipe.
    
    Inspired-by: Ramkumar Ramachandra <artagnon@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
  2. vcs-svn: guard against overflow when computing preimage length

    jrn committed May 27, 2011
    Signed integer overflow produces undefined behavior in C and off_t is
    a signed type.  For predictable behavior, add some checks to protect
    in advance against overflow.
    
    On 32-bit systems ftell as called by buffer_tmpfile_prepare_to_read
    is likely to fail with EOVERFLOW when reading the corresponding
    postimage, and this patch does not fix that.  So it's more of a
    futureproofing measure than a complete fix.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
  3. Merge branch 'db/delta-applier' into db/text-delta

    jrn committed Jun 15, 2011
    * db/delta-applier:
      vcs-svn: cap number of bytes read from sliding view
      test-svn-fe: split off "test-svn-fe -d" into a separate function
  4. vcs-svn: cap number of bytes read from sliding view

    jrn committed May 27, 2011
    Introduce a "max_off" field in struct sliding_view, roughly
    representing a maximum number of bytes that can be read from "file".
    If it is set to a nonnegative integer, a call to move_window()
    attempting to put the right endpoint beyond that offset will return
    an error instead.
    
    The idea is to use this when applying Subversion-format deltas to
    prevent reads past the end of the preimage (which has known length).
    Without such a check, corrupt deltas would cause svn-fe to block
    indefinitely when data in the input pipe is exhausted.
    
    Inspired-by: Ramkumar Ramachandra <artagnon@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Commits on May 26, 2011
  1. vcs-svn: implement text-delta handling

    barrbrain authored and jrn committed Mar 19, 2011
    Handle input in Subversion's dumpfile format, version 3.  This is the
    format produced by "svnrdump dump" and "svnadmin dump --deltas", and
    the main difference between v3 dumpfiles and the dumpfiles already
    handled is that these can include nodes whose properties and text are
    expressed relative to some other node.
    
    To handle such nodes, we find which node the text and properties are
    based on, handle its property changes, use the cat-blob command to
    request the basis blob from the fast-import backend, use the
    svndiff0_apply() helper to apply the text delta on the fly, writing
    output to a temporary file, and then measure that postimage file's
    length and write its content to the fast-import stream.
    
    The temporary postimage file is shared between delta-using nodes to
    avoid some file system overhead.
    
    The svn-fe interface needs to be more complicated to accomodate the
    backward flow of information from the fast-import backend to svn-fe.
    The backflow fd is not needed when parsing streams without deltas,
    though, so existing scripts using svn-fe on v2 dumps should
    continue to work.
    
    NEEDSWORK: generalize interface so caller sets the backflow fd, close
    temporary file before exiting
    
    Signed-off-by: David Barr <david.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>
  2. vcs-svn: implement text-delta handling

    barrbrain authored and jrn committed Mar 19, 2011
    Handle input in Subversion's dumpfile format, version 3.  This is the
    format produced by "svnrdump dump" and "svnadmin dump --deltas", and
    the main difference between v3 dumpfiles and the dumpfiles already
    handled is that these can include nodes whose properties and text are
    expressed relative to some other node.
    
    To handle such nodes, we find which node the text and properties are
    based on, handle its property changes, use the cat-blob command to
    request the basis blob from the fast-import backend, use the
    svndiff0_apply() helper to apply the text delta on the fly, writing
    output to a temporary file, and then measure that postimage file's
    length and write its content to the fast-import stream.
    
    The temporary postimage file is shared between delta-using nodes to
    avoid some file system overhead.
    
    The svn-fe interface needs to be more complicated to accomodate the
    backward flow of information from the fast-import backend to svn-fe.
    The backflow fd is not needed when parsing streams without deltas,
    though, so existing scripts using svn-fe on v2 dumps should
    continue to work.
    
    NEEDSWORK: generalize interface so caller sets the backflow fd, close
    temporary file before exiting
    
    Signed-off-by: David Barr <david.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>
  3. Merge branch 'db/delta-applier' into db/text-delta

    jrn committed May 26, 2011
    * db/delta-applier:
      vcs-svn: let deltas use data from preimage
      vcs-svn: let deltas use data from postimage
      vcs-svn: verify that deltas consume all inline data
      vcs-svn: implement copyfrom_data delta instruction
      vcs-svn: read instructions from deltas
      vcs-svn: read inline data from deltas
      vcs-svn: read the preimage when applying deltas
      vcs-svn: parse svndiff0 window header
      vcs-svn: skeleton of an svn delta parser
      vcs-svn: make buffer_read_binary API more convenient
      vcs-svn: learn to maintain a sliding view of a file
      Makefile: list one vcs-svn/xdiff object or header per line
    
    Conflicts:
    	Makefile
    	vcs-svn/LICENSE
  4. Merge branch 'db/svn-fe-code-purge' into svn-fe

    jrn committed May 26, 2011
    * db/svn-fe-code-purge:
      vcs-svn: drop obj_pool
      vcs-svn: drop treap
      vcs-svn: drop string_pool
      vcs-svn: pass paths through to fast-import
    
    Conflicts:
    	vcs-svn/fast_export.c
    	vcs-svn/fast_export.h
    	vcs-svn/repo_tree.c
    	vcs-svn/repo_tree.h
    	vcs-svn/string_pool.c
    	vcs-svn/svndump.c
    	vcs-svn/trp.txt
  5. Merge branch 'db/vcs-svn-incremental' into svn-fe

    jrn committed May 26, 2011
    This teaches svn-fe to incrementally import into an existing
    repository (at last!) at the expense of less convenient UI.  Think of
    it as growing pains.  This opens the door to many excellent things,
    and it would be a bad idea to discourage people from building on it
    for much longer.
    
    * db/vcs-svn-incremental:
      vcs-svn: avoid using ls command twice
      vcs-svn: use mark from previous import for parent commit
      vcs-svn: handle filenames with dq correctly
      vcs-svn: quote paths correctly for ls command
      vcs-svn: eliminate repo_tree structure
      vcs-svn: add a comment before each commit
      vcs-svn: save marks for imported commits
      vcs-svn: use higher mark numbers for blobs
      vcs-svn: set up channel to read fast-import cat-blob response
    
    Conflicts:
    	t/t9010-svn-fe.sh
    	vcs-svn/fast_export.c
    	vcs-svn/fast_export.h
    	vcs-svn/repo_tree.c
    	vcs-svn/svndump.c
Commits on Apr 27, 2011
  1. Merge branch 'rj/sparse'

    gitster committed Apr 27, 2011
    * rj/sparse:
      sparse: Fix some "symbol not declared" warnings
      sparse: Fix errors due to missing target-specific variables
      sparse: Fix an "symbol 'merge_file' not decared" warning
      sparse: Fix an "symbol 'format_subject' not declared" warning
      sparse: Fix some "Using plain integer as NULL pointer" warnings
      sparse: Fix an "symbol 'cmd_index_pack' not declared" warning
      Makefile: Use cgcc rather than sparse in the check target
Commits on Apr 22, 2011
  1. sparse: Fix some "symbol not declared" warnings

    Ramsay Jones authored and gitster committed Apr 7, 2011
    In particular, sparse issues the "symbol 'a_symbol' was not declared.
    Should it be static?" warnings for the following symbols:
    
        attr.c:468:12: 'git_etc_gitattributes'
        attr.c:476:5:  'git_attr_system'
        vcs-svn/svndump.c:282:6: 'svndump_read'
        vcs-svn/svndump.c:417:5: 'svndump_init'
        vcs-svn/svndump.c:432:6: 'svndump_deinit'
        vcs-svn/svndump.c:445:6: 'svndump_reset'
    
    The symbols in attr.c only require file scope, so we add the static
    modifier to their declaration.
    
    The symbols in vcs-svn/svndump.c are external symbols, and they
    already have extern declarations in the "svndump.h" header file,
    so we simply include the header in svndump.c.
    
    Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 13, 2011
  1. remove doubled words, e.g., s/to to/to/, and fix related typos

    meyering authored and gitster committed Apr 13, 2011
    I found that some doubled words had snuck back into projects from which
    I'd already removed them, so now there's a "syntax-check" makefile rule in
    gnulib to help prevent recurrence.
    
    Running the command below spotted a few in git, too:
    
      git ls-files | xargs perl -0777 -n \
        -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt])\s+\1\b/gims)' \
        -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g;' \
        -e 'print "$ARGV:$n:$v\n"}'
    
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 30, 2011
  1. Merge branch 'svn-fe' of git://repo.or.cz/git/jrn

    gitster committed Mar 30, 2011
    * 'svn-fe' of git://repo.or.cz/git/jrn:
      tests: kill backgrounded processes more robustly
      vcs-svn: a void function shouldn't try to return something
      tests: make sure input to sed is newline terminated
      vcs-svn: add missing cast to printf argument
Commits on Mar 29, 2011
  1. vcs-svn: a void function shouldn't try to return something

    mfwitten authored and jrn committed Mar 29, 2011
    As v1.7.4-rc0~184 (2010-10-04) and C99 §6.8.6.4.1 remind us, standard
    C does not permit returning an expression of type void, even for a
    tail call.
    
    Noticed with gcc -pedantic:
    
     vcs-svn/svndump.c: In function 'handle_node':
     vcs-svn/svndump.c:213:3: warning: ISO C forbids 'return' with expression,
      in function returning void [-pedantic]
    
    [jn: with simplified log message]
    
    Signed-off-by: Michael Witten <mfwitten@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Commits on Mar 28, 2011
  1. vcs-svn: add missing cast to printf argument

    jrn authored and gitster committed Mar 28, 2011
    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>
  2. vcs-svn: let deltas use data from preimage

    jrn committed Oct 13, 2010
    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>