1. 27 1月, 2011 2 次提交
    • J
      rebase: give a better error message for bogus branch · 4ac5356c
      Jeff King 提交于
      When you give a non-existent branch to git-rebase, it spits
      out the usage. This can be confusing, since you may
      understand the usage just fine, but simply have made a
      mistake in the branch name.
      
      Before:
      
        $ git rebase origin bogus
        Usage: git rebase ...
      
      After:
      
        $ git rebase origin bogus
        fatal: no such branch: bogus
        Usage: git rebase ...
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4ac5356c
    • J
      rebase: use explicit "--" with checkout · 3b21a438
      Jeff King 提交于
      In the case of a ref/pathname conflict, checkout will
      already do the right thing and checkout the ref. However,
      for a non-existant ref, this has two advantages:
      
        1. If a file with that pathname exists, rebase will
           refresh the file from the index and then rebase the
           current branch instead of producing an error.
      
        2. If no such file exists, the error message using an
           explicit "--" is better:
      
             # before
             $ git rebase -i origin bogus
             error: pathspec 'bogus' did not match any file(s) known to git.
             Could not checkout bogus
      
             # after
             $ git rebase -i origin bogus
             fatal: invalid reference: bogus
             Could not checkout bogus
      
      The problems seem to be trigger-able only through "git
      rebase -i", as regular git-rebase checks the validity of the
      branch parameter as a ref very early on. However, it doesn't
      hurt to be defensive.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3b21a438
  2. 30 11月, 2010 1 次提交
  3. 24 11月, 2010 1 次提交
  4. 11 11月, 2010 1 次提交
  5. 14 10月, 2010 1 次提交
  6. 10 9月, 2010 1 次提交
  7. 10 8月, 2010 1 次提交
  8. 04 8月, 2010 1 次提交
  9. 29 7月, 2010 1 次提交
  10. 24 7月, 2010 1 次提交
    • J
      rebase: protect against diff.renames configuration · 840b3ca7
      Junio C Hamano 提交于
      We currently do not disable diff.renames configuration while rebase
      internally runs "format-patch" to feed "am -3".
      
      The end user configuration for "diff" should not affect the result
      produced by the higher level command that is related to "diff" only
      because internally it is implemented in terms of it.
      
      For that matter, I have a feeling that format-patch should not even look
      at diff.renames, but we seem to have been doing this for a long time so
      there is no easy way to fix this thinko.
      
      In any case, here is a much straightforward fix for "rebase".
      
      [jn: with test case from David]
      Reported-by: NDavid D. Kilzer <ddkilzer@kilzer.net>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      840b3ca7
  11. 01 6月, 2010 1 次提交
  12. 25 3月, 2010 1 次提交
    • M
      Teach rebase the --no-ff option. · b4995494
      Marc Branchaud 提交于
      For git-rebase.sh, --no-ff is a synonym for --force-rebase.
      
      For git-rebase--interactive.sh, --no-ff cherry-picks all the commits in
      the rebased branch, instead of fast-forwarding over any unchanged commits.
      
      --no-ff offers an alternative way to deal with reverted merges.  Instead of
      "reverting the revert" you can use "rebase --no-ff" to recreate the branch
      with entirely new commits (they're new because at the very least the
      committer time is different).  This obviates the need to revert the
      reversion, as you can re-merge the new topic branch directly.  Added an
      addendum to revert-a-faulty-merge.txt describing the situation and how to
      use --no-ff to handle it.
      Signed-off-by: NMarc Branchaud <marcnarc@xiplink.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b4995494
  13. 13 3月, 2010 2 次提交
  14. 31 1月, 2010 1 次提交
  15. 26 1月, 2010 1 次提交
  16. 08 1月, 2010 1 次提交
  17. 04 12月, 2009 1 次提交
  18. 24 11月, 2009 1 次提交
    • J
      Protect scripted Porcelains from GREP_OPTIONS insanity · e1622bfc
      Junio C Hamano 提交于
      If the user has exported the GREP_OPTIONS environment variable, the output
      from "grep" and "egrep" in scripted Porcelains may be different from what
      they expect.  For example, we may want to count number of matching lines,
      by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use.
      
      The approach taken by this change to address this issue is to protect only
      our own use of grep/egrep.  Because we do not unset it at the beginning of
      our scripts, hook scripts run from the scripted Porcelains are exposed to
      the same insanity this environment variable causes when grep/egrep is used
      to implement logic (e.g. "grep | wc -l"), and it is entirely up to the
      hook scripts to protect themselves.
      
      On the other hand, applypatch-msg hook may want to show offending words in
      the proposed commit log message using grep to the end user, and the user
      might want to set GREP_OPTIONS=--color to paint the match more visibly.
      The approach to protect only our own use without unsetting the environment
      variable globally will allow this use case.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e1622bfc
  19. 22 11月, 2009 1 次提交
    • J
      "rebase --onto A...B" replays history on the merge base between A and B · 61dfa1bb
      Junio C Hamano 提交于
      This is in spirit similar to "checkout A...B".  To re-queue a new set of
      patches for a series that the original author prepared to apply on 'next'
      on the same base as before, you would do something like this:
      
          $ git checkout next^0
          $ git am -s rerolled-series.mbox
          $ git rebase --onto next...jh/notes next
      
      The first two commands recreates commits to be rebased as the original
      author intended (i.e. applies directly on top of 'next'), and the rebase
      command replays that history on top of the same commit the series being
      replaced was built on (which is typically much older than the tip of
      'next').
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61dfa1bb
  20. 25 10月, 2009 1 次提交
  21. 12 9月, 2009 1 次提交
  22. 07 8月, 2009 1 次提交
  23. 06 8月, 2009 1 次提交
  24. 19 6月, 2009 1 次提交
    • S
      am, rebase: teach quiet option · 0e987a12
      Stephen Boyd 提交于
      git-am and git-rebase are talkative scripts. Teach them to be quiet when
      told, allowing them to speak only when they fail or experience errors.
      
      The quiet option is maintained when git-am or git-rebase fails to apply
      a patch. This means subsequent --resolved, --continue, --skip, --abort
      invocations will be quiet if the original invocation was quiet.
      
      Drop a handful of >&2 redirection; the rest of the program sends all the
      info messages to stdout, not to stderr.
      Signed-off-by: NStephen Boyd <bebarino@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0e987a12
  25. 15 6月, 2009 1 次提交
  26. 28 3月, 2009 1 次提交
  27. 19 3月, 2009 1 次提交
  28. 03 3月, 2009 1 次提交
  29. 19 2月, 2009 1 次提交
  30. 14 2月, 2009 1 次提交
  31. 12 1月, 2009 1 次提交
    • T
      rebase: learn to rebase root commit · 190f5323
      Thomas Rast 提交于
      Teach git-rebase a new option --root, which instructs it to rebase the
      entire history leading up to <branch>.  This option must be used with
      --onto <newbase>, and causes commits that already exist in <newbase>
      to be skipped.  (Normal operation skips commits that already exist in
      <upstream> instead.)
      
      One possible use-case is with git-svn: suppose you start hacking
      (perhaps offline) on a new project, but later notice you want to
      commit this work to SVN.  You will have to rebase the entire history,
      including the root commit, on a (possibly empty) commit coming from
      git-svn, to establish a history connection.  This previously had to
      be done by cherry-picking the root commit manually.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      190f5323
  32. 11 12月, 2008 1 次提交
    • J
      rebase: improve error messages about dirty state · 07e62b73
      Jeff King 提交于
      If you have unstaged changes in your working tree and try to
      rebase, you will get the cryptic "foo: needs update"
      message, but nothing else.  If you have staged changes, you
      get "your index is not up-to-date".
      
      Let's improve this situation in two ways:
      
       - for unstaged changes, let's also tell them we are
         canceling the rebase, and why (in addition to the "needs
         update" lines)
      
       - for the staged changes case, let's use language that is a
         little more clear to the user: their index contains
         uncommitted changes
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      07e62b73
  33. 04 12月, 2008 1 次提交
  34. 07 10月, 2008 1 次提交
  35. 06 10月, 2008 1 次提交
  36. 01 10月, 2008 1 次提交
    • A
      rebase: Support preserving merges in non-interactive mode · f8cca019
      Andreas Ericsson 提交于
      As a result of implementation details, 'git rebase' could
      previously only preserve merges in interactive mode. That
      limitation was hard for users to understand and awkward to
      explain.
      
      This patch works around it by running the interactive rebase
      helper git-rebase--interactive with GIT_EDITOR set to ':'
      when the user passes "-p" but not "-i" to the rebase command.
      The effect is that the interactive rebase helper is used but
      the user never sees an editor.
      
      The test-case included in this patch was originally written
      by Stephen Habermann <stephen@exigencecorp.com>, but has
      been extensively modified since its creation.
      Signed-off-by: NAndreas Ericsson <ae@op5.se>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      f8cca019
  37. 17 8月, 2008 1 次提交
    • S
      Improve error output of git-rebase · 9b752a6e
      Stephan Beyer 提交于
      "git rebase" without arguments on initial startup showed:
      
      	fatal: Needed a single revision
      	invalid upstream
      
      This patch makes it show the ordinary usage string.
      
      If .git/rebase-merge or .git/rebase-apply/rebasing exists, git-rebase
      will die with a message saying that a rebase is in progress and the user
      should try --skip/--abort/--continue.
      
      If .git/rebase-apply/applying exists, git-rebase will die with a message
      saying that git-am is in progress, regardless how many arguments are
      given.
      
      If no arguments are given and .git/rebase-apply/ exists, but neither a
      rebasing nor applying file is in that directory, git-rebase dies with a
      message saying that rebase-apply exists and no arguments were given.
      Signed-off-by: NStephan Beyer <s-beyer@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9b752a6e
  38. 22 7月, 2008 1 次提交