Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Feb 05, 2010

  1. Wesley J. Landaker

    Update git fsck --full short description to mention packs

    The '--full' option to git fsck does two things:
    
      1) Check objects in packs
      2) Check alternate objects
    
    This is documented in the git fsck manual; this patch reflects that in
    the short git fsck option help message as well.
    
    Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 05, 2010 gitster committed February 05, 2010

Nov 16, 2009

  1. Check the format of more printf-type functions

    We already have these checks in many printf-type functions that have
    prototypes which are in header files.  Add these same checks to some
    more prototypes in header functions and to static functions in .c
    files.
    
    cc: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored November 14, 2009 gitster committed November 15, 2009

Oct 20, 2009

  1. Junio C Hamano

    fsck: default to "git fsck --full"

    Linus and other git developers from the early days trained their fingers
    to type the command, every once in a while even without thinking, to check
    the consistency of the repository back when the lower core part of the git
    was still being developed.  Developers who wanted to make sure that git
    correctly dealt with packfiles could deliberately trigger their creation
    and checked them after they were created carefully, but loose objects are
    the ones that are written by various commands from random codepaths.  It
    made some technical sense to have a mode that checked only loose objects
    from the debugging point of view for that reason.
    
    Even for git developers, there no longer is any reason to type "git fsck"
    every five minutes these days, worried that some newly created objects
    might be corrupt due to recent change to git.
    
    The reason we did not make "--full" the default is probably we trust our
    filesystems a bit too much.  At least, we trusted filesystems more than we
    trusted the lower core part of git that was under development.
    
    Once a packfile is created and we always use it read-only, there didn't
    seem to be much point in suspecting that the underlying filesystems or
    disks may corrupt them in such a way that is not caught by the SHA-1
    checksum over the entire packfile and per object checksum.  That trust in
    the filesystems might have been a good tradeoff between fsck performance
    and reliability on platforms git was initially developed on and for, but
    it may not be true anymore as we run on many more platforms these days.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored October 20, 2009

Aug 22, 2009

  1. Junio C Hamano

    Merge branch 'cc/replace'

    * cc/replace:
      t6050: check pushing something based on a replaced commit
      Documentation: add documentation for "git replace"
      Add git-replace to .gitignore
      builtin-replace: use "usage_msg_opt" to give better error messages
      parse-options: add new function "usage_msg_opt"
      builtin-replace: teach "git replace" to actually replace
      Add new "git replace" command
      environment: add global variable to disable replacement
      mktag: call "check_sha1_signature" with the replacement sha1
      replace_object: add a test case
      object: call "check_sha1_signature" with the replacement sha1
      sha1_file: add a "read_sha1_file_repl" function
      replace_object: add mechanism to replace objects found in "refs/replace/"
      refs: add a "for_each_replace_ref" function
    authored August 21, 2009

Jul 06, 2009

  1. Junio C Hamano

    Merge branch 'tr/die_errno'

    * tr/die_errno:
      Use die_errno() instead of die() when checking syscalls
      Convert existing die(..., strerror(errno)) to die_errno()
      die_errno(): double % in strerror() output just in case
      Introduce die_errno() that appends strerror(errno) to die()
    authored July 06, 2009

Jun 27, 2009

  1. trast

    Use die_errno() instead of die() when checking syscalls

    Lots of die() calls did not actually report the kind of error, which
    can leave the user confused as to the real problem.  Use die_errno()
    where we check a system/library call that sets errno on failure, or
    one of the following that wrap such calls:
    
      Function              Passes on error from
      --------              --------------------
      odb_pack_keep         open
      read_ancestry         fopen
      read_in_full          xread
      strbuf_read           xread
      strbuf_read_file      open or strbuf_read_file
      strbuf_readlink       readlink
      write_in_full         xwrite
    
    Signed-off-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 27, 2009 gitster committed June 27, 2009
  2. trast

    Convert existing die(..., strerror(errno)) to die_errno()

    Change calls to die(..., strerror(errno)) to use the new die_errno().
    
    In the process, also make slight style adjustments: at least state
    _something_ about the function that failed (instead of just printing
    the pathname), and put paths in single quotes.
    
    Signed-off-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 27, 2009 gitster committed June 27, 2009

Jun 21, 2009

  1. Linus Torvalds

    Fix various sparse warnings in the git source code

    There are a few remaining ones, but this fixes the trivial ones. It boils
    down to two main issues that sparse complains about:
    
     - warning: Using plain integer as NULL pointer
    
       Sparse doesn't like you using '0' instead of 'NULL'. For various good
       reasons, not the least of which is just the visual confusion. A NULL
       pointer is not an integer, and that whole "0 works as NULL" is a
       historical accident and not very pretty.
    
       A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
       I didn't touch those.
    
     - warning: symbol 'xyz' was not declared. Should it be static?
    
       Sparse wants to see declarations for any functions you export. A lack
       of a declaration tends to mean that you should either add one, or you
       should mark the function 'static' to show that it's in file scope.
    
       A few of these remain: I only did the ones that should obviously just
       be made static.
    
    That 'wt_status_submodule_summary' one is debatable. It has a few related
    flags (like 'wt_status_use_color') which _are_ declared, and are used by
    builtin-commit.c. So maybe we'd like to export it at some point, but it's
    not declared now, and not used outside of that file, so 'static' it is in
    this patch.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 18, 2009 gitster committed June 20, 2009

Jun 01, 2009

  1. Christian Couder

    environment: add global variable to disable replacement

    This new "read_replace_refs" global variable is set to 1 by
    default, so that replace refs are used by default. But
    reachability traversal and packing commands ("cmd_fsck",
    "cmd_prune", "cmd_pack_objects", "upload_pack",
    "cmd_unpack_objects") set it to 0, as they must work with the
    original DAG.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 23, 2009 gitster committed May 31, 2009

May 25, 2009

  1. Stephen Boyd

    parse-opts: prepare for OPT_FILENAME

    To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
    which passes the prefix to parse_options_start() which sets the prefix
    member of parse_opts_ctx accordingly. If there isn't a prefix in the
    calling context, passing NULL will suffice.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 23, 2009 gitster committed May 25, 2009

Apr 09, 2009

  1. Junio C Hamano

    Merge branch 'jc/maint-1.6.0-keep-pack' into maint

    * jc/maint-1.6.0-keep-pack:
      pack-objects: don't loosen objects available in alternate or kept packs
      t7700: demonstrate repack flaw which may loosen objects unnecessarily
      Remove --kept-pack-only option and associated infrastructure
      pack-objects: only repack or loosen objects residing in "local" packs
      git-repack.sh: don't use --kept-pack-only option to pack-objects
      t7700-repack: add two new tests demonstrating repacking flaws
      is_kept_pack(): final clean-up
      Simplify is_kept_pack()
      Consolidate ignore_packed logic more
      has_sha1_kept_pack(): take "struct rev_info"
      has_sha1_pack(): refactor "pretend these packs do not exist" interface
      git-repack: resist stray environment variable
    
    Conflicts:
    	t/t7700-repack.sh
    authored April 08, 2009

Feb 28, 2009

  1. Junio C Hamano

    has_sha1_pack(): refactor "pretend these packs do not exist" interface

    Most of the callers of this function except only one pass NULL to its last
    parameter, ignore_packed.
    
    Introduce has_sha1_kept_pack() function that has the function signature
    and the semantics of this function, and convert the sole caller that does
    not pass NULL to call this new function.
    
    All other callers and has_sha1_pack() lose the ignore_packed parameter.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 27, 2009

Jan 31, 2009

  1. Junio C Hamano

    fsck: check loose objects from alternate object stores by default

    "git fsck" used to validate only loose objects that are local and nothing
    else by default.  This is not just too little when a repository is
    borrowing objects from other object stores, but also caused the
    connectivity check to mistakenly declare loose objects borrowed from them
    to be missing.
    
    The rationale behind the default mode that validates only loose objects is
    because these objects are still young and more unlikely to have been
    pushed to other repositories yet.  That holds for loose objects borrowed
    from alternate object stores as well.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 30, 2009
  2. Junio C Hamano

    fsck: HEAD is part of refs

    By default we looked at all refs but not HEAD.  The only thing that made
    fsck not lose sight of commits that are only reachable from a detached
    HEAD was the reflog for the HEAD.
    
    This fixes it, with a new test.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 30, 2009

Jan 18, 2009

  1. Junio C Hamano

    Merge branch 'ap/clone-into-empty'

    * ap/clone-into-empty:
      Allow cloning to an existing empty directory
      add is_dot_or_dotdot inline function
    authored January 17, 2009
  2. Junio C Hamano

    Merge branch 'maint-1.6.0' into maint

    * maint-1.6.0:
      builtin-fsck: fix off by one head count
      Documentation: let asciidoc align related options
      githooks.txt: add missing word
      builtin-commit.c: do not remove COMMIT_EDITMSG
    authored January 17, 2009
  3. Christian Couder

    builtin-fsck: fix off by one head count

    According to the man page, if "git fsck" is passed one or more heads, it
    should verify connectivity and validity of only objects reachable from the
    heads it is passed.
    
    However, since 5ac0a20 (Make builtin-fsck.c use parse_options.,
    2007-10-15) the command behaved as if no heads were passed, when given
    only one argument.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 18, 2009 gitster committed January 17, 2009

Jan 11, 2009

  1. Alexander Potashev

    add is_dot_or_dotdot inline function

    A new inline function is_dot_or_dotdot is used to check if the
    directory name is either "." or "..". It returns a non-zero value if
    the given string is "." or "..". It's applicable to a lot of Git
    source code.
    
    Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 10, 2009 gitster committed January 11, 2009

Dec 11, 2008

  1. Junio C Hamano

    Merge branch 'maint'

    * maint:
      fsck: reduce stack footprint
      make sure packs to be replaced are closed beforehand
    authored December 11, 2008
  2. Linus Torvalds

    fsck: reduce stack footprint

    The logic to mark all objects that are reachable from tips of refs were
    implemented as a set of recursive functions.  In a repository with a deep
    enough history, this can easily eat up all the available stack space.
    
    Restructure the code to require less stackspace by using an object array
    to keep track of the objects that still need to be processed.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored December 10, 2008 gitster committed December 11, 2008

Dec 05, 2008

  1. Make some of fwrite/fclose/write/close failures visible

    So that full filesystem conditions or permissions problems won't go
    unnoticed.
    
    Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored December 05, 2008 gitster committed December 04, 2008

Aug 06, 2008

  1. Teach fsck and prune that tmp_obj_ file names may not be 14 bytes long

    As Shawn pointed out, not all temporary file creation routines can
    ensure that the generated temporary file is of a certain length.
    e.g. Java's createTempFile(prefix, suffix). So just depend on the
    prefix 'tmp_obj_' for detection.
    
    Update prune, and fix the "fix" introduced by a08c53a :)
    
    Signed-off-by: Brandon "appendixless" Casey <casey@nrlssc.navy.mil>
    Acked-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored August 05, 2008 gitster committed August 05, 2008

Jul 27, 2008

  1. Shawn O. Pearce

    fsck: Don't require tmp_obj_ file names are 14 bytes in length

    Not all temporary file creation routines will ensure 14 bytes are
    used to generate the temporary file name.  In C Git this may be
    true, but alternate implementations such as jgit are not always
    able to generate a temporary file name with a specific prefix and
    also ensure the file name length is 14 bytes long.
    
    Since temporary files in a directory we are fsck'ing should be
    uncommon (as they are short lived only long enough for an active
    writer to finish writing the file and rename it) we shouldn't see
    these show up very often.  Always using a prefixcmp() call and
    ignoring the length opens up room for other implementations to use
    different name generation schemes.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 26, 2008 gitster committed July 27, 2008

Jul 25, 2008

  1. Teach fsck and prune about the new location of temporary objects

    Since 5723fe7, temporary objects are now created in their final destination
    directories, rather than in .git/objects/. Teach fsck to recognize and
    ignore the temporary objects it encounters, and teach prune to remove them.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 24, 2008 gitster committed July 24, 2008

Jul 13, 2008

  1. Stephan Beyer

    Make usage strings dash-less

    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: Stephan Beyer <s-beyer@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 13, 2008 gitster committed July 13, 2008

Jun 25, 2008

  1. move show_pack_info() where it belongs

    This is called when verify_pack() has its verbose argument set, and
    verbose in this context makes sense only for the actual 'git verify-pack'
    command.  Therefore let's move show_pack_info() to builtin-verify-pack.c
    instead and remove useless verbose argument from verify_pack().
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 24, 2008 gitster committed June 24, 2008

Mar 02, 2008

  1. Junio C Hamano

    Merge branch 'mk/maint-parse-careful'

    * mk/maint-parse-careful:
      receive-pack: use strict mode for unpacking objects
      index-pack: introduce checking mode
      unpack-objects: prevent writing of inconsistent objects
      unpack-object: cache for non written objects
      add common fsck error printing function
      builtin-fsck: move common object checking code to fsck.c
      builtin-fsck: reports missing parent commits
      Remove unused object-ref code
      builtin-fsck: move away from object-refs to fsck_walk
      add generic, type aware object chain walker
    
    Conflicts:
    
    	Makefile
    	builtin-fsck.c
    authored March 02, 2008

Feb 26, 2008

  1. builtin-fsck: move common object checking code to fsck.c

    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 25, 2008 gitster committed February 25, 2008
  2. builtin-fsck: reports missing parent commits

    parse_commit ignores parent commits with certain errors
    (eg. a non commit object is already loaded under the sha1 of
    the parent). To make fsck reports such errors, it has to compare
    the nummer of parent commits returned by parse commit with the
    number of parent commits in the object or in the graft/shallow file.
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 25, 2008 gitster committed February 25, 2008
  3. builtin-fsck: move away from object-refs to fsck_walk

    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 25, 2008 gitster committed February 25, 2008

Feb 12, 2008

  1. Junio C Hamano

    Merge branch 'lt/in-core-index'

    * lt/in-core-index:
      lazy index hashing
      Create pathname-based hash-table lookup into index
      read-cache.c: introduce is_racy_timestamp() helper
      read-cache.c: fix a couple more CE_REMOVE conversion
      Also use unpack_trees() in do_diff_cache()
      Make run_diff_index() use unpack_trees(), not read_tree()
      Avoid running lstat(2) on the same cache entry.
      index: be careful when handling long names
      Make on-disk index representation separate from in-core one
    authored February 11, 2008

Feb 04, 2008

  1. git-fsck: report missing author/commit line in a commit as an error

    A zero commit date could be caused by:
    * a missing author line
    * a missing commiter line
    * a malformed email address in the commiter line
    * a malformed commit date
    
    Simply reporting it as zero commit date is missleading.
    
    Additionally, it upgrades the message to an error (instead of an printf).
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 03, 2008 gitster committed February 03, 2008

Jan 21, 2008

  1. Linus Torvalds

    Make on-disk index representation separate from in-core one

    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: Linus Torvalds <torvalds@linux-foundation.org>
    authored January 14, 2008

Jan 16, 2008

  1. Linus Torvalds

    Make 'git fsck' complain about non-commit branches

    Since having non-commits in branches is a no-no, and just means you cannot
    commit on them, let's make fsck tell you when a branch is bad.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored January 15, 2008 gitster committed January 16, 2008

Oct 30, 2007

  1. Fixed a command line option type for builtin-fsck.c

    The typo was introduced by 5ac0a20
    (Make builtin-fsck.c use parse_options.)
    
    Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
    Acked-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored October 30, 2007 gitster committed October 30, 2007
Something went wrong with that request. Please try again.