threads / bug / 59435

git log -L:<funcname>:<file> bug report

Subject: git log -L:<funcname>:<file> bug report

## tl;dr

One message between Mar 22, 2023 and Mar 22, 2023.

replies: 0people: 1as markdown or json

Robin Vagner· Mar 22, 2023, 10:05 UTC · lore

Hello, this is my first time reporting an issue through mail, so I am sorry if I missed something. The file generated with `git bugreport` is attached to this mail, and I also copy-pasted its contents below just in case.

Tell me if you need more precisions, I feel like this is a bug, but it might just be an absence of feature.

Thanks in advance,
Robin Vagner.
---

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
> Use the command `git log -L:<funcname>:<file>` on a python file, with an existing function name in an existing file.
What did you expect to happen? (Expected behavior)
> The git log function to find the given function name and display its history.
What happened instead? (Actual behavior)
> I got this error : `fatal: -L parameter 'get_comment_from_args' starting at line 1: no match`
What's different between what you expected and what actually happened?
> Since git already knows by default to use python for diffs with *.py files, I expected it to find the function.
Anything else you want to add:
> It works properly if I add a .gitattributes file with the following line : `*.py diff=python`, which is weird because I thought this was already the default values for git (at least a `git diff` shows me the function name properly in the diff blobs.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.35.1.windows.2 cpu: x86_64 built from commit: 5437f0fd368c7faf1a0b5e1fef048232c1f2a3e6 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 19043 compiler info: gnuc: 11.2 libc info: no libc information available $SHELL (typically, interactive shell): <unset>

[Enabled Hooks]

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
> Use the command `git log -L:<funcname>:<file>` on a python file, with an existing function name in an existing file.
What did you expect to happen? (Expected behavior)
> The git log function to find the given function name and display its history.
What happened instead? (Actual behavior)
> I got this error : `fatal: -L parameter 'get_comment_from_args' starting at line 1: no match`
What's different between what you expected and what actually happened?
> Since git already knows by default to use python for diffs with *.py files, I expected it to find the function.
Anything else you want to add:
> It works properly if I add a .gitattributes file with the following line : `*.py diff=python`, which is weird because I thought this was already the default values for git (at least a `git diff` shows me the function name properly in the diff blobs.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.35.1.windows.2 cpu: x86_64 built from commit: 5437f0fd368c7faf1a0b5e1fef048232c1f2a3e6 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 19043 compiler info: gnuc: 11.2 libc info: no libc information available $SHELL (typically, interactive shell): <unset>

[Enabled Hooks]

← back to recent threads