Skip to content

Commit cedf304

Browse files
committed
Add URL to repo & fix some spelling/grammar
1 parent 87dd0de commit cedf304

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

CMakeLists.txt

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# ---------------------------------------------------------------------------- #
22
#
33
# Copyright (c) 2020 C++ Modern Framework
4+
# https://github.com/cppmf/GitInfo.cmake
45
#
56
# ---------------------------------------------------------------------------- #
67

78
# ---------------------------------------------------------------------------- #
89
#
9-
# Following variables will be set when calling GitInfo
10+
# The following variables will be set when calling GitInfo
1011
#
1112
# GIT_DIR: path to the project .git directory
1213
# GIT_IS_DIRTY: whether or not the working tree is dirty
13-
# GIT_HEAD_BRANCH : name of the branch associated te HEAD
14+
# GIT_HEAD_BRANCH : name of the branch associated with HEAD
1415
# GIT_REVISION_HASH: current HEAD sha hash
15-
# GIT_REVISION: shorten version of GIT_REVISION_HASH
16-
# GIT_REVISION_NAME: name associated to GIT_REVISION_HASH
16+
# GIT_REVISION: short version of GIT_REVISION_HASH
17+
# GIT_REVISION_NAME: name associated with GIT_REVISION_HASH
1718
# GIT_AUTHOR_NAME : author name
1819
# GIT_AUTHOR_EMAIL : author email
1920
# GIT_AUTHOR_DATE : author date
@@ -32,7 +33,7 @@
3233
# source should point to the root project directory
3334
function(GitInfo source)
3435

35-
# Check is source is a valid path
36+
# Check if source is a valid path
3637
if(NOT EXISTS ${source})
3738
message(FATAL_ERROR "'${source}' is not a valid path")
3839
endif()
@@ -43,7 +44,6 @@ function(GitInfo source)
4344
# Check if .git folder exist
4445
if(EXISTS ${GIT_DIR})
4546

46-
#
4747
set(GIT_DIR "${GIT_DIR}" CACHE PATH "Project .git directory")
4848

4949
# Check if git is installed
@@ -70,29 +70,29 @@ function(GitInfo source)
7070
set(GIT_IS_DIRTY OFF CACHE BOOL "Indicate if current branch is dirty")
7171
endif()
7272

73-
# name of the brack associated te HEAD
73+
# name of the branch associated with HEAD
7474
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
7575
WORKING_DIRECTORY ${source}
7676
OUTPUT_VARIABLE GIT_HEAD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
77-
set(GIT_HEAD_BRANCH "${GIT_HEAD_BRANCH}" CACHE INTERNAL "name of the brack associated te HEAD")
77+
set(GIT_HEAD_BRANCH "${GIT_HEAD_BRANCH}" CACHE INTERNAL "name of the branch associated with HEAD")
7878

7979
# git revision full hash
8080
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%H" HEAD
8181
WORKING_DIRECTORY ${source}
8282
OUTPUT_VARIABLE GIT_REVISION_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
8383
set(GIT_REVISION_HASH "${GIT_REVISION_HASH}" CACHE INTERNAL "git revision full hash")
8484

85-
# shorten version of git revision
85+
# short version of git revision
8686
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%h" HEAD
8787
WORKING_DIRECTORY ${source}
8888
OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
89-
set(GIT_REVISION "${GIT_REVISION}" CACHE INTERNAL "shorten version of git revision")
89+
set(GIT_REVISION "${GIT_REVISION}" CACHE INTERNAL "short version of git revision")
9090

91-
# shorten version of git revision name
91+
# short version of git revision name
9292
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%s" HEAD
9393
WORKING_DIRECTORY ${source}
9494
OUTPUT_VARIABLE GIT_REVISION_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
95-
set(GIT_REVISION_NAME "${GIT_REVISION_NAME}" CACHE INTERNAL "shorten version of git revision name")
95+
set(GIT_REVISION_NAME "${GIT_REVISION_NAME}" CACHE INTERNAL "short version of git revision name")
9696

9797
# author name
9898
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%an" HEAD

README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
---
1010

1111
## Usage
12+
1213
The easiest way to use [GitInfo.cmake](https://github.com/cppmf/GitInfo.cmake) is by adding [GetCPM.cmake](https://github.com/cppmf/GetCPM.cmake) to your project.
1314

1415
First add GetCPM.cmake module :
@@ -20,7 +21,6 @@ wget -O cmake/GetCPM.cmake https://raw.githubusercontent.com/cppmf/GetCPM.cmake/
2021

2122
Then add the following lines to the project's `CMakeLists.txt`.
2223

23-
2424
```bash
2525
# include CPM.cmake module
2626
include(cmake/GetCPM.cmake)
@@ -40,22 +40,22 @@ GitInfo(${CMAKE_CURRENT_SOURCE_DIR})
4040

4141
After calling GitInfo function, the following variables will be set
4242

43-
variable | description
44-
---------|------------
45-
GIT_DIR | path to the project .git directory
46-
GIT_IS_DIRTY | whether or not the working tree is dirty
47-
GIT_HEAD_BRANCH | name of the branch associated to HEAD
48-
GIT_REVISION_HASH | current HEAD sha hash
49-
GIT_REVISION | shorten version of GIT_REVISION_HASH
50-
GIT_REVISION_NAME | name associated to GIT_REVISION_HASH
51-
GIT_AUTHOR_NAME | author name
52-
GIT_AUTHOR_EMAIL | author email
53-
GIT_AUTHOR_DATE | author date
54-
GIT_AUTHOR_DATE_ISO | author date, strict ISO 8601 format
55-
GIT_COMMITTER_NAME | committer name
56-
GIT_COMMITTER_EMAIL | committer email
57-
GIT_COMMITTER_DATE | committer date
58-
GIT_COMMITTER_DATE_ISO | committer date, strict ISO 8601 format
59-
GIT_REMOTE_ORIGIN_URL | origin remote url
60-
GIT_LATEST_TAG_LONG | most recent tag of the current branch
61-
GIT_LATEST_TAG | most recent tagname of the current branch
43+
| variable | description |
44+
| ---------------------- | ----------------------------------------- |
45+
| GIT_DIR | path to the project .git directory |
46+
| GIT_IS_DIRTY | whether or not the working tree is dirty |
47+
| GIT_HEAD_BRANCH | name of the branch associated with HEAD |
48+
| GIT_REVISION_HASH | current HEAD sha hash |
49+
| GIT_REVISION | short version of GIT_REVISION_HASH |
50+
| GIT_REVISION_NAME | name associated to GIT_REVISION_HASH |
51+
| GIT_AUTHOR_NAME | author name |
52+
| GIT_AUTHOR_EMAIL | author email |
53+
| GIT_AUTHOR_DATE | author date |
54+
| GIT_AUTHOR_DATE_ISO | author date, strict ISO 8601 format |
55+
| GIT_COMMITTER_NAME | committer name |
56+
| GIT_COMMITTER_EMAIL | committer email |
57+
| GIT_COMMITTER_DATE | committer date |
58+
| GIT_COMMITTER_DATE_ISO | committer date, strict ISO 8601 format |
59+
| GIT_REMOTE_ORIGIN_URL | origin remote url |
60+
| GIT_LATEST_TAG_LONG | most recent tag of the current branch |
61+
| GIT_LATEST_TAG | most recent tagname of the current branch |

0 commit comments

Comments
 (0)