On failure of a pre-commit hook, run git stash pop

Đang mở
#762 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
git, ruby
Lĩnh vực
devtools

Hướng nghiên cứu

The issue reports that a failed pre-commit run leaves the stash unrestored, and the README is cited as documenting the stash step. Start by reading the README section on stashing and then reproduce with a pre-commit hook that fails, using a .overcommit.yml with a deliberately broken hook. Done means that after a failed run the stashed changes are restored, with a spec covering the failure path.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I'm getting an error in the pre-commit hook run (I don't have any pre-commit hooks, but that's another issue). When the program finishes running, files have been stashed (as is mentioned in the README) but are not restored.

kenyon@Kenyons-MacBook-Pro ~b % git status
On branch BBS-3445-b
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   db/schema.rb

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   .git_hooks/post_commit/run_annotate_models.rb
	modified:   .overcommit.yml
kenyon@Kenyons-MacBook-Pro ~b % git commit       
Unable to setup environment for pre-commit hook run:
STDOUT:
STDERR:Signature of configuration file has changed!
Run `overcommit --sign` once you've verified the configuration changes.
For more information, see https://github.com/sds/overcommit#security
kenyon@Kenyons-MacBook-Pro ~b % git status
On branch dev
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   file1.txt

kenyon@Kenyons-MacBook-Pro ~b % git stash pop
On branch dev
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   file1.txt

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   file2.txt
	modified:   file3.txt
Ngôn ngữ chính
Ruby
Star
4k
Fork
288
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sds/overcommit

Tất cả issue của sds/overcommit

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.