bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8756: 23.3; vc-git.el doesn't use --follow argument in vc-git-print-


From: Steinar Bang
Subject: bug#8756: 23.3; vc-git.el doesn't use --follow argument in vc-git-print-log
Date: Sun, 12 Jan 2014 00:32:56 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (windows-nt)

>>>>> Steinar Bang <address@hidden>:

> To get the sha1/path infomation one can do the command
>  git log --follow --name-only --pretty=oneline 
> path-to-current-version-of-the-file
> and then parse out the sha1/path pairs.

Some example code:
(let
    ((git-result (split-string 
                  (shell-command-to-string "cd ~/git/renametest/;git log 
--follow --name-only --pretty=oneline application/main.txt")
                  "\r?\n"))
     (sha1-path-map)
     (sha1)
     (path))
  (while git-result
    (setq sha1 (car (split-string (car git-result))))
    (setq git-result (cdr git-result))
    (setq path (car git-result))
    (setq git-result (cdr git-result))
    (add-to-list 'sha1-path-map (cons sha1 path)))
  (cdr sha1-path-map))

Which results in the following alist of sha1-to-path:
(("e5984c6a9e8e015dc521fb6a1756a88d5ffd676d" . "hoved.txt") 
("b35723cfbc91a3108469091c8c77ee91107e1ab8" . "hoved.txt") 
("2b0f570422db1e0fac39697d908b31eb70e895f5" . "main.txt") 
("dd99483cda11b4ab040135767655c07c5cf07efb" . "main.txt") 
("9b47cdca956a59b4582c67d24f9474a576aff7b9" . "main.txt") 
("313aa2f727fefc9e50354380cb9fb3a70401b5f3" . "application/main.txt") 
("09d1bf6aa4dcd20dd36ca7668b75809e794428e0" . "application/main.txt"))

(The cdr on the return value, is because the list was headed by a (nil)
and I couldn't figure out where it came from)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]