[Orgmode] [PATCH 0/2] Teach org-version to include git version information
This series teaches org-version to include the git version number information from git describe when running org-mode from a git repository. The version is reported as dirty if tracked files are modified. This series is available at git://git.norang.ca/org-mode for-carsten Bernt Hansen (2): Add git version number to org-version information Add .dirty to git org-version info if files are modified lisp/org.el | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Awesome! I had meant to ask you for this change. THanks! - Carsten On Aug 18, 2009, at 6:22 PM, Bernt Hansen wrote: This series teaches org-version to include the git version number information from git describe when running org-mode from a git repository. The version is reported as dirty if tracked files are modified. This series is available at git://git.norang.ca/org-mode for-carsten Bernt Hansen (2): Add git version number to org-version information Add .dirty to git org-version info if files are modified lisp/org.el | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
I don't know if that will work on Windows (with git). I've only tested it on Linux here. You may want to test drive it before including it. -Bernt Carsten Dominik writes: > Awesome! > > I had meant to ask you for this change. > > THanks! > > - Carsten > > On Aug 18, 2009, at 6:22 PM, Bernt Hansen wrote: > >> This series teaches org-version to include the git version number >> information from git describe when running org-mode from a git >> repository. >> >> The version is reported as dirty if tracked files are modified. >> >> This series is available at git://git.norang.ca/org-mode for-carsten >> >> Bernt Hansen (2): >> Add git version number to org-version information >> Add .dirty to git org-version info if files are modified >> >> lisp/org.el | 25 + >> 1 files changed, 21 insertions(+), 4 deletions(-) >> >> >> >> ___ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: I don't know if that will work on Windows (with git). I've only tested it on Linux here. You may want to test drive it before including it. I have already included it, please test M-x org-version on your system and let me know if it causes problems anywhere. - Carsten -Bernt Carsten Dominik writes: Awesome! I had meant to ask you for this change. THanks! - Carsten On Aug 18, 2009, at 6:22 PM, Bernt Hansen wrote: This series teaches org-version to include the git version number information from git describe when running org-mode from a git repository. The version is reported as dirty if tracked files are modified. This series is available at git://git.norang.ca/org-mode for-carsten Bernt Hansen (2): Add git version number to org-version information Add .dirty to git org-version info if files are modified lisp/org.el | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Dear Carsten, dear Bernt, On 18.08.2009, at 21:15, Carsten Dominik wrote: On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: I don't know if that will work on Windows (with git). I've only tested it on Linux here. You may want to test drive it before including it. I have already included it, please test M-x org-version on your system and let me know if it causes problems anywhere. I just did a "make update" on MacOS X 10.5.8 and M-x org-version in Aquamacs 2.0pr2 now yields: "release_6.29c.44.ga32e.dirty" (my Makefile contains a path modification), according to Bernt's comment of commit a5e87a47230030ab4c4bc4521f5af47a7521243a, "44" refers to 44 commits after "release_6.29c" (neat!). What is the meaning of "ga32e"? Warm regards, Stefan -- Dr. Stefan Vollmar, Dipl.-Phys. Max-Planck-Institut für neurologische Forschung Gleuelerstr. 50, 50931 Köln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: voll...@nf.mpg.de http://www.nf.mpg.de ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 12:45 AM, Carsten Dominik wrote: > > On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: > >> I don't know if that will work on Windows (with git). I've only tested >> it on Linux here. You may want to test drive it before including it. > > I have already included it, please test > > M-x org-version > > on your system and let me know if it causes problems anywhere. It doesn't work on Windows (at least in my setup.) My git is from Cygwin and Windows native Emacs from GNU. - GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON - Windows XP - Cygwin git version 1.6.1.2 -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 12:45 AM, Carsten Dominik wrote: >> >> On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: >> >>> I don't know if that will work on Windows (with git). I've only tested >>> it on Linux here. You may want to test drive it before including it. >> >> I have already included it, please test >> >> M-x org-version >> >> on your system and let me know if it causes problems anywhere. > > It doesn't work on Windows (at least in my setup.) My git is from Cygwin and > Windows native Emacs from GNU. > > - GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON > - Windows XP > - Cygwin git version 1.6.1.2 Does it crash and cause an error or report the old org version as before? -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 4:54 PM, Bernt Hansen wrote: > Manish writes: > >> On Wed, Aug 19, 2009 at 12:45 AM, Carsten Dominik wrote: >>> >>> On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: >>> I don't know if that will work on Windows (with git). I've only tested it on Linux here. You may want to test drive it before including it. >>> >>> I have already included it, please test >>> >>> M-x org-version >>> >>> on your system and let me know if it causes problems anywhere. >> >> It doesn't work on Windows (at least in my setup.) My git is from Cygwin and >> Windows native Emacs from GNU. >> >> - GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON >> - Windows XP >> - Cygwin git version 1.6.1.2 > > Does it crash and cause an error or report the old org version as before? It just reports the version as before; no crashing or error of any sort. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 4:54 PM, Bernt Hansen wrote: >> Does it crash and cause an error or report the old org version as before? > > It just reports the version as before; no crashing or error of any sort. Okay that's good. I don't have Emacs on windows here. If you have time to step through the org-version function in debug and figure out where it fails we might be able to get it working on windows too. My guess is that determining the location of the .git directory fails so it acts just like it's not running from a git repository. What do you get when evaluating the following form? (file-name-directory (locate-library "org")) I need to move up one directory from what that returns to see if the .git directory exists and I append '../' to the path to move up on *nix systems. That probably doesn't work for windows. Maybe there's a better way to strip off the last directory from the path that file-name-directory returns. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 5:38 PM, Bernt Hansen wrote: > Manish writes: > >> On Wed, Aug 19, 2009 at 4:54 PM, Bernt Hansen wrote: >>> Does it crash and cause an error or report the old org version as before? >> >> It just reports the version as before; no crashing or error of any sort. > > Okay that's good. I don't have Emacs on windows here. If you have time > to step through the org-version function in debug and figure out where > it fails we might be able to get it working on windows too. I'll find out how to do this and let you know the results. > > My guess is that determining the location of the .git directory fails so > it acts just like it's not running from a git repository. > > What do you get when evaluating the following form? > > (file-name-directory (locate-library "org")) > > I need to move up one directory from what that returns to see if the > .git directory exists and I append '../' to the path to move up on *nix > systems. That probably doesn't work for windows. Maybe there's a > better way to strip off the last directory from the path that > file-name-directory returns. It returns "d:/home/zms/elisp/org-mode.git/lisp/" cd'ing into "d:/home/zms/elisp/org-mode.git/lisp/.." works in Cygwin but fails in Windows shell due to front slahes. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish wrote: > On Wed, Aug 19, 2009 at 12:45 AM, Carsten Dominik wrote: > > > > On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: > > > >> I don't know if that will work on Windows (with git). I've only tested > >> it on Linux here. You may want to test drive it before including it. > > > > I have already included it, please test > > > > M-x org-version > > > > on your system and let me know if it causes problems anywhere. > > It doesn't work on Windows (at least in my setup.) My git is from Cygwin and > Windows native Emacs from GNU. > > - GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON > - Windows XP > - Cygwin git version 1.6.1.2 > Does it break? Or does it just not provide the git information? Thanks, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish, Could you try this patch - does it work? -Bernt >From 1b26a9ef0a9105d3e855c242fce3a44d1b8cd9c7 Mon Sep 17 00:00:00 2001 From: Bernt Hansen Date: Wed, 19 Aug 2009 08:26:43 -0400 Subject: [PATCH] Fix org-version so the git version report works on windows too --- lisp/org.el |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bd32b70..de971e2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -104,10 +104,10 @@ With prefix arg HERE, insert it at point." (interactive "P") (let* ((org-version org-version) (git-version) -(dir (concat (file-name-directory (locate-library "org")) "../" ))) +(dir (file-truename (concat (file-name-directory (locate-library "org")) "../" (if (file-exists-p (expand-file-name ".git" dir)) (progn -(shell-command (concat "cd " dir " && git describe --abbrev=4 HEAD")) +(shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 HEAD")) (save-excursion (set-buffer "*Shell Command Output*") (goto-char (point-min)) @@ -115,7 +115,7 @@ With prefix arg HERE, insert it at point." (goto-char (point-min)) (re-search-forward "[^\n]+") (setq git-version (match-string 0)) - (shell-command (concat "cd " dir " && git diff-index --name-only HEAD --")) + (shell-command (concat "GITDIR=" dir " && git diff-index --name-only HEAD --")) (unless (eql 1 (point-max)) (setq git-version (concat git-version ".dirty"))) (setq org-version (concat org-version " (" git-version ")") -- 1.6.4 ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 5:51 PM, Nick Dokos wrote: > Manish wrote: > >> On Wed, Aug 19, 2009 at 12:45 AM, Carsten Dominik wrote: >> > >> > On Aug 18, 2009, at 8:10 PM, Bernt Hansen wrote: >> > >> >> I don't know if that will work on Windows (with git). I've only tested >> >> it on Linux here. You may want to test drive it before including it. >> > >> > I have already included it, please test >> > >> > M-x org-version >> > >> > on your system and let me know if it causes problems anywhere. >> >> It doesn't work on Windows (at least in my setup.) My git is from Cygwin and >> Windows native Emacs from GNU. >> >> - GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON >> - Windows XP >> - Cygwin git version 1.6.1.2 >> > > Does it break? Or does it just not provide the git information? It continues to work the way it used to work with no error or breakage. Although I have reloaded and restarted org a few times, I will report again after rebooting Emacs. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 6:00 PM, Bernt Hansen wrote: > Manish, > > Could you try this patch - does it work? Patch application fails. I tried with patch -p1 as well. , | [Wed 19 18:47] (2118) ~/elisp/org-mode.git $ git apply org-version-patch-by-bernt.patch | error: patch failed: lisp/org.el:104 | error: lisp/org.el: patch does not apply ` -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 5:38 PM, Bernt Hansen wrote: > Manish writes: > >> On Wed, Aug 19, 2009 at 4:54 PM, Bernt Hansen wrote: >>> Does it crash and cause an error or report the old org version as before? >> >> It just reports the version as before; no crashing or error of any sort. > > Okay that's good. I don't have Emacs on windows here. If you have time > to step through the org-version function in debug and figure out where > it fails we might be able to get it working on windows too. I had not compiled the latest git and hence an older copy was getting loaded because of which it kept working without any errors. Now it returns: "Org-mode version 6.29trans (The system cannot find the path specified..dirty)" Sorry about that. When I tried to run the function under debug the *Shell Command Output* buffer displays this message "The system cannot find the path specified." Perhaps this is because of the slashes since Windows shell does not understand them? Could we detect if we are on Windows and use "\" instead of "/"? Thanks -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 6:00 PM, Bernt Hansen wrote: >> Manish, >> >> Could you try this patch - does it work? > > Patch application fails. I tried with patch -p1 as well. > > , > | [Wed 19 18:47] (2118) ~/elisp/org-mode.git $ git apply > org-version-patch-by-bernt.patch > | error: patch failed: lisp/org.el:104 > | error: lisp/org.el: patch does not apply > ` > > -- > Manish Can you try evaluating this? and then M-x org-version and report the results? (defun org-version (&optional here) "Show the org-mode version in the echo area. With prefix arg HERE, insert it at point." (interactive "P") (let* ((org-version org-version) (git-version) (dir (file-truename (concat (file-name-directory (locate-library "org")) "../" (if (file-exists-p (expand-file-name ".git" dir)) (progn (shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 HEAD")) (save-excursion (set-buffer "*Shell Command Output*") (goto-char (point-min)) (replace-regexp "-" ".") (goto-char (point-min)) (re-search-forward "[^\n]+") (setq git-version (match-string 0)) (shell-command (concat "GITDIR=" dir " && git diff-index --name-only HEAD --")) (unless (eql 1 (point-max)) (setq git-version (concat git-version ".dirty"))) (setq org-version (concat org-version " (" git-version ")") (let ((version (format "Org-mode version %s" org-version))) (if here (insert version)) (message version) version))) -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Bernt Hansen writes: > Can you try evaluating this? and then M-x org-version and report the > results? Nevermind - that version is broken. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 5:38 PM, Bernt Hansen wrote: >> Manish writes: >> > When I tried to run the function under debug the *Shell Command > Output* buffer displays this message "The system cannot find the path > specified." Perhaps this is because of the slashes since Windows > shell does not understand them? Could we detect if we are on Windows > and use "\" instead of "/"? I'm not sure how to determine if we're on windows vs something else. Any suggestions? -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Bernt Hansen wrote: > Manish writes: > > > On Wed, Aug 19, 2009 at 5:38 PM, Bernt Hansen wrote: > >> Manish writes: > >> > > When I tried to run the function under debug the *Shell Command > > Output* buffer displays this message "The system cannot find the path > > specified." Perhaps this is because of the slashes since Windows > > shell does not understand them? Could we detect if we are on Windows > > and use "\" instead of "/"? > > I'm not sure how to determine if we're on windows vs something else. > Any suggestions? > Check the variable system-type. HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 7:02 PM, Bernt Hansen wrote: > Manish writes: > >> On Wed, Aug 19, 2009 at 6:00 PM, Bernt Hansen wrote: >>> Manish, >>> >>> Could you try this patch - does it work? >> >> Patch application fails. I tried with patch -p1 as well. >> >> , >> | [Wed 19 18:47] (2118) ~/elisp/org-mode.git $ git apply >> org-version-patch-by-bernt.patch >> | error: patch failed: lisp/org.el:104 >> | error: lisp/org.el: patch does not apply >> ` >> >> -- >> Manish > > Can you try evaluating this? and then M-x org-version and report the > results? > > (defun org-version (&optional here) > "Show the org-mode version in the echo area. > With prefix arg HERE, insert it at point." > (interactive "P") > (let* ((org-version org-version) > (git-version) > (dir (file-truename (concat (file-name-directory (locate-library > "org")) "../" > (if (file-exists-p (expand-file-name ".git" dir)) > (progn > (shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 > HEAD")) > (save-excursion > (set-buffer "*Shell Command Output*") > (goto-char (point-min)) > (replace-regexp "-" ".") > (goto-char (point-min)) > (re-search-forward "[^\n]+") > (setq git-version (match-string 0)) > (shell-command (concat "GITDIR=" dir " && git diff-index > --name-only HEAD --")) > (unless (eql 1 (point-max)) > (setq git-version (concat git-version ".dirty"))) > (setq org-version (concat org-version " (" git-version ")") > (let ((version (format "Org-mode version %s" org-version))) > (if here (insert version)) > (message version) > version))) > > -Bernt > Results follows: Org-mode version 6.29trans ('GITDIR' is not recognized as an internal or external command,.dirty) Sorry for the delay.. had to step away for sometime. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Bernt Hansen wrote: ... >(shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 > HEAD")) ... Disclaimer: I touch Windows once a day to check a mail account and possibly surf the web - other than that, I'm pretty much at sea in it (and I've never used emacs on Windows, let alone install git on it.) Please excuse the elementary questions. How does shell-command work under Windows? What shell is it using? Is cygwin a prerequisite for it? Is cygwin a prerequisite for git? Thanks, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 7:32 PM, Nick Dokos wrote: > Bernt Hansen wrote: > > ... >>(shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 HEAD")) > ... > > Disclaimer: I touch Windows once a day to check a mail account and > possibly surf the web - other than that, I'm pretty much at sea in it > (and I've never used emacs on Windows, let alone install git on it.) > Please excuse the elementary questions. > > How does shell-command work under Windows? No idea. > What shell is it using? Windows has it's own CMD shell (CMD.exe). > Is cygwin a prerequisite for it? Prerequisite for CMD? No. CMD is native and comes with Windows. > Is cygwin a prerequisite for git? Native git on Windows was reported to have issues quite sometime back. I read somewhere that the situation is much better now. Cygwin git has always worked for me without any issues. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Nick Dokos writes: > Bernt Hansen wrote: > > ... >> (shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 >> HEAD")) > ... > > Disclaimer: I touch Windows once a day to check a mail account and > possibly surf the web - other than that, I'm pretty much at sea in it > (and I've never used emacs on Windows, let alone install git on it.) > Please excuse the elementary questions. > > How does shell-command work under Windows? What shell is it using? > Is cygwin a prerequisite for it? Is cygwin a prerequisite for git? > > Thanks, > Nick Nick, You use windows more than me :) I have no idea what shell it uses - but if it's the DOS shell the && above is never going to work. I have GNU Emacs 23.0.91.1 (i386-mingw-nt5.1.2600) of 2009-02-26 on LENNART-69DE564 (patched) here which I can try. I think this version uses the DOS shell and git which is installed on the system isn't available from this shell. Maybe I should just disable the git version for now on ms-dos, windows-nt, and cygwin since I don't know how to make it work reliably on windows. Opinions? -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish wrote: > On Wed, Aug 19, 2009 at 7:32 PM, Nick Dokos wrote: > > Bernt Hansen wrote: > > > > ... > >>(shell-command (concat "GITDIR=" dir " && git describe --abbrev=4 > >> HEAD")) > > ... > > > > Disclaimer: I touch Windows once a day to check a mail account and > > possibly surf the web - other than that, I'm pretty much at sea in it > > (and I've never used emacs on Windows, let alone install git on it.) > > Please excuse the elementary questions. > > > > How does shell-command work under Windows? > > No idea. > > > What shell is it using? > > Windows has it's own CMD shell (CMD.exe). > > > Is cygwin a prerequisite for it? > > Prerequisite for CMD? No. CMD is native and comes with Windows. > > > Is cygwin a prerequisite for git? > > Native git on Windows was reported to have issues quite sometime back. I read > somewhere that the situation is much better now. Cygwin git has always worked > for me without any issues. > Manish, Thanks! IIUC, there are then multiple forks in the decision tree: o running on Windows or on something else? o if on Windows, running native or under cygwin? o what shell am I using? cmd.exe and bash under cygwin accept different syntax - in particular, the GITDIR=foo solution of setting env variables has no hope of working under cmd.exe - is that correct? Sounds complicated. Maybe the best solution for now is to punt on the git information on Windows? (when (not (member system-type '(ms-dos windows-nt cygwin))) ...add git info...) What about system-type == "darwin"? Does Bernt's code work there? Thanks, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 7:47 PM, Bernt Hansen wrote: [snip: attempting to make git reporting functionality in org-version (29 lines)] > > Maybe I should just disable the git version for now on ms-dos, > windows-nt, and cygwin since I don't know how to make it work reliably > on windows. > > Opinions? It appears there are very few Windows users on the list so I guess the effort involved does not benefit a lot of people anyways. I am okay if you would like to disable the functionality on Windows. -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Nick Dokos writes: > Thanks! IIUC, there are then multiple forks in the decision tree: > > o running on Windows or on something else? > > o if on Windows, running native or under cygwin? > > o what shell am I using? cmd.exe and bash under cygwin accept > different syntax - in particular, the GITDIR=foo solution of > setting env variables has no hope of working under cmd.exe - > is that correct? > > Sounds complicated. Maybe the best solution for now is to punt on > the git information on Windows? > > (when (not (member system-type '(ms-dos windows-nt cygwin))) > ...add git info...) > > What about system-type == "darwin"? Does Bernt's code work there? Yes it'll be complicated. Right now I think we should punt and just go back to the old org-version reporting for windows until we can get a better working solution since the current version breaks on windows. I'll try to provide a patch for this. Manish: What value do you have for system-type? I expect it says 'windows-nt' If that's true then the problem is determining if - git is installed - what version? Msysgit? cygwin git? - what shells are available (since CMD.exe has little hope of working) - msysgit bash - cygwin shell - cmd (won't work if msysgit was installed with git in the msysgit bash shell only) - running some other shell (git-bash, cygwin) so the git executable is available and provide the right syntax for each to Do The Right Thing(tm) Right now I'm inclined to skip the git-version magic if system-type is windows-nt just to stop it from breaking on that platform. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 7:47 PM, Bernt Hansen wrote: > [snip: attempting to make git reporting functionality in org-version (29 > lines)] >> >> Maybe I should just disable the git version for now on ms-dos, >> windows-nt, and cygwin since I don't know how to make it work reliably >> on windows. >> >> Opinions? > > It appears there are very few Windows users on the list so I guess the > effort involved does not benefit a lot of people anyways. I am okay > if you would like to disable the functionality on Windows. If you want to work with me off-list we can pursue this and see if we can cobble something together that works. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 8:12 PM, Bernt Hansen wrote: > Nick Dokos writes: > >> Thanks! IIUC, there are then multiple forks in the decision tree: >> >> o running on Windows or on something else? >> >> o if on Windows, running native or under cygwin? >> >> o what shell am I using? cmd.exe and bash under cygwin accept >> different syntax - in particular, the GITDIR=foo solution of >> setting env variables has no hope of working under cmd.exe - >> is that correct? >> >> Sounds complicated. Maybe the best solution for now is to punt on >> the git information on Windows? >> >> (when (not (member system-type '(ms-dos windows-nt cygwin))) >> ...add git info...) >> >> What about system-type == "darwin"? Does Bernt's code work there? > > Yes it'll be complicated. Right now I think we should punt and just go > back to the old org-version reporting for windows until we can get a > better working solution since the current version breaks on windows. > I'll try to provide a patch for this. > > Manish: > > What value do you have for system-type? I expect it says 'windows-nt' Yes, it does. > > If that's true then the problem is determining if > - git is installed > - what version? Msysgit? cygwin git? > - what shells are available (since CMD.exe has little hope of working) > - msysgit bash > - cygwin shell > - cmd (won't work if msysgit was installed with git in the msysgit > bash shell only) > - running some other shell (git-bash, cygwin) so the git executable is > available and provide the right syntax for each to Do The Right > Thing(tm) Do we test if git is installed if we are on a non-Windows system or show whatever error shell returns in case git is not installed? I tried calling cygwin git from CMD shell and it seems to work okay. So I am guessing we need to figure out how to correctly pass git command from Emacs to Windows shell. I will try to find examples from Org's PDF processing code. > > Right now I'm inclined to skip the git-version magic if system-type is > windows-nt just to stop it from breaking on that platform. Sure. I will share some information/examples if I can find anything to make it work. Thanks -- Manish> ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish wrote: > ... > Do we test if git is installed if we are on a non-Windows system or > show whatever error shell returns in case git is not installed? > > I tried calling cygwin git from CMD shell and it seems to work okay. > So I am guessing we need to figure out how to correctly pass git > command from Emacs to Windows shell. I will try to find examples from > Org's PDF processing code. > Bernt's code checks for the existence of the .git subdirectory in the parent directory of wherever emacs get the org.el[c] library: if it's present, then the assumption is that git is installed. HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 8:34 PM, Nick Dokos wrote: > Manish wrote: > > >> ... >> Do we test if git is installed if we are on a non-Windows system or >> show whatever error shell returns in case git is not installed? >> >> I tried calling cygwin git from CMD shell and it seems to work okay. >> So I am guessing we need to figure out how to correctly pass git >> command from Emacs to Windows shell. I will try to find examples from >> Org's PDF processing code. >> > > Bernt's code checks for the existence of the .git subdirectory > in the parent directory of wherever emacs get the org.el[c] library: > if it's present, then the assumption is that git is installed. Yeah.. that makes sense. Thanks -- Manish ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Nick Dokos writes: > Manish wrote: > > >> ... >> Do we test if git is installed if we are on a non-Windows system or >> show whatever error shell returns in case git is not installed? >> >> I tried calling cygwin git from CMD shell and it seems to work okay. >> So I am guessing we need to figure out how to correctly pass git >> command from Emacs to Windows shell. I will try to find examples from >> Org's PDF processing code. >> > > Bernt's code checks for the existence of the .git subdirectory > in the parent directory of wherever emacs get the org.el[c] library: > if it's present, then the assumption is that git is installed. Well maybe. I have an older version of Emacs 23 installed on my windows Eee PC system and I have msysGit installed (not cygwin git) but it's not available to the shell as a command. Nothing prevents me from running org-mode from a git repository there. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
On Wed, Aug 19, 2009 at 8:46 PM, Bernt Hansen wrote: > Nick Dokos writes: > [...] >> >> Bernt's code checks for the existence of the .git subdirectory >> in the parent directory of wherever emacs get the org.el[c] library: >> if it's present, then the assumption is that git is installed. > > Well maybe. I have an older version of Emacs 23 installed on my > windows Eee PC system and I have msysGit installed (not cygwin git) but > it's not available to the shell as a command. It should be, I think. May be it's not added to PATH environment variable? You can set it up like so: 1. Right-click on "My Computer", click "Properties" 2. Click on "Advanced" tab 3. Click "Environment Variables" button 4. Add the path to git binary under System or User PATH variable. 5. Restart Emacs and test again. -- Manish > Nothing prevents me from > running org-mode from a git repository there. > > -Bernt > ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH 0/2] Teach org-version to include git version information
Manish writes: > On Wed, Aug 19, 2009 at 8:46 PM, Bernt Hansen wrote: >> Nick Dokos writes: >> > [...] >>> >>> Bernt's code checks for the existence of the .git subdirectory >>> in the parent directory of wherever emacs get the org.el[c] library: >>> if it's present, then the assumption is that git is installed. >> >> Well maybe. I have an older version of Emacs 23 installed on my >> windows Eee PC system and I have msysGit installed (not cygwin git) but >> it's not available to the shell as a command. > > It should be, I think. May be it's not added to PATH environment variable? > You can set it up like so: > > 1. Right-click on "My Computer", click "Properties" > 2. Click on "Advanced" tab > 3. Click "Environment Variables" button > 4. Add the path to git binary under System or User PATH variable. > 5. Restart Emacs and test again. The msysGit installation gives a choice to include the git executables in the path or not. I'm not sure what the current state of that is but they used to recommend _not_ installing it for cmd.exe so we can't assume that it's available. I can probably find the msysgit shell if it's available and run that instead. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode