Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to disable submodule support? #996

Open
stepancheg opened this issue Dec 18, 2024 · 5 comments
Open

How to disable submodule support? #996

stepancheg opened this issue Dec 18, 2024 · 5 comments

Comments

@stepancheg
Copy link
Contributor

Most of commands are broken, and I'm highly suspicious it is related to submodules. For example, on freshly cloned git repo (with submodules):

reposetup failed in extension dirsync: When constructing alloc::boxed::Box<dyn commits_trait::DagCommits + core::marker::Send> from dyn storemodel::StoreInfo, "10-git-commits" reported error

Caused by:
    0: resolving 209989e9e8d1bde8c8bb333be116937662cbc327 to git commit
    1: object not found - no match for id (209989e9e8d1bde8c8bb333be116937662cbc327); class=Odb (9); code=NotFound (-3)
abort: When constructing alloc::boxed::Box<dyn commits_trait::DagCommits + core::marker::Send> from dyn storemodel::StoreInfo, "10-git-commits" reported error

Caused by:
    0: resolving 209989e9e8d1bde8c8bb333be116937662cbc327 to git commit
    1: object not found - no match for id (209989e9e8d1bde8c8bb333be116937662cbc327); class=Odb (9); code=NotFound (-3)

Is there an option in sapling to just ignore submodules like they don't exist?

@quark-zju
Copy link
Contributor

There is git.submodule=false. It does not look like related to submodule, though. It could be related to git gc. If you are using .git mode you might just delete .git/sl and sl will recreate related data.

@stepancheg
Copy link
Contributor Author

Does not seem to help.

$ sl config
ui.username=Stepan Koltsov <stepan.koltsov@gmail.com>
ui.editor=vim
git.submodule=false
remotefilelog.reponame=xai
paths.default=redacted

rm -rf .git/sl

and still

reposetup failed in extension dirsync: When constructing alloc::boxed::Box<dyn commits_trait::DagCommits + core::marker::Send> from dyn storemodel::StoreInfo, "10-git-commits" reported error

Caused by:
    0: resolving 209989e9e8d1bde8c8bb333be116937662cbc327 to git commit
    1: object not found - no match for id (209989e9e8d1bde8c8bb333be116937662cbc327); class=Odb (9); code=NotFound (-3)
abort: When constructing alloc::boxed::Box<dyn commits_trait::DagCommits + core::marker::Send> from dyn storemodel::StoreInfo, "10-git-commits" reported error

Caused by:
    0: resolving 209989e9e8d1bde8c8bb333be116937662cbc327 to git commit
    1: object not found - no match for id (209989e9e8d1bde8c8bb333be116937662cbc327); class=Odb (9); code=NotFound (-3)

OK, is also might be possible due to shallow checkout. I'll check.

@stepancheg
Copy link
Contributor Author

stepancheg commented Dec 19, 2024

The issue was indeed shallow checkout (#998). But it doesn't work well with full checkout either.

I can actually reproduce the issue with opensource repos:

$ sl config
ui.editor=vim
git.submodule=false
$ git clone https://github.com/rust-lang/rust
...
$ cd rust
$ git st
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
$ sl st
R library/backtrace
R library/stdarch
R src/doc/book
R src/doc/edition-guide
R src/doc/embedded-book
R src/doc/nomicon
R src/doc/reference
R src/doc/rust-by-example
R src/doc/rustc-dev-guide
R src/gcc
R src/llvm-project
R src/tools/cargo
R src/tools/enzyme
R src/tools/rustc-perf
$ echo test >> CONTRIBUTING.md
$ sl commit -m 'test test'
** Sapling SCM (version 0.2.20241203-120811-a2174689) has crashed:
Traceback (most recent call last):
  File "static:sapling", line 86, in run
    dispatch.run(args, fin, fout, ferr, ctx, skipprehooks)
  File "static:sapling.dispatch", line 161, in run
    status = (dispatch(req) or 0) & 255
              ^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 344, in dispatch
    ret = _runcatch(req)
          ^^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 528, in _runcatch
    return _callcatch(ui, req, _runcatchfunc)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 537, in _callcatch
    return scmutil.callcatch(ui, req, func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.scmutil", line 151, in callcatch
    return func()
           ^^^^^^
  File "static:sapling.dispatch", line 515, in _runcatchfunc
    return _dispatch(req)
           ^^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 1083, in _dispatch
    ret = runcommand(
          ^^^^^^^^^^^
  File "static:sapling.ext.undo", line 176, in _runcommandwrapper
    result = orig(lui, repo, cmd, fullargs, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.ext.undo", line 120, in origunsetpid
    return _orig(*args, **opts)
           ^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.ext.journal", line 82, in runcommand
    return orig(lui, repo, cmd, fullargs, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 755, in runcommand
    ret = _runcommand(ui, options, cmd, d)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.dispatch", line 1134, in _runcommand
    return cmdfunc()
           ^^^^^^^^^
  File "static:sapling.dispatch", line 1082, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.util", line 1376, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.util", line 1376, in check
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.ext.automv", line 65, in mvcheck
    renames = _findrenames(repo, match, added, removed, threshold / 100.0)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.ext.automv", line 101, in _findrenames
    for src, dst, score in similar.findrenames(repo, added, removed, similarity):
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.similar", line 107, in findrenames
    removedfiles = _dropempty(pctx[fp] for fp in sorted(removed) if fp in pctx)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.similar", line 95, in _dropempty
    return [x for x in fctxs if x.size() > 0]
                                ^^^^^^^^
  File "static:sapling.context", line 1484, in size
    return self._filelog.size(self._filerev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "static:sapling.git", line 1202, in size
    return self.store.readobjsize(node, "blob")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error.HttpError: Command exited with code 128
  git -c fetch.negotiationAlgorithm=noop --git-dir=/Users/st/devel/left/rust/.git fetch https://github.com/rust-lang/rust --no-tags --no-write-fetch-head --recurse-submodules=no --filter=blob:none --stdin --progress
    fatal: remote error: upload-pack: not our ref 230570f2dac80a601f5c0b30da00cc9480bd35eb

@stepancheg
Copy link
Contributor Author

stepancheg commented Dec 19, 2024

OK, config option is actually git.submodules=false, not git.submodule. I need to check again.

@stepancheg
Copy link
Contributor Author

OK, with git.submodules=false it actually kinda seems to work. Need to test more.

But for now maybe consider switching this option to false by default.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants