git - Git diff 补丁在 git apply 失败
问题描述
我已经使用以下 git 命令生成了补丁
git diff -b -w lib/web/mage/requirejs/mixins.js > mixinjs.patch
当我应用补丁时,出现以下错误
$ git apply --check --reverse --verbose mixinjs.patch
Checking patch lib/web/mage/requirejs/mixins.js...
error: while searching for:
], function (module) {
'use strict';
var contexts = require.s.contexts,
defContextName = '_',
defContext = contexts[defContextName],
unbundledContext = require.s.newContext('$'),
defaultConfig = defContext.config,
unbundledConfig = {
baseUrl: defaultConfig.baseUrl,
paths: defaultConfig.paths,
shim: defaultConfig.shim,
config: defaultConfig.config,
map: defaultConfig.map
},
rjsMixins;
/**
* Prepare a separate context where modules are not assigned to bundles
* so we are able to get their true path and corresponding mixins.
*/
unbundledContext.configure(unbundledConfig);
/**
* Checks if specified string contains
error: patch failed: lib/web/mage/requirejs/mixins.js:7
error: lib/web/mage/requirejs/mixins.js: patch does not apply
如果我使用以下 git apply 命令,我可以成功应用补丁
git apply --ignore-space-change --ignore-whitespace m2-hotfixes/magepack_mixinjs.patch
但问题是我们无法将 git apply 命令更改为上述命令,我们使用的是不允许更改 git apply 命令的 Magento 云 PaaS 环境。
在 git diff 中,我提到了忽略空格(-b)和忽略空格(-w),但它不起作用。当我们在 git apply 命令中提到忽略空格和忽略空格时,只有它起作用了。
请帮我解决这个问题。
提前致谢。
解决方案
推荐阅读
- chisel - 官方皮棉方式
- python-2.7 - 所有输入数组 (x) 应具有相同数量的样本。得到数组形状:[(52, 224, 224, 3), (64, 35)]
- python - 如何修改张量值?
- mongodb - 升级到 Ubuntu 18.04 后 Mongod 升级错误
- javascript - v-for 用于作为 props 传递的数组抛出错误
- sql - SQL查找唯一ID
- sql - 自定义选择实体框架
- python - 加载大泡菜时,Flask应用程序中的Google App Engine gunicorn worker超时?
- python - 构建分类器时如何对输入特征之间的依赖关系进行建模
- javascript - php ajax 自动完成 - 缺少完全匹配