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

Bug: Truncated summary entries don't work. #1

Open
SpicyLemon opened this issue Aug 13, 2022 · 1 comment
Open

Bug: Truncated summary entries don't work. #1

SpicyLemon opened this issue Aug 13, 2022 · 1 comment

Comments

@SpicyLemon
Copy link
Owner

When the compact summary doesn't have room to put the entire filename, it ends up being truncated. Git will change part of it to .... When that happens, git_diff_explorer can't find the actual file path in order to show the diff.

I've no idea what an entry would look like if it is a moved file and also truncated like this.

@SpicyLemon
Copy link
Owner Author

Possible plan of attack.
Try to identify such entries by checking if they contain ... and don't exist.
In such cases, do the following:

  1. Escape the entry for a regex.
  2. Change the ... into .*.
  3. Run the git diff --name-only command.
  4. Grep those with the -x flag (--line-regexp, only matches whole lines) using the modified entry.
  • If only 1 entry is found, use that as the filename.
  • If zero entries are found, just go with the original entry.
  • If two or more entries are found, I'm not sure what to do. I'm tempted to just say to use all of them. I'm not sure how we'd be able to further refine the search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant