Skip to content

Cannot untrack rediscovered git submodule #8065

@thomasa88

Description

@thomasa88

Description

Setup: Git repo with submodules. One moves back in history past the submodule creation and then forward to the future again. The submodule is no longer ignored and the directory shows up as "D submodule". It seems impossible to get out of this state, without commiting to the submodule directory being removed. Trying exclude files and untrack does not help.

Steps to Reproduce the Problem

#!/bin/bash

set -ex

git clone https://github.com/thomasa88/jj-submodule-bug.git
cd jj-submodule-bug
jj git init
jj bookmark track main@origin
jj new 258c2b20
jj st
jj new 3ef6b442
jj st
echo sub >> .git/info/exclude
jj file untrack sub
jj new 3ef6b442
jj st
jj abandon

Expected Behavior

Way to recover from the submodule directory not being ignored any longer.

Actual Behavior

> jj abandon
Abandoned 1 commits:
  kkmqxzlx cf2309a1 (no description set)
Working copy  (@) now at: wszxoryo 59e34e67 (empty) (no description set)
Parent commit (@-)      : lmywpurl 3ef6b442 main | Add simple test runner script
Added 1 files, modified 0 files, removed 0 files
Warning: 1 of those updates were skipped because there were conflicting changes in the working copy.
Hint: Inspect the changes compared to the intended target with `jj diff --from 59e34e679671`.
Discard the conflicting changes with `jj restore --from 59e34e679671`.

> jj st
Working copy changes:
D sub
Working copy  (@) : wszxoryo 1c8d0bb7 (no description set)
Parent commit (@-): lmywpurl 3ef6b442 main | Add simple test runner script

Cannot get rid of the change by abandon or new to the past.

Specifications

  • Platform: Ubuntu 25.04
  • Version: 0.35.0-aa2b76978c4a23cb01c61629a11b1254af3ad0d9

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions