Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on May 9, 2009
  1. @gitster

    archive-tar.c: squelch a type mismatch warning

    gitster authored
    On some systems, giving a value of type time_t to printf "%lo" that
    expects an unsigned long would give a type mismatch warning.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 12, 2008
  1. @spearce

    Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer

    Brandon Casey authored spearce committed
    Many call sites use strbuf_init(&foo, 0) to initialize local
    strbuf variable "foo" which has not been accessed since its
    declaration. These can be replaced with a static initialization
    using the STRBUF_INIT macro which is just as readable, saves a
    function call, and takes up fewer lines.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Jul 19, 2008
  1. @gitster

    archive: remove unused headers

    René Scharfe authored gitster committed
    Remove obsolete #includes.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 15, 2008
  1. @gitster

    archive: centralize archive entry writing

    René Scharfe authored gitster committed
    Add the exported function write_archive_entries() to archive.c, which uses
    the new ability of read_tree_recursive() to pass a context pointer to its
    callback in order to centralize previously duplicated code.
    
    The new callback function write_archive_entry() does the work that every
    archiver backend needs to do: loading file contents, entering subdirectories,
    handling file attributes, constructing the full path of the entry.  All that
    done, it calls the backend specific write_archive_entry_fn_t function.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    archive: add baselen member to struct archiver_args

    René Scharfe authored gitster committed
    Calculate the length of base and save it in a new member of struct
    archiver_args.  This way we don't have to compute it in each of the
    format backends.
    
    Note: parse_archive_args() guarantees that ->base won't ever be NULL.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    add context pointer to read_tree_recursive()

    René Scharfe authored gitster committed
    Add a pointer parameter to read_tree_recursive(), which is passed to the
    callback function.  This allows callers of read_tree_recursive() to
    share data with the callback without resorting to global variables.  All
    current callers pass NULL.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 9, 2008
  1. @gitster

    Teach new attribute 'export-ignore' to git-archive

    René Scharfe authored gitster committed
    Paths marked with this attribute are not output to git-archive
    output.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 14, 2008
  1. @dscho @gitster

    Provide git_config with a callback-data parameter

    dscho authored gitster committed
    git_config() only had a function parameter, but no callback data
    parameter.  This assumes that all callback functions only modify
    global variables.
    
    With this patch, every callback gets a void * parameter, and it is hoped
    that this will help the libification effort.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 10, 2008
  1. @gitster

    git-archive: ignore prefix when checking file attribute

    René Scharfe authored gitster committed
    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: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 11, 2008
  1. @gitster

    archive-tar.c: guard config parser from value=NULL

    gitster authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 21, 2007
  1. @MadCoder @gitster

    Fix the expansion pattern of the pseudo-static path buffer.

    MadCoder authored gitster committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Commits on Sep 17, 2007
  1. @MadCoder @gitster

    Now that cache.h needs strbuf.h, remove useless includes.

    MadCoder authored gitster committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 10, 2007
  1. @MadCoder @gitster

    Strbuf API extensions and fixes.

    MadCoder authored gitster committed
      * 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: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    Merge branch 'master' into ph/strbuf

    gitster authored
    * master:
      archive - leakfix for format_subst()
      Make --no-thin the default in git-push to save server resources
      fix doc for --compression argument to pack-objects
      git-tag -s must fail if gpg cannot sign the tag.
      git-svn: understand grafts when doing dcommit
      git-diff: don't squelch the new SHA1 in submodule diffs
      Define NO_MEMMEM on Darwin as it lacks the function
      git-svn: fix "Malformed network data" with svn:// servers
      (cvs|svn)import: Ask git-tag to overwrite old tags.
      git-rebase: fix -C option
      git-rebase: support --whitespace=<option>
      Documentation / grammer nit
      archive: rename attribute specfile to export-subst
      archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just "%PLCHLDR" (take 2)
      add memmem()
      Remove unused function convert_sha1_file()
      archive: specfile support (--pretty=format: in archive files)
      Export format_commit_message()
Commits on Sep 7, 2007
  1. @MadCoder @gitster

    Simplify strbuf uses in archive-tar.c using strbuf API

    MadCoder authored gitster committed
      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: Junio C Hamano <gitster@pobox.com>
  2. @MadCoder @gitster

    Rework strbuf API and semantics.

    MadCoder authored gitster committed
      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: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 3, 2007
  1. @gitster

    archive: specfile support (--pretty=format: in archive files)

    René Scharfe authored gitster committed
    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: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 22, 2007
  1. @tali

    rename dirlink to gitlink.

    tali authored Junio C Hamano committed
    Unify naming of plumbing dirlink/gitlink concept:
    
    git ls-files -z '*.[ch]' |
    xargs -0 perl -pi -e 's/dirlink/gitlink/g;' -e 's/DIRLNK/GITLINK/g;'
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on May 18, 2007
  1. git-archive: convert archive entries like checkouts do

    René Scharfe authored Junio C Hamano committed
    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: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on May 12, 2007
  1. @hjemli

    git-archive: don't die when repository uses subprojects

    hjemli authored Junio C Hamano committed
    Both archive-tar and archive-zip needed to be taught about subprojects.
    The tar function died when trying to read the subproject commit object,
    while the zip function reported "unsupported file mode".
    
    This fixes both by representing the subproject as an empty directory.
    
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 27, 2007
  1. convert object type handling from a string to a number

    Nicolas Pitre authored Junio C Hamano committed
    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: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Jan 6, 2007
  1. Set default "tar" umask to 002 and owner.group to root.root

    René Scharfe authored Junio C Hamano committed
    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: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Dec 20, 2006
  1. simplify inclusion of system header files.

    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: Junio C Hamano <junkio@cox.net>
Commits on Sep 25, 2006
  1. git-tar-tree: Move code for git-archive --format=tar to archive-tar.c

    Rene Scharfe authored Junio C Hamano committed
    This patch doesn't change any functionality, it only moves code around.  It
    makes seeing the few remaining lines of git-tar-tree code easier. ;-)
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.