1. 16 Nov, 2009 1 commit
  2. 01 May, 2009 1 commit
  3. 20 Feb, 2009 1 commit
  4. 10 Feb, 2009 1 commit
  5. 05 Jan, 2009 1 commit
  6. 12 Oct, 2008 2 commits
  7. 16 Sep, 2008 1 commit
  8. 31 Aug, 2008 2 commits
  9. 05 Aug, 2008 1 commit
    • Junio C Hamano's avatar
      update-index: refuse to add working tree items beyond symlinks · 806d13b1
      Junio C Hamano authored
      When "sym" is a symbolic link that is inside the working tree, and it
      points at a directory "dir" that has "path" in it, "update-index --add
      sym/path" used to mistakenly add "sym/path" as if "sym" were a normal
      directory.
      
      "git apply", "git diff" and "git merge" have been taught about this issue
      some time ago, but "update-index" and "add" have been left ignorant for
      too long.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      806d13b1
  10. 13 Jul, 2008 1 commit
    • Stephan Beyer's avatar
      Make usage strings dash-less · 1b1dd23f
      Stephan Beyer authored
      When you misuse a git command, you are shown the usage string.
      But this is currently shown in the dashed form.  So if you just
      copy what you see, it will not work, when the dashed form
      is no longer supported.
      
      This patch makes git commands show the dash-less version.
      
      For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
      generates a dash-less usage string now.
      Signed-off-by: default avatarStephan Beyer <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1b1dd23f
  11. 15 May, 2008 1 commit
  12. 14 May, 2008 1 commit
  13. 21 Jan, 2008 1 commit
    • Linus Torvalds's avatar
      Make on-disk index representation separate from in-core one · 7a51ed66
      Linus Torvalds authored
      This converts the index explicitly on read and write to its on-disk
      format, allowing the in-core format to contain more flags, and be
      simpler.
      
      In particular, the in-core format is now host-endian (as opposed to the
      on-disk one that is network endian in order to be able to be shared
      across machines) and as a result we can dispense with all the
      htonl/ntohl on accesses to the cache_entry fields.
      
      This will make it easier to make use of various temporary flags that do
      not exist in the on-disk format.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      7a51ed66
  14. 16 Jan, 2008 1 commit
  15. 29 Sep, 2007 1 commit
  16. 21 Sep, 2007 1 commit
    • Pierre Habouzit's avatar
      Rework unquote_c_style to work on a strbuf. · 7fb1011e
      Pierre Habouzit authored
      If the gain is not obvious in the diffstat, the resulting code is more
      readable, _and_ in checkout-index/update-index we now reuse the same buffer
      to unquote strings instead of always freeing/mallocing.
      
      This also is more coherent with the next patch that reworks quoting
      functions.
      
      The quoting function is also made more efficient scanning for backslashes
      and treating portions of strings without a backslash at once.
      Signed-off-by: default avatarPierre Habouzit <[email protected]>
      7fb1011e
  17. 18 Sep, 2007 1 commit
  18. 17 Sep, 2007 1 commit
  19. 14 Sep, 2007 1 commit
    • Junio C Hamano's avatar
      Simplify cache API · 09d5dc32
      Junio C Hamano authored
      Earlier, add_file_to_index() invalidated the path in the cache-tree
      but remove_file_from_cache() did not, and the user of the latter
      needed to invalidate the entry himself.  This led to a few bugs due to
      missed invalidate calls already.  This patch makes the management of
      cache-tree less error prone by making more invalidate calls from lower
      level cache API functions.
      
      The rules are:
      
       - If you are going to write the index, you should either maintain
         cache_tree correctly.
      
         - If you cannot, alternatively you can remove the entire cache_tree
           by calling cache_tree_free() before you call write_cache().
      
         - When you modify the index, cache_tree_invalidate_path() should be
           called with the path you are modifying, to discard the entry from
           the cache-tree structure.
      
       - The following cache API functions exported from read-cache.c (and
         the macro whose names have "cache" instead of "index")
         automatically call cache_tree_invalidate_path() for you:
      
         - remove_file_from_index();
         - add_file_to_index();
         - add_index_entry();
      
         You can modify the index bypassing the above API functions
         (e.g. find an existing cache entry from the index and modify it in
         place).  You need to call cache_tree_invalidate_path() yourself in
         such a case.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      09d5dc32
  20. 10 Sep, 2007 1 commit
    • Pierre Habouzit's avatar
      Strbuf API extensions and fixes. · f1696ee3
      Pierre Habouzit authored
        * Add strbuf_rtrim to remove trailing spaces.
        * Add strbuf_insert to insert data at a given position.
        * Off-by one fix in strbuf_addf: strbuf_avail() does not counts the final
          \0 so the overflow test for snprintf is the strict comparison. This is
          not critical as the growth mechanism chosen will always allocate _more_
          memory than asked, so the second test will not fail. It's some kind of
          miracle though.
        * Add size extension hints for strbuf_init and strbuf_read. If 0, default
          applies, else:
            + initial buffer has the given size for strbuf_init.
            + first growth checks it has at least this size rather than the
              default 8192.
      Signed-off-by: default avatarPierre Habouzit <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      f1696ee3
  21. 10 Aug, 2007 1 commit
    • Linus Torvalds's avatar
      Fix "git commit directory/" performance anomaly · 22631473
      Linus Torvalds authored
      This trivial patch avoids re-hashing files that are already clean in the
      index. This mirrors what commit 0781b8a9
      did for "git add .", only for "git commit ." instead.
      
      This improves the cold-cache case immensely, since we don't need to bring
      in all the file contents, just the index and any files dirty in the index.
      
      Before:
      
      	[[email protected] linux]$ time git commit .
      	real    1m49.537s
      	user    0m3.892s
      	sys     0m2.432s
      
      After:
      
      	[[email protected] linux]$ time git commit .
      	real    0m14.273s
      	user    0m1.312s
      	sys     0m0.516s
      
      (both after doing a "echo 3 > /proc/sys/vm/drop_caches" to get cold-cache
      behaviour - even with the index optimization git still has to "lstat()"
      all the files, so with a truly cold cache, bringing all the inodes in
      will take some time).
      
      [jc: trivial "return 0;" fixed]
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      22631473
  22. 22 May, 2007 1 commit
  23. 19 Apr, 2007 1 commit
  24. 15 Apr, 2007 1 commit
    • Jim Meyering's avatar
      sscanf/strtoul: parse integers robustly · 61d6ed13
      Jim Meyering authored
      * builtin-grep.c (strtoul_ui): Move function definition from here, to...
      * git-compat-util.h (strtoul_ui): ...here, with an added "base" parameter.
      * builtin-grep.c (cmd_grep): Update use of strtoul_ui to include base, "10".
      * builtin-update-index.c (read_index_info): Diagnose an invalid mode integer
      that is out of range or merely larger than INT_MAX.
      (cmd_update_index): Use strtoul_ui, not sscanf.
      * convert-objects.c (write_subdirectory): Likewise.
      Signed-off-by: default avatarJim Meyering <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      61d6ed13
  25. 12 Apr, 2007 2 commits
    • Linus Torvalds's avatar
      Teach git-update-index about gitlinks · e011054b
      Linus Torvalds authored
      I finally got around to looking at Alex' patch to teach update-index about
      gitlinks too, so that "git commit -a" along with any other explicit
      update-index scripts can work.
      
      I don't think there was anything wrong with Alex' patch, but the code he
      patched I felt was just so ugly that the added cases just pushed it over
      the edge. Especially as I don't think that patch necessarily did the right
      thing for a gitlink entry that already existed in the index, but that
      wasn't actually a real git repository in the working tree (just an empty
      subdirectory or a non-git snapshot because it hadn't wanted to track that
      particular subproject).
      
      So I ended up deciding to clean up the git-update-index handling the same
      way I tackled the directory traversal used by git-add earlier: by
      splitting the different cases up into multiple smaller functions, and just
      making the code easier to read (and adding more comments about the
      different cases).
      
      So this replaces the old "process_file()" with a new "process_path()"
      function that then just calls out to different helper functions depending
      on what kind of path it is. Processing a nondirectory ends up being just
      one of the simpler cases.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e011054b
    • Jim Meyering's avatar
      sscanf/strtoul: parse integers robustly · 6aead43d
      Jim Meyering authored
      * builtin-grep.c (strtoul_ui): Move function definition from here, to...
      * git-compat-util.h (strtoul_ui): ...here, with an added "base" parameter.
      * builtin-grep.c (cmd_grep): Update use of strtoul_ui to include base, "10".
      * builtin-update-index.c (read_index_info): Diagnose an invalid mode integer
      that is out of range or merely larger than INT_MAX.
      (cmd_update_index): Use strtoul_ui, not sscanf.
      * convert-objects.c (write_subdirectory): Likewise.
      Signed-off-by: default avatarJim Meyering <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      6aead43d
  26. 05 Apr, 2007 1 commit
  27. 04 Apr, 2007 1 commit
    • Junio C Hamano's avatar
      _GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index file. · 30ca07a2
      Junio C Hamano authored
      When defined, this allows plumbing commands that update the
      index (add, apply, checkout-index, merge-recursive, mv,
      read-tree, rm, update-index, and write-tree) to write their
      resulting index to an alternative index file while holding a
      lock to the original index file.  With this, git-commit that
      jumps the index does not have to make an extra copy of the index
      file, and more importantly, it can do the update while holding
      the lock on the index.
      
      However, I think the interface to let an environment variable
      specify the output is a mistake, as shown in the documentation.
      If a curious user has the environment variable set to something
      other than the file GIT_INDEX_FILE points at, almost everything
      will break.  This should instead be a command line parameter to
      tell these plumbing commands to write the result in the named
      file, to prevent stupid mistakes.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      30ca07a2
  28. 03 Mar, 2007 1 commit
    • Johannes Sixt's avatar
      Add core.symlinks to mark filesystems that do not support symbolic links. · 78a8d641
      Johannes Sixt authored
      Some file systems that can host git repositories and their working copies
      do not support symbolic links. But then if the repository contains a symbolic
      link, it is impossible to check out the working copy.
      
      This patch enables partial support of symbolic links so that it is possible
      to check out a working copy on such a file system.  A new flag
      core.symlinks (which is true by default) can be set to false to indicate
      that the filesystem does not support symbolic links. In this case, symbolic
      links that exist in the trees are checked out as small plain files, and
      checking in modifications of these files preserve the symlink property in
      the database (as long as an entry exists in the index).
      
      Of course, this does not magically make symbolic links work on such defective
      file systems; hence, this solution does not help if the working copy relies
      on that an entry is a real symbolic link.
      Signed-off-by: default avatarJohannes Sixt <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      78a8d641
  29. 22 Feb, 2007 1 commit
  30. 17 Feb, 2007 1 commit
    • Junio C Hamano's avatar
      Do not take mode bits from index after type change. · 185c975f
      Junio C Hamano authored
      When we do not trust executable bit from lstat(2), we copied
      existing ce_mode bits without checking if the filesystem object
      is a regular file (which is the only thing we apply the "trust
      executable bit" business) nor if the blob in the index is a
      regular file (otherwise, we should do the same as registering a
      new regular file, which is to default non-executable).
      
      Noticed by Johannes Sixt.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      185c975f
  31. 31 Jan, 2007 1 commit
  32. 23 Nov, 2006 1 commit
  33. 27 Sep, 2006 1 commit
  34. 22 Sep, 2006 1 commit
  35. 24 Aug, 2006 1 commit
  36. 23 Aug, 2006 1 commit
    • Shawn Pearce's avatar
      Convert memcpy(a,b,20) to hashcpy(a,b). · e702496e
      Shawn Pearce authored
      This abstracts away the size of the hash values when copying them
      from memory location to memory location, much as the introduction
      of hashcmp abstracted away hash value comparsion.
      
      A few call sites were using char* rather than unsigned char* so
      I added the cast rather than open hashcpy to be void*.  This is a
      reasonable tradeoff as most call sites already use unsigned char*
      and the existing hashcmp is also declared to be unsigned char*.
      
      [jc: Splitted the patch to "master" part, to be followed by a
       patch for merge-recursive.c which is not in "master" yet.
      
       Fixed the cast in the latter hunk to combine-diff.c which was
       wrong in the original.
      
       Also converted ones left-over in combine-diff.c, diff-lib.c and
       upload-pack.c ]
      Signed-off-by: default avatarShawn O. Pearce <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e702496e
  37. 17 Aug, 2006 1 commit