Import failing and rolling back due to whitespace error (2.0.0-rc5)
See original GitHub issue@evocateur, could you please suggest a work around for this or help me find someone who can?
lerna import
is reporting a git
error and rolling back changes, the second part seems unfortunate because git gives instructions for fixing the problem using git am continue
or skip
, but that doesn’t seem possible by the time lerna has stopped… See message below…
Updated: It looks like the commit causing the problem for lerna import
is one months ago where I unfortunately lost the newline at the end of a .gitignore file. The next commit fixes the problem, and the current version of that directory doesn’t even have the file present anymore. However it is blocking lerna import
from operating.
Expected Behavior
Import operation should be robust to whitespace issues, or should at least give the user a chance to fix-up any git merge problems and continue. (I recognize the newline error may be generated by git not lerna. )
Current Behavior
Instead, the command is aborting and rolling back, it displays this message:
lerna ERR! execute callback with error
lerna ERR! execute Failed to apply commit 7c728ce.
lerna ERR! execute Error: Command failed: git am -3
lerna ERR! execute .git/rebase-apply/patch:87: new blank line at EOF.
lerna ERR! execute +
lerna ERR! execute warning: 1 line adds whitespace errors.
lerna ERR! execute error: Failed to merge in the changes.
lerna ERR! execute Applying: Fixup gitignore to allow tests writtenin JavaScript
lerna ERR! execute Using index info to reconstruct a base tree...
lerna ERR! execute M "packages\\tool/.gitignore"
lerna ERR! execute Falling back to patching base and 3-way merge...
lerna ERR! execute Auto-merging packages\tool/.gitignore
lerna ERR! execute CONFLICT (content): Merge conflict in packages\tool/.gitignore
lerna ERR! execute Patch failed at 0001 Fixup gitignore to allow tests writtenin JavaScript
lerna ERR! execute The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! execute When you have resolved this problem, run "git am --continue".
lerna ERR! execute If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! execute To restore the original branch and stop patching, run "git am --abort".
lerna ERR! execute
lerna ERR! execute Rolling back to previous HEAD (commit 5df9d8e4952921e54c4709f55e30f525d9f49539).
Possible Solution
It seems like I could skip the failing patch, but lerna’s decision to roll-back isn’t helping.
Steps to Reproduce (for bugs)
npm install -g lerna
git clone https://github.com/tunnelvisionlabs/antlr4ts.git
git init a4
cd a4
lerna init
git add .
git commit -m "initial commit"
lerna import ../antlr4ts/tool
lerna.json
{
"lerna": "2.0.0-rc.5",
"packages": [
"packages/*"
],
"version": "0.0.0"
}
lerna-debug.log
0 silly input [ '..\\antlr4ts\\tool' ]
1 silly flags { _: [ 'import' ],
1 silly flags sort: true,
1 silly flags concurrency: 4,
1 silly flags pathToRepo: '..\\antlr4ts\\tool' }
2 verbose rootPath C:\code\a4t
3 info version 2.0.0-rc.5
4 silly isInitialized
5 silly isInitialized true
6 silly existsSync C:\code\a4t\VERSION
7 silly initialize attempt
8 silly statSync C:\code\antlr4ts\tool
9 silly existsSync C:\code\a4t\packages\tool
10 silly getCurrentSHA
11 verbose getCurrentSHA 5df9d8e4952921e54c4709f55e30f525d9f49539
12 info About to import 839 commits from ..\antlr4ts\tool into packages\tool
13 silly initialize success
14 silly execute attempt
15 info b6e8e74
16 info eeab44a
17 info 1afddd2
18 info d80d2d8
19 info accde09
20 info 5999d62
21 info af23610
22 info 31c64c9
23 info c9b4a64
24 info 5918a03
25 info 9fd43f1
26 info ea9fb85
27 info fce51df
28 info 64dc537
29 info b9483a7
30 info 5a873d1
31 info 6bdde7e
32 info 6ccd725
33 info 1eaf015
34 info fe7abec
35 info 943b9f1
36 info a9d0e99
37 info 7c728ce
38 error execute callback with error
38 error execute Failed to apply commit 7c728ce.
38 error execute Error: Command failed: git am -3
38 error execute .git/rebase-apply/patch:87: new blank line at EOF.
38 error execute +
38 error execute warning: 1 line adds whitespace errors.
38 error execute error: Failed to merge in the changes.
38 error execute Applying: Fixup gitignore to allow tests writtenin JavaScript
38 error execute Using index info to reconstruct a base tree...
38 error execute M "packages\\tool/.gitignore"
38 error execute Falling back to patching base and 3-way merge...
38 error execute Auto-merging packages\tool/.gitignore
38 error execute CONFLICT (content): Merge conflict in packages\tool/.gitignore
38 error execute Patch failed at 0001 Fixup gitignore to allow tests writtenin JavaScript
38 error execute The copy of the patch that failed is found in: .git/rebase-apply/patch
38 error execute When you have resolved this problem, run "git am --continue".
38 error execute If you prefer to skip this patch, run "git am --skip" instead.
38 error execute To restore the original branch and stop patching, run "git am --abort".
38 error execute
38 error execute Rolling back to previous HEAD (commit 5df9d8e4952921e54c4709f55e30f525d9f49539).
Context
Blocking even evaluating if lerna can help me.
Your Environment
Executable | Version |
---|---|
lerna --version |
2.0.0-rc.5 |
npm --version |
5.0.3 |
yarn --version |
n/a |
node --version |
v6.10.3 |
OS | Version |
---|---|
Windows 10 | 1703 (OS Build 15063.322) |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:7 (1 by maintainers)
I’m getting a similar issue that is likely related.
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.