Skip to content

Patch 导入:git apply / git am #15

Description

@zjywill

现状

只有导出:GitClient.formatPatch(_:)format-patch -1 --stdoutSources/TheGit/Core/GitClient.swift:304)。没有反向的导入。

目标

补齐 patch 的另一半:

  • 「Apply Patch…」选一个 .patch / .diff 文件 → git applygit am
  • 两种模式:git apply(只改工作区)和 git am(保留作者信息并生成提交)
  • 冲突时进入现有的 ongoing-operation 流程 —— 注意 operationState()GitClient.swift:102)目前检测 rebase-apply 会被判成 .rebasegit am 用的正是这个目录,需要区分开

实现要点

  • applyPatch(_:reverse:) 已经有写临时文件 + git apply --cached 的模式(GitClient.swift:70),可以复用。
  • git am 失败时的 continue/skip/abort 要接进 OngoingOperation

优先级

P2 —— 已经有导出,只差反向,成本很低。邮件流 patch 的用户会用到。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions