1. 24 Jun, 2017 1 commit
  2. 29 Sep, 2016 1 commit
  3. 22 Feb, 2016 1 commit
  4. 24 Feb, 2014 1 commit
    • Kirill Smelkov's avatar
      diffcore-order: export generic ordering interface · 1df4320f
      Kirill Smelkov authored
      diffcore_order() interface only accepts a queue of `struct
      diff_filepair`.
      
      In the next patches, we'll want to order `struct combine_diff_path`
      by path, so let's first rework diffcore-order to also provide
      generic low-level interface for ordering arbitrary objects, provided
      they have path accessors.
      
      The new interface is:
      
          - `struct obj_order`    for describing objects to ordering routine, and
          - order_objects()       for actually doing the ordering work.
      Signed-off-by: 's avatarKirill Smelkov <kirr@mns.spb.ru>
      Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
      1df4320f
  5. 20 Feb, 2014 1 commit
  6. 19 Dec, 2013 1 commit
    • Samuel Bronson's avatar
      diff: let "git diff -O" read orderfile from any file and fail properly · a21bae33
      Samuel Bronson authored
      The -O flag really shouldn't silently fail to do anything when given
      a path that it can't read from.
      
      However, it should be able to read from un-mmappable files, such as:
      
       * pipes/fifos
      
       * /dev/null:  It's a character device (at least on Linux)
      
       * ANY empty file:
      
         Quoting Linux mmap(2), "SUSv3 specifies that mmap() should fail if
         length is 0.  However, in kernels before 2.6.12, mmap() succeeded in
         this case: no mapping was created and the call returned addr.  Since
         kernel 2.6.12, mmap() fails with the error EINVAL for this case."
      
      We especially want "-O/dev/null" to work, since we will be documenting
      it as the way to cancel "diff.orderfile" when we add that.
      
      (Note: "-O/dev/null" did have the right effect, since the existing error
      handling essentially worked out to "silently ignore the orderfile".  But
      this was probably more coincidence than anything else.)
      
      So, lets toss all of that logic to get the file mmapped and just use
      strbuf_read_file() instead, which gives us decent error handling
      practically for free.
      Signed-off-by: Samuel Bronson's avatarSamuel Bronson <naesten@gmail.com>
      Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
      a21bae33
  7. 16 Dec, 2013 1 commit
  8. 19 Sep, 2007 1 commit
  9. 07 Mar, 2007 1 commit
    • Shawn O. Pearce's avatar
      Cast 64 bit off_t to 32 bit size_t · dc49cd76
      Shawn O. Pearce authored
      Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
      This implies that we are able to access and work on files whose
      maximum length is around 2^63-1 bytes, but we can only malloc or
      mmap somewhat less than 2^32-1 bytes of memory.
      
      On such a system an implicit conversion of off_t to size_t can cause
      the size_t to wrap, resulting in unexpected and exciting behavior.
      Right now we are working around all gcc warnings generated by the
      -Wshorten-64-to-32 option by passing the off_t through xsize_t().
      
      In the future we should make xsize_t on such problematic platforms
      detect the wrapping and die if such a file is accessed.
      Signed-off-by: 's avatarShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: 's avatarJunio C Hamano <junkio@cox.net>
      dc49cd76
  10. 20 Dec, 2006 1 commit
    • Junio C Hamano's avatar
      simplify inclusion of system header files. · 85023577
      Junio C Hamano authored
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: 's avatarJunio C Hamano <junkio@cox.net>
      85023577
  11. 20 Jun, 2006 1 commit
  12. 27 Dec, 2005 1 commit
  13. 30 Jul, 2005 1 commit
    • Pavel Roskin's avatar
      [PATCH] mmap error handling · e35f9824
      Pavel Roskin authored
      I have reviewed all occurrences of mmap() in git and fixed three types
      of errors/defects:
      
      1) The result is not checked.
      2) The file descriptor is closed if mmap() succeeds, but not when it
      fails.
      3) Various casts applied to -1 are used instead of MAP_FAILED, which is
      specifically defined to check mmap() return value.
      
      [jc: This is a second round of Pavel's patch.  He fixed up the problem
      that close() potentially clobbering the errno from mmap, which
      the first round had.]
      Signed-off-by: Pavel Roskin's avatarPavel Roskin <proski@gnu.org>
      Signed-off-by: 's avatarJunio C Hamano <junkio@cox.net>
      e35f9824
  14. 31 May, 2005 1 commit