* Enhancing (?) `emacs-version'
@ 2016-02-10 19:01 Marcin Borkowski
2016-02-10 19:18 ` Óscar Fuentes
2016-02-10 19:24 ` Eli Zaretskii
0 siblings, 2 replies; 8+ messages in thread
From: Marcin Borkowski @ 2016-02-10 19:01 UTC (permalink / raw)
To: emacs-devel
Hi all,
would it be hard and/or reasonable to make `emacs-version' display the
sha of the git commit used to build this version for development
versions of Emacs? I guess it would make sense for bug reporting.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 19:01 Enhancing (?) `emacs-version' Marcin Borkowski
@ 2016-02-10 19:18 ` Óscar Fuentes
2016-02-10 19:24 ` Eli Zaretskii
1 sibling, 0 replies; 8+ messages in thread
From: Óscar Fuentes @ 2016-02-10 19:18 UTC (permalink / raw)
To: emacs-devel
Marcin Borkowski <mbork@mbork.pl> writes:
> would it be hard and/or reasonable to make `emacs-version' display the
> sha of the git commit used to build this version for development
> versions of Emacs? I guess it would make sense for bug reporting.
report-emacs-bug already mentions the sha of the revision that was
checked out at build time.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 19:01 Enhancing (?) `emacs-version' Marcin Borkowski
2016-02-10 19:18 ` Óscar Fuentes
@ 2016-02-10 19:24 ` Eli Zaretskii
2016-02-10 20:27 ` Marcin Borkowski
1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2016-02-10 19:24 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: emacs-devel
> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Wed, 10 Feb 2016 20:01:57 +0100
>
> would it be hard and/or reasonable to make `emacs-version' display the
> sha of the git commit used to build this version for development
> versions of Emacs? I guess it would make sense for bug reporting.
We already have the variable emacs-repository-version, and
report-emacs-bug already includes it in the report.
If that's not good enough, please tell the details of the use case you
had in mind.
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 19:24 ` Eli Zaretskii
@ 2016-02-10 20:27 ` Marcin Borkowski
2016-02-10 20:33 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Marcin Borkowski @ 2016-02-10 20:27 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 2016-02-10, at 20:24, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Marcin Borkowski <mbork@mbork.pl>
>> Date: Wed, 10 Feb 2016 20:01:57 +0100
>>
>> would it be hard and/or reasonable to make `emacs-version' display the
>> sha of the git commit used to build this version for development
>> versions of Emacs? I guess it would make sense for bug reporting.
>
> We already have the variable emacs-repository-version, and
> report-emacs-bug already includes it in the report.
Thanks, I had no idea that this exists! What does it state for
non-development versions (official, prebuilt pretests or binaries, for
instance)?
> If that's not good enough, please tell the details of the use case you
> had in mind.
I guess it is (almost) good enough. I will probably advise
emacs-version to include that info, though. Would it be helpful for the
devs if I do? Not all bug-related messages are created with
report-emacs-bug. Use case: a message to the bug-gnu-emacs list,
stating that this-and-this bug can be reproduced on that-and-that Emacs
version. It might be helpful for me if emacs-version included that info
automatically.
> Thanks.
Thanks, and best regards,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 20:27 ` Marcin Borkowski
@ 2016-02-10 20:33 ` Eli Zaretskii
2016-02-10 20:53 ` Marcin Borkowski
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2016-02-10 20:33 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: emacs-devel
> From: Marcin Borkowski <mbork@mbork.pl>
> Cc: emacs-devel@gnu.org
> Date: Wed, 10 Feb 2016 21:27:38 +0100
>
> > We already have the variable emacs-repository-version, and
> > report-emacs-bug already includes it in the report.
>
> Thanks, I had no idea that this exists! What does it state for
> non-development versions (official, prebuilt pretests or binaries, for
> instance)?
The value is nil then.
> I guess it is (almost) good enough. I will probably advise
> emacs-version to include that info, though. Would it be helpful for the
> devs if I do? Not all bug-related messages are created with
> report-emacs-bug. Use case: a message to the bug-gnu-emacs list,
> stating that this-and-this bug can be reproduced on that-and-that Emacs
> version. It might be helpful for me if emacs-version included that info
> automatically.
IME, if the version is reported, it's reported by report-emacs-bug.
But maybe I misremember.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 20:33 ` Eli Zaretskii
@ 2016-02-10 20:53 ` Marcin Borkowski
2016-02-10 22:30 ` Kaushal Modi
0 siblings, 1 reply; 8+ messages in thread
From: Marcin Borkowski @ 2016-02-10 20:53 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 2016-02-10, at 21:33, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Marcin Borkowski <mbork@mbork.pl>
>> Cc: emacs-devel@gnu.org
>> Date: Wed, 10 Feb 2016 21:27:38 +0100
>>
>> > We already have the variable emacs-repository-version, and
>> > report-emacs-bug already includes it in the report.
>>
>> Thanks, I had no idea that this exists! What does it state for
>> non-development versions (official, prebuilt pretests or binaries, for
>> instance)?
>
> The value is nil then.
I guess that it makes sense to include a check for non-nil-ness in
emacs-version, and if it passes, include at least the first 6-8
characters of the commit sha.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 20:53 ` Marcin Borkowski
@ 2016-02-10 22:30 ` Kaushal Modi
2016-02-10 22:37 ` Óscar Fuentes
0 siblings, 1 reply; 8+ messages in thread
From: Kaushal Modi @ 2016-02-10 22:30 UTC (permalink / raw)
To: Marcin Borkowski; +Cc: Eli Zaretskii, emacs-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]
I use this function to get the emacs dev version.
(defun emacs-version-dev (here)
"Display emacs build info and also save it to the kill-ring.
If HERE is non-nil, also insert the string at point."
(interactive "P")
(let ((emacs-build-info
(concat "Emacs version: " (emacs-version) ","
" built using commit " emacs-repository-version ".\n\n"
"./configure options:\n " system-configuration-options "\n\n"
"Features:\n " system-configuration-features "\n")))
(kill-new emacs-build-info)
(message emacs-build-info)
(when here
(insert emacs-build-info))
emacs-build-info))
AFAIK there is no definitive way to get the branch name because
branches are ephemeral. But the below hack works for me.
(defvar emacs-git-branch
(when (and emacs-repository-version
(file-exists-p source-directory))
(let ((shell-return
(replace-regexp-in-string
"[\n)]" " " ; Replace newline and ) chars with spaces
(shell-command-to-string
(concat "cd " source-directory " && "
"git branch --contains "
emacs-repository-version)))))
;; Below regexp is tested for following "git branch --contains" values
;; Output for a commit in master branch too
;; "* (HEAD detached at origin/emacs-25)
;; master
;; "
;; Output for a commit only in emacs-25 branch
;; "* (HEAD detached at origin/emacs-25)
;; "
;; (message "%S" shell-return)
(string-match ".*[/ ]\\([^ ]+?\\)\\s-*$" shell-return)
(match-string-no-properties 1 shell-return)))
"Name of git branch from which the current emacs is built.")
https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-misc.el
--
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 16793 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Enhancing (?) `emacs-version'
2016-02-10 22:30 ` Kaushal Modi
@ 2016-02-10 22:37 ` Óscar Fuentes
0 siblings, 0 replies; 8+ messages in thread
From: Óscar Fuentes @ 2016-02-10 22:37 UTC (permalink / raw)
To: emacs-devel
Kaushal Modi <kaushal.modi@gmail.com> writes:
> AFAIK there is no definitive way to get the branch name because
> branches are ephemeral. But the below hack works for me.
I use this:
(defun get-git-branch-en-directorio (dir)
(with-temp-buffer
(cd dir)
(vc-file-clearprops ".")
(let ((branch-name (vc-git--symbolic-ref ".")))
(when (string= branch-name "")
(error "get-git-branch-en-directorio: no hay git info en %s" dir))
branch-name)))
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-02-10 22:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 19:01 Enhancing (?) `emacs-version' Marcin Borkowski
2016-02-10 19:18 ` Óscar Fuentes
2016-02-10 19:24 ` Eli Zaretskii
2016-02-10 20:27 ` Marcin Borkowski
2016-02-10 20:33 ` Eli Zaretskii
2016-02-10 20:53 ` Marcin Borkowski
2016-02-10 22:30 ` Kaushal Modi
2016-02-10 22:37 ` Óscar Fuentes
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).