Open rightx2 opened 3 years ago
If I run with a raw command, git diff file_name
(without scm_breeze
), it works well..
I'm facing the same issue here. From within the submodule directory:
git status
works correctly
$ git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
foo.txt
gs
displays a weird /.git/modules
path
$ gs
# On branch: | [*] => $e*
#
➤ Untracked files
#
# untracked: [1] ../.git/modules/<SUBMODULE_DIRNAME>/foo.txt
#
As a result, gd 1
fails due to this abnormal path : fatal: ambiguous argument '<REPO_DIRNAME>/.git/modules/<SUBMODULE_DIRNAME>/foo.txt': unknown revision or path not in the working tree.
, whereas git diff foo.txt
works well.
My environment is:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS (fossa-cory-tgl X59)
Release: 20.04
Codename: focal
$ git --version
git version 2.25.1
$ cd $HOME/.scm_breeze && git rev-parse --short HEAD
ff6af42
I solved the issue by installing ruby
.
Indeed, 'scm_breeze.sh' behaves differently depending on whethter ruby
is present or not (cf code permalink):
if ! type ruby > /dev/null 2>&1; then # If Ruby is not installed, fall back to the # slower bash/zsh implementation of 'git_status_shortcuts' source "$scmbDir/lib/git/fallback/status_shortcuts_shell.sh" fi
ruby
installed, gs
is aliased to the git_status_shortcuts
defined in status_shortcuts.sh, which works properly.ruby
installed, gs
is aliased to the git_status_shortcuts
defined in status_shortcuts_shell.sh, which seems to be buggy (?).Yes, the shell version needs to be worked on and is known to have some strange behavior. Glad you were able to fix your issue by installing ruby.
On Wed, Sep 29, 2021 at 04:57 lrntgr @.***> wrote:
I solved the issue by installing ruby.
Indeed, 'scm_breeze.sh' behaves differently depending on whethter ruby is present or not (cf code permalink https://github.com/scmbreeze/scm_breeze/blob/ff6af425e2769c55061d866c1e8fb4def4efab12/scm_breeze.sh#L30:L34 ):
if ! type ruby > /dev/null 2>&1; then
If Ruby is not installed, fall back to the
slower bash/zsh implementation of 'git_status_shortcuts'
source "$scmbDir/lib/git/fallback/status_shortcuts_shell.sh" fi
- with ruby installed, gs is aliased to the git_status_shortcuts defined in status_shortcuts.sh, which works properly.
- without ruby installed, gs is aliased to the git_status_shortcuts defined in status_shortcuts_shell.sh, which seems to be buggy (?).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scmbreeze/scm_breeze/issues/309#issuecomment-929978057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABHEKRPB4QAWFDGAQX247DUELIJFANCNFSM4W4AQJAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I have the main project repository which has a submodule. Below is the directory structure in my workspace
~/Dropbox/Programming/Workspace/django/super_trading_project
~/Dropbox/Programming/Workspace/django/super_trading_project/super_trading/backtester/event_driven
cat ....../event_driven/.git
:gitdir: ../../../.git/modules/super_trading/backtester/event_driven
Problem
When the file in
event_driven
changed,gs
showed this:When I run just
gd
, it shows all diff information and it works wellBut the problem is happening when I run
gd [number]
.gd 1
shows an error like this:I have no idea why it happens!
Some notes:
gd [number]
works well in parent modules. It does not work only in git submodule