Skip to content

git commit presubmit may lose data #17593

Open
@Arthur-Milchior

Description

How to reproduce:

  • In a file A, change a local variable in all upper case
  • in a file b, rename a variable, but keep the name valid for our linter
  • git add A; git commit -m test

Actual result:

  • Warning that the commit can't be done, and to read AnkiDroid/build/reports/ktlint/ktlintMainSourceSetFormat/ktlintMainSourceSetFormat.txt to find why
  • B was reverted!!!!!!!!!!!

Expected result:

  • A warning that commit failed
  • A still committed, B uncomitted.

I wanted to add a first part of the work first, and then the big part of the work. I lost more than two hours of work. I was not expecting "git commit" to delete anything.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions