GNU bug report logs - #8756
23.3; vc-git.el doesn't use --follow argument in vc-git-print-log

Previous Next

Package: emacs;

Reported by: Steinar Bang <sb <at> dod.no>

Date: Sun, 29 May 2011 20:28:01 UTC

Severity: normal

Tags: fixed

Merged with 19045

Found in versions 23.3, 25.0.50

Fixed in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Steinar Bang <sb <at> dod.no>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 8756 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>
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
>>>>> Steinar Bang <sb <at> dod.no>:

> 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)





This bug report was last modified 5 years and 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.