1. 31 5月, 2012 1 次提交
  2. 05 3月, 2012 1 次提交
    • C
      Make git-{pull,rebase} message without tracking information friendlier · 3c02396a
      Carlos Martín Nieto 提交于
      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: NCarlos Martín Nieto <cmn@elego.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3c02396a
  3. 14 10月, 2011 1 次提交
    • J
      pull,rebase: handle GIT_WORK_TREE better · 035b5bf6
      Jeff King 提交于
      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 e2eb5273
      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: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      035b5bf6
  4. 06 8月, 2011 1 次提交
  5. 14 7月, 2011 1 次提交
    • M
      rebase: clarify "restore the original branch" · 5960bc9d
      Martin von Zweigbergk 提交于
      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: NMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5960bc9d
  6. 30 6月, 2011 1 次提交
    • J
      rebase: do not print lots of usage hints after an obvious error message · 34840db8
      Johannes Sixt 提交于
      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 4ac5356c (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 45e2acf3
      (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: NJohannes Sixt <j6t@kdbg.org>
      Acked-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      34840db8
  7. 28 5月, 2011 2 次提交
    • J
      rebase: write a reflog entry when finishing · 53f2ffa8
      Jeff King 提交于
      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: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      53f2ffa8
    • C
      rebase: create HEAD reflog entry when aborting · ea69619c
      Csaba Henk 提交于
      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: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ea69619c
  8. 05 3月, 2011 1 次提交
    • M
      rebase: define options in OPTIONS_SPEC · 45e2acf3
      Martin von Zweigbergk 提交于
      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 cf432ca0
      (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: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      45e2acf3
  9. 11 2月, 2011 25 次提交
  10. 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
  11. 30 11月, 2010 1 次提交
  12. 24 11月, 2010 2 次提交
  13. 11 11月, 2010 1 次提交