1. 11 1月, 2007 1 次提交
  2. 28 12月, 2006 2 次提交
    • S
      Use branch names in 'git-rebase -m' conflict hunks. · 0bb733c9
      Shawn O. Pearce 提交于
      If a three-way merge in git-rebase generates a conflict then we
      should take advantage of git-merge-recursive's ability to include
      the branch name of each side of the conflict hunk by setting the
      GITHEAD_* environment variables.
      
      In the case of rebase there aren't really two clear branches; we
      have the branch we are rebasing onto, and we have the branch we are
      currently rebasing.  Since most conflicts will be arising between
      the user's current branch and the branch they are rebasing onto
      we assume the stuff that isn't in the current commit is the "onto"
      branch and the stuff in the current commit is the "current" branch.
      
      This assumption may however come up wrong if the user resolves one
      conflict in such a way that it conflicts again on a future commit
      also being rebased.  In this case the user's prior resolution will
      appear to be in the "onto" part of the hunk.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0bb733c9
    • S
      Use GIT_REFLOG_ACTION environment variable instead. · f9474132
      Shawn O. Pearce 提交于
      Junio rightly pointed out that the --reflog-action parameter
      was starting to get out of control, as most porcelain code
      needed to hand it to other porcelain and plumbing alike to
      ensure the reflog contained the top-level user action and
      not the lower-level actions it invoked.
      
      At Junio's suggestion we are introducing the new set_reflog_action
      function to all shell scripts, allowing them to declare early on
      what their default reflog name should be, but this setting only
      takes effect if the caller has not already set the GIT_REFLOG_ACTION
      environment variable.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f9474132
  3. 23 12月, 2006 1 次提交
    • J
      merge and reset: adjust for "reset --hard" messages · 228e2eb6
      Junio C Hamano 提交于
      An earlier commit made "reset --hard" chattier but leaking its
      message from "git rebase" (which calls it when first rewinding
      the current branch to prepare replaying our own changes) without
      explanation was confusing, so add an extra message to mention
      it.  Inside restorestate in merge (which is rarely exercised
      codepath, where more than one strategies are attempted),
      resetting to the original state uses "reset --hard" -- this can
      be squelched entirely.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      228e2eb6
  4. 10 12月, 2006 1 次提交
  5. 22 11月, 2006 1 次提交
  6. 10 11月, 2006 1 次提交
  7. 05 10月, 2006 2 次提交
  8. 25 9月, 2006 1 次提交
    • J
      Deprecate merge-recursive.py · a06f678e
      Junio C Hamano 提交于
      This renames merge-recursive written in Python to merge-recursive-old,
      and makes merge-recur as a synonym to merge-recursive.  We do not remove
      merge-recur yet, but we will remove merge-recur and merge-recursive-old
      in a few releases down the road.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a06f678e
  9. 31 7月, 2006 2 次提交
  10. 14 7月, 2006 3 次提交
    • J
      recur vs recursive: help testing without touching too many stuff. · 06d30f4f
      Junio C Hamano 提交于
      During git-merge-recur development, you could set an environment
      variable GIT_USE_RECUR_FOR_RECURSIVE to use WIP recur in place
      of the recursive strategy.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      06d30f4f
    • J
      Status update on merge-recursive in C · 6d297f81
      Johannes Schindelin 提交于
      This is just an update for people being interested. Alex and me were
      busy with that project for a few days now. While it has progressed nicely,
      there are quite a couple TODOs in merge-recursive.c, just search for "TODO".
      
      For impatient people: yes, it passes all the tests, and yes, according
      to the evil test Alex did, it is faster than the Python script.
      
      But no, it is not yet finished. Biggest points are:
      
      - there are still three external calls
      - in the end, it should not be necessary to write the index more than once
        (just before exiting)
      - a lot of things can be refactored to make the code easier and shorter
      
      BTW we cannot just plug in git-merge-tree yet, because git-merge-tree
      does not handle renames at all.
      
      This patch is meant for testing, and as such,
      
      - it compile the program to git-merge-recur
      - it adjusts the scripts and tests to use git-merge-recur instead of
        git-merge-recursive
      - it provides "TEST", a script to execute the tests regarding -recursive
      - it inlines the changes to read-cache.c (read_cache_from(), discard_cache()
        and refresh_cache_entry())
      
      Brought to you by Alex Riesen and Dscho
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6d297f81
    • S
      8ef1c7c7
  11. 09 7月, 2006 1 次提交
  12. 28 6月, 2006 3 次提交
  13. 25 6月, 2006 3 次提交
  14. 22 6月, 2006 1 次提交
    • J
      rebase --merge: fix for rebasing more than 7 commits. · 5887ac82
      Junio C Hamano 提交于
      Instead of using 4-digit numbers to name commits being rebased,
      just use "cmt.$msgnum" string, with $msgnum as a decimal number
      without leading zero padding.  This makes it possible to rebase
      more than 9999 commits, but of more practical importance is that
      the earlier code used "printf" to format already formatted
      $msgnum and barfed when it counted up to 0008.  In other words,
      the old code was incapable of rebasing more than 7 commits, and
      this fixes that problem.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5887ac82
  15. 21 6月, 2006 2 次提交
  16. 21 5月, 2006 1 次提交
  17. 15 5月, 2006 1 次提交
  18. 27 4月, 2006 2 次提交
    • S
      Add --continue and --abort options to git-rebase. · 031321c6
      sean 提交于
        git rebase [--onto <newbase>] <upstream> [<branch>]
        git rebase --continue
        git rebase --abort
      
      Add "--continue" to restart the rebase process after
      manually resolving conflicts.  The user is warned if
      there are still differences between the index and the
      working files.
      
      Add "--abort" to restore the original branch, and
      remove the .dotest working files.
      
      Some minor additions to the git-rebase documentation.
      
      [jc: fix that applies to the maintenance track has been dealt
       with separately.]
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      031321c6
    • J
      rebase: typofix. · b176e6ba
      Junio C Hamano 提交于
      Noticed by Sean.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b176e6ba
  19. 14 4月, 2006 1 次提交
  20. 22 2月, 2006 2 次提交
  21. 15 2月, 2006 1 次提交
    • J
      rebase: allow rebasing onto different base. · e646c9c8
      Junio C Hamano 提交于
      This allows you to rewrite history a bit more flexibly, by
      separating the other branch name and new branch point.  By
      default, the new branch point is the same as the tip of the
      other branch as before, but you can specify where you graft the
      rebased branch onto.
      
      When you have this ancestry graph:
      
                A---B---C topic
               /
          D---E---F---G master
      
      	$ git rebase --onto master~1 master topic
      
      would rewrite the history to look like this:
      
      	      A'\''--B'\''--C'\'' topic
      	     /
          D---E---F---G master
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e646c9c8
  22. 13 2月, 2006 1 次提交
  23. 15 12月, 2005 2 次提交
  24. 14 12月, 2005 1 次提交
  25. 29 11月, 2005 1 次提交
    • J
      rebase: one safety net, one bugfix and one optimization. · 7f4bd5d8
      Junio C Hamano 提交于
      When a .dotest from a previously failed rebase or patch
      application exists, rebase got confused and tried to apply
      mixture of what was already there and what is being rebased.
      Check the existence of the directory and barf.
      
      It failed with an mysterious "fatal: cannot read mbox" message
      if the branch being rebased is fully in sync with the base.
      Also if the branch is a proper descendant of the base, there is
      no need to run rebase logic.  Prevent these from happening by
      checking where the merge-base is.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      7f4bd5d8
  26. 26 11月, 2005 1 次提交
  27. 19 11月, 2005 1 次提交
    • J
      Rewrite rebase to use git-format-patch piped to git-am. · 7f59dbbb
      Junio C Hamano 提交于
      The current rebase implementation finds commits in our tree but
      not in the upstream tree using git-cherry, and tries to apply
      them using git-cherry-pick (i.e. always use 3-way) one by one.
      
      Which is fine, but when some of the changes do not apply
      cleanly, it punts, and punts badly.
      
      Suppose you have commits A-B-C-D-E since you forked from the
      upstream and submitted the changes for inclusion.  You fetch
      from upstream head U and find that B has been picked up.  You
      run git-rebase to update your branch, which tries to apply
      changes contained in A-C-D-E, in this order, but replaying of C
      fails, because the upstream got changes that touch the same area
      from elsewhere.
      
      Now what?
      
      It notes that fact, and goes ahead to apply D and E, and at the
      very end tells you to deal with C by hand.  Even if you somehow
      managed to replay C on top of the result, you would now end up
      with ...-B-...-U-A-D-E-C.
      
      Breaking the order between B and others was the conscious
      decision made by the upstream, so we would not worry about it,
      and even if it were worrisome, it is too late for us to fix now.
      What D and E do may well depend on having C applied before them,
      which is a problem for us.
      
      This rewrites rebase to use git-format-patch piped to git-am,
      and when the patch does not apply, have git-am fall back on
      3-way merge.  The updated diff/patch pair knows how to apply
      trivial binary patches as long as the pre- and post-images are
      locally available, so this should work on a repository with
      binary files as well.
      
      The primary benefit of this change is that it makes rebase
      easier to use when some of the changes do not replay cleanly.
      In the "unapplicable patch in the middle" case, this "rebase"
      works like this:
      
       - A series of patches in e-mail form is created that records
         what A-C-D-E do, and is fed to git-am.  This is stored in
         .dotest/ directory, just like the case you tried to apply
         them from your mailbox.  Your branch is rewound to the tip of
         upstream U, and the original head is kept in .git/ORIG_HEAD,
         so you could "git reset --hard ORIG_HEAD" in case the end
         result is really messy.
      
       - Patch A applies cleanly.  This could either be a clean patch
         application on top of rewound head (i.e. same as upstream
         head), or git-am might have internally fell back on 3-way
         (i.e.  it would have done the same thing as git-cherry-pick).
         In either case, a rebased commit A is made on top of U.
      
       - Patch C does not apply.  git-am stops here, with conflicts to
         be resolved in the working tree.  Yet-to-be-applied D and E
         are still kept in .dotest/ directory at this point.  What the
         user does is exactly the same as fixing up unapplicable patch
         when running git-am:
      
         - Resolve conflict just like any merge conflicts.
         - "git am --resolved --3way" to continue applying the patches.
      
       - This applies the fixed-up patch so by definition it had
         better apply.  "git am" knows the patch after the fixed-up
         one is D and then E; it applies them, and you will get the
         changes from A-C-D-E commits on top of U, in this order.
      
      I've been using this without noticing any problem, and as people
      may know I do a lot of rebases.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      7f59dbbb