1. 19 5月, 2012 1 次提交
  2. 04 5月, 2012 4 次提交
  3. 23 6月, 2011 6 次提交
    • J
      upload-archive: allow user to turn off filters · 7b97730b
      Jeff King 提交于
      Some tar filters may be very expensive to run, so sites do
      not want to expose them via upload-archive. This patch lets
      users configure tar.<filter>.remote to turn them off.
      
      By default, gzip filters are left on, as they are about as
      expensive as creating zip archives.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7b97730b
    • J
      archive: provide builtin .tar.gz filter · 0e804e09
      Jeff King 提交于
      This works exactly as if the user had configured it via:
      
        [tar "tgz"]
      	command = gzip -cn
        [tar "tar.gz"]
      	command = gzip -cn
      
      but since it is so common, it's convenient to have it
      builtin without the user needing to do anything.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0e804e09
    • J
      archive: implement configurable tar filters · 767cf457
      Jeff King 提交于
      It's common to pipe the tar output produce by "git archive"
      through gzip or some other compressor. Locally, this can
      easily be done by using a shell pipe. When requesting a
      remote archive, though, it cannot be done through the
      upload-archive interface.
      
      This patch allows configurable tar filters, so that one
      could define a "tar.gz" format that automatically pipes tar
      output through gzip.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      767cf457
    • J
      archive: pass archiver struct to write_archive callback · 4d7c9898
      Jeff King 提交于
      The current archivers are very static; when you are in the
      write_tar_archive function, you know you are writing a tar.
      However, to facilitate runtime-configurable archivers
      that will share a common write function we need to tell the
      function which archiver was used.
      
      As a convenience, we also provide an opaque data pointer in
      the archiver struct so that individual archivers can put
      something useful there when they register themselves.
      Technically they could just use the "name" field to look in
      an internal map of names to data, but this is much simpler.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4d7c9898
    • J
      archive: refactor list of archive formats · 13e0f88d
      Jeff King 提交于
      Most of the tar and zip code was nicely split out into two
      abstracted files which knew only about their specific
      formats. The entry point to this code was a single "write
      archive" function.
      
      However, as these basic formats grow more complex (e.g., by
      handling multiple file extensions and format names), a
      static list of the entry point functions won't be enough.
      Instead, let's provide a way for the tar and zip code to
      tell the main archive code what they support by registering
      archiver names and functions.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      13e0f88d
    • J
      archive-tar: don't reload default config options · 40e76291
      Jeff King 提交于
      We load our own tar-specific config, and then chain to
      git_default_config. This is pointless, as our caller should
      already have loaded the default config. It also introduces a
      needless inconsistency with the zip archiver, which does not
      look at the config files at all (and therefore relies on the
      caller to have loaded config).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      40e76291
  4. 09 5月, 2009 1 次提交
  5. 13 10月, 2008 1 次提交
  6. 20 7月, 2008 1 次提交
  7. 15 7月, 2008 3 次提交
  8. 10 6月, 2008 1 次提交
  9. 15 5月, 2008 1 次提交
  10. 10 4月, 2008 1 次提交
    • R
      git-archive: ignore prefix when checking file attribute · ac7fa277
      René Scharfe 提交于
      Ulrik Sverdrup noticed that git-archive doesn't correctly apply the attribute
      export-subst when the option --prefix is given, too.
      
      When it checked if a file has the attribute turned on, git-archive would try
      to look up the full path -- including the prefix -- in .gitattributes.  That's
      wrong, as the prefix doesn't need to have any relation to any existing
      directories, tracked or not.
      
      This patch makes git-archive ignore the prefix when looking up if value of the
      attribute export-subst for a file.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ac7fa277
  11. 12 2月, 2008 1 次提交
  12. 21 9月, 2007 1 次提交
  13. 17 9月, 2007 1 次提交
  14. 11 9月, 2007 1 次提交
    • P
      Strbuf API extensions and fixes. · f1696ee3
      Pierre Habouzit 提交于
        * 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: NPierre Habouzit <madcoder@debian.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f1696ee3
  15. 07 9月, 2007 2 次提交
    • P
      Simplify strbuf uses in archive-tar.c using strbuf API · 7a604f16
      Pierre Habouzit 提交于
        This is just cleaner way to deal with strbufs, using its API rather than
      reinventing it in the module (e.g. strbuf_append_string is just the plain
      strbuf_addstr function, and it was used to perform what strbuf_addch does
      anyways).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7a604f16
    • P
      Rework strbuf API and semantics. · b449f4cf
      Pierre Habouzit 提交于
        The gory details are explained in strbuf.h. The change of semantics this
      patch enforces is that the embeded buffer has always a '\0' character after
      its last byte, to always make it a C-string. The offs-by-one changes are all
      related to that very change.
      
        A strbuf can be used to store byte arrays, or as an extended string
      library. The `buf' member can be passed to any C legacy string function,
      because strbuf operations always ensure there is a terminating \0 at the end
      of the buffer, not accounted in the `len' field of the structure.
      
        A strbuf can be used to generate a string/buffer whose final size is not
      really known, and then "strbuf_detach" can be used to get the built buffer,
      and keep the wrapping "strbuf" structure usable for further work again.
      
        Other interesting feature: strbuf_grow(sb, size) ensure that there is
      enough allocated space in `sb' to put `size' new octets of data in the
      buffer. It helps avoiding reallocating data for nothing when the problem the
      strbuf helps to solve has a known typical size.
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b449f4cf
  16. 04 9月, 2007 1 次提交
    • R
      archive: specfile support (--pretty=format: in archive files) · 8460b2fc
      René Scharfe 提交于
      Add support for a new attribute, specfile.  Files marked as being
      specfiles are expanded by git-archive when they are written to an
      archive.  It has no effect on worktree files.  The same placeholders
      as those for the option --pretty=format: of git-log et al. can be
      used.
      
      The attribute is useful for creating auto-updating specfiles.  It is
      limited by the underlying function format_commit_message(), though.
      E.g. currently there is no placeholder for git-describe like output,
      and expanded specfiles can't contain NUL bytes.  That can be fixed
      in format_commit_message() later and will then benefit users of
      git-log, too.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8460b2fc
  17. 22 5月, 2007 1 次提交
  18. 19 5月, 2007 1 次提交
    • R
      git-archive: convert archive entries like checkouts do · 5e6cfc80
      René Scharfe 提交于
      As noted by Johan Herland, git-archive is a kind of checkout and needs
      to apply any checkout filters that might be configured.
      
      This patch adds the convenience function convert_sha1_file which returns
      a buffer containing the object's contents, after converting, if necessary
      (i.e. it's a combination of read_sha1_file and convert_to_working_tree).
      Direct calls to read_sha1_file in git-archive are then replaced by calls
      to convert_sha1_file.
      
      Since convert_sha1_file expects its path argument to be NUL-terminated --
      a convention it inherits from convert_to_working_tree -- the patch also
      changes the path handling in archive-tar.c to always NUL-terminate the
      string.  It used to solely rely on the len field of struct strbuf before.
      
      archive-zip.c already NUL-terminates the path and thus needs no such
      change.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5e6cfc80
  19. 13 5月, 2007 1 次提交
  20. 27 2月, 2007 1 次提交
    • N
      convert object type handling from a string to a number · 21666f1a
      Nicolas Pitre 提交于
      We currently have two parallel notation for dealing with object types
      in the code: a string and a numerical value.  One of them is obviously
      redundent, and the most used one requires more stack space and a bunch
      of strcmp() all over the place.
      
      This is an initial step for the removal of the version using a char array
      found in object reading code paths.  The patch is unfortunately large but
      there is no sane way to split it in smaller parts without breaking the
      system.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      21666f1a
  21. 07 1月, 2007 1 次提交
    • R
      Set default "tar" umask to 002 and owner.group to root.root · f08b3b0e
      René Scharfe 提交于
      In order to make the generated tar files more friendly to users who
      extract them as root using GNU tar and its implied -p option, change
      the default umask to 002 and change the owner name and group name to
      root.  This ensures that a) the extracted files and directories are
      not world-writable and b) that they belong to user and group root.
      
      Before they would have been assigned to a user and/or group named
      git if it existed.  This also answers the question in the removed
      comment: uid=0, gid=0, uname=root, gname=root is exactly what we
      want.
      
      Normal users who let tar apply their umask while extracting are
      only affected if their umask allowed the world to change their
      files (e.g. a umask of zero).  This case is so unlikely and strange
      that we don't need to support it.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f08b3b0e
  22. 21 12月, 2006 1 次提交
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      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: NJunio C Hamano <junkio@cox.net>
      85023577
  23. 25 9月, 2006 2 次提交
  24. 17 9月, 2006 1 次提交
    • R
      git-tar-tree: devolve git-tar-tree into a wrapper for git-archive · 87af29f0
      Rene Scharfe 提交于
      This patch removes the custom tree walker tree_traverse(), and makes
      generate_tar() use write_tar_archive() and the infrastructure provided
      by git-archive instead.
      
      As a kind of side effect, make write_tar_archive() able to handle NULL
      as base directory, as this is what the new and simple generate_tar()
      uses to indicate the absence of a base directory.  This was simpler
      and cleaner than playing tricks with empty strings.
      
      The behaviour of git-tar-tree should be unchanged (quick tests didn't
      indicate otherwise) except for the text of some error messages.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      87af29f0
  25. 11 9月, 2006 2 次提交
  26. 10 9月, 2006 1 次提交
  27. 02 9月, 2006 1 次提交
    • S
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce 提交于
      Like xmalloc and xrealloc xstrdup dies with a useful message if
      the native strdup() implementation returns NULL rather than a
      valid pointer.
      
      I just tried to use xstrdup in new code and found it to be missing.
      However I expected it to be present as xmalloc and xrealloc are
      already commonly used throughout the code.
      
      [jc: removed the part that deals with last_XXX, which I am
       finding more and more dubious these days.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9befac47