Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

--filter . not the same as --filter pwd #4298

Open
skeept opened this issue Feb 20, 2025 · 3 comments
Open

--filter . not the same as --filter pwd #4298

skeept opened this issue Feb 20, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@skeept
Copy link

skeept commented Feb 20, 2025

Describe the bug
I just found out about -f it's great option, Thanks.
The behavior I want is given by lazygit -f $(pwd)
I expected lazygit -f . to show exactly same screen.

To Reproduce

run lazygit -f .

Expected behavior
same output as lazygit -f $(pwd)

Version info:
commit=6636d0c15aa18ef202689f151f2d6464f2ce064e, build date=2025-02-15T04:51:49Z, build source=binaryRelease, version=0.46.0, os=linux, arch=amd64, git version=2.34.1

@skeept skeept added the bug Something isn't working label Feb 20, 2025
@ChrisMcD1
Copy link
Contributor

Thanks for the report!

My debug logs shows this:

Feb 20 17:31:27 |INFO| postRefreshUpdate for commits took 611.2µs
Feb 20 17:31:27 |DEBU| using cache for key rebase.updateRefs
Feb 20 17:31:27 |DEBU| RunCommand command="git -C /home/chrismcdonnell/linux-repos/lazygit -c diff.noprefix=false show --no-ext-diff --submodule --color=always --unified=3 --stat --decorate -p 11616190eeb1f3341fd95248116d5e6af3807dc0 --find-renames=50% -- ."
Feb 20 17:31:27 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p --follow -- . (233.7202ms)
Feb 20 17:31:27 |INFO| postRefreshUpdate for reflogCommits took 8.7841ms
Feb 20 17:31:27 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (25.3552ms)
Feb 20 17:31:27 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads"
Feb 20 17:31:27 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (4.4803ms)
Feb 20 17:31:27 |INFO| postRefreshUpdate for localBranches took 1.1425ms
Feb 20 17:31:27 |DEBU| using cache for key rebase.updateRefs

when I reproduce. The slightly suspicious thing to me is that we do a git log twice, and the 2nd time does not include the path filter. The same thing happens with $(pwd) though, so that can't be the full story.

Since git log --follow -- . works as expected, I would expect our wrapper to work the same way.

@ChrisMcD1
Copy link
Contributor

@skeept To clarify your intent: Are you reproducing this error by launching lazygit from within a directory that is not the root of your repository? That is what I need to do to reproduce. In the root of the repository (which is where I always launch lazygit in my normal flow), the two screens look the same.

@skeept
Copy link
Author

skeept commented Feb 21, 2025

@ChrisMcD1 yes launching from a directory different than the root of the repo. For example for this repo in the scripts folder we have for lazigit -f .

Image

and for lazygit -f $(pwd)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants