Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Sep 7, 2009
  1. Merge branch 'tr/reset-checkout-patch'

    authored
    * tr/reset-checkout-patch:
      stash: simplify defaulting to "save" and reject unknown options
      Make test case number unique
      tests: disable interactive hunk selection tests if perl is not available
      DWIM 'git stash save -p' for 'git stash -p'
      Implement 'git stash save --patch'
      Implement 'git checkout --patch'
      Implement 'git reset --patch'
      builtin-add: refactor the meat of interactive_add()
      Add a small patch-mode testing library
      git-apply--interactive: Refactor patch mode code
      Make 'git stash -k' a short form for 'git stash save --keep-index'
Commits on Aug 29, 2009
  1. Merge branch 'jk/maint-1.6.3-checkout-unborn'

    authored
    * jk/maint-1.6.3-checkout-unborn:
      checkout: do not imply "-f" on unborn branches
Commits on May 26, 2009
  1. Merge branch 'lt/maint-diff-reduce-lstat' into maint

    authored
    * lt/maint-diff-reduce-lstat:
      Teach 'git checkout' to preload the index contents
      Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
Commits on May 23, 2009
  1. Merge branch 'lt/maint-diff-reduce-lstat'

    authored
    * lt/maint-diff-reduce-lstat:
      Teach 'git checkout' to preload the index contents
      Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
Commits on May 12, 2009
  1. Merge branch 'maint-1.6.2' into maint

    authored
    * maint-1.6.2:
      Revert "checkout branch: prime cache-tree fully"
  2. Revert "checkout branch: prime cache-tree fully"

    authored
    The logic in 83ae209 (checkout branch: prime cache-tree fully,
    2009-04-20) is bogus; checkout can switch branches with a dirty
    index and in such a case the tree won't match HEAD.
    
    Add t2014-switch to catch this breakage.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 23, 2009
  1. Merge branch 'jc/maint-read-tree-multi'

    authored
    * jc/maint-read-tree-multi:
      checkout branch: prime cache-tree fully
      read-tree -m A B: prime cache-tree from the switched-to tree
      Move prime_cache_tree() to cache-tree.c
      read-tree A B: do not corrupt cache-tree
Commits on Apr 20, 2009
  1. checkout branch: prime cache-tree fully

    authored
    When switching to another branch, the earlier code relied on incremental
    invalidation of cache-tree entries to degrade it.  While it is not wrong
    per-se, we know that the resulting index must fully match the branch we
    are switching to unless the -m (merge) option is used.
    
    We should simply fully re-prime the cache-tree using the new tree object
    in such a case.  And for safety, invalidate the cache-tree as a whole in
    other cases.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Move prime_cache_tree() to cache-tree.c

    authored
    The interface to build cache-tree belongs there.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 18, 2009
  1. Merge branch 'js/maint-submodule-checkout' into maint

    authored
    * js/maint-submodule-checkout:
      Fix 'git checkout <submodule>' to update the index
Commits on Apr 8, 2009
  1. Merge branch 'maint'

    authored
    * maint:
      Change double quotes to single quotes in message
      Documentation: clarify .gitattributes search
      git-checkout.txt: clarify that <branch> applies when no path is given.
      git-checkout.txt: fix incorrect statement about HEAD and index
    
    Conflicts:
    	Documentation/git-checkout.txt
  2. Merge branch 'js/maint-submodule-checkout'

    authored
    * js/maint-submodule-checkout:
      Fix 'git checkout <submodule>' to update the index
Commits on Apr 6, 2009
  1. Merge branch 'jc/name-branch'

    authored
    * jc/name-branch:
      Don't permit ref/branch names to end with ".lock"
      check_ref_format(): tighten refname rules
      strbuf_check_branch_ref(): a helper to check a refname for a branch
      Fix branch -m @{-1} newname
      check-ref-format --branch: give Porcelain a way to grok branch shorthand
      strbuf_branchname(): a wrapper for branch name shorthands
      Rename interpret/substitute nth_last_branch functions
    
    Conflicts:
    	Documentation/git-check-ref-format.txt
Commits on Mar 23, 2009
  1. strbuf_check_branch_ref(): a helper to check a refname for a branch

    authored
    This allows a common calling sequence
    
    	strbuf_branchname(&ref, name);
    	strbuf_splice(&ref, 0, 0, "refs/heads/", 11);
    	if (check_ref_format(ref.buf))
    		die(...);
    
    to be refactored into
    
    	if (strbuf_check_branch_ref(&ref, name))
    		die(...);
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. strbuf_branchname(): a wrapper for branch name shorthands

    authored
    The function takes a user-supplied string that is supposed to be a branch
    name, and puts it in a strbuf after expanding possible shorthand notation.
    
    A handful of open coded sequence to do this in the existing code have been
    changed to use this helper function.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. Rename interpret/substitute nth_last_branch functions

    authored
    These allow you to say "git checkout @{-2}" to switch to the branch two
    "branch switching" ago by pretending as if you typed the name of that
    branch.  As it is likely that we will be introducing more short-hands to
    write the name of a branch without writing it explicitly, rename the
    functions from "nth_last_branch" to more generic "branch_name", to prepare
    for different semantics.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 20, 2009
  1. Merge branch 'mv/parseopt-ls-files'

    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 Jan 28, 2009
  1. Merge branch 'tr/previous-branch'

    authored
    * tr/previous-branch:
      t1505: remove debugging cruft
      Simplify parsing branch switching events in reflog
      Introduce for_each_recent_reflog_ent().
      interpret_nth_last_branch(): plug small memleak
      Fix reflog parsing for a malformed branch switching entry
      Fix parsing of @{-1}@{1}
      interpret_nth_last_branch(): avoid traversing the reflog twice
      checkout: implement "-" abbreviation, add docs and tests
      sha1_name: support @{-N} syntax in get_sha1()
      sha1_name: tweak @{-N} lookup
      checkout: implement "@{-N}" shortcut name for N-th last branch
    
    Conflicts:
    	sha1_name.c
Commits on Jan 26, 2009
  1. Merge branch 'cb/add-pathspec'

    authored
    * cb/add-pathspec:
      remove pathspec_match, use match_pathspec instead
      clean up pathspec matching
Commits on Jan 18, 2009
  1. checkout: implement "@{-N}" shortcut name for N-th last branch

    authored
    Implement a shortcut @{-N} for the N-th last branch checked out, that
    works by parsing the reflog for the message added by previous
    git-checkout invocations.  We expand the @{-N} to the branch name, so
    that you end up on an attached HEAD on that branch.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 12, 2009
  1. Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint

    authored
    * jc/maint-do-not-switch-to-non-commit:
      git checkout: do not allow switching to a tree-ish that is not a commit
Commits on Jan 3, 2009
  1. Merge branch 'jc/maint-do-not-switch-to-non-commit'

    authored
    * jc/maint-do-not-switch-to-non-commit:
      git checkout: do not allow switching to a tree-ish that is not a commit
  2. git checkout: do not allow switching to a tree-ish that is not a commit

    authored
    "git checkout -b newbranch $commit^{tree}" mistakenly created a new branch
    rooted at the current HEAD, because in that case, the two structure fields
    used to see if the command was invoked without any argument (hence it
    needs to default to checking out the HEAD) were populated incorrectly.
    
    Upon seeing a command line argument that we took as a rev, we should store
    that string in new.name, even if that does not name a commit.  This will
    correctly trigger the existing safety logic.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Commits on Dec 8, 2008
  1. builtin-checkout.c: check error return from read_cache()

    authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 28, 2008
  1. Merge branch 'maint'

    authored
    * maint:
      sha1_file.c: resolve confusion EACCES vs EPERM
      sha1_file: avoid bogus "file exists" error message
      git checkout: don't warn about unborn branch if -f is already passed
      bash: offer refs instead of filenames for 'git revert'
      bash: remove dashed command leftovers
      git-p4: fix keyword-expansion regex
      fast-export: use an unsorted string list for extra_refs
      Add new testcase to show fast-export does not always exports all tags
Commits on Nov 12, 2008
  1. Merge branch 'maint'

    authored
    * maint:
      Start 1.6.0.5 cycle
      Fix pack.packSizeLimit and --max-pack-size handling
      checkout: Fix "initial checkout" detection
      Remove the period after the git-check-attr summary
    
    Conflicts:
    	RelNotes
  2. checkout: Fix "initial checkout" detection

    authored
    Earlier commit 5521883 (checkout: do not lose staged removal, 2008-09-07)
    tightened the rule to prevent switching branches from losing local
    changes, so that staged removal of paths can be protected, while
    attempting to keep a loophole to still allow a special case of switching
    out of an un-checked-out state.
    
    However, the loophole was made a bit too tight, and did not allow
    switching from one branch (in an un-checked-out state) to check out
    another branch.
    
    The change to builtin-checkout.c in this commit loosens it to allow this,
    by not insisting the original commit and the new commit to be the same.
    
    It also introduces a new function, is_index_unborn (and an associated
    macro, is_cache_unborn), to check if the repository is truly in an
    un-checked-out state more reliably, by making sure that $GIT_INDEX_FILE
    did not exist when populating the in-core index structure.  A few places
    the earlier commit 5521883 added the check for the initial checkout
    condition are updated to use this function.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 9, 2008
  1. Merge branch 'maint'

    authored
    * maint:
      Documentation: bisect: change a few instances of "git-cmd" to "git cmd"
      Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"
      checkout: Don't crash when switching away from an invalid branch.
Commits on Oct 19, 2008
  1. Fix mismerge at cdb22c4 in builtin-checkout.c

    authored
    The code to complain when -b is not given but an explicit --track/--no-track
    override was given from the command line was unchanged on one branch and
    reworked on the other branch.  The merge result incorrectly kept it.
    
    Spotted by Matt McCutchen.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 18, 2008
  1. Merge branch 'db/maint-checkout-b' into maint

    authored
    * db/maint-checkout-b:
      Check early that a new branch is new and valid
Commits on Sep 22, 2008
  1. Merge branch 'db/maint-checkout-b'

    authored
    * db/maint-checkout-b:
      Check early that a new branch is new and valid
Commits on Sep 19, 2008
  1. Merge branch 'jc/maint-checkout-keep-remove' into maint

    authored
    * jc/maint-checkout-keep-remove:
      checkout: do not lose staged removal
Commits on Sep 16, 2008
  1. Merge branch 'jc/maint-checkout-keep-remove'

    authored
    * jc/maint-checkout-keep-remove:
      checkout: do not lose staged removal
Commits on Sep 10, 2008
  1. Merge branch 'jc/maint-checkout-fix' into maint

    authored
    * jc/maint-checkout-fix:
      checkout: do not check out unmerged higher stages randomly
  2. checkout: do not lose staged removal

    authored
    The logic to checkout a different commit implements the safety to never
    lose user's local changes.  For example, switching from a commit to
    another commit, when you have changed a path that is different between
    them, need to merge your changes to the version from the switched-to
    commit, which you may not necessarily be able to resolve easily.  By
    default, "git checkout" refused to switch branches, to give you a chance
    to stash your local changes (or use "-m" to merge, accepting the risks of
    getting conflicts).
    
    This safety, however, had one deliberate hole since early June 2005.  When
    your local change was to remove a path (and optionally to stage that
    removal), the command checked out the path from the switched-to commit
    nevertheless.
    
    This was to allow an initial checkout to happen smoothly (e.g. an initial
    checkout is done by starting with an empty index and switching from the
    commit at the HEAD to the same commit).  We can tighten the rule slightly
    to allow this special case to pass, without losing sight of removal
    explicitly done by the user, by noticing if the index is truly empty when
    the operation begins.
    
    For historical background, see:
    
        http://thread.gmane.org/gmane.comp.version-control.git/4641/focus=4646
    
    This case is marked as *0* in the message, which both Linus and I said "it
    feels somewhat wrong but otherwise we cannot start from an empty index".
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.