diff mbox series

[bug#38738,WIP,v2] etc: Add "tarball" snippet

Message ID 87eewszz20.fsf@gnu.org
State Accepted
Headers show
Series [bug#38738,WIP,v2] etc: Add "tarball" snippet | expand

Commit Message

Brett Gilio Dec. 25, 2019, 6:42 a.m. UTC
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).

Comments

Pierre Neidhardt Feb. 27, 2020, 10:14 a.m. UTC | #1
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]:"))))))`
zimoun April 12, 2022, 10:40 a.m. UTC | #2
Hi,


On Thu, 27 Feb 2020 at 11:14, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

The last interaction of this patch #38738 [1] from 2 years, 6 weeks, 2
days ago ends with:

> Looks good to me!

and since it is still a WIP, I propose to close it.


1: <http://issues.guix.gnu.org/issue/38738>



Cheers,
simon
zimoun May 19, 2022, 9:20 p.m. UTC | #3
Hi,

On Tue, 12 Apr 2022 at 12:40, zimoun <zimon.toutoune@gmail.com> wrote:
> On Thu, 27 Feb 2020 at 11:14, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
>
> The last interaction of this patch #38738 [1] from 2 years, 6 weeks, 2
> days ago ends with:
>
>> Looks good to me!
>
> and since it is still a WIP, I propose to close it.

Therefore, I am closing.


Cheers,
simon
diff mbox series

Patch

From 488faa8cabd298bb2d00f91a6056b26227089060 Mon Sep 17 00:00:00 2001
From: Brett Gilio <brettg@gnu.org>
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