From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:45735) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ik0Nq-0004Ks-UU for guix-patches@gnu.org; Wed, 25 Dec 2019 01:43:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ik0Np-0006Uf-SE for guix-patches@gnu.org; Wed, 25 Dec 2019 01:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47255) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ik0Np-0006US-Oz for guix-patches@gnu.org; Wed, 25 Dec 2019 01:43:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ik0Np-0004IW-MW for guix-patches@gnu.org; Wed, 25 Dec 2019 01:43:01 -0500 Subject: [bug#38738] [PATCH WIP v2] etc: Add "tarball" snippet References: <87h81pymzj.fsf@gnu.org> In-Reply-To: <87h81pymzj.fsf@gnu.org> Resent-Message-ID: From: Brett Gilio Date: Wed, 25 Dec 2019 00:42:15 -0600 Message-ID: <87eewszz20.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38738@debbugs.gnu.org --=-=-= Content-Type: text/plain This is a revised (but still ugly) revision of the original snippet that I think details somewhat what I mean by detecting the relevant changes to these types of commits and adding something to indicate this. I'd really like to see this be on the same line, instead of having two [source] blocks. But, as noted before, not a pro in Yasnippet by any means. :) (not to mention, the elisp is not good, but it is a rough concept). --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-etc-Add-tarball-snippet.patch Content-Description: [PATCH] etc: Add "tarball" snippet >From 488faa8cabd298bb2d00f91a6056b26227089060 Mon Sep 17 00:00:00 2001 From: Brett Gilio Date: Wed, 25 Dec 2019 00:38:37 -0600 Subject: [PATCH] etc: Add "tarball" snippet * etc/snippets/text-mode/guix-commit-message-unstable-tarball: New file. --- .../guix-commit-message-unstable-tarball | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 etc/snippets/text-mode/guix-commit-message-unstable-tarball diff --git a/etc/snippets/text-mode/guix-commit-message-unstable-tarball b/etc/snippets/text-mode/guix-commit-message-unstable-tarball new file mode 100644 index 0000000000..6a41d2156a --- /dev/null +++ b/etc/snippets/text-mode/guix-commit-message-unstable-tarball @@ -0,0 +1,20 @@ +# -*- mode: snippet -*- +# name: guix-commit-message-unstable-tarball +# key: tarball +# condition: git-commit-mode +# -- +gnu: $1: Don't use unstable tarball. + +* `(car (magit-staged-files))` ($1): Modify package to use stable git references. +`(with-temp-buffer + (magit-git-wash #'magit-diff-wash-diffs + "diff" "--staged") + (beginning-of-buffer) + (when (search-forward "(method git-fetch" nil 'noerror) + (print "[source]: Use GIT-FETCH.")))` +`(with-temp-buffer + (magit-git-wash #'magit-diff-wash-diffs + "diff" "--staged") + (beginning-of-buffer) + (when (search-forward "(file-name (git-file-name" nil 'noerror) + (print "[source]: Use GIT-FILE-NAME.")))` -- 2.24.1 --=-=-=--