[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gited 736ac62 52/73: Do not assume that 'git rev-parse
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gited 736ac62 52/73: Do not assume that 'git rev-parse 1' exits with status != 0 |
Date: |
Sun, 29 Nov 2020 00:00:38 -0500 (EST) |
branch: externals/gited
commit 736ac6229582030f414c407d1c5406c2541108c9
Author: tino calancha <tino.calancha@gmail.com>
Commit: tino calancha <tino.calancha@gmail.com>
Do not assume that 'git rev-parse 1' exits with status != 0
For some repositories `git rev-parse 1' might returns success, with
the reference pointing to something different that HEAD~1.
In that case, `gited-show-commit' fails to show commit HEAD~1.
If we reject those references, then `gited-show-commit' is forced
to include the branch name.
Bump version to 0.3.4.
* packages/gited/gited.el (gited--valid-ref-p): Explicitely reject when STR
is
just a digit, like "0", "1", "2", etc.
---
gited.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/gited.el b/gited.el
index cc7b1d5..66459dd 100644
--- a/gited.el
+++ b/gited.el
@@ -8,11 +8,11 @@
;; Created: Wed Oct 26 01:28:54 JST 2016
;; Compatibility: GNU Emacs: 24.4
-;; Version: 0.3.3
+;; Version: 0.3.4
;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Sun Aug 13 12:49:07 JST 2017
+;; Last-Updated: Sun Jan 21 14:07:11 JST 2018
;; By: calancha
-;; Update #: 682
+;; Update #: 683
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -1915,8 +1915,12 @@ diff OLD-REF REF."
(gited--set-output-buffer-mode buf 'diff)))
(defun gited--valid-ref-p (str)
- (let ((args `("rev-parse" ,str)))
- (zerop (gited-git-command args))))
+ ;; Explicitely reject when STR is just a digit, like "0", "1", "2", etc.
+ ;; For some repositories `git rev-parse 1' might returns success, with
+ ;; that reference pointing to something different that HEAD~1.
+ (unless (string-match "\\`[0-9]+\\'" str)
+ (let ((args `("rev-parse" ,str)))
+ (zerop (gited-git-command args)))))
(defun gited-show-commit (branch &optional commit)
"Show a commit of BRANCH.
- [elpa] externals/gited d78161b 56/73: * packages/gited/gited.el (gited-pull): Delete unused variable, (continued)
- [elpa] externals/gited d78161b 56/73: * packages/gited/gited.el (gited-pull): Delete unused variable, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 475e297 72/73: Support Gited buffers over a tramp connection, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 8f6722e 66/73: * gited.el: Bump version to 0.5.4, Stefan Monnier, 2020/11/29
- [elpa] externals/gited e8f116d 02/73: Default to beginning of epoch when no commit time info, Stefan Monnier, 2020/11/29
- [elpa] externals/gited cc4d5f7 17/73: Use taggerdate/taggername when listing tags, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 68c723a 46/73: * gited.el (gited-git-checkout): Avoid harmless warning., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 7a691c9 57/73: Skip tests when Git is not available, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 33c42d9 55/73: gited-pull fetches all remote branches, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 96ec28a 35/73: * gited.el (gited-goto-branch): Return point on success., Stefan Monnier, 2020/11/29
- [elpa] externals/gited c8eaa05 58/73: gited.el: Merge branch 'show-trunk-ci-status', Stefan Monnier, 2020/11/29
- [elpa] externals/gited 736ac62 52/73: Do not assume that 'git rev-parse 1' exits with status != 0,
Stefan Monnier <=
- [elpa] externals/gited 910cf66 40/73: * gited.el (gited-do-sync-with-trunk): Fix typo in docstring., Stefan Monnier, 2020/11/29
- [elpa] externals/gited dc0b527 38/73: gited-do-sync-with-trunk: New command, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 2ce2163 13/73: Prune deleted remote branches, Stefan Monnier, 2020/11/29
- [elpa] externals/gited fac8958 03/73: gited-list-branches: Move to current branch only when it's shown, Stefan Monnier, 2020/11/29
- [elpa] externals/gited aba4cf9 18/73: * gited.el (gited-goto-branch): Check first that BRANCH is shown., Stefan Monnier, 2020/11/29
- [elpa] externals/gited b0fe243 19/73: * gited.el (gited-set-branch-upstream): Output buffer must be editable., Stefan Monnier, 2020/11/29
- [elpa] externals/gited ff44a0d 23/73: * gited.el (gited-tag-add): Fix docstring., Stefan Monnier, 2020/11/29
- [elpa] externals/gited b4e58ca 27/73: gited-list: Add autoload cookie, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 7ed4084 24/73: * gited.el (gited-list-branches): Update docstring. Make alias to `gited-list'., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 09d3586 28/73: Show example screenshots, Stefan Monnier, 2020/11/29