From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.devel Subject: [PATCH] version.el (emacs-repository-get-version): Let git change the directory. Date: Tue, 18 Nov 2014 01:41:45 +0100 Message-ID: <1416271305-6656-1-git-send-email-mina86@mina86.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1416271345 17781 80.91.229.3 (18 Nov 2014 00:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Nov 2014 00:42:25 +0000 (UTC) To: Glenn Morris , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 18 01:42:18 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqWs5-000481-HS for ged-emacs-devel@m.gmane.org; Tue, 18 Nov 2014 01:42:17 +0100 Original-Received: from localhost ([::1]:50791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqWs4-0001xg-Mo for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 19:42:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqWrn-0001xX-2J for emacs-devel@gnu.org; Mon, 17 Nov 2014 19:42:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqWrc-0003O0-Vm for emacs-devel@gnu.org; Mon, 17 Nov 2014 19:41:59 -0500 Original-Received: from mail-la0-f73.google.com ([209.85.215.73]:38952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqWrc-0003Np-PT for emacs-devel@gnu.org; Mon, 17 Nov 2014 19:41:48 -0500 Original-Received: by mail-la0-f73.google.com with SMTP id gm9so210471lab.4 for ; Mon, 17 Nov 2014 16:41:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=vJ2FcW3CjuCi8Swmnb11v9AO+oaGiIkXIj8I+unZMBM=; b=CIapSQf3w9t6R6vvwz47Bzijn8JDaLVIfj5iHqJWSIZiqipIWaKGWrx3kdg3v/0q7S 3XGIvZF0pzwHwsFU3foVPILsR7UcKpG0oUeR+Zm2LNOgdfUE94tO7ymlQTzglTpXjve8 2ua5G6RNvdBuN9QakaLgMZ7XKZ+ZGu46q/g3shxp+ECw1nEuQpJ6q376PeiQcLGoMKc5 xXiZxXSZ9hoUjrMJ+FylFq4SO789I1zWWRRHM87lEi/Mc0SyV9Awq6FnHLOeu93TTued 9QQ02+bdbU/Px4zs5T9D3Zg4MEqr/iKbF0KGyvMkEfUpJbucOqI6rZJ5hx1VajsYVpJr 4kdg== X-Gm-Message-State: ALoCoQmjUvc06D3ejEOFBP3F4h7thde3+NDN+XKg8WcJe+U+rk6m4C4Io9KxBUaT0HmxC5uGJ2f8/ktEgrEm6RiGgiv1KdmPeo/1VTavCr17tXxqG/7HuSAzP+DteAgZjs96/yZbXWYctx8TDA2m1XUF58Q96cY1fA== X-Received: by 10.180.87.103 with SMTP id w7mr1397935wiz.3.1416271307702; Mon, 17 Nov 2014 16:41:47 -0800 (PST) Original-Received: from corpmail-nozzle1-2.eem.corp.google.com ([172.25.144.13]) by gmr-mx.google.com with ESMTPS id r13si711028wib.0.2014.11.17.16.41.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 16:41:47 -0800 (PST) Original-Received: from mpn.zrh.corp.google.com ([172.16.113.113]) by corpmail-nozzle1-2.eem.corp.google.com with ESMTP id hCx5rhyU.1; Mon, 17 Nov 2014 16:41:47 -0800 Original-Received: by mpn.zrh.corp.google.com (Postfix, from userid 126942) id 3916F1E01AD; Tue, 18 Nov 2014 01:41:47 +0100 (CET) X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.73 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177507 Archived-At: --- lisp/ChangeLog | 5 +++++ lisp/version.el | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0075c5a..e5baecc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-11-18 Michal Nazarewicz + + * version.el (emacs-repository-get-version): Let git change the + directory. This makes the code one line shorter. ;) + 2014-11-17 Michal Nazarewicz * textmodes/tildify.el (tildify-pattern, tildify-space-string): diff --git a/lisp/version.el b/lisp/version.el index cab2d28..db31308 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -184,14 +184,12 @@ only ask the VCS if we cannot find any information ourselves." ((file-directory-p (expand-file-name ".git" dir)) (message "Waiting for git...") (with-temp-buffer - (let ((default-directory (file-name-as-directory dir))) - (and (eq 0 - (condition-case nil - (call-process "git" nil '(t nil) nil "rev-parse" - "HEAD") - (error nil))) - (not (zerop (buffer-size))) - (replace-regexp-in-string "\n" "" (buffer-string)))))))) + (and (zerop (condition-case nil + (call-process "git" nil '(t nil) nil + "-C" dir "rev-parse" "HEAD") + (error nil))) + (not (zerop (buffer-size))) + (replace-regexp-in-string "\n" "" (buffer-string))))))) ;; We put version info into the executable in the form that `ident' uses. (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version)) -- 2.1.0.rc2.206.gedb03e5