添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When both conflicting commits "add a file", the rebase dashboard does not display the conflict, and it fails to continue.

rebase in progress; onto 12738af
You are currently rebasing branch 'wip-git-flow-interface' on '12738af'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)
Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both modified:   Default.sublime-commands
    both modified:   core/commands/__init__.py
    both added:      core/commands/flow.py
    both added:      docs/flow.md

What may happen is that RewriteMixin methods are called by rebase dashboard to find changes to files; however, even when resolving "both changed" conflicts, the "both added" files still remain in conflict, and do not appear in rebase dash:

Git status now returns:

rebase in progress; onto 12738af
You are currently rebasing branch 'wip-git-flow-interface' on '12738af'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)
Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
    both added:      core/commands/flow.py
    both added:      docs/flow.md
grep core/commands/flow.py .git/rebase-apply/*
.git/rebase-apply/0001: core/commands/flow.py     | 302 ++++++++++++++++++++++++++++++++++++++++++++++
.git/rebase-apply/0001: create mode 100644 core/commands/flow.py
.git/rebase-apply/0001:diff --git a/core/commands/flow.py b/core/commands/flow.py
.git/rebase-apply/0001:+++ b/core/commands/flow.py
.git/rebase-apply/0002: core/commands/flow.py    | 99 +++++++++++++++++++++++++++++-------------------
.git/rebase-apply/0002:diff --git a/core/commands/flow.py b/core/commands/flow.py
.git/rebase-apply/0002:--- a/core/commands/flow.py
.git/rebase-apply/0002:+++ b/core/commands/flow.py
.git/rebase-apply/0003: core/commands/flow.py | 70 +++++++++++++++++++++++++++++++++++++++------------
.git/rebase-apply/0003:diff --git a/core/commands/flow.py b/core/commands/flow.py
.git/rebase-apply/0003:--- a/core/commands/flow.py
.git/rebase-apply/0003:+++ b/core/commands/flow.py
.git/rebase-apply/patch:diff --git a/core/commands/flow.py b/core/commands/flow.py
.git/rebase-apply/patch:+++ b/core/commands/flow.py

My bad, it seems the change is much simpler, and the files displayed are inserted in RebaseInterface._get_conflicts_in_rebase from StatusMixin.get_status (which uses git status --porcelain, but it filters out any merge conflicts except when both modified (UU).

It should instead follow the status "short format" as described in git status man page:

Short Format
    In the short-format, the status of each path is shown as
       XY PATH1 -> PATH2
   where PATH1 is the path in the HEAD, and the " -> PATH2" part is shown
   only when PATH1 corresponds to a different path in the index/worktree
   (i.e. the file is renamed). The XY is a two-letter status code.
   The fields (including the ->) are separated from each other by a
   single space. If a filename contains whitespace or other nonprintable
   characters, that field will be quoted in the manner of a C string
   literal: surrounded by ASCII double quote (34) characters, and with
   interior special characters backslash-escaped.
   For paths with merge conflicts, X and Y show the modification states
   of each side of the merge. For paths that do not have merge conflicts,
   X shows the status of the index, and Y shows the status of the work
   tree. For untracked paths, XY are ??. Other status codes can be
   interpreted as follows:
   o   ' ' = unmodified
   o   M = modified
   o   A = added
   o   D = deleted
   o   R = renamed
   o   C = copied
   o   U = updated but unmerged
   Ignored files are not listed, unless --ignored option is in effect, in
   which case XY are !!.
       X          Y     Meaning
       -------------------------------------------------
                 [MD]   not updated
       M        [ MD]   updated in index
       A        [ MD]   added to index
       D         [ M]   deleted from index
       R        [ MD]   renamed in index
       C        [ MD]   copied in index
       [MARC]           index and work tree matches
       [ MARC]     M    work tree changed since index
       [ MARC]     D    deleted in work tree
       -------------------------------------------------
       D           D    unmerged, both deleted
       A           U    unmerged, added by us
       U           D    unmerged, deleted by them
       U           A    unmerged, added by them
       D           U    unmerged, deleted by us
       A           A    unmerged, both added
       U           U    unmerged, both modified
       -------------------------------------------------
       ?           ?    untracked
       !           !    ignored
       -------------------------------------------------
   If -b is used the short-format status is preceded by a line
   ## branchname tracking info
Merge-tool launching is disallowed when one side has been deleted - a message
will be displayed to the user.  When choosing "use version from your commit"
or "use version from new base" in the rebase dashboard, and when that option
is that the file has been deleted, deleted the file in the working directory
and index instead of checking the file out (which would error).
Closes #267.