Skip to content

gd [number] doesn't work in the submodule!! #309

@rightx2

Description

@rightx2
  • Ubuntu 20.04
  • git version: git version 2.30.0
  • scm_breeze: master(0a687dc )

I have the main project repository which has a submodule. Below is the directory structure in my workspace

  • main: ~/Dropbox/Programming/Workspace/django/super_trading_project
  • submodule: ~/Dropbox/Programming/Workspace/django/super_trading_project/super_trading/backtester/event_driven
  • Run cat ....../event_driven/.git: gitdir: ../../../.git/modules/super_trading/backtester/event_driven

Problem

When the file in event_driven changed, gs showed this:

➤ Changes not staged for commit
#
#      modified: [1] ../../../.git/modules/super_trading/backtester/event_driven/alphas/mpaa.py

When I run just gd, it shows all diff information and it works well

But the problem is happening when I run gd [number]. gd 1 shows an error like this:

=> gd 1
fatal: ambiguous argument '~/Dropbox/Programming/Workspace/django/super_trading_project/.git/modules/super_trading/backtester/event_driven/alphas/mpaa.py': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

I have no idea why it happens!

Some notes:

  • gd [number] works well in parent modules. It does not work only in git submodule
  • All these strange things don't happen in Mac OS X
  • I was faced with the same problem even when I cloned the new parent module and submodule in the clean directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions