Looks good to me! If you want to print only one "[source]:" I suggest the following, untested: * `(car (magit-staged-files))` ($1): Modify package to use stable git references. `(with-temp-buffer (magit-git-wash #'magit-diff-wash-diffs "diff" "--staged") (let ((source-block "[source]: ") (wrote-source-block? nil)) (beginning-of-buffer) (when (search-forward "(method git-fetch" nil 'noerror) (setq wrote-source-block? t) (print (format "%sUse GIT-FETCH." source-block))) (beginning-of-buffer) (when (search-forward "(file-name (git-file-name" nil 'noerror) (print (format "%sUse GIT-FILE-NAME." (if wrote-source-block? "" "[source]:"))))))` -- Pierre Neidhardt https://ambrevar.xyz/