unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs and URLs in Git commit messages
@ 2021-02-04  8:38 Chris Marusich
  2021-02-04  9:15 ` Maxime Devos
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Chris Marusich @ 2021-02-04  8:38 UTC (permalink / raw)
  To: guix-devel

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

Hi,

Many Guix commits look like this:

  commit f9978346e73359ac1d8b88c9ed874edc7225582b
  Author: Ludovic Courtès <ludo@gnu.org>
  Date:   Fri Dec 18 18:10:04 2020 +0100

      avahi: Remove poll timeout when possible.

      Fixes <https://issues.guix.gnu.org/45314>.

      * guix/avahi.scm (avahi-browse-service-thread): Change timeout default value
      to false when no "stop-loop?" procedure is passed. Adapt "iterate-simple-poll"
      call accordingly.

      Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>

Regarding the URL, do people just type it all out, including the opening
and closing brackets (<>)?  Or is there an Emacs command that does it
for you?  I've briefly looked on the Internet, but this is the kind of
thing that seems difficult to search for.

-- 
Chris

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

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

* Re: Emacs and URLs in Git commit messages
  2021-02-04  8:38 Emacs and URLs in Git commit messages Chris Marusich
@ 2021-02-04  9:15 ` Maxime Devos
  2021-02-06  5:00   ` Chris Marusich
  2021-02-04 13:16 ` zimoun
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2021-02-04  9:15 UTC (permalink / raw)
  To: Chris Marusich, guix-devel

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

On Thu, 2021-02-04 at 00:38 -0800, Chris Marusich wrote:
> Regarding the URL, do people just type it all out, including the opening
> and closing brackets (<>)?  Or is there an Emacs command that does it
> for you?  I've briefly looked on the Internet, but this is the kind of
> thing that seems difficult to search for.

I don't known any emacs command for that, but you inspired me to write
such a command myself: [1].

Maxime.
[1]: https://notabug.org/mdevos/things/commit/b0400ba06b6f031e88f1f89b47079c3c6d7dcac4

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: Emacs and URLs in Git commit messages
  2021-02-04  8:38 Emacs and URLs in Git commit messages Chris Marusich
  2021-02-04  9:15 ` Maxime Devos
@ 2021-02-04 13:16 ` zimoun
  2021-02-04 19:12 ` Bengt Richter
  2021-02-05 10:40 ` Ludovic Courtès
  3 siblings, 0 replies; 8+ messages in thread
From: zimoun @ 2021-02-04 13:16 UTC (permalink / raw)
  To: Chris Marusich, guix-devel

Hi Chris,

On Thu, 04 Feb 2021 at 00:38, Chris Marusich <cmmarusich@gmail.com> wrote:

>       Fixes <https://issues.guix.gnu.org/45314>.

[...]

> Regarding the URL, do people just type it all out, including the opening
> and closing brackets (<>)?  Or is there an Emacs command that does it
> for you?  I've briefly looked on the Internet, but this is the kind of
> thing that seems difficult to search for.

I am not representative since I commit few fixes.  Well, I have a tiny
helper that pushes to the kill ring:

<https://github.com/zimoun/my-conf/blob/master/.config/emacs/lisp/funs.el#L271>

Especially reading bug#45314 in Debbugs mode, I type “M-x
my/guix-issues” then the URL ’http://issues.guix.gnu.org/issue/45314’ is
stashed.  If not in debbugs mode, as here in message mode, the tiny
helper asks the bug number then pushes it to the kill ring.  This tiny
helper is far from perfect, any improvements is welcome. :-) Especially
if it is already provided by an Emacs command.

About the brackets, I type them.


Aside I thought the convention was <http://bugs.gnu.org/45314> tough for
bug fix commit.  Anyway.


Hope that helps,
simon


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

* Re: Emacs and URLs in Git commit messages
  2021-02-04  8:38 Emacs and URLs in Git commit messages Chris Marusich
  2021-02-04  9:15 ` Maxime Devos
  2021-02-04 13:16 ` zimoun
@ 2021-02-04 19:12 ` Bengt Richter
  2021-02-05 10:40 ` Ludovic Courtès
  3 siblings, 0 replies; 8+ messages in thread
From: Bengt Richter @ 2021-02-04 19:12 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

Hi Chris,

On +2021-02-04 00:38:18 -0800, Chris Marusich wrote:
> Hi,
> 
> Many Guix commits look like this:
> 
>   commit f9978346e73359ac1d8b88c9ed874edc7225582b
>   Author: Ludovic Courtès <ludo@gnu.org>
>   Date:   Fri Dec 18 18:10:04 2020 +0100
> 
>       avahi: Remove poll timeout when possible.
> 
>       Fixes <https://issues.guix.gnu.org/45314>.
> 
>       * guix/avahi.scm (avahi-browse-service-thread): Change timeout default value
>       to false when no "stop-loop?" procedure is passed. Adapt "iterate-simple-poll"
>       call accordingly.
> 
>       Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
> 
> Regarding the URL, do people just type it all out, including the opening
> and closing brackets (<>)?  Or is there an Emacs command that does it
> for you?  I've briefly looked on the Internet, but this is the kind of
> thing that seems difficult to search for.
>
I am not sure I understand your context or goal in searching ;/

I.e., what did you briefly look for on the internet?
Did you search for an instance of "<https://issues.guix.gnu.org/45314>"
hoping to find discussion of it elsehere than at the URL itself?

What were you referring to with the "this" in
"...this is the kind of thing that seems difficult to search for." ?

If you were looking for alternate site discussion of bug#45314, duckduckgo
seems to respond better without the '#' and narrowed by a last search term
specifying the year, like
    duckduckgo "bug 45314" 2020
(don't leave out the quotes, and don't put the year inside them)

NB: there are lots of bug trackers out there, so you will probably
want to Ctl-f to ask your browser to walk through all the 45314's just by hitting Enter
after that (firefox example).

Not so many hits for 2021 yet, so I can show the result: (2 irrelevant hits :)
--8<---------------cut here---------------start------------->8---
DuckDuckGo
[...]
FreeNAS - Bug #45314
[Search domain redmine.ixsystems.com/issues/45314.pdf] https://redmine.ixsystems.com/issues/45314.pdf
FreeNAS - Bug #45314 Add the ability to set the password on first login if user left password blank during installation 09/07/2018 07:54 AM - Bonnie Follweiler
Possible IPad/1.7 bug - Unity Forum
[Search domain forum.unity.com/threads/possible-ipad-1-7-bug.45314/] https://forum.unity.com/threads/possible-ipad-1-7-bug.45314/
Unity ID. A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate in the Unity community.

No more results found for "bug 45314" 2021.
[...]
--8<---------------cut here---------------end--------------->8---

If your context is in emacs editing a git commit, and you just want an easy command to insert
a line like
    Fixes <https://issues.guix.gnu.org/45314>.
... I'm sure you can handle that yourself if you want to, hence my confusion about what you were up to ;)

But maybe you are lazy like me, and wanted to see what was available. For me, that brings up the question
of what form of solution would be most helpful to the most people if I offered one. E.g., I could

1. point you to the others' elisp solutions,
2. offer a bash script that formats the line based on clipboard-captured number (e.g., using xclip or wl-paste)
   which you can easily invoke from emacs by "Esc 1 Esc ! bash-script"
3. offer a guile script to do the same
4. offer a bash script that will compile and link a C program (source and commands all in script) that will do the same,
   assuming you have a usual x86_64 tool chain at hand, or
5. write it in some other interesting language (rash? :)

I am not sure having the solution be dependent on emacs' (or any limiting entity's) internals
is the most generally useful, but it's something I think about.

I'd be interested in what you all think, though maybe it ought to be a new thread ;)

> -- 
> Chris
--
Regards,
Bengt Richter


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

* Re: Emacs and URLs in Git commit messages
  2021-02-04  8:38 Emacs and URLs in Git commit messages Chris Marusich
                   ` (2 preceding siblings ...)
  2021-02-04 19:12 ` Bengt Richter
@ 2021-02-05 10:40 ` Ludovic Courtès
  2021-04-21  3:09   ` Maxim Cournoyer
  3 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2021-02-05 10:40 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

Hi,

Chris Marusich <cmmarusich@gmail.com> skribis:

> Many Guix commits look like this:
>
>   commit f9978346e73359ac1d8b88c9ed874edc7225582b
>   Author: Ludovic Courtès <ludo@gnu.org>
>   Date:   Fri Dec 18 18:10:04 2020 +0100
>
>       avahi: Remove poll timeout when possible.
>
>       Fixes <https://issues.guix.gnu.org/45314>.
>
>       * guix/avahi.scm (avahi-browse-service-thread): Change timeout default value
>       to false when no "stop-loop?" procedure is passed. Adapt "iterate-simple-poll"
>       call accordingly.
>
>       Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
>
> Regarding the URL, do people just type it all out, including the opening
> and closing brackets (<>)?  Or is there an Emacs command that does it
> for you?  I've briefly looked on the Internet, but this is the kind of
> thing that seems difficult to search for.

I have this helper for debbugs.el:

--8<---------------cut here---------------start------------->8---
(defun ludo-copy-debbugs-url ()
  "Add to the kill ring the URL of the Debbugs issue at point."
  (interactive)
  (let ((url1 (concat "https://bugs.gnu.org/"
		      (number-to-string (debbugs-gnu-current-id))))
	(url2 (concat "https://issues.guix.gnu.org/"
		      (number-to-string (debbugs-gnu-current-id)))))
    (kill-new url1)
    (kill-new url2)
    (message "Copied %s and %s" url1 url2)))

(define-key debbugs-gnu-mode-map (kbd "C-w") 'ludo-copy-debbugs-url)
--8<---------------cut here---------------end--------------->8---

That way I can C-w on a bug in *Guix Bugs* and I get the two URLs in the
clipboard (I normally use “bugs.gnu.org” as the canonical bug URL.)

Ludo’.


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

* Re: Emacs and URLs in Git commit messages
  2021-02-04  9:15 ` Maxime Devos
@ 2021-02-06  5:00   ` Chris Marusich
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Marusich @ 2021-02-06  5:00 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-devel

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

Hi,

Thank you for the replies!

Maxime Devos <maximedevos@telenet.be> writes:

> I don't known any emacs command for that, but you inspired me to write
> such a command myself: [1].
>
> Maxime.
> [1]: https://notabug.org/mdevos/things/commit/b0400ba06b6f031e88f1f89b47079c3c6d7dcac4

zimoun <zimon.toutoune@gmail.com> writes:

> I am not representative since I commit few fixes.  Well, I have a tiny
> helper that pushes to the kill ring:
>
> <https://github.com/zimoun/my-conf/blob/master/.config/emacs/lisp/funs.el#L271>
>
> Especially reading bug#45314 in Debbugs mode, I type “M-x
> my/guix-issues” then the URL ’http://issues.guix.gnu.org/issue/45314’ is
> stashed.  If not in debbugs mode, as here in message mode, the tiny
> helper asks the bug number then pushes it to the kill ring.  This tiny
> helper is far from perfect, any improvements is welcome. :-) Especially
> if it is already provided by an Emacs command.
>
> About the brackets, I type them.

Ludovic Courtès <ludo@gnu.org> writes:

> I have this helper for debbugs.el:
>
> (defun ludo-copy-debbugs-url ()
>   "Add to the kill ring the URL of the Debbugs issue at point."
>   (interactive)
>   (let ((url1 (concat "https://bugs.gnu.org/"
> 		      (number-to-string (debbugs-gnu-current-id))))
> 	(url2 (concat "https://issues.guix.gnu.org/"
> 		      (number-to-string (debbugs-gnu-current-id)))))
>     (kill-new url1)
>     (kill-new url2)
>     (message "Copied %s and %s" url1 url2)))
>
> (define-key debbugs-gnu-mode-map (kbd "C-w") 'ludo-copy-debbugs-url)
>
> That way I can C-w on a bug in *Guix Bugs* and I get the two URLs in the
> clipboard (I normally use “bugs.gnu.org” as the canonical bug URL.)
>
> Ludo’.

OK, I see.  So I'm not missing out on some built-in Emacs (or
debbugs-emacs) magic; most people just put together something convenient
on their own.  That makes sense!  Thank you for the examples; it's
helpful to see how others are doing it.  I think I'll try something
similar.

Bengt Richter <bokr@bokr.com> writes:

> I am not sure I understand your context or goal in searching ;/

I'm always interested in finding more effective ways to get things done.
Sometimes, asking people how they do something is the best way to
discover new methods, even if the answer seems simple or obvious.

-- 
Chris

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

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

* Re: Emacs and URLs in Git commit messages
  2021-02-05 10:40 ` Ludovic Courtès
@ 2021-04-21  3:09   ` Maxim Cournoyer
  2021-05-07  9:20     ` Alexey Abramov
  0 siblings, 1 reply; 8+ messages in thread
From: Maxim Cournoyer @ 2021-04-21  3:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi,

Ludovic Courtès <ludo@gnu.org> writes:

[...]

> I have this helper for debbugs.el:
>
> (defun ludo-copy-debbugs-url ()
>   "Add to the kill ring the URL of the Debbugs issue at point."
>   (interactive)
>   (let ((url1 (concat "https://bugs.gnu.org/"
> 		      (number-to-string (debbugs-gnu-current-id))))
> 	(url2 (concat "https://issues.guix.gnu.org/"
> 		      (number-to-string (debbugs-gnu-current-id)))))
>     (kill-new url1)
>     (kill-new url2)
>     (message "Copied %s and %s" url1 url2)))
>
> (define-key debbugs-gnu-mode-map (kbd "C-w") 'ludo-copy-debbugs-url)
>
> That way I can C-w on a bug in *Guix Bugs* and I get the two URLs in the
> clipboard (I normally use “bugs.gnu.org” as the canonical bug URL.)

Oh, that's perhaps nicer than what I had here (I like the
debbugs-gnu-current-id function):

(defun buffer-string-match (regexp)
  "Return the string matching the first group, else nil"
  (let ((text (buffer-substring-no-properties (point-min) (point-max))))
    (and (string-match regexp text)
         (match-string 1 text))))

(defun guix-get-debbugs-bug-number ()
  (interactive)
  (or (buffer-string-match "\\([[:digit:]]+\\)@debbugs.gnu.org")
      (buffer-string-match "bug#\\([[:digit:]]+\\)")))

(defun guix-get-mumi-link (bug-number)
  (interactive (list (guix-get-debbugs-bug-number)))
  "Parse the current buffer for a Debbugs issues number and
return a link for it in the MUMI Guix tracker."
  (let ((url (concat "https://issues.guix.gnu.org/" bug-number)))
    (kill-new url)
    (message "%s" url)))

Maxim


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

* Re: Emacs and URLs in Git commit messages
  2021-04-21  3:09   ` Maxim Cournoyer
@ 2021-05-07  9:20     ` Alexey Abramov
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Abramov @ 2021-05-07  9:20 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Ludovic Courtès, guix-devel

Hi,

I gave hyperbole [1] a try, and now if I move the point to that bug
string [bug#48262] or bug#48262 and press action key (M-RET) it
magically brings me to the debbugs with that bug. 

Footnotes:

[1]  https://www.gnu.org/software/hyperbole/

-- 
Alexey


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

end of thread, other threads:[~2021-05-07  9:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04  8:38 Emacs and URLs in Git commit messages Chris Marusich
2021-02-04  9:15 ` Maxime Devos
2021-02-06  5:00   ` Chris Marusich
2021-02-04 13:16 ` zimoun
2021-02-04 19:12 ` Bengt Richter
2021-02-05 10:40 ` Ludovic Courtès
2021-04-21  3:09   ` Maxim Cournoyer
2021-05-07  9:20     ` Alexey Abramov

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