Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jan 19, 2010
  1. @moy @gitster

    branch: warn and refuse to set a branch as a tracking branch of itself.

    moy authored gitster committed
    Previous patch allows commands like "git branch --set-upstream foo foo",
    which doesn't make much sense. Warn the user and don't change the
    configuration in this case. Don't die to let the caller finish its job in
    such case.
    Signed-off-by: Matthieu Moy <>
    Signed-off-by: Ilari Liusvaara <>
    Signed-off-by: Junio C Hamano <>
  2. @gitster

    Add branch --set-upstream

    Ilari Liusvaara authored gitster committed
    Add --set-upstream option to branch that works like --track, except that
    when branch exists already, its upstream info is changed without changing
    the ref value.
    Based-on-patch-from: Matthieu Moy <>
    Signed-off-by: Matthieu Moy <>
    Signed-off-by: Ilari Liusvaara <>
    Signed-off-by: Junio C Hamano <>
Commits on Jun 27, 2009
  1. @trast @gitster

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

    trast authored gitster committed
    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 <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 23, 2009
  1. @gitster

    strbuf_check_branch_ref(): a helper to check a refname for a branch

    gitster 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))
    to be refactored into
    	if (strbuf_check_branch_ref(&ref, name))
    Signed-off-by: Junio C Hamano <>
  2. @gitster

    strbuf_branchname(): a wrapper for branch name shorthands

    gitster 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 <>
  3. @gitster

    Rename interpret/substitute nth_last_branch functions

    gitster 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 <>
Commits on Mar 11, 2009
  1. @gitster

    Improve "git branch --tracking" output

    gitster authored
    An earlier patch always spelled the full name of the ref that we track
    (e.g. "refs/heads/frotz" instead of just "frotz" when we mean the branch
    whose name is "frotz").  Worse yet, because we now use the true name of
    the ref at the original repository when talk about a tracking branch that
    copies from a remote, such a full name alone still does not give enough
    This reorganizes the verbose codepath to:
     - differentiate "refs/heads/something" and everything else; we say that
       the branch tracks "branch <something>" if it begins with "refs/heads/",
       and otherwise the branch tracks "ref refs/<someother>/<something>";
     - report the name of the remote when we talk about a tracking branch, by
       saying "branch frotz from origin";
     - not say "by merging" at the end; it is the default and is not worth
    Signed-off-by: Junio C Hamano <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 4, 2009
  1. @gitster

    Make git-clone respect branch.autosetuprebase

    gitster authored
    When git-clone creates an initial branch it was not checking the
    branch.autosetuprebase configuration option (which may exist in
    ~/.gitconfig).  Refactor the code used by "git branch" to create
    a new branch, and use it instead of the insufficiently duplicated code
    in builtin-clone.
    Changes are partly, and the test is mostly, based on the previous work by
    Pat Notz.
    Signed-off-by: Junio C Hamano <>
Commits on Feb 14, 2009
  1. @gitster

    Teach the "@{-1} syntax to "git branch"

    gitster authored
    This teaches the new "@{-1} syntax to refer to the previous branch to "git
    branch".  After looking at somebody's faulty patch series on a topic
    branch too long, if you decide it is not worth merging, you can just say:
        $ git checkout master
        $ git branch -D @{-1}
    to get rid of it without having to type the name of the topic you now hate
    so much for wasting a lot of your time.
    Signed-off-by: Junio C Hamano <>
Commits on Oct 22, 2008
  1. @gitster

    Merge branch 'jc/maint-co-track'

    gitster authored
    * jc/maint-co-track:
      Enhance hold_lock_file_for_{update,append}() API
      demonstrate breakage of detached checkout with symbolic link HEAD
      Fix "checkout --track -b newbranch" on detached HEAD
Commits on Oct 17, 2008
  1. @gitster

    Fix "checkout --track -b newbranch" on detached HEAD

    gitster authored
    The test to make sure that checkout fails when --track was asked for and
    we cannot set up tracking information in t7201 was wrong, and it turns out
    that the implementation for that feature itself was buggy.  This fixes it.
    Signed-off-by: Junio C Hamano <>
Commits on Oct 3, 2008
  1. @spearce

    builtin-commit: use reduce_heads() only when appropriate

    Miklos Vajna authored spearce committed
    Since commit 6bb6b03 (builtin-commit: use commit_tree(), 2008-09-10),
    builtin-commit performs a reduce_heads() unconditionally.  However,
    it's not always needed, and in some cases even harmful.
    reduce_heads() is not needed for the initial commit or for an
    "ordinary" commit, because they don't have any or have only one
    parent, respectively.
    reduce_heads() must be avoided when 'git commit' is run after a 'git
    merge --no-ff --no-commit', otherwise it will turn the
    non-fast-forward merge into fast-forward.  For the same reason,
    reduce_heads() must be avoided when amending such a merge commit.
    To resolve this issue, 'git merge' will write info about whether
    fast-forward is allowed or not to $GIT_DIR/MERGE_MODE.  Based on this
    info, 'git commit' will only perform reduce_heads() when it's
    committing a merge and fast-forward is enabled.
    Also add test cases to ensure that non-fast-forward merges are
    committed and amended properly.
    Signed-off-by: Miklos Vajna <>
    Signed-off-by: SZEDER Gábor <>
    Signed-off-by: Shawn O. Pearce <>
Commits on Jul 13, 2008
  1. @dscho @gitster

    Move MERGE_RR from .git/rr-cache/ into .git/

    dscho authored gitster committed
    If you want to reuse the rerere cache in another repository, and set
    a symbolic link to it, you do not want to have the two repositories
    interfer with each other by accessing the _same_ MERGE_RR.
    For example, if you use contrib/git-new-workdir to set up a second
    working directory, and you have a conflict in one working directory,
    but commit in the other working directory first, the wrong "resolution"
    will be recorded.
    The easy solution is to move MERGE_RR out of the rr-cache/ directory,
    which also corresponds with the notion that rr-cache/ contains cached
    resolutions, not some intermediate temporary states.
    Noticed by Kalle Olavi Niemitalo.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on May 11, 2008
  1. @dustin @gitster

    Allow tracking branches to set up rebase by default.

    dustin authored gitster committed
    Change cd67e4d introduced a new configuration parameter that told
    pull to automatically perform a rebase instead of a merge.  This
    change provides a configuration option to enable this feature
    automatically when creating a new branch.
    If the variable branch.autosetuprebase applies for a branch that's
    being created, that branch will have branch.<name>.rebase set to true.
    Signed-off-by: Dustin Sallings <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 20, 2008
  1. @jaysoffian @gitster

    branch: optionally setup branch.*.merge from upstream local branches

    jaysoffian authored gitster committed
    "git branch" and "git checkout -b" now honor --track option even when
    the upstream branch is local.  Previously --track was silently ignored
    when forking from a local branch.  Also the command did not error out
    when --track was explicitly asked for but the forked point specified
    was not an existing branch (i.e. when there is no way to set up the
    tracking configuration), but now it correctly does.
    The configuration setting branch.autosetupmerge can now be set to
    "always", which is equivalent to using --track from the command line.
    Setting branch.autosetupmerge to "true" will retain the former behavior
    of only setting up branch.*.merge for remote upstream branches.
    Includes test cases for the new functionality.
    Signed-off-by: Jay Soffian <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 10, 2008
  1. @gitster

    Move code to clean up after a branch change to branch.c

    Daniel Barkalow authored gitster committed
    Signed-off-by: Daniel Barkalow <>
  2. @gitster

    Move create_branch into a library file

    Daniel Barkalow authored gitster committed
    You can also create branches, in exactly the same way, with checkout -b.
    This introduces branch.{c,h} library files for doing porcelain-level
    operations on branches (such as creating them with their appropriate
    default configuration).
    Signed-off-by: Daniel Barkalow <>
Something went wrong with that request. Please try again.