Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 11, 2008
  1. @gitster

    setup.c: guard config parser from value=NULL

    gitster authored
    core.worktree expects a string value
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 3, 2008
  1. @meyering @gitster

    Fix grammar nits in documentation and in code comments.

    meyering authored gitster committed
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Dec 9, 2007
  1. @pclouds @gitster

    Remove repo version check from setup_git_directory

    pclouds authored gitster committed
    setup_git_directory_gently has done the check already.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Dec 6, 2007
  1. @gitster

    Merge branch 'maint'

    gitster authored
    * maint:
      git-am -i: report rewritten title
      git grep shows the same hit repeatedly for unmerged paths
      Do check_repository_format() early (re-fix)
      Do check_repository_format() early
      Add missing inside_work_tree setting in setup_git_directory_gently
Commits on Dec 5, 2007
  1. @pclouds @gitster

    Do check_repository_format() early (re-fix)

    pclouds authored gitster committed
    This pushes check_repository_format() (actually _gently() version)
    to setup_git_directory_gently() in order to prevent from
    using unsupported repositories.
    
    New setup_git_directory_gently()'s behaviour is stop searching
    for a valid gitdir and return as if there is no gitdir if a
    unsupported repository is found. Warning will be thrown in these
    cases.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 30, 2007
  1. @pclouds @gitster

    Do check_repository_format() early

    pclouds authored gitster committed
    Repository version check is only performed when
    setup_git_directory() is called. This makes sure
    setup_git_directory_gently() does the check too.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 26, 2007
  1. @sprohaska @gitster

    Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c

    sprohaska authored gitster committed
    Using the helper function to test for absolute paths makes porting easier.
    
    Signed-off-by: Steffen Prohaska <prohaska@zib.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 10, 2007
  1. @dscho @gitster

    builtin-blame: set up the work_tree before the first file access

    dscho authored gitster committed
    We check in cmd_blame() if the specified path is there, but we
    failed to set up the working tree before that.
    
    While at it, make setup_work_tree() just return if it was run
    before.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 8, 2007
  1. @gitster

    Style: place opening brace of a function definition at column 1

    gitster authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 6, 2007
  1. @glandium @gitster

    Refactor working tree setup

    glandium authored gitster committed
    Create a setup_work_tree() that can be used from any command requiring
    a working tree conditionally.
    
    Signed-off-by: Mike Hommey <mh@glandium.org>
    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 4, 2007
  1. @pclouds @gitster

    Add missing inside_work_tree setting in setup_git_directory_gently

    pclouds authored gitster committed
    When both GIT_DIR and GIT_WORK_TREE are set, and
    setup_git_directory_gently() changes the current working
    directory accordingly, it should also set inside_work_tree = 1.
    
    Without this, work_tree handling code in setup_git_directory()
    will be activated. If you stay in root work tree (no prefix),
    it does not harm. It does if you work from a subdirectory though.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 17, 2007
  1. @dscho @spearce

    Fix setup_git_directory_gently() with relative GIT_DIR & GIT_WORK_TREE

    dscho authored spearce committed
    There are a few programs, such as config and diff, which allow running
    without a git repository.  Therefore, they have to call
    setup_git_directory_gently().
    
    However, when GIT_DIR and GIT_WORK_TREE were set, and the current
    directory was a subdirectory of the work tree,
    setup_git_directory_gently() would return a bogus NULL prefix.
    
    This patch fixes that.
    
    Noticed by REPLeffect on IRC.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Aug 10, 2007
  1. @dscho @gitster

    Reinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is …

    dscho authored gitster committed
    …unset
    
    The old behaviour was to unilaterally default to the cwd is the work tree
    when GIT_DIR was set, but GIT_WORK_TREE wasn't, no matter if we are inside
    the GIT_DIR, or if GIT_DIR is actually something like ../../../.git.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 6, 2007
  1. @gitster

    Merge branch 'maint'

    gitster authored
    * maint:
      apply: remove directory that becomes empty by renaming the last file away
      setup.c:verify_non_filename(): don't die unnecessarily while disambiguating
  2. @gitster

    setup.c:verify_non_filename(): don't die unnecessarily while disambig…

    gitster authored
    …uating
    
    If you have a working tree _file_ "foo", attempt to refer to a
    branch "foo/bar" without -- to disambiguate, like this:
    
    	$ git log foo/bar
    
    tried to make sure that foo/bar cannot be naming a working tree
    file "foo/bar" (in which case we would say "which one do you
    want?  A rev or a working tree file?  clarify with -- please").
    We run lstat("foo/bar") to check that.  If it does not succeed,
    there is no ambiguity.
    
    That is good.  But we also checked the error status for the
    lstat() and expected it to fail with ENOENT.  In this particular
    case, however, it fails with ENOTDIR.  That should be treated as
    "expected error" as well.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 3, 2007
  1. @gitster

    Fix work-tree related breakages

    gitster authored
    In set_work_tree(), variable rel needs to be reinitialized to
    NULL on every call (it should not be static).
    
    Make sure the incoming dir variable is not too long before
    copying to the temporary buffer, and make sure chdir to the
    resulting directory succeeds.
    
    This was spotted and fixed by Alex and Johannes in a handful
    patch exchanges.  Here is the final version.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Commits on Aug 1, 2007
  1. @dscho @gitster

    Clean up work-tree handling

    dscho authored gitster committed
    The old version of work-tree support was an unholy mess, barely readable,
    and not to the point.
    
    For example, why do you have to provide a worktree, when it is not used?
    As in "git status".  Now it works.
    
    Another riddle was: if you can have work trees inside the git dir, why
    are some programs complaining that they need a work tree?
    
    IOW it is allowed to call
    
    	$ git --git-dir=../ --work-tree=. bla
    
    when you really want to.  In this case, you are both in the git directory
    and in the working tree.  So, programs have to actually test for the right
    thing, namely if they are inside a working tree, and not if they are
    inside a git directory.
    
    Also, GIT_DIR=../.git should behave the same as if no GIT_DIR was
    specified, unless there is a repository in the current working directory.
    It does now.
    
    The logic to determine if a repository is bare, or has a work tree
    (tertium non datur), is this:
    
    --work-tree=bla overrides GIT_WORK_TREE, which overrides core.bare = true,
    which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR
    ends in /.git, which overrides the directory in which .git/ was found.
    
    In related news, a long standing bug was fixed: when in .git/bla/x.git/,
    which is a bare repository, git formerly assumed ../.. to be the
    appropriate git dir.  This problem was reported by Shawn Pearce to have
    caused much pain, where a colleague mistakenly ran "git init" in "/" a
    long time ago, and bare repositories just would not work.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 30, 2007
  1. @dscho @gitster

    white space fixes in setup.c

    dscho authored gitster committed
    Some lines were not indented by tabs but by spaces.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 11, 2007
  1. @dscho @gitster

    Fix core.sharedRepository = 2

    dscho authored gitster committed
    For compatibility reasons, "git init --shared=all" does not write
    "all" into the config, but a number.  In the shared setup, you
    really have to support even older clients on the _same_ repository.
    
    But git_config_perm() did not pick up on it.
    
    Also, "git update-server-info" failed to pick up on the shared
    permissions.
    
    This patch fixes both issues, and adds a test to prove it.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Tested-by: martin f krafft <madduck@madduck.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 4, 2007
  1. @gitster

    Do not check if getcwd() result begins with a slash.

    gitster authored
    In user space, and for getcwd(), the check to see if the
    resulting path begins with a '/' does not make sense.  This is
    merely a mistake by Linus who is so used to code for the kernel,
    where a d_path() return value pathname can be either a real
    path, or something like "pipe:[8003]", and the difference is the
    '/' at the beginning.
    
    Pointed out by Dscho, Matthias Lederhofer and clarified by Linus.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 1, 2007
  1. @gitster

    Merge branch 'ei/worktree+filter'

    gitster authored
    * ei/worktree+filter:
      filter-branch: always export GIT_DIR if it is set
      setup_git_directory: fix segfault if repository is found in cwd
      test GIT_WORK_TREE
      extend rev-parse test for --is-inside-work-tree
      Use new semantics of is_bare/inside_git_dir/inside_work_tree
      introduce GIT_WORK_TREE to specify the work tree
      test git rev-parse
      rev-parse: introduce --is-bare-repository
      rev-parse: document --is-inside-git-dir
Commits on Jun 7, 2007
  1. @gitster

    War on whitespace

    gitster authored
    This uses "git-apply --whitespace=strip" to fix whitespace errors that have
    crept in to our source files over time.  There are a few files that need
    to have trailing whitespaces (most notably, test vectors).  The results
    still passes the test, and build result in Documentation/ area is unchanged.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 6, 2007
  1. @matled @gitster

    setup_git_directory: fix segfault if repository is found in cwd

    matled authored gitster committed
    Additionally there was a similar part calling setenv and getenv
    in the same way which missed a check if getenv succeeded.
    
    Signed-off-by: Matthias Lederhofer <matled@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @matled @gitster

    Use new semantics of is_bare/inside_git_dir/inside_work_tree

    matled authored gitster committed
    Up to now to check for a working tree this was used:
    	!is_bare && !inside_git_dir
    (the check for bare is redundant because is_inside_git_dir
    returned already 1 for bare repositories).
    Now the check is:
    	inside_work_tree && !inside_git_dir
    
    Signed-off-by: Matthias Lederhofer <matled@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @matled @gitster

    introduce GIT_WORK_TREE to specify the work tree

    matled authored gitster committed
    setup_gdg is used as abbreviation for setup_git_directory_gently.
    
    The work tree can be specified using the environment variable
    GIT_WORK_TREE and the config option core.worktree (the environment
    variable has precendence over the config option).  Additionally
    there is a command line option --work-tree which sets the
    environment variable.
    
    setup_gdg does the following now:
    
    GIT_DIR unspecified
    repository in .git directory
        parent directory of the .git directory is used as work tree,
        GIT_WORK_TREE is ignored
    
    GIT_DIR unspecified
    repository in cwd
        GIT_DIR is set to cwd
        see the cases with GIT_DIR specified what happens next and
        also see the note below
    
    GIT_DIR specified
    GIT_WORK_TREE/core.worktree unspecified
        cwd is used as work tree
    
    GIT_DIR specified
    GIT_WORK_TREE/core.worktree specified
        the specified work tree is used
    
    Note on the case where GIT_DIR is unspecified and repository is in cwd:
        GIT_WORK_TREE is used but is_inside_git_dir is always true.
        I did it this way because setup_gdg might be called multiple
        times (e.g. when doing alias expansion) and in successive calls
        setup_gdg should do the same thing every time.
    
    Meaning of is_bare/is_inside_work_tree/is_inside_git_dir:
    
    (1) is_bare_repository
        A repository is bare if core.bare is true or core.bare is
        unspecified and the name suggests it is bare (directory not
        named .git).  The bare option disables a few protective
        checks which are useful with a working tree.  Currently
        this changes if a repository is bare:
            updates of HEAD are allowed
            git gc packs the refs
            the reflog is disabled by default
    
    (2) is_inside_work_tree
        True if the cwd is inside the associated working tree (if there
        is one), false otherwise.
    
    (3) is_inside_git_dir
        True if the cwd is inside the git directory, false otherwise.
        Before this patch is_inside_git_dir was always true for bare
        repositories.
    
    When setup_gdg finds a repository git_config(git_default_config) is
    always called.  This ensure that is_bare_repository makes use of
    core.bare and does not guess even though core.bare is specified.
    
    inside_work_tree and inside_git_dir are set if setup_gdg finds a
    repository.  The is_inside_work_tree and is_inside_git_dir functions
    will die if they are called before a successful call to setup_gdg.
    
    Signed-off-by: Matthias Lederhofer <matled@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 11, 2007
  1. Merge branch 'maint'

    Junio C Hamano authored
    * maint:
      git.el: Retrieve commit log information from .dotest directory.
      git.el: Avoid appending a signoff line that is already present.
      setup_git_directory_gently: fix off-by-one error
      user-manual: install user manual stylesheet with other web documents
      user-manual: fix rendering of history diagrams
      user-manual: fix missing colon in git-show example
      user-manual: fix inconsistent use of pull and merge
      user-manual: fix inconsistent example
      glossary: fix overoptimistic automatic linking of defined terms
      Documentation: s/seperator/separator/
      Adjust reflog filemode in shared repository
  2. @matled

    setup_git_directory_gently: fix off-by-one error

    matled authored Junio C Hamano committed
    don't tell getcwd that the buffer has one spare byte for an extra /
    
    Signed-off-by: Matthias Lederhofer <matled@gmx.net>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 21, 2007
  1. Mechanical conversion to use prefixcmp()

    Junio C Hamano authored
    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 <junkio@cox.net>
Commits on Jan 21, 2007
  1. @dscho

    Do not verify filenames in a bare repository

    dscho authored Junio C Hamano committed
    For example, it makes no sense to check the presence of a file
    named "HEAD" when calling "git log HEAD" in a bare repository.
    
    Noticed by Han-Wen Nienhuys.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Commits on Jan 8, 2007
  1. Detached HEAD (experimental)

    Junio C Hamano authored
    This allows "git checkout v1.4.3" to dissociate the HEAD of
    repository from any branch.  After this point, "git branch"
    starts reporting that you are not on any branch.  You can go
    back to an existing branch by saying "git checkout master", for
    example.
    
    This is still experimental.  While I think it makes sense to
    allow commits on top of detached HEAD, it is rather dangerous
    unless you are careful in the current form.  Next "git checkout
    master" will obviously lose what you have done, so we might want
    to require "git checkout -f" out of a detached HEAD if we find
    that the HEAD commit is not an ancestor of any other branches.
    There is no such safety valve implemented right now.
    
    On the other hand, the reason the user did not start the ad-hoc
    work on a new branch with "git checkout -b" was probably because
    the work was of a throw-away nature, so the convenience of not
    having that safety valve might be even better.  The user, after
    accumulating some commits on top of a detached HEAD, can always
    create a new branch with "git checkout -b" not to lose useful
    work done while the HEAD was detached.
    
    We'll see.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Dec 31, 2006
  1. @spearce

    Automatically detect a bare git repository.

    spearce authored Junio C Hamano committed
    Many users find it unfriendly that they can create a bare git
    repository easily with `git clone --bare` but are then unable to
    run simple commands like `git log` once they cd into that newly
    created bare repository.  This occurs because we do not check to
    see if the current working directory is a git repository.
    
    Instead of failing out with "fatal: Not a git repository" we should
    try to automatically detect if the current working directory is
    a bare repository and use that for GIT_DIR, and fail out only if
    that doesn't appear to be true.
    
    We test the current working directory only after we have tried
    searching up the directory tree.  This is to retain backwards
    compatibility with our previous behavior on the off chance that
    a user has a 'refs' and 'objects' subdirectories and a 'HEAD'
    file that looks like a symref, all stored within a repository's
    associated working directory.
    
    This change also consolidates the validation logic between the case
    of GIT_DIR being supplied and GIT_DIR not being supplied, cleaning
    up the code.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Oct 31, 2006
  1. @spearce

    Move deny_non_fast_forwards handling completely into receive-pack.

    spearce authored Junio C Hamano committed
    The 'receive.denynonfastforwards' option has nothing to do with
    the repository format version.  Since receive-pack already uses
    git_config to initialize itself before executing any updates we
    can use the normal configuration strategy and isolate the receive
    specific variables away from the core variables.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Sep 20, 2006
  1. @dscho

    add receive.denyNonFastforwards config variable

    dscho authored Junio C Hamano committed
    If receive.denyNonFastforwards is set to true, git-receive-pack will deny
    non fast-forwards, i.e. forced updates. Most notably, a push to a repository
    which has that flag set will fail.
    
    As a first user, 'git-init-db --shared' sets this flag, since in a shared
    setup, you are most unlikely to want forced pushes to succeed.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Aug 4, 2006
  1. @dscho

    Fix crash when GIT_DIR is invalid

    dscho authored Junio C Hamano committed
    We used to test if a pointer was NULL, and if it was, try to access it.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Jul 31, 2006
  1. @matled

    setup_git_directory_gently: do not barf when GIT_DIR is given.

    matled authored Junio C Hamano committed
    Earlier we barfed when GIT_DIR environment variable points at a
    directory yet to be created, which made it impossible to use
    configuration mechanism in "git-init-db".
    
    Signed-off-by: Matthias Lederhofer <matled@gmx.net>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.