clemera / dired-git-info

Show git info in Emacs dired
77 stars 8 forks source link

Throwing error based on content of commit message? #14

Open ghost opened 1 year ago

ghost commented 1 year ago

Running Gnu Emacs 28.1 (9.0) on MacOS: I have been using this module for sometime without issue, but recently, I've started seeing errors like this when running the command emacs --debug-init .github/workflows in my repo:

Debugger entered--Lisp error: (args-out-of-range "  fixup: Post merge of 8.1.6 release branch       ..." 0 -157)
  dgi--clamp-string("  fixup: Post merge of 8.1.6 release branch       ..." 1)
  dgi--format-line-overlay("  fixup: Post merge of 8.1.6 release branch       ...")
  dired-git-info-mode()
  dired-git-info-auto-enable()
  run-hooks(dired-after-readin-hook)
  dired-readin()
  dired-internal-noselect("~/projects/build-system/.github/workflows/" nil)
  dired-noselect("~/projects/build-system/.github/workflows")
  run-hook-with-args-until-success(dired-noselect "~/projects/build-system/.github/workflows")
  find-file-noselect("/Users/lgadalla/projects/build-system/.github/work...")
  #f(compiled-function (displayable-buffers dir line column name) #<bytecode 0x1e44b7cca3878944>)((nil) "~/projects/build-system/" (0) (0) ".github/workflows")
  command-line-1((".github/workflows"))
  command-line()
  normal-top-level()

First I suspected my emacs and package configuration, but even after deleting all packages except this one, I was able to reproduce the error. My init.el contains the following snippet:

;; dired-git-info setup
;; Bind the minor mode command in dired
(with-eval-after-load 'dired
  (define-key dired-mode-map ")" 'dired-git-info-mode))
;; Don’t hide normal Dired file info
(setq dgi-auto-hide-details-p nil)
;; Enable automatically in every Dired buffer (if in Git repository)
(add-hook 'dired-after-readin-hook 'dired-git-info-auto-enable)

I suspected that there might be something about the contents of the commit message, but after checking it, I did not find anything that looked unusual. I noticed that if I ran emacs --debug-init . or emacs -debug-init .github in my repo, the error did not occur until I used dired to enter the .github/workflows directory, which does not appear to have any unusual contents:

$ ls -la .github/workflows/
total 456
drwxr-xr-x  11 lgadalla  staff    352 Mar 17 13:26 .
drwxr-xr-x   6 lgadalla  staff    192 Mar 17 13:26 ..
-rw-r--r--   1 lgadalla  staff   2947 Mar 17 13:26 README.md
-rw-r--r--   1 lgadalla  staff  29924 Mar 17 13:26 build-all.yml
-rw-r--r--   1 lgadalla  staff   6110 Mar 17 13:26 build.yml
-rw-r--r--   1 lgadalla  staff   2815 Mar 17 13:26 feature-test.yml
-rw-r--r--   1 lgadalla  staff  85396 Mar 17 13:26 full-integration-check.yml
-rw-r--r--   1 lgadalla  staff  34288 Mar 17 13:26 merge-readiness-check.yml
-rw-r--r--   1 lgadalla  staff  42995 Mar 17 13:26 release-deploy.yml
-rw-r--r--   1 lgadalla  staff   2120 Mar 17 13:26 release.yml
-rw-r--r--   1 lgadalla  staff  10588 Mar 17 13:26 test_summary.py

Is there anything else I can do to diagnose/debug this issue further?

ghost commented 1 year ago

Update: Upgraded to 28.2, but the same behavior was observed.