A repo init strange error

2,254 views
Skip to first unread message

Chih-Wei

unread,
Jun 12, 2017, 2:53:44 AM6/12/17
to Repo and Gerrit Discussion
What's wrong with it?

$ repo init -u git://192.168.0.185/nougat-x86/manifest -b multiwindow-nougat
Traceback (most recent call last):
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/subcmds/init.py", line 390, in Execute
    self._SyncManifest(opt)
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/subcmds/init.py", line 236, in _SyncManifest
    m.MetaBranchSwitch()
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/project.py", line 2801, in MetaBranchSwitch
    self.Sync_LocalHalf(syncbuf)
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/project.py", line 1247, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "/mnt/SSD/cwhuang/nougat-x86/.repo/repo/project.py", line 2384, in _InitWorkTree
    raise e
error.GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync .repo/manifests` to proceed.

$ repo init -u git://192.168.0.185/nougat-x86/manifest -b multiwindow-nougat --force-sync
Usage: repo init [options]

main.py: error: no such option: --force-sync

David Pursehouse

unread,
Jun 12, 2017, 3:08:05 AM6/12/17
to Chih-Wei, Repo and Gerrit Discussion
The previous error message says to use repo sync:

   use `repo sync --force-sync .repo/manifests` to proceed

Have you tried that?

 

main.py: error: no such option: --force-sync

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chih-Wei

unread,
Jun 12, 2017, 4:27:11 AM6/12/17
to Repo and Gerrit Discussion, cwh...@android-x86.org


David Pursehouse於 2017年6月12日星期一 UTC+8下午3時08分05秒寫道:

I think you didn't read the error carefully.
 

David Pursehouse

unread,
Jun 12, 2017, 7:10:47 AM6/12/17
to Chih-Wei, Repo and Gerrit Discussion
The first error says to run repo sync, but then in the next command you are running repo init.  The "no such option" error is because repo init does not have that option.

git-repo $ git grep force-sync
project.py:          raise GitError('--force-sync not enabled; cannot overwrite a local '
project.py:                         ' use `repo sync --force-sync {0}` to '
subcmds/sync.py:The --force-sync option can be used to overwrite existing git
subcmds/sync.py:    p.add_option('--force-sync',


 
 
 

main.py: error: no such option: --force-sync


Chih-Wei

unread,
Jun 12, 2017, 11:25:55 PM6/12/17
to Repo and Gerrit Discussion, cwh...@android-x86.org

Please read the error of my post more carefully.

I did "repo init ..." and got the error.
Why should I do "repo sync --force-sync .repo/manifests" first?
Is .repo/manifests a valid project to be synced?
Not at all.

I reported the issue since it's an apparent bug of repo.

David Pursehouse於 2017年6月12日星期一 UTC+8下午7時10分47秒寫道:
Reply all
Reply to author
Forward
0 new messages