Function: vc-git-revision-published-p

vc-git-revision-published-p is a byte-compiled function defined in vc-git.el.gz.

Signature

(vc-git-revision-published-p REV)

Documentation

Whether we think REV has been pushed such that it is public history.

Considers only the current branch. Does not fetch.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-git.el.gz
(defun vc-git-revision-published-p (rev)
  "Whether we think REV has been pushed such that it is public history.
Considers only the current branch.  Does not fetch."
  (let ((branch (vc-git--current-branch))
        (rev (vc-git--rev-parse rev)))
    (vc-git--assert-revision-on-branch rev branch)
    (and
     ;; BRANCH has an upstream.
     (with-temp-buffer
       (vc-git--out-ok "config" "--get"
                       (format "branch.%s.merge" branch)))
     ;; REV is not outgoing.
     (not (cl-member rev
                     (split-string
                      (with-output-to-string
                        (vc-git-command standard-output 0 nil "log"
                                        "--pretty=format:%H"
                                        "@{upstream}..HEAD")))
                     :test #'string-prefix-p)))))