Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sep 18, 2012

  1. Andrew Wong

    rebase -i: Teach "--edit-todo" action

    This allows users to edit the todo file while they're stopped in the
    middle of an interactive rebase. When this action is executed, all
    comments from the original todo file are stripped, and new help messages
    are appended to the end.
    
    Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored September 17, 2012 gitster committed September 17, 2012
  2. martinvonz

    rebase usage: subcommands can not be combined with -i

    Since 95135b0 (rebase: stricter check of standalone sub command,
    2011-02-06), git-rebase has not allowed to use -i together with e.g.
    --continue. Yet, when rebase started using OPTIONS_SPEC in 45e2acf
    (rebase: define options in OPTIONS_SPEC, 2011-02-28), the usage message
    included
    
    	git-rebase [-i] --continue | --abort | --skip
    
    Remove the "[-i]" from this line.
    
    Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
    Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored September 17, 2012 gitster committed September 17, 2012

Aug 01, 2012

  1. git-rebase.sh: fix typo in an error message

    Fix a typo in the error messages which is shown if it seems that a
    rebase is already in progress.
    
    Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored August 01, 2012 gitster committed August 01, 2012

Jul 27, 2012

  1. Jiang Xin

    rebase: remove obsolete and unused LONG_USAGE which breaks xgettext

    Since there is a modern OPTIONS_SPEC variable in use in this script,
    the obsolete USAGE and LONG_USAGE variables are no longer used.
    Remove them.
    
    In addition, the obsolete LONG_USAGE variable has the following
    message in it:
    
        A'\''--B'\''--C'\''
    
    And such complex LONG_USAGE message will break xgettext when
    extracting l10n messages (but if single quotes are removed from the
    message, xgettext works fine on 'git-rebase.sh').
    
    Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
    Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 25, 2012 gitster committed July 26, 2012
  2. Jiang Xin

    i18n: Rewrite gettext messages start with dash

    Gettext message in a shell script should not start with '-', one
    workaround is adding '--' between gettext and the message, like:
    
        gettext -- "--exec option ..."
    
    But due to a bug in the xgettext extraction, xgettext can not
    extract the actual message for this case. Rewriting the message
    is a simpler and better solution.
    
    Reported-by: Vincent van Ravesteijn <vfr@lyx.org>
    Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 25, 2012 gitster committed July 26, 2012

Jul 25, 2012

  1. Jiang Xin

    i18n: rebase: mark messages for translation

    Mark messages in git-rebase.sh for translation.  While doing this
    Jonathan noticed that the comma usage and sentence structure of the
    resolvemsg was not quite right, so correct that and its cousins in
    git-am.sh and t/t0201-gettext-fallbacks.sh at the same time.
    
    Some tests would start to fail with GETTEXT_POISON turned on after
    this update.  Use test_i18ncmp and test_i18ngrep where appropriate
    to mark strings that should only be checked in the C locale output
    to avoid such issues.
    
    Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
    Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored July 25, 2012 gitster committed July 25, 2012

Jul 16, 2012

  1. Junio C Hamano

    Merge branch 'cw/rebase-i-root'

    "git rebase [-i] --root $tip" can now be used to rewrite all the
    history down to the root.
    
    * cw/rebase-i-root:
      t3404: make test 57 work with dash and others
      Add tests for rebase -i --root without --onto
      rebase -i: support --root without --onto
    authored July 15, 2012

Jul 13, 2012

  1. Junio C Hamano

    Merge branch 'mz/rebase-no-mbox'

    Teach "am --rebasing" codepath to grab authorship, log message and
    the patch text directly out of existing commits.  This will help
    rebasing commits that have confusing "diff" output in their log
    messages.
    
    * mz/rebase-no-mbox:
      am: don't call mailinfo if $rebasing
      am --rebasing: get patch body from commit, not from mailbox
      rebase --root: print usage on too many args
      rebase: don't source git-sh-setup twice
    authored July 13, 2012

Jun 26, 2012

  1. Chris Webb

    rebase -i: support --root without --onto

    Allow --root to be specified to rebase -i without --onto, making it
    possible to edit and re-order all commits right back to the root(s).
    
    If there is a conflict to be resolved when applying the first change,
    the user will expect a sane index and working tree to get sensible
    behaviour from git-diff and friends, so create a sentinel commit with an
    empty tree to rebase onto. Automatically squash the sentinel with any
    commits rebased directly onto it, so they end up as root commits in
    their own right and retain their authorship and commit message.
    
    Implicitly use rebase -i for non-interactive rebase of --root without
    an --onto argument now that rebase -i can correctly do this.
    
    Signed-off-by: Chris Webb <chris@arachsys.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 26, 2012 gitster committed June 26, 2012
  2. rebase --root: print usage on too many args

    Just like
    
      git rebase --onto newbase upstream branch error
    
    displays the usage message, so should clearly
    
      git rebase --onto newbase --root branch error
    
    , but it doesn't. Instead, it ignores both "branch" and "error" and
    rebases the current HEAD. This is because we try to match the number
    of remainging arguments "$#", which fails to match "1" argument and
    matches the "*" that really should have been a "0".
    
    Make sure we display usage information when too many arguments are
    given. Also fail-fast in case of similar bugs in the future by
    matching on exactly 0 arguments and failing on unknown numbers.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 26, 2012 gitster committed June 26, 2012

Jun 13, 2012

  1. rebase -i: teach "--exec <cmd>"

    During an interactive rebase session, it is sometimes desirable to
    run tests on each commit in the resulting history.  This can be done
    by adding "exec <test command>" when editing the insn sheet, but the
    command used for testing is often the same for all resulting commits.
    
    By passing "--exec <cmd>" from the command line, automatically add
    these "exec" lines after each commit in the final history.  To work
    well with the --autosquash option, these are added at the end of
    each run of "fixup" and "squash".
    
    Helped-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>
    Signed-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr>
    Signed-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr>
    Signed-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr>
    Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>
    Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored June 12, 2012 gitster committed June 13, 2012

Jun 01, 2012

  1. Junio C Hamano

    Merge branch 'ef/maint-rebase-error-message'

    By Erik Faye-Lund
    * ef/maint-rebase-error-message:
      rebase: report invalid commit correctly
    authored June 01, 2012

May 30, 2012

  1. Erik Faye-Lund

    rebase: report invalid commit correctly

    In 9765b6a (rebase: align variable content, 2011-02-06), the code
    to error out was moved up one level. Unfortunately, one reference
    to a function parameter wasn't rewritten as it should, leading to
    the wrong parameter being errored on.
    
    This error was propagated by 71786f5 (rebase: factor out reference
    parsing, 2011-02-06) and merged in 78c6e0f (Merge branch
    'mz/rebase', 2011-04-28).
    
    Correct this by reporting $onto_name istead.
    
    Reported-By: Manuela Hutter <manuelah@opera.com>
    Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 30, 2012 gitster committed May 30, 2012

May 29, 2012

  1. Vincent van Ravesteijn

    Do not autosquash in case of an implied interactive rebase

    The option to autosquash is only used in case of an interactive rebase.
    When merges are preserved, rebase uses an interactive rebase internally,
    but in this case autosquash should still be disabled.
    
    Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored May 24, 2012 gitster committed May 29, 2012

Apr 24, 2012

  1. git-rebase: add keep_empty flag

    Add a command line switch to git-rebase to allow a user the ability to specify
    that they want to keep any commits in a series that are empty.
    
    When git-rebase's type is am, then this option will automatically keep any
    commit that has a tree object identical to its parent.
    
    This patch changes the default behavior of interactive rebases as well.  With
    this patch, git-rebase -i will produce a revision set passed to
    git-revision-editor, in which empty commits are commented out.  Empty commits
    may be kept manually by uncommenting them.  If the new --keep-empty option is
    used in an interactive rebase the empty commits will automatically all be
    uncommented in the editor.
    
    Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored April 20, 2012 gitster committed April 24, 2012

Mar 05, 2012

  1. Carlos Martín Nieto

    Make git-{pull,rebase} message without tracking information friendlier

    The current message is too long and at too low a level for anybody
    to understand it if they don't know about the configuration format
    already.
    
    The text about setting up a remote is superfluous and doesn't help
    understand or recover from the error that has happened.  Show the
    usage more prominently and explain how to set up the tracking
    information. If there is only one remote, that name is used instead
    of the generic <remote>.
    
    Also simplify the message we print on detached HEAD to remove
    unnecessary information which is better left for the documentation.
    
    Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    authored March 04, 2012 gitster committed March 04, 2012

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