Archived
1
0

Adding list of modified files to the cli version command.

This commit is contained in:
Jacob Alexander 2015-02-28 23:50:13 -08:00
parent a9c5898ba5
commit bf3b06aa22
3 changed files with 39 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 by Jacob Alexander /* Copyright (C) 2014-2015 by Jacob Alexander
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -422,7 +422,7 @@ void cliFunc_version( char* args )
print( NL ); print( NL );
print( " \033[1mRevision:\033[0m " CLI_Revision NL ); print( " \033[1mRevision:\033[0m " CLI_Revision NL );
print( " \033[1mBranch:\033[0m " CLI_Branch NL ); print( " \033[1mBranch:\033[0m " CLI_Branch NL );
print( " \033[1mTree Status:\033[0m " CLI_ModifiedStatus NL ); print( " \033[1mTree Status:\033[0m " CLI_ModifiedStatus CLI_ModifiedFiles NL );
print( " \033[1mRepo Origin:\033[0m " CLI_RepoOrigin NL ); print( " \033[1mRepo Origin:\033[0m " CLI_RepoOrigin NL );
print( " \033[1mCommit Date:\033[0m " CLI_CommitDate NL ); print( " \033[1mCommit Date:\033[0m " CLI_CommitDate NL );
print( " \033[1mCommit Author:\033[0m " CLI_CommitAuthor NL ); print( " \033[1mCommit Author:\033[0m " CLI_CommitAuthor NL );

View File

@ -178,6 +178,16 @@ if ( ${Git_Modified_LENGTH} GREATER 2 )
set ( Git_Modified_Status "Dirty" ) set ( Git_Modified_Status "Dirty" )
endif () endif ()
#| List of modified files
execute_process ( COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Modified_Files
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string ( REGEX REPLACE "\n" "\\\\r\\\\n\\\\t" Git_Modified_Files "${Git_Modified_Files}" )
set ( Git_Modified_Files "\\r\\n\\t${Git_Modified_Files}" )
#| Branch #| Branch
execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2013-2014 by Jacob Alexander /* Copyright (C) 2013-2015 by Jacob Alexander
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -38,6 +38,7 @@
#define CLI_Revision "@Git_Commit_Revision@" #define CLI_Revision "@Git_Commit_Revision@"
#define CLI_Branch "@Git_Branch_INFO@" #define CLI_Branch "@Git_Branch_INFO@"
#define CLI_ModifiedStatus "@Git_Modified_Status@" #define CLI_ModifiedStatus "@Git_Modified_Status@"
#define CLI_ModifiedFiles "@Git_Modified_Files@"
#define CLI_RepoOrigin "@Git_Origin_URL@" #define CLI_RepoOrigin "@Git_Origin_URL@"
#define CLI_CommitDate "@Git_Date_INFO@" #define CLI_CommitDate "@Git_Date_INFO@"
#define CLI_CommitAuthor @Git_Commit_Author@ #define CLI_CommitAuthor @Git_Commit_Author@