Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Oct 18, 2011

  1. Junio C Hamano

    Merge branch 'jk/pull-rebase-with-work-tree'

    * jk/pull-rebase-with-work-tree:
      pull,rebase: handle GIT_WORK_TREE better
    
    Conflicts:
    	git-pull.sh
    authored October 17, 2011

Oct 13, 2011

  1. Jeff King

    pull,rebase: handle GIT_WORK_TREE better

    You can't currently run git-pull or git-rebase from outside
    of the work tree, even with GIT_WORK_TREE set, due to an
    overeager require_work_tree function. Commit e2eb527
    documents this problem and provides the infrastructure for a
    fix, but left it to later commits to audit and update
    individual scripts.
    
    Changing these scripts to use require_work_tree_exists is
    easy to verify. We immediately call cd_to_toplevel, anyway.
    Therefore no matter which function we use, the state
    afterwards is one of:
    
      1. We have a work tree, and we are at the top level.
    
      2. We don't have a work tree, and we have died.
    
    The only catch is that we must also make sure no code that
    ran before the cd_to_toplevel assumed that we were already
    in the working tree.
    
    In this case, we will only have included shell libraries and
    called set_reflog_action, neither of which care about the
    current working directory at all.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored October 13, 2011 gitster committed October 13, 2011

Aug 05, 2011

  1. jonseymour

    misc-sh: fix up whitespace in some other .sh files.

    I found that the patched 4 files were different when this
    filter is applied.
    
    	expand -i | unexpand --first-only
    
    This patch contains the corrected files.
    
    Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored August 05, 2011 gitster committed August 05, 2011

Jul 22, 2011

  1. Junio C Hamano

    Merge branch 'mz/doc-rebase-abort'

    * mz/doc-rebase-abort:
      rebase: clarify "restore the original branch"
    authored July 22, 2011

Jul 14, 2011

  1. rebase: clarify "restore the original branch"

    The description for 'git rebase --abort' currently says:
    
        Restore the original branch and abort the rebase operation.
    
    The "restore" can be misinterpreted to imply that the original branch
    was somehow in a broken state during the rebase operation. It is also
    not completely clear what "the original branch" is --- is it the
    branch that was checked out before the rebase operation was called or
    is the the branch that is being rebased (it is the latter)? Although
    both issues are made clear in the DESCRIPTION section, let us also
    make the entry in the OPTIONS secion more clear.
    
    Also remove the term "rebasing process" from the usage text, since the
    user already knows that the text is about "git rebase".
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 13, 2011 gitster committed July 13, 2011

Jul 13, 2011

  1. Junio C Hamano

    Merge branch 'js/rebase-typo-branch-squelch-usage'

    * js/rebase-typo-branch-squelch-usage:
      rebase: do not print lots of usage hints after an obvious error message
    authored July 13, 2011

Jun 29, 2011

  1. rebase: do not print lots of usage hints after an obvious error message

    When a non-existent branch was specified to be rebased, the complete
    usage information is printed after the error message that carries the
    relevant piece of information:
    
       $ git rebase master topci
       fatal: no such branch: topci
       usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
          or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
          or: git-rebase [-i] --continue | --abort | --skip
    
       Available options are
       [30 lines of usage stripped]
    
    The error message was introduced recently by 4ac5356 (rebase: give a
    better error message for bogus branch, 2011-01-27), and the result was
    acceptable because the usage text was just two lines. But 45e2acf
    (rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse
    because the usage text is now 35 lines.
    
    Just drop the usage information because it does not add value to the
    error message.
    
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Acked-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 28, 2011 gitster committed June 29, 2011

May 27, 2011

  1. Jeff King

    rebase: write a reflog entry when finishing

    When we finish a rebase, our detached HEAD is at the final
    result. We update the original branch ref with this result,
    and then point the HEAD symbolic ref at the updated branch.
    We write a reflog for the branch update, but not for the
    update of HEAD.
    
    Because we're already at the final result on the detached
    HEAD, moving to the branch actually doesn't change our
    commit sha1 at all. So in that sense, a reflog entry would
    be pointless.
    
    However, humans do read reflogs, and an entry saying "rebase
    finished: returning to refs/heads/master" can be helpful in
    understanding what is going on.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 27, 2011 gitster committed May 27, 2011
  2. Csaba Henk

    rebase: create HEAD reflog entry when aborting

    When we abort a rebase, we return to the original value of
    HEAD. Failing to write a reflog entry means we create a
    gap in the reflog (which can cause "git show
    HEAD@{5.minutes.ago}" to issue a warning). Plus having the
    extra entry makes the reflog easier to follow for a human.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 27, 2011 gitster committed May 27, 2011

Mar 05, 2011

  1. rebase: define options in OPTIONS_SPEC

    Interactive rebase used to have its own command line processing. Since
    it used the 'git rev-parse --parseopt' functionality exposed through
    git-sh-setup, it had some flexibility, like matching prefixes of long
    options, that non-interactive rebase didn't. When interactive rebase's
    command line processing was factored out into git-rebase.sh in cf432ca
    (rebase: factor out command line option processing, 2011-02-06), this
    flexibility was lost. Give back that flexibility to interactive and
    non-interactive by defining its options in OPTIONS_SPEC.
    
    Also improve the usage message to contain the --continue, --skip and
    --abort sub commands.
    
    Reported-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 28, 2011 gitster committed March 04, 2011

Feb 10, 2011

  1. rebase: use @{upstream} if no upstream specified

    'git rebase' without arguments is currently not supported. Make it
    default to 'git rebase @{upstream}'. That is also what 'git pull
    [--rebase]' defaults to, so it only makes sense that 'git rebase'
    defaults to the same thing.
    
    Defaulting to @{upstream} will make it possible to run e.g. 'git
    rebase -i' without arguments, which is probably a quite common use
    case. It also improves the scenario where you have multiple branches
    that rebase against a remote-tracking branch, where you currently have
    to choose between the extra network delay of 'git pull' or the
    slightly awkward keys to enter 'git rebase @{u}'.
    
    The error reporting when no upstream is configured for the current
    branch or when no branch is checked out is reused from git-pull.sh. A
    function is extracted into git-parse-remote.sh for this purpose.
    
    Helped-by: Yann Dirson <ydirson@altern.org>
    Helped-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 09, 2011 gitster committed February 10, 2011
  2. rebase -m: remember allow_rerere_autoupdate option

    If '--[no-]allow_rerere_autoupdate' is passed when 'git rebase -m' is
    called and a merge conflict occurs, the flag will be forgotten for the
    rest of the rebase process. Make rebase remember it by saving the
    value.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  3. rebase: remember strategy and strategy options

    When a rebase is resumed, interactive rebase remembers any merge
    strategy passed when the rebase was initated. Make non-interactive
    rebase remember any merge strategy as well. Also make non-interactive
    rebase remember any merge strategy options.
    
    To be able to resume a rebase that was initiated with an older version
    of git (older than this commit), make sure not to expect the saved
    option files to exist.
    
    Test case idea taken from Junio's 71fc224 (t3402: test "rebase
    -s<strategy> -X<opt>", 2010-11-11).
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  4. rebase: remember verbose option

    Currently, only interactive rebase remembers the value of the '-v'
    flag from the initial invocation. Make non-interactive rebase also
    remember it.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  5. rebase: extract code for writing basic state

    Extract the code for writing the state to rebase-apply/ or
    rebase-merge/ when a rebase is initiated. This will make it easier to
    later make both interactive and non-interactive rebase remember the
    options used.
    
    Note that non-interactive rebase stores the sha1 of the original head
    in a file called orig-head, while interactive rebase stores it in a
    file called head. Change this by writing to orig-head in both
    cases. When reading, try to read from orig-head. If that fails, read
    from head instead. This protects users who upgraded git while they had
    an ongoing interactive rebase, while still making it possible to
    remove the code that reads from head at some point in the future.
    
    Helped-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  6. rebase: factor out sub command handling

    Factor out the common parts of the handling of the sub commands
    '--continue', '--skip' and '--abort'. The '--abort' handling can
    handled completely in git-rebase.sh.
    
    After this refactoring, the calls to git-rebase--am.sh,
    git-rebase--merge.sh and git-rebase--interactive.sh will be better
    aligned. There will only be one call to interactive rebase that will
    shortcut the very last part of git-rebase.sh.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  7. rebase: make -v a tiny bit more verbose

    To make it possible to later remove the handling of --abort from
    git-rebase--interactive.sh, align the implementation in git-rebase.sh
    with the former by making it a bit more verbose.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  8. rebase: extract am code to new source file

    Extract the code for am-based rebase to git-rebase--am.sh.
    
    Suggested-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  9. rebase: extract merge code to new source file

    Extract the code for merge-based rebase to git-rebase--merge.sh.
    
    Suggested-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  10. rebase: remove $branch as synonym for $orig_head

    The variables $branch and $orig_head were used as synonyms. To avoid
    confusion, remove $branch. The name 'orig_head' seems more suitable,
    since that is the name used when the variable is persisted.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  11. rebase -i: support --stat

    Move up the code that displays the diffstat if '--stat' is passed, so
    that it will be executed before calling git-rebase--interactive.sh.
    
    A side effect is that the diffstat is now displayed before "First,
    rewinding head to replay your work on top of it...".
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  12. rebase: factor out call to pre-rebase hook

    Remove the call to the pre-rebase hook from
    git-rebase--interactive.sh and rely on the call in
    git-rebase.sh.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  13. rebase: factor out clean work tree check

    Remove the check for clean work tree from git-rebase--interactive.sh and
    rely on the check in git-rebase.sh.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  14. rebase: factor out reference parsing

    Remove the parsing and validation of references (onto, upstream, branch)
    from git-rebase--interactive.sh and rely on the information exported from
    git-rebase.sh.
    
    By using the parsing of the --onto parameter in git-rebase.sh, this
    improves the error message when the parameter is invalid.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  15. rebase: reorder validation steps

    Reorder validation steps in preparation for the validation to be factored
    out from git-rebase--interactive.sh into git-rebase.sh.
    
    The main functional difference is that the pre-rebase hook will no longer
    be run if the work tree is dirty.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  16. rebase: factor out command line option processing

    Factor out the command line processing in git-rebase--interactive.sh
    to git-rebase.sh. Store the options in variables in git-rebase.sh and
    then source git-rebase--interactive.sh.
    
    Suggested-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  17. rebase: align variable content

    Make sure to interpret variables with the same name in the same way in
    git-rebase.sh and git-rebase--interactive.sh. This will make it easier
    to factor out code from git-rebase.sh to git-rebase--interactive and
    export the variables.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  18. rebase: align variable names

    git-rebase--interactive.sh will soon be sourced from
    git-rebase.sh. Align the names of variables used in these scripts to
    prepare for that.
    
    Some names in git-rebase--interactive.sh, such as "author_script" and
    "amend", are currently used in their upper case form to refer to a
    file and in their lower case form to refer to something else. In these
    cases, change the name of the existing lower case variable and
    downcase the name of the variable that refers to the file.
    
    Currently, git-rebase.sh uses mostly lower case variable names, while
    git-rebase--interactive.sh uses mostly upper case variable names. For
    consistency, downcase all variables, not just the ones that will be
    shared between the two script files.
    
    Helped-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  19. rebase: stricter check of standalone sub command

    The sub commands '--continue', '--skip' or '--abort' may only be used
    standalone according to the documentation. Other options following the
    sub command are currently not accepted, but options preceeding them
    are. For example, 'git rebase --continue -v' is not accepted, while
    'git rebase -v --continue' is. Tighten up the check and allow no other
    options when one of these sub commands are used.
    
    Only check that it is standalone for non-interactive rebase for
    now. Once the command line processing for interactive rebase has been
    replaced by the command line processing in git-rebase.sh, this check
    will also apply to interactive rebase.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  20. rebase: act on command line outside parsing loop

    To later be able to use the command line processing in git-rebase.sh
    for both interactive and non-interactive rebases, move anything that
    is specific to non-interactive rebase outside of the parsing
    loop. Keep only parsing and validation of command line options in the
    loop.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  21. rebase: improve detection of rebase in progress

    Detect early on if a rebase is in progress and what type of rebase it
    is (interactive, merge-based or am-based). This prepares for further
    refactoring where am-based rebase will be dispatched to
    git-rebase--am.sh and merge-based rebase will be dispatched to
    git-rebase--merge.sh.
    
    The idea is to use the same variables whether the type of rebase was
    detected from rebase-apply/ or rebase-merge/ directories or from the
    command line options. This will make the code more readable and will
    later also make it easier to dispatch to the type-specific scripts.
    
    Also show a consistent error message independent of the type of rebase
    that was in progress and remove the obsolete wording about being in
    the middle of a 'patch application', since that (an existing
    "$GIT_DIR"/rebase-apply/applying) aborts 'git rebase' at an earlier
    stage.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  22. rebase: remove unused rebase state 'prev_head'

    The state stored in $GIT_DIR/rebase-merge/prev_head was introduced in
    58634db (rebase: Allow merge strategies to be used when rebasing,
    2006-06-21), but it was never used and should therefore be removed.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  23. rebase: read state outside loop

    The 'onto_name' state used in 'git rebase --merge' is currently read
    once for each commit that need to be applied. It doesn't change
    between each iteration, however, so it should be moved out of the
    loop. This also makes the code more readable. Also remove the unused
    variable 'end'.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  24. rebase: refactor reading of state

    The code reading the state saved in $merge_dir or $rebase_dir is
    currently spread out in many places, making it harder to read and to
    introduce additional state. Extract this code into one method that
    reads the state. Only extract the code associated with the state that
    is written when the rebase is initiated. Leave the state that changes
    for each commmit, at least for now.
    
    Currently, when resuming a merge-based rebase using --continue or
    --skip, move_to_original_branch (via finish_rb_merge) will be called
    without head_name and orig_head set. These variables are then lazily
    read in move_to_original_branch if head_name is not set (together with
    onto, which is unnecessarily read again). Change this by always
    eagerly reading the state, for both am-based and merge-based rebase,
    in the --continue and --skip cases. Note that this does not change the
    behavior for am-based rebase, which read the state eagerly even before
    this commit.
    
    Reading the state eagerly means that part of the state will sometimes
    be read unnecessarily. One example is when the rebase is continued,
    but stops again at another merge conflict. Another example is when the
    rebase is aborted. However, since both of these cases involve user
    interaction, the delay is hopefully not noticeable. The
    call_merge/continue_merge loop is not affected.
    
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
  25. rebase: clearer names for directory variables

    Instead of using the old variable name 'dotest' for
    "$GIT_DIR"/rebase-merge and no variable for "$GIT_DIR"/rebase-apply,
    introduce two variables 'merge_dir' and 'apply_dir' for these paths.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored February 06, 2011 gitster committed February 10, 2011
Something went wrong with that request. Please try again.