1. 01 6月, 2008 1 次提交
  2. 15 5月, 2008 1 次提交
  3. 29 2月, 2008 1 次提交
  4. 11 11月, 2007 1 次提交
    • N
      fix index-pack with packs >4GB containing deltas on 32-bit machines · a91ef6e7
      Nicolas Pitre 提交于
      This probably hasn't been properly tested before.  Here's a script to
      create a 8GB repo with the necessary characteristics (copy the
      test-genrandom executable from the Git build tree to /tmp first):
      
      -----
      #!/bin/bash
      
      git init
      git config core.compression 0
      
      # create big objects with no deltas
      for i in $(seq -w 1 2 63)
      do
      	echo $i
      	/tmp/test-genrandom $i 268435456 > file_$i
      	git add file_$i
      	rm file_$i
      	echo "file_$i -delta" >> .gitattributes
      done
      
      # create "deltifiable" objects in between big objects
      for i in $(seq -w 2 2 64)
      do
      	echo "$i $i $i" >> grow
      	cp grow file_$i
      	git add file_$i
      	rm file_$i
      done
      rm grow
      
      # create a pack with them
      git commit -q -m "commit of big objects interlaced with small deltas"
      git repack -a -d
      -----
      
      Then clone this repo over the Git protocol.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a91ef6e7
  5. 09 11月, 2007 1 次提交
  6. 06 11月, 2007 1 次提交
    • N
      make display of total transferred more accurate · 218558af
      Nicolas Pitre 提交于
      The throughput display needs a delay period before accounting and
      displaying anything.  Yet it might be called after some amount of data
      has already been transferred.  The display of total data is therefore
      accounted late and therefore smaller than the reality.
      
      Let's call display_throughput() with an absolute amount of transferred
      data instead of a relative number, and let the throughput code find the
      relative amount of data by itself as needed.  This way the displayed
      total is always exact.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      218558af
  7. 02 11月, 2007 1 次提交
  8. 31 10月, 2007 3 次提交
  9. 17 10月, 2007 3 次提交
    • N
      fix for more minor memory leaks · c85228ed
      Nicolas Pitre 提交于
      Now that some pointers have lost their const attribute, we can free their
      associated memory when done with them.  This is more a correctness issue
      about the rule for freeing those pointers which isn't completely trivial
      more than the leak itself which didn't matter as the program is
      exiting anyway.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      c85228ed
    • N
      fix const issues with some functions · 4049b9cf
      Nicolas Pitre 提交于
      Two functions, namely write_idx_file() and open_pack_file(), currently
      return a const pointer.  However that pointer is either a copy of the
      first argument, or set to a malloc'd buffer when that first argument
      is null.  In the later case it is wrong to qualify that pointer as const
      since ownership of the buffer is transferred to the caller to dispose of,
      and obviously the free() function is not meant to be passed const
      pointers.
      
      Making the return pointer not const causes a warning when the first
      argument is returned since that argument is also marked const.
      
      The correct thing to do is therefore to remove the const qualifiers,
      avoiding the need for ugly casts only to silence some warnings.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      4049b9cf
    • N
      more compact progress display · 42e18fbf
      Nicolas Pitre 提交于
      Each progress can be on a single line instead of two.
      
      [sp: Changed "Checking files out" to "Checking out files" at
           Johannes Sixt's suggestion as it better explains the
      	 action that is taking place]
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      42e18fbf
  10. 15 8月, 2007 1 次提交
  11. 27 6月, 2007 1 次提交
  12. 03 6月, 2007 1 次提交
  13. 16 5月, 2007 1 次提交
  14. 03 5月, 2007 1 次提交
  15. 23 4月, 2007 2 次提交
  16. 11 4月, 2007 5 次提交
  17. 04 4月, 2007 1 次提交
  18. 25 3月, 2007 1 次提交
  19. 21 3月, 2007 3 次提交
    • N
      index-pack: more validation checks and cleanups · 9096c660
      Nicolas Pitre 提交于
      When appending objects to a pack, make sure the appended data is really
      what we expect instead of simply loading potentially corrupted objects
      and legitimating them by computing a SHA1 of that corrupt data.
      
      With this the sha1_object() can lose its test_for_collision parameter
      which is now redundent.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9096c660
    • N
      index-pack: use hash_sha1_file() · ce9fbf16
      Nicolas Pitre 提交于
      Use hash_sha1_file() instead of duplicating code to compute object SHA1.
      While at it make it accept a const pointer.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ce9fbf16
    • N
      don't ever allow SHA1 collisions to exist by fetching a pack · 8685da42
      Nicolas Pitre 提交于
      Waaaaaaay back Git was considered to be secure as it never overwrote
      an object it already had.  This was ensured by always unpacking the
      packfile received over the network (both in fetch and receive-pack)
      and our already existing logic to not create a loose object for an
      object we already have.
      
      Lately however we keep "large-ish" packfiles on both fetch and push
      by running them through index-pack instead of unpack-objects.  This
      would let an attacker perform a birthday attack.
      
      How?  Assume the attacker knows a SHA-1 that has two different
      data streams.  He knows the client is likely to have the "good"
      one.  So he sends the "evil" variant to the other end as part of
      a "large-ish" packfile.  The recipient keeps that packfile, and
      indexes it.  Now since this is a birthday attack there is a SHA-1
      collision; two objects exist in the repository with the same SHA-1.
      They have *very* different data streams.  One of them is "evil".
      
      Currently the poor recipient cannot tell the two objects apart,
      short of by examining the timestamp of the packfiles.  But lets
      say the recipient repacks before he realizes he's been attacked.
      We may wind up packing the "evil" version of the object, and deleting
      the "good" one.  This is made *even more likely* by Junio's recent
      rearrange_packed_git patch (b867092f).
      
      It is extremely unlikely for a SHA1 collisions to occur, but if it
      ever happens with a remote (hence untrusted) object we simply must
      not let the fetch succeed.
      
      Normally received packs should not contain objects we already have.
      But when they do we must ensure duplicated objects with the same SHA1
      actually contain the same data.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8685da42
  20. 08 3月, 2007 1 次提交
    • S
      General const correctness fixes · 3a55602e
      Shawn O. Pearce 提交于
      We shouldn't attempt to assign constant strings into char*, as the
      string is not writable at runtime.  Likewise we should always be
      treating unsigned values as unsigned values, not as signed values.
      
      Most of these are very straightforward.  The only exception is the
      (unnecessary) xstrdup/free in builtin-branch.c for the detached
      head case.  Since this is a user-level interactive type program
      and that particular code path is executed no more than once, I feel
      that the extra xstrdup call is well worth the easy elimination of
      this warning.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3a55602e
  21. 28 2月, 2007 1 次提交
  22. 27 2月, 2007 2 次提交
  23. 23 2月, 2007 2 次提交
    • J
      git-bundle: assorted fixes · fa257b05
      Johannes Schindelin 提交于
      This patch fixes issues mentioned by Junio, Nico and Simon:
      
      - I forgot to convert the usage string when removing the "--" from
        the subcommands,
      - a style fix in the bundle_header,
      - use xread() instead of read(),
      - use write_or_die() instead of write(),
      - make the bundle header extensible,
      - fail if the whitespace after a sha1 of a reference is missing,
      - close() the fds passed to a subprocess,
      - in verify_bundle(), do not use "rev-list --stdin", but rather
        pass the revs directly (avoiding a fork()),
      - fix a corrupted comment in show_object(), and
      - fix the size check in index_pack.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      fa257b05
    • J
      Add git-bundle: move objects and references by archive · 2e0afafe
      Johannes Schindelin 提交于
      Some workflows require use of repositories on machines that cannot be
      connected, preventing use of git-fetch / git-push to transport objects and
      references between the repositories.
      
      git-bundle provides an alternate transport mechanism, effectively allowing
      git-fetch and git-pull to operate using sneakernet transport. `git-bundle
      create` allows the user to create a bundle containing one or more branches
      or tags, but with specified basis assumed to exist on the target
      repository. At the receiving end, git-bundle acts like git-fetch-pack,
      allowing the user to invoke git-fetch or git-pull using the bundle file as
      the URL. git-fetch and git-ls-remote determine they have a bundle URL by
      checking that the URL points to a file, but are otherwise unchanged in
      operation with bundles.
      
      The original patch was done by Mark Levedahl <mdl123@verizon.net>.
      
      It was updated to make git-bundle a builtin, and get rid of the tar
      format: now, the first line is supposed to say "# v2 git bundle", the next
      lines either contain a prerequisite ("-" followed by the hash of the
      needed commit), or a ref (the hash of a commit, followed by the name of
      the ref), and finally the pack. As a result, the bundle argument can be
      "-" now.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2e0afafe
  24. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  25. 12 1月, 2007 1 次提交
  26. 09 1月, 2007 2 次提交