Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Trouble importing repo #1644

Closed
danwoods opened this issue Aug 31, 2018 · 4 comments
Closed

Trouble importing repo #1644

danwoods opened this issue Aug 31, 2018 · 4 comments
Labels

Comments

@danwoods
Copy link

When trying to import an existing repo, with or without the --flatten argument, I get a git error

Expected Behavior

import would succeed

Current Behavior

When trying to import without --flatten, I get the following error:

lerna ERR! import Rolling back to previous HEAD (commit a235ee9b3c382c9751abf792a22b2ec9df894a18)
lerna ERR! EIMPORT Failed to apply commit a932c8cf8.
lerna ERR! EIMPORT Command failed: git am -3 --keep-non-patch
lerna ERR! EIMPORT error: Failed to merge in the changes.
lerna ERR! EIMPORT Applying: Made Device Analytics Controller. Made device-analytics.stache be rendered through controller.
lerna ERR! EIMPORT Using index info to reconstruct a base tree...
lerna ERR! EIMPORT M    packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT M    packages/some-repo/app/templates/device/active-device.stache
lerna ERR! EIMPORT M    packages/some-repo/views/index.jade
lerna ERR! EIMPORT Falling back to patching base and 3-way merge...
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/templates/device/device-analytics.stache
lerna ERR! EIMPORT CONFLICT (add/add): Merge conflict in packages/some-repo/app/templates/device/device-analytics.stache
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/scripts/app/controls/device-analytics.js
lerna ERR! EIMPORT CONFLICT (add/add): Merge conflict in packages/some-repo/app/scripts/app/controls/device-analytics.js
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT CONFLICT (content): Merge conflict in packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT Patch failed at 0001 Made Device Analytics Controller. Made device-analytics.stache be rendered through controller.
lerna ERR! EIMPORT The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! EIMPORT When you have resolved this problem, run "git am --continue".
lerna ERR! EIMPORT If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! EIMPORT To restore the original branch and stop patching, run "git am --abort".
lerna ERR! EIMPORT
lerna ERR! EIMPORT
lerna ERR! EIMPORT You may try again with --flatten to import flat history.

When trying to import with --flatten, I get the following error:

lerna ERR! import Rolling back to previous HEAD (commit a235ee9b3c382c9751abf792a22b2ec9df894a18)
lerna ERR! EIMPORT Failed to apply commit f16ede066.
lerna ERR! EIMPORT Command failed: git am -3 --keep-non-patch
lerna ERR! EIMPORT error: git diff header lacks filename information when removing 1 leading pathname component (line 845968)
lerna ERR! EIMPORT error: could not build fake ancestor
lerna ERR! EIMPORT Applying: Adding dist files. Refs #17
lerna ERR! EIMPORT Patch failed at 0001 Adding dist files. Refs #17
lerna ERR! EIMPORT The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! EIMPORT When you have resolved this problem, run "git am --continue".
lerna ERR! EIMPORT If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! EIMPORT To restore the original branch and stop patching, run "git am --abort".

Steps to Reproduce (for bugs)

  1. import my private repo from my local filesystem :)
lerna.json

{
  "packages": [
    "packages/*"
  ],
  "version": "independent"
}

lerna-debug.log

0 silly argv { _: [ 'import' ],
0 silly argv   flatten: true,
0 silly argv   lernaVersion: '3.2.1',
0 silly argv   '$0': 'lerna',
0 silly argv   dir: '../../../webapp/master/my-webapp/' }
1 notice cli v3.2.1
2 verbose rootPath /Users/dan/Development/DELETE/lerna-testing/lerna-repo
3 info versioning independent
4 error Error: Command failed: git rev-parse HEAD
4 error fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
4 error Use '--' to separate paths from revisions, like this:
4 error 'git <command> [<revision>...] -- [<file>...]'
4 error
4 error HEAD
4 error
4 error     at makeError (/usr/local/lib/node_modules/lerna/node_modules/execa/index.js:172:9)
4 error     at Function.module.exports.sync (/usr/local/lib/node_modules/lerna/node_modules/execa/index.js:341:15)
4 error     at Object.execSync (/usr/local/lib/node_modules/lerna/node_modules/@lerna/child-process/index.js:22:16)
4 error     at ImportCommand.getCurrentSHA (/usr/local/lib/node_modules/lerna/node_modules/@lerna/import/index.js:118:34)
4 error     at ImportCommand.initialize (/usr/local/lib/node_modules/lerna/node_modules/@lerna/import/index.js:90:31)
4 error     at Promise.resolve.then (/usr/local/lib/node_modules/lerna/node_modules/@lerna/command/index.js:245:24)
4 error     at <anonymous>

<!-- Otherwise, feel free to delete this <details> block -->

Context

Your Environment

Executable Version
lerna --version 3.2.1
npm --version 6.4.0
node --version 8.8.0
OS Version
macOS 10.13.6
@evocateur
Copy link
Member

There's not a lot anyone can do without a compact reproduction. In any case, these lines look like the significant parts of the error message:

error: git diff header lacks filename information when removing 1 leading pathname component (line 845968)
error: could not build fake ancestor

@chrisdothtml
Copy link
Contributor

Possibly fixed by #1655?

@stale
Copy link

stale bot commented Dec 27, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 27, 2018
@stale stale bot closed this as completed Jan 3, 2019
@lock
Copy link

lock bot commented Apr 3, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants