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

Pre-commit hook don't log diff #18003

Open
2 of 4 tasks
Arthur-Milchior opened this issue Feb 22, 2025 · 0 comments · May be fixed by #18008
Open
2 of 4 tasks

Pre-commit hook don't log diff #18003

Arthur-Milchior opened this issue Feb 22, 2025 · 0 comments · May be fixed by #18008

Comments

@Arthur-Milchior
Copy link
Member

Checked for duplicates?

  • This issue is not a duplicate

Does it also happen in the desktop version?

  • This bug does not occur in the latest version of Anki Desktop

What are the steps to reproduce this bug?

Make change to ankidroid.
Use git commit -am "whatever" or ./pre-commit or ./git/hooks/pre-commitIn.git` look at the last created file. "unstaged-ktlin-git-hook-date_hour.diff"

Expected behaviour

This file should contains the diff (or be deleted). Instead it's always empty.

Debug info

running on HEAD

(Optional) Anything else you want to share?

When I try the lines

    date=$(date +%y%m%d_%H%M%S)
    diff_path=.git/unstaged-ktlint-git-hook-$date.diff
     git diff --color=never > $diff_path

directly in a terminal it works as expected. I don't understand what's going on.

This cause data loss, again, when you only mrege some files and not all

Research

  • I have checked the manual and the FAQ and could not find a solution to my issue
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant