Skip to content
Commits on Jul 11, 2009
  1. @bebarino @gitster

    write-tree: migrate to parse-options

    bebarino committed with gitster
    A check for extra options has been dropped, it could never be triggered
    in the original code as the usage message would be printed instead.
    Signed-off-by: Stephen Boyd <>
    Signed-off-by: Junio C Hamano <>
Commits on May 20, 2009
  1. @gitster

    write-tree --ignore-cache-tree

    gitster committed
    This allows you to discard the cache-tree information before writing the
    tree out of the index (i.e. it always recomputes the tree object names for
    all the subtrees).
    This is only useful as a debug option, so I did not bother documenting it.
    Signed-off-by: Junio C Hamano <>
Commits on Dec 1, 2008
  1. @gitster

    git add --intent-to-add: do not let an empty blob be committed by acc…

    gitster committed
    Writing a tree out of an index with an "intent to add" entry is blocked.
    This implies that you cannot "git commit" from such a state; however you
    can still do "git commit -a" or "git commit $that_path".
    Signed-off-by: Junio C Hamano <>
Commits on Jul 13, 2008
  1. @sbeyer @gitster

    Make usage strings dash-less

    sbeyer committed with gitster
    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,
    generates a dash-less usage string now.
    Signed-off-by: Stephan Beyer <>
    Signed-off-by: Junio C Hamano <>
Commits on May 14, 2008
  1. @dscho @gitster

    Provide git_config with a callback-data parameter

    dscho committed with gitster
    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 <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 5, 2008
  1. @gitster

    Make error messages from cherry-pick/revert more sensible

    gitster committed
    The original "rewrite in C" did somewhat a sloppy job while
    stealing code from git-write-tree.
    The caller pretends as if the write_tree() function would return
    an error code and being able to issue a sensible error message
    itself, but write_tree() function just calls die() and never
    returns an error.  Worse yet, the function claims that it was
    running git-write-tree (which is no longer true after
    cherry-pick stole it).
    Tested-by: Björn Steinbrink <>
    Signed-off-by: Junio C Hamano <>
Commits on Jan 16, 2008
  1. @gitster

    Improve use of lockfile API

    Brandon Casey committed with gitster
    Remove remaining double close(2)'s.  i.e. close() before
    commit_locked_index() or commit_lock_file().
    Signed-off-by: Junio C Hamano <>
Commits on Aug 25, 2007
  1. @torvalds @gitster

    Fix racy-git handling in git-write-tree.

    torvalds committed with gitster
    After git-write-tree finishes computing the tree, it updates the
    index so that later operations can take advantage of fully
    populated cache tree.
    However, anybody writing the index file has to mark the entries
    that are racily clean.  For each entry whose cached lstat(3)
    data in the index exactly matches what is obtained from the
    filesystem, if the timestamp on the index file was the same or
    older than the modification timestamp of the file, the blob
    contents and the work tree file, after convert_to_git(), need to
    be compared, and if they are different, its index entry needs to
    be marked not to match the lstat(3) data from the filesystem.
    In order for this to work, convert_to_git() needs to work
    correctly, which in turn means you need to read the config file
    to get the settings of core.crlf and friends.
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 26, 2007
  1. @pclouds @gitster

    git-write-tree should not crash if prefix does not exist

    pclouds committed with gitster
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 26, 2007
  1. Merge branch 'maint'

    Junio C Hamano committed
    * maint:
      Start preparing for
      Sanitize @to recipients.
      git-svn: Ignore usernames in URLs in find_by_url
      Document --dry-run and envelope-sender for git-send-email.
      Allow users to optionally specify their envelope sender.
      Ensure clean addresses are always used with Net::SMTP
      Validate @recipients before using it for sendmail and Net::SMTP.
      Perform correct quoting of recipient names.
      Change the scope of the $cc variable as it is not needed outside of send_message.
      Debugging cleanup improvements
      Prefix Dry- to the message status to denote dry-runs.
      Document --dry-run parameter to send-email.
      git-svn: Don't rely on $_ after making a function call
      Fix handle leak in write_tree
      Actually handle some-low memory conditions
  2. @raalkml

    Fix handle leak in write_tree

    raalkml committed with Junio C Hamano
    This is a quick and dirty fix for the broken "git cherry-pick -n" on
    some broken OS, which does not remove the directory entry after unlink
    succeeded(!) if the file is still open somewher.
    The entry is left but "protected": no open, no unlink, no stat.
    Very annoying.
    Signed-off-by: Alex Riesen <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 4, 2007
  1. _GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index f…

    Junio C Hamano committed
    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: Junio C Hamano <>
Commits on Feb 21, 2007
  1. Mechanical conversion to use prefixcmp()

    Junio C Hamano committed
    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: Junio C Hamano <>
Commits on Aug 23, 2006
  1. @spearce

    Convert memcpy(a,b,20) to hashcpy(a,b).

    spearce committed with Junio C Hamano
    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: Shawn O. Pearce <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 13, 2006
  1. Better error message when we are unable to lock the index file

    Junio C Hamano committed
    Most of the callers except the one in refs.c use the function to
    update the index file.  Among the index writers, everybody
    except write-tree dies if they cannot open it for writing.
    This gives the function an extra argument, to tell it to die
    when it cannot create a new file as the lockfile.
    The only caller that does not have to die is write-tree, because
    updating the index for the cache-tree part is optional and not
    being able to do so does not affect the correctness.  I think we
    do not have to be so careful and make the failure into die() the
    same way as other callers, but that would be a different patch.
    Signed-off-by: Junio C Hamano <>
Commits on Aug 4, 2006
  1. Replace some calls to die(usage_str) with usage(usage_str).

    Ramsay Allan Jones committed with Junio C Hamano
    The only change in behaviour should be having a "usage: " prefix
    on the output string rather than "fatal: ", and an exit code of
    129 rather than 128.
    Signed-off-by: Ramsay Allan Jones <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 29, 2006
  1. Call setup_git_directory() much earlier

    Linus Torvalds committed with Junio C Hamano
    This changes the calling convention of built-in commands and
    passes the "prefix" (i.e. pathname of $PWD relative to the
    project root level) down to them.
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 8, 2006
  1. @dscho

    Close the index file between writing and committing

    dscho committed with Junio C Hamano
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Jun 20, 2006
  1. @dscho

    Initialize lock_file struct to all zero.

    dscho committed with Junio C Hamano
    hold_lock_file_for_update() relies on that.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Jun 19, 2006
  1. Make git-write-tree a builtin

    Lukas Sandström committed with Junio C Hamano
    Signed-off-by: Lukas Sandström <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.