unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38738] [PATCH WIP] etc: Add "tarball" snippet.
@ 2019-12-25  5:48 Brett Gilio
  2019-12-25  6:42 ` [bug#38738] [PATCH WIP v2] " Brett Gilio
  0 siblings, 1 reply; 5+ messages in thread
From: Brett Gilio @ 2019-12-25  5:48 UTC (permalink / raw)
  To: 38738

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

This patch is actually a WIP. I'd ideally like it if it could also
detect the addition of `(git-file-name ...)` and add that to the
sub-header commit message portion, but I am not so talented in Yasnippet
creation :).

If anybody wants to take a crack at it, please do. But I think this
snippet will prove useful as we will almost always have unstable
tarballs coming into our sources.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] etc: Add "tarball" snippet. --]
[-- Type: text/x-patch, Size: 1009 bytes --]

From f4b14a47e3741c107ea83e2717674c8a032f8dba Mon Sep 17 00:00:00 2001
From: Brett Gilio <brettg@gnu.org>
Date: Tue, 24 Dec 2019 23:42:27 -0600
Subject: [PATCH] etc: Add "tarball" snippet.

* etc/snippets/text-mode/guix-commit-message-unstable-tarball: New file.
---
 .../text-mode/guix-commit-message-unstable-tarball        | 8 ++++++++
 1 file changed, 8 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..e82f522e54
--- /dev/null
+++ b/etc/snippets/text-mode/guix-commit-message-unstable-tarball
@@ -0,0 +1,8 @@
+# -*- 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)[source]: Download using GIT-FETCH.
\ No newline at end of file
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#38738] [PATCH WIP v2] etc: Add "tarball" snippet
  2019-12-25  5:48 [bug#38738] [PATCH WIP] etc: Add "tarball" snippet Brett Gilio
@ 2019-12-25  6:42 ` Brett Gilio
  2020-02-27 10:14   ` Pierre Neidhardt
  0 siblings, 1 reply; 5+ messages in thread
From: Brett Gilio @ 2019-12-25  6:42 UTC (permalink / raw)
  To: 38738

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

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).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] etc: Add "tarball" snippet --]
[-- Type: text/x-patch, Size: 1443 bytes --]

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#38738] [PATCH WIP v2] etc: Add "tarball" snippet
  2019-12-25  6:42 ` [bug#38738] [PATCH WIP v2] " Brett Gilio
@ 2020-02-27 10:14   ` Pierre Neidhardt
  2022-04-12 10:40     ` [bug#38738] [PATCH WIP] " zimoun
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Neidhardt @ 2020-02-27 10:14 UTC (permalink / raw)
  To: Brett Gilio; +Cc: 38738

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#38738] [PATCH WIP] etc: Add "tarball" snippet.
  2020-02-27 10:14   ` Pierre Neidhardt
@ 2022-04-12 10:40     ` zimoun
  2022-05-19 21:20       ` bug#38738: " zimoun
  0 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2022-04-12 10:40 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 38738, Brett Gilio

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38738: [PATCH WIP] etc: Add "tarball" snippet.
  2022-04-12 10:40     ` [bug#38738] [PATCH WIP] " zimoun
@ 2022-05-19 21:20       ` zimoun
  0 siblings, 0 replies; 5+ messages in thread
From: zimoun @ 2022-05-19 21:20 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 38738-done, Brett Gilio

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-19 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  5:48 [bug#38738] [PATCH WIP] etc: Add "tarball" snippet Brett Gilio
2019-12-25  6:42 ` [bug#38738] [PATCH WIP v2] " Brett Gilio
2020-02-27 10:14   ` Pierre Neidhardt
2022-04-12 10:40     ` [bug#38738] [PATCH WIP] " zimoun
2022-05-19 21:20       ` bug#38738: " zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).