What command would be used with git for the doxygen FILE_VERSION_FILTER
? The output would preferably be the number of times that file as been revised in the repo.
Using git with Doxygen FILE_VERSION_FILTER
1.3k views Asked by HSchmale At
3
There are 3 answers
0
On
git revlist --count
accepts a list of paths after --
(I don't know if this is a recent feature or if it has always been there).
Since doxygen wants a single command to call using popen()
, I'm using a small script like this:
#!/bin/sh
echo -n "File version: "
git -C <path_to_git_directory> rev-list HEAD --count -- $1
-C
is necessary if doxygen is not executed in the git directory and requires a recent git version.
0
On
This is an old question, but since I found it looking for the same problem, here's my solution:
FILE_VERSION_FILTER = "git log --format='%H' -1"
It will actually just get the git revision for each file and that seems to be the intended use of FILE_VERSION_FILTER
. If you like, you could use abbreviated revisions by changing format from '%H'
to '%h'
.
For a file, you can use one of the
git log
commands in "List all commits for a specific file":Another option, in "How to get the git commit count?" (
git rev-list HEAD --count
) would apply to the all repo, not one single file.It was introduced in commit f69c501, Git 1.7.2-rc1, Jun 2010. Combined with a
-- afile
, it can work too. Note the option was only offically documented in commit 75d2e5a, Git 2.4.7.Original answer, for a all repo:
In Git, the usual command is
git-describe
.Either:
Or (if you have put at least one tag)
See "Deriving application build version from
git describe
- how to get a relatively straightforward string?".