Function: vc-user-login-name

vc-user-login-name is a byte-compiled function defined in vc-hooks.el.gz.

Signature

(vc-user-login-name FILE)

Documentation

Return the name under which the user accesses the given FILE.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-user-login-name (file)
  "Return the name under which the user accesses the given FILE."
  (or (and (file-remote-p file)
           ;; tramp case: execute "whoami" via tramp
           (let ((default-directory (file-name-directory file))
		 process-file-side-effects)
             (with-temp-buffer
               (if (not (zerop (process-file "whoami" nil t)))
                   ;; fall through if "whoami" didn't work
                   nil
                 ;; remove trailing newline
                 (delete-region (1- (point-max)) (point-max))
                 (buffer-string)))))
      ;; normal case
      (user-login-name)
      ;; if user-login-name is nil, return the UID as a string
      (number-to-string (user-uid))))