Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jan 20, 2010
  1. @gitster

    Merge branch 'jc/cache-unmerge'

    gitster authored
    * jc/cache-unmerge:
      rerere forget path: forget recorded resolution
      rerere: refactor rerere logic to make it independent from I/O
      rerere: remove silly 1024-byte line limit
      resolve-undo: teach "update-index --unresolve" to use resolve-undo info
      resolve-undo: "checkout -m path" uses resolve-undo information
      resolve-undo: allow plumbing to clear the information
      resolve-undo: basic tests
      resolve-undo: record resolved conflicts in a new index extension section
      builtin-merge.c: use standard active_cache macros
    
    Conflicts:
    	builtin-ls-files.c
    	builtin-merge.c
    	builtin-rerere.c
Commits on Jan 13, 2010
  1. @gitster

    Merge branch 'nd/sparse'

    gitster authored
    * nd/sparse: (25 commits)
      t7002: test for not using external grep on skip-worktree paths
      t7002: set test prerequisite "external-grep" if supported
      grep: do not do external grep on skip-worktree entries
      commit: correctly respect skip-worktree bit
      ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALID
      tests: rename duplicate t1009
      sparse checkout: inhibit empty worktree
      Add tests for sparse checkout
      read-tree: add --no-sparse-checkout to disable sparse checkout support
      unpack-trees(): ignore worktree check outside checkout area
      unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
      unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
      unpack-trees.c: generalize verify_* functions
      unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
      Introduce "sparse checkout"
      dir.c: export excluded_1() and add_excludes_from_file_1()
      excluded_1(): support exclude files in index
      unpack-trees(): carry skip-worktree bit over in merged_entry()
      Read .gitignore from index if it is skip-worktree
      Avoid writing to buffer in add_excludes_from_file_1()
      ...
    
    Conflicts:
    	.gitignore
    	Documentation/config.txt
    	Documentation/git-update-index.txt
    	Makefile
    	entry.c
    	t/t7002-grep.sh
Commits on Dec 26, 2009
  1. @gitster

    resolve-undo: basic tests

    gitster authored
    Make sure that resolving a failed merge with git add records
    the conflicted state, committing the result keeps that state,
    and checking out another commit clears the state.
    
    "git ls-files" learns a new option --resolve-undo to show the
    recorded information.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 10, 2009
  1. @gitster

    Merge branch 'jk/maint-1.6.3-ls-files-i'

    gitster authored
    * jk/maint-1.6.3-ls-files-i:
      ls-files: unbreak "ls-files -i"
Commits on Oct 30, 2009
  1. @peff @gitster

    ls-files: unbreak "ls-files -i"

    peff authored gitster committed
    Commit b5227d8 changed the behavior of "ls-files" with
    respect to includes, but accidentally broke the "-i" option
    The original behavior was:
    
      1. if no "-i" is given, cull all results according to --exclude*
      2. if "-i" is given, show the inverse of (1)
    
    The broken behavior was:
    
      1. if no "-i" is given:
         a. for "-o", cull results according to --exclude*
         b. for index files, always show all
      2. if "-i" is given:
         a. for "-o", shows the inverse of (1a)
         b. for index files, always show all
    
    The fixed behavior keeps the new (1b) behavior introduced
    by b5227d8, but fixes the (2b) behavior to show only ignored
    files, not all files.
    
    This patch also tweaks the documentation. The original text
    was somewhat obscure in the first place, but it is also now
    inaccurate (the relationship between (1b) and (2b) is not
    quite a "reverse").
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 19, 2009
  1. @gitster

    Merge branch 'jk/maint-1.6.3-ls-files-no-ignore-cached'

    gitster authored
    * jk/maint-1.6.3-ls-files-no-ignore-cached:
      ls-files: excludes should not impact tracked files
Commits on Oct 12, 2009
  1. @peff @gitster

    ls-files: excludes should not impact tracked files

    peff authored gitster committed
    In all parts of git, .gitignore and other exclude files
    impact only how we treat untracked files; they should have
    no effect on files listed in the index.
    
    This behavior was originally implemented very early on in
    9ff768e, but only for --exclude-from. Later, commit 63d285c
    accidentally caused us to trigger the behavior for
    --exclude-per-directory.
    
    This patch totally ignores excludes for files found in the
    index. This means we are reversing the original intent of
    9ff768e, while at the same time fixing the accidental
    behavior of 63d285c. This is a good thing, though, as the
    way that 9ff768e behaved does not really make sense with the
    way exclusions are used in modern git.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 9, 2009
  1. @gitster

    ls-files: die instead of fprintf/exit in -i error

    Ben Walton authored gitster committed
    When ls-files was called with -i but no exclude pattern, it was
    calling fprintf(stderr, "...", NULL) and then exiting.  On Solaris,
    passing NULL into fprintf was causing a segfault.  On glibc systems,
    it was simply producing incorrect output (eg: "(null)": ...).  The
    NULL pointer was a result of argv[0] not being preserved by the option
    parser.  Instead of requesting that the option parser preserve
    argv[0], use die() with a constant string.
    
    A trigger for this bug was: `git ls-files -i`
    
    Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 24, 2009
  1. @pclouds @gitster

    Read .gitignore from index if it is skip-worktree

    pclouds authored gitster committed
    This adds index as a prerequisite for directory listing (with
    exclude).  At the moment directory listing is used by "git clean",
    "git add", "git ls-files" and "git status"/"git commit" and
    unpack_trees()-related commands.  These commands have been
    checked/modified to populate index before doing directory listing.
    
    add_excludes_from_file() does not enable this feature, because it
    is used to read .git/info/exclude and some explicit files specified
    by "git ls-files".
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @pclouds @gitster

    Teach Git to respect skip-worktree bit (reading part)

    pclouds authored gitster committed
    grep: turn on --cached for files that is marked skip-worktree
    ls-files: do not check for deleted file that is marked skip-worktree
    update-index: ignore update request if it's skip-worktree, while still allows removing
    diff*: skip worktree version
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @pclouds @gitster

    Introduce "skip-worktree" bit in index, teach Git to get/set this bit

    pclouds authored gitster committed
    Detail about this bit is in Documentation/git-update-index.txt.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 9, 2009
  1. @torvalds @gitster

    Add 'fill_directory()' helper function for directory traversal

    torvalds authored gitster committed
    Most of the users of "read_directory()" actually want a much simpler
    interface than the whole complex (but rather powerful) one.
    
    In fact 'git add' had already largely abstracted out the core interface
    issues into a private "fill_directory()" function that was largely
    applicable almost as-is to a number of callers.  Yes, 'git add' wants to
    do some extra work of its own, specific to the add semantics, but we can
    easily split that out, and use the core as a generic function.
    
    This function does exactly that, and now that much simplified
    'fill_directory()' function can be shared with a number of callers,
    while also ensuring that the rather more complex calling conventions of
    read_directory() are used by fewer call-sites.
    
    This also makes the 'common_prefix()' helper function private to dir.c,
    since all callers are now in that file.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 25, 2009
  1. @bebarino @gitster

    parse-opts: prepare for OPT_FILENAME

    bebarino authored gitster committed
    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>
Commits on May 9, 2009
  1. @peff @gitster

    parseopt: add OPT_NEGBIT

    peff authored gitster committed
    On Thu, May 07, 2009 at 09:44:17PM +0200, René Scharfe wrote:
    Subject: [PATCH] ls-files: make --no-empty-directory properly negatable
    
    This option was specified to parseopt as an OPT_BIT; however, we
    actually want to _set_ the bit on --no-empty-directory. Thus the
    existing implementation used --no-empty-directory, and required
    --no-no-empty-directory to negate it.
    
    Now that OPT_NEGBIT exists, we can properly support it as
    --empty-directory and --no-empty-directory (but of course
    still defaulting to showing empty directories).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 23, 2009
  1. @MikeRalphson @gitster

    Fix typos / spelling in comments

    MikeRalphson authored gitster committed
    Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 20, 2009
  1. @gitster

    Merge branch 'mv/parseopt-ls-files'

    gitster authored
    * mv/parseopt-ls-files:
      ls-files: fix broken --no-empty-directory
      t3000: use test_cmp instead of diff
      parse-opt: migrate builtin-ls-files.
      Turn the flags in struct dir_struct into a single variable
    
    Conflicts:
    	builtin-ls-files.c
    	t/t3000-ls-files-others.sh
Commits on Mar 17, 2009
  1. @peff @gitster

    ls-files: require worktree when --deleted is given

    peff authored gitster committed
    The code will end up calling lstat() to check whether the
    file still exists; obviously this doesn't work if we're not
    in the worktree.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 8, 2009
  1. @peff @gitster

    ls-files: fix broken --no-empty-directory

    peff authored gitster committed
    Commit ce8e880 converted ls-files to use parseopt; the
    --no-empty-directory option was converted as an
    OPT_BIT for "empty-directory" to set the
    DIR_HIDE_EMPTY_DIRECTORY flag. However, that makes it do the
    opposite of what it should: --empty-directory would hide,
    but --no-empty-directory would turn off hiding.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 18, 2009
  1. @gitster

    parse-opt: migrate builtin-ls-files.

    Miklos Vajna authored gitster committed
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @dscho @gitster

    Turn the flags in struct dir_struct into a single variable

    dscho authored gitster committed
    By having flags represented as bits in the new member variable 'flags',
    it will be easier to use parse_options when dir_struct is involved.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 7, 2009
  1. @dscho @gitster

    Let ls-files strip trailing slashes in submodules' paths

    dscho authored gitster committed
    Tab completion makes it easy to add a trailing slash to a submodule path.
    As it is completely clear what the user actually wanted to say, be nice
    and strip that slash at the end.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 15, 2009
  1. @drizzd @gitster

    remove pathspec_match, use match_pathspec instead

    drizzd authored gitster committed
    Both versions have the same functionality. This removes any
    redundancy.
    
    This also adds makes two extensions to match_pathspec:
    
    - If pathspec is NULL, return 1. This reflects the behavior of git
      commands, for which no paths usually means "match all paths".
    
    - If seen is NULL, do not use it.
    
    Signed-off-by: Clemens Buchacher <drizzd@aon.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 16, 2008
  1. @gitster

    Teach ls-files --with-tree=<tree> to work with options other than -c

    gitster authored
    Originally --with-tree=<tree> was designed for the sole purpose of
    checking if a given pathspec makes sense as a parameter to git-commit
    using it in conjunction with --error-unmatch.  It had logic to avoid
    showing the same entry (one came from the original index, another from the
    overlayed tree) twice so that it works with -c (i.e. "show-cached"), but
    otherwise it was not designed to work with the flags such as -m, -d, etc.
    
    This teaches the same logic to cover the codepath for -m and -d.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    builtin-ls-files.c: coding style fix.

    gitster authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 17, 2008
  1. @peff @gitster

    refactor handling of "other" files in ls-files and status

    peff authored gitster committed
    When the "git status" display code was originally converted
    to C, we copied the code from ls-files to discover whether a
    pathname returned by read_directory was an "other", or
    untracked, file.
    
    Much later, 5698454 updated the code in ls-files to handle
    some new cases caused by gitlinks.  This left the code in
    wt-status.c broken: it would display submodule directories
    as untracked directories. Nobody noticed until now, however,
    because unless status.showUntrackedFiles was set to "all",
    submodule directories were not actually reported by
    read_directory. So the bug was only triggered in the
    presence of a submodule _and_ this config option.
    
    This patch pulls the ls-files code into a new function,
    cache_name_is_other, and uses it in both places. This should
    leave the ls-files functionality the same and fix the bug
    in status.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 31, 2008
  1. @gitster

    'git foo' program identifies itself without dash in die() messages

    gitster authored
    This is a mechanical conversion of all '*.c' files with:
    
    	s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;
    
    The result was manually inspected and no false positive was found.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 13, 2008
  1. @sbeyer @gitster

    Make usage strings dash-less

    sbeyer authored gitster committed
    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>
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 Mar 7, 2008
  1. @gitster

    Revert part of d089eba (setup: sanitize absolute and funny paths in g…

    gitster authored
    …et_pathspec())
    
    When get_pathspec() was originally made absolute-path capable,
    we botched the interface to it, without dying inside the function
    when given a path that is outside the work tree, and made it the
    responsibility of callers to check the condition in a roundabout
    way.  This is made unnecessary with the previous patch.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 21, 2008
  1. @gitster

    Merge branch 'jc/setup'

    gitster authored
    * jc/setup:
      builtin-mv: minimum fix to avoid losing files
      git-add: adjust to the get_pathspec() changes.
      Make blame accept absolute paths
      setup: sanitize absolute and funny paths in get_pathspec()
Commits on Feb 17, 2008
  1. @gitster

    Merge branch 'jc/gitignore-ends-with-slash'

    gitster authored
    * jc/gitignore-ends-with-slash:
      gitignore: lazily find dtype
      gitignore(5): Allow "foo/" in ignore list to match directory "foo"
Commits on Feb 5, 2008
  1. @gitster

    gitignore: lazily find dtype

    gitster authored
    When we process "foo/" entries in gitignore files on a system
    that does not have d_type member in "struct dirent", the earlier
    implementation ran lstat(2) separately when matching with
    entries that came from the command line, in-tree .gitignore
    files, and $GIT_DIR/info/excludes file.
    
    This optimizes it by delaying the lstat(2) call until it becomes
    absolutely necessary.
    
    The initial idea for this change was by Jeff King, but I
    optimized it further to pass pointers to around.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    gitignore(5): Allow "foo/" in ignore list to match directory "foo"

    gitster authored
    A pattern "foo/" in the exclude list did not match directory
    "foo", but a pattern "foo" did.  This attempts to extend the
    exclude mechanism so that it would while not matching a regular
    file or a symbolic link "foo".  In order to differentiate a
    directory and non directory, this passes down the type of path
    being checked to excluded() function.
    
    A downside is that the recursive directory walk may need to run
    lstat(2) more often on systems whose "struct dirent" do not give
    the type of the entry; earlier it did not have to do so for an
    excluded path, but we now need to figure out if a path is a
    directory before deciding to exclude it.  This is especially bad
    because an idea similar to the earlier CE_UPTODATE optimization
    to reduce number of lstat(2) calls would by definition not apply
    to the codepaths involved, as (1) directories will not be
    registered in the index, and (2) excluded paths will not be in
    the index anyway.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    setup: sanitize absolute and funny paths in get_pathspec()

    gitster authored
    The prefix_path() function called from get_pathspec() is
    responsible for translating list of user-supplied pathspecs to
    list of pathspecs that is relative to the root of the work
    tree.  When working inside a subdirectory, the user-supplied
    pathspecs are taken to be relative to the current subdirectory.
    
    Among special path components in pathspecs, we used to accept
    and interpret only "." ("the directory", meaning a no-op) and
    ".."  ("up one level") at the beginning.  Everything else was
    passed through as-is.
    
    For example, if you are in Documentation/ directory of the
    project, you can name Documentation/howto/maintain-git.txt as:
    
        howto/maintain-git.txt
        ../Documentation/howto/maitain-git.txt
        ../././Documentation/howto/maitain-git.txt
    
    but not as:
    
        howto/./maintain-git.txt
        $(pwd)/howto/maintain-git.txt
    
    This patch updates prefix_path() in several ways:
    
     - If the pathspec is not absolute, prefix (i.e. the current
       subdirectory relative to the root of the work tree, with
       terminating slash, if not empty) and the pathspec is
       concatenated first and used in the next step.  Otherwise,
       that absolute pathspec is used in the next step.
    
     - Then special path components "." (no-op) and ".." (up one
       level) are interpreted to simplify the path.  It is an error
       to have too many ".." to cause the intermediate result to
       step outside of the input to this step.
    
     - If the original pathspec was not absolute, the result from
       the previous step is the resulting "sanitized" pathspec.
       Otherwise, the result from the previous step is still
       absolute, and it is an error if it does not begin with the
       directory that corresponds to the root of the work tree.  The
       directory is stripped away from the result and is returned.
    
     - In any case, the resulting pathspec in the array
       get_pathspec() returns omit the ones that caused errors.
    
    With this patch, the last two examples also behave as expected.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 21, 2008
  1. @torvalds

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

    torvalds authored
    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>
Something went wrong with that request. Please try again.